public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Andrea Corallo <andrea.corallo@arm.com>
To: Binutils <binutils@sourceware.org>
Cc: "richard.earnshaw@arm.com" <richard.earnshaw@arm.com>
Subject: PATCH [6/10] arm: Add -march=armv8.1-m.main+pacbti flag
Date: Tue, 20 Jul 2021 17:38:52 +0200	[thread overview]
Message-ID: <gkr5yx5ov03.fsf@arm.com> (raw)
Message-ID: <20210720153852.tZ5ZAt16hXaY-KoC0mzzk9H_VmhX8_BOrlH6FiAj4zQ@z> (raw)

[-- Attachment #1: Type: text/plain, Size: 512 bytes --]

Hi all,

sixth patch of the series adding support for PACBTI for Cortex-M.

This is to add the -march=armv8.1-m.main+pacbti flag.

See:
- Armv8.1-M Pointer Authentication and Branch Target Identification Extension [1]
- Armv8-M Architecture Reference Manual [2]

Regards

  Andrea

[1] <https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/armv8-1-m-pointer-authentication-and-branch-target-identification-extension>
[2] <https://developer.arm.com/documentation/ddi0553/latest>


[-- Attachment #2: 0006-PATCH-6-10-arm-Add-march-armv8.1-m.main-pacbti-flag.patch --]
[-- Type: text/plain, Size: 2982 bytes --]

From a1a693d81c8291788428e9bc2a2b5e5b48f181f1 Mon Sep 17 00:00:00 2001
From: Andrea Corallo <andrea.corallo@arm.com>
Date: Fri, 4 Jun 2021 10:17:17 +0200
Subject: [PATCH 06/10] PATCH [6/10] arm: Add -march=armv8.1-m.main+pacbti flag

gas/
2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

	* config/tc-arm.c (pacbti_ext): Define.
	(BAD_PACBTI): New macro.
	(armv8_1m_main_ext_table): Add 'pacbti' extension.

include/
2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

	* opcode/arm.h (ARM_EXT3_PACBTI, ARM_AEXT3_V8_1M_MAIN_PACBTI): New
	macro.
---
 gas/config/tc-arm.c  | 4 ++++
 include/opcode/arm.h | 7 +++++++
 2 files changed, 11 insertions(+)

diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 6ef0cd97a5e..3ec353abf78 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -365,6 +365,8 @@ static const arm_feature_set fpu_neon_ext_v8_1 =
   ARM_FEATURE_COPROC (FPU_NEON_EXT_RDMA);
 static const arm_feature_set fpu_neon_ext_dotprod =
   ARM_FEATURE_COPROC (FPU_NEON_EXT_DOTPROD);
+static const arm_feature_set pacbti_ext =
+  ARM_FEATURE_CORE_HIGH_HIGH (ARM_EXT3_PACBTI);
 
 static int mfloat_abi_opt = -1;
 /* Architecture feature bits selected by the last -mcpu/-march or .cpu/.arch
@@ -945,6 +947,7 @@ struct asm_opcode
 			  "and source operands makes instruction UNPREDICTABLE")
 #define BAD_EL_TYPE	_("bad element type for instruction")
 #define MVE_BAD_QREG	_("MVE vector register Q[0..7] expected")
+#define BAD_PACBTI	_("selected processor does not support PACBTI extention")
 
 static htab_t  arm_ops_hsh;
 static htab_t  arm_cond_hsh;
@@ -31934,6 +31937,7 @@ static const struct arm_ext_table armv8_1m_main_ext_table[] =
 			ARM_EXT2_FP16_INST | ARM_EXT2_MVE | ARM_EXT2_MVE_FP,
 			FPU_VFP_V5_SP_D16 | FPU_VFP_EXT_FP16 | FPU_VFP_EXT_FMA)),
   CDE_EXTENSIONS,
+  ARM_ADD ("pacbti", ARM_FEATURE_CORE_HIGH_HIGH (ARM_AEXT3_V8_1M_MAIN_PACBTI)),
   { NULL, 0, ARM_ARCH_NONE, ARM_ARCH_NONE }
 };
 
diff --git a/include/opcode/arm.h b/include/opcode/arm.h
index 1152e781222..4a6044f6f68 100644
--- a/include/opcode/arm.h
+++ b/include/opcode/arm.h
@@ -90,6 +90,11 @@
 #define ARM_EXT2_CDE7	     0x40000000 /* Using CDE coproc 7.	   */
 #define ARM_EXT2_V8R	     0x80000000	/* Arm V8R.	               */
 
+#define ARM_EXT3_PACBTI	     0x00000001 /* Arm v8-M Mainline Pointer
+					   Authentication and Branch
+					   Target Identification
+					   Extension.  */
+
 /* Co-processor space extensions.  */
 #define ARM_CEXT_XSCALE	     0x00000001	/* Allow MIA etc.	 	   */
 #define ARM_CEXT_MAVERICK    0x00000002	/* Use Cirrus/DSP coprocessor.	   */
@@ -197,6 +202,8 @@
 #define ARM_AEXT2_V8_1M_MAIN	(ARM_AEXT2_V8M_MAIN | ARM_EXT2_V8_1M_MAIN     \
 						    | ARM_EXT2_FP16_INST)
 
+#define ARM_AEXT3_V8_1M_MAIN_PACBTI	(ARM_AEXT2_V8M_MAIN | ARM_EXT3_PACBTI)
+
 /* Processors with specific extensions in the co-processor space.  */
 #define ARM_ARCH_XSCALE	ARM_FEATURE_LOW (ARM_AEXT_V5TE, ARM_CEXT_XSCALE)
 #define ARM_ARCH_IWMMXT	\
-- 
2.20.1


             reply	other threads:[~2021-07-20 15:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20 15:38 Andrea Corallo [this message]
2021-07-20 15:38 ` PATCH [3/4] arm: Add Tag_BTI_use build attribute Andrea Corallo
2021-07-20 15:38 ` PATCH [9/10] arm: add 'pacg' instruction for Armv8.1-M pacbti extension Andrea Corallo
2021-07-20 15:38 ` PATCH [6/10] arm: Add -march=armv8.1-m.main+pacbti flag Andrea Corallo
2021-07-20 15:38 ` PATCH [10/10] arm: Alias 'ra_auth_code' to r12 for pacbti Andrea Corallo
2021-07-20 15:38 ` PATCH [8/10] arm: add 'autg' instruction for Armv8.1-M pacbti extension Andrea Corallo
2021-07-20 15:38 ` PATCH [7/10] arm: add 'bxaut' " Andrea Corallo
2021-07-20 15:38 ` PATCH [5/10] arm: Extend again arm_feature_set struct to provide more bits Andrea Corallo
2021-07-20 15:38 ` PATCH [3/10] arm: add 'aut' instruction for Armv8.1-M pacbti extension Andrea Corallo
2021-07-20 15:38 ` PATCH V2 [2/10] arm: add 'pacbti' " Andrea Corallo
2021-07-20 15:38 ` PATCH [4/10] arm: add 'pac' " Andrea Corallo
2021-07-20 15:38 ` PATCH [4/4] arm: Add Tag_PACRET_use build attribute Andrea Corallo
2021-07-20 15:38 ` PATCH [2/4] arm: Add Tag_BTI_extension " Andrea Corallo
2021-07-21 14:31 ` PATCH [1/10] arm: add 'bti' instruction for Armv8.1-M pacbti extension Nick Clifton
2021-07-21 15:12   ` Andrea Corallo
2021-07-26 12:32   ` Andrea Corallo
2021-08-10 15:31 ` PATCH [2/4] arm: Add Tag_BTI_extension build attribute Nick Clifton
2021-08-17 12:59   ` Andrea Corallo
2021-08-10 15:32 ` PATCH [3/4] arm: Add Tag_BTI_use " Nick Clifton
2021-08-10 15:33 ` PATCH [4/4] arm: Add Tag_PACRET_use " Nick Clifton
2021-08-10 15:33 ` PATCH V2 [2/10] arm: add 'pacbti' instruction for Armv8.1-M pacbti extension Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gkr5yx5ov03.fsf@arm.com \
    --to=andrea.corallo@arm.com \
    --cc=binutils@sourceware.org \
    --cc=richard.earnshaw@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).