From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AE6CC433E0 for ; Wed, 10 Feb 2021 11:37:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E90264DAF for ; Wed, 10 Feb 2021 11:37:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230019AbhBJLhc convert rfc822-to-8bit (ORCPT ); Wed, 10 Feb 2021 06:37:32 -0500 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.86.151]:27875 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbhBJLgI (ORCPT ); Wed, 10 Feb 2021 06:36:08 -0500 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-115-a5OTD5OFOq-Owgh4ZRfTyA-1; Wed, 10 Feb 2021 11:34:27 +0000 X-MC-Unique: a5OTD5OFOq-Owgh4ZRfTyA-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 10 Feb 2021 11:34:25 +0000 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Wed, 10 Feb 2021 11:34:25 +0000 From: David Laight To: 'Nathan Chancellor' , Nick Desaulniers CC: Jiri Olsa , Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , "Song Liu" , Yonghong Song , John Fastabend , KP Singh , Networking , bpf , clang-built-linux , Veronika Kabatova , Jiri Olsa , Arnaldo Carvalho de Melo , Daniel Kiss Subject: RE: FAILED unresolved symbol vfs_truncate on arm64 with LLVM Thread-Topic: FAILED unresolved symbol vfs_truncate on arm64 with LLVM Thread-Index: AQHW/0GRCH7UzKiswkSGiUsyv9cB9qpRQTWg Date: Wed, 10 Feb 2021 11:34:25 +0000 Message-ID: <67555404a0d449508def1d5be4d1f569@AcuMS.aculab.com> References: <20210209052311.GA125918@ubuntu-m3-large-x86> <20210209074904.GA286822@ubuntu-m3-large-x86> <20210210000257.GA1683281@ubuntu-m3-large-x86> In-Reply-To: <20210210000257.GA1683281@ubuntu-m3-large-x86> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > > > vfs_truncate disasm: > > > > > > ffff80001031f430 : > > > ffff80001031f430: 5f 24 03 d5 hint #34 > > > ffff80001031f434: 1f 20 03 d5 nop > > > ffff80001031f438: 1f 20 03 d5 nop > > > ffff80001031f43c: 3f 23 03 d5 hint #25 > > > > > > thats why we don't match it in pahole.. I checked few other functions > > > and some have the same problem and some match the function boundary > > > > > > those that match don't have that first hint instrucion, like: > > > > > > ffff800010321e40 : > > > ffff800010321e40: 1f 20 03 d5 nop > > > ffff800010321e44: 1f 20 03 d5 nop > > > ffff800010321e48: 3f 23 03 d5 hint #25 > > > > > > any hints about hint instructions? ;-) > > > > aarch64 makes *some* newer instructions reuse the "hint" ie "nop" > > encoding space to make software backwards compatible on older hardware > > that doesn't support such instructions. Is this BTI, perhaps? (The > > function is perhaps the destination of an indirect call?) > > It seems like it. The issue is not reproducible when > CONFIG_ARM64_BTI_KERNEL is not set. Is the compiler/linker doing something 'crazy'? If a function address is taken then the BTI instruction is placed before the function body and the symbol moved. But non-indirect calls still jump to the original start of the function. (In this case the first nop.) This saves the execution time of the BTI instruction for non-indirect calls. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)