From patchwork Wed May 12 09:27:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naohiro Tamura X-Patchwork-Id: 43387 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 65BB03891C04; Wed, 12 May 2021 09:28:29 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from esa3.hc1455-7.c3s2.iphmx.com (esa3.hc1455-7.c3s2.iphmx.com [207.54.90.49]) by sourceware.org (Postfix) with ESMTPS id 398103891C00 for ; Wed, 12 May 2021 09:28:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 398103891C00 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=fujitsu.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=naohirot@fujitsu.com IronPort-SDR: wL/aS36oDytpKPqmolzItGPja8ECedYpqOxfM94W+pAj1biPTqe2x1hekjh4EIMYg3NqB4k7d5 Z0Gq9k5gwL00aNueQlwDCHam8mkiRs5GRD9mRnE4UqfYK9mCayMK/SePOf/GaZqQjiQH2SW1Ou xY7H8n6wxduyINXFNglnoXsYfo9nJz+6/6yKT4RKf0aZBUBgj/b3g3negSuWayujs1y1/Ry40M 3nMo0OLjcz7MoU+XW2u5q6fNFEzrG0LvpOW8o440XA+G4EMsGz6nq5eLNOaB6cnIHqzhp1nAPF f6U= X-IronPort-AV: E=McAfee;i="6200,9189,9981"; a="29262706" X-IronPort-AV: E=Sophos;i="5.82,293,1613401200"; d="scan'208";a="29262706" Received: from unknown (HELO oym-r3.gw.nic.fujitsu.com) ([210.162.30.91]) by esa3.hc1455-7.c3s2.iphmx.com with ESMTP; 12 May 2021 18:28:25 +0900 Received: from oym-m1.gw.nic.fujitsu.com (oym-nat-oym-m1.gw.nic.fujitsu.com [192.168.87.58]) by oym-r3.gw.nic.fujitsu.com (Postfix) with ESMTP id 85AE81FB301 for ; Wed, 12 May 2021 18:28:24 +0900 (JST) Received: from m3050.s.css.fujitsu.com (msm.b.css.fujitsu.com [10.134.21.208]) by oym-m1.gw.nic.fujitsu.com (Postfix) with ESMTP id C3C84B4E43 for ; Wed, 12 May 2021 18:28:23 +0900 (JST) Received: from bionic.lxd (unknown [10.126.53.116]) by m3050.s.css.fujitsu.com (Postfix) with ESMTP id A36E1AF; Wed, 12 May 2021 18:28:23 +0900 (JST) From: Naohiro Tamura To: libc-alpha@sourceware.org Subject: [PATCH v2 2/6] aarch64: define BTI_C and BTI_J macros as NOP unless HAVE_AARCH64_BTI Date: Wed, 12 May 2021 09:27:20 +0000 Message-Id: <20210512092720.901129-1-naohirot@fujitsu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210512092308.900998-1-naohirot@fujitsu.com> References: <20210512092308.900998-1-naohirot@fujitsu.com> X-TM-AS-GCONF: 00 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Naohiro Tamura Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" From: Naohiro Tamura This patch defines BTI_C and BTI_J macros conditionally for performance. If HAVE_AARCH64_BTI is true, BTI_C and BTI_J are defined as HINT instruction for ARMv8.5 BTI (Branch Target Identification). If HAVE_AARCH64_BTI is false, both BTI_C and BTI_J are defined as NOP. --- sysdeps/aarch64/sysdep.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sysdeps/aarch64/sysdep.h b/sysdeps/aarch64/sysdep.h index 90acca4e42..b936e29cbd 100644 --- a/sysdeps/aarch64/sysdep.h +++ b/sysdeps/aarch64/sysdep.h @@ -62,8 +62,13 @@ strip_pac (void *p) #define ASM_SIZE_DIRECTIVE(name) .size name,.-name /* Branch Target Identitication support. */ -#define BTI_C hint 34 -#define BTI_J hint 36 +#if HAVE_AARCH64_BTI +# define BTI_C hint 34 +# define BTI_J hint 36 +#else +# define BTI_C nop +# define BTI_J nop +#endif /* Return address signing support (pac-ret). */ #define PACIASP hint 25