public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH [1/10] arm: add 'bti' instruction for Armv8.1-M pacbti extension
@ 2021-07-20 15:38 Andrea Corallo
  2021-07-20 15:38 ` PATCH [5/10] arm: Extend again arm_feature_set struct to provide more bits Andrea Corallo
                   ` (16 more replies)
  0 siblings, 17 replies; 21+ messages in thread
From: Andrea Corallo @ 2021-07-20 15:38 UTC (permalink / raw)
  To: Binutils; +Cc: richard.earnshaw

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

Hi all,

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

This is to add the 'bti' instruction.

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

The series was tested and does not introduce regressions.

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: 0001-PATCH-1-10-arm-add-bti-instruction-for-Armv8.1-M-pac.patch --]
[-- Type: text/plain, Size: 2945 bytes --]

From a0404601c17994dbbf49a152daf316731161ca68 Mon Sep 17 00:00:00 2001
From: Andrea Corallo <andrea.corallo@arm.com>
Date: Fri, 14 May 2021 16:19:39 +0200
Subject: [PATCH 01/10] PATCH [1/10] arm: add 'bti' instruction for Armv8.1-M
 pacbti extension

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

	* config/tc-arm.c (insns): Add 'bti' insn.
	* testsuite/gas/arm/armv8_1-m-pacbti.d: New file.
	* testsuite/gas/arm/armv8_1-m-pacbti.s: Likewise.

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

	* arm-dis.c (thumb32_opcodes): Add bti instruction.
---
 gas/config/tc-arm.c                      |  1 +
 gas/testsuite/gas/arm/armv8_1-m-pacbti.d | 10 ++++++++++
 gas/testsuite/gas/arm/armv8_1-m-pacbti.s |  5 +++++
 opcodes/arm-dis.c                        |  5 +++++
 4 files changed, 21 insertions(+)
 create mode 100644 gas/testsuite/gas/arm/armv8_1-m-pacbti.d
 create mode 100644 gas/testsuite/gas/arm/armv8_1-m-pacbti.s

diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index fa023b4461e..d7f8fca803b 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -26305,6 +26305,7 @@ static const struct asm_opcode insns[] =
  /* Armv8.1-M Mainline instructions.  */
 #undef  THUMB_VARIANT
 #define THUMB_VARIANT & arm_ext_v8_1m_main
+ ToU("bti",   f3af800f, 0, (), noargs),
  toU("cinc",  _cinc,  3, (RRnpcsp, RR_ZR, COND),	t_cond),
  toU("cinv",  _cinv,  3, (RRnpcsp, RR_ZR, COND),	t_cond),
  toU("cneg",  _cneg,  3, (RRnpcsp, RR_ZR, COND),	t_cond),
diff --git a/gas/testsuite/gas/arm/armv8_1-m-pacbti.d b/gas/testsuite/gas/arm/armv8_1-m-pacbti.d
new file mode 100644
index 00000000000..3c693728468
--- /dev/null
+++ b/gas/testsuite/gas/arm/armv8_1-m-pacbti.d
@@ -0,0 +1,10 @@
+#name: Valid Armv8.1-M pointer authentication and branch target identification extention
+#source: armv8_1-m-pacbti.s
+#as: -march=armv8.1-m.main
+#objdump: -dr --prefix-addresses --show-raw-insn
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+0[0-9a-f]+ <[^>]+> f3af 800f 	bti
+#...
diff --git a/gas/testsuite/gas/arm/armv8_1-m-pacbti.s b/gas/testsuite/gas/arm/armv8_1-m-pacbti.s
new file mode 100644
index 00000000000..38929e3dd02
--- /dev/null
+++ b/gas/testsuite/gas/arm/armv8_1-m-pacbti.s
@@ -0,0 +1,5 @@
+	.syntax unified
+	.text
+	.thumb
+.Lstart:
+	bti
diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c
index 92cd098d6c9..1e096997543 100644
--- a/opcodes/arm-dis.c
+++ b/opcodes/arm-dis.c
@@ -4652,6 +4652,11 @@ static const struct opcode16 thumb_opcodes[] =
    makes heavy use of special-case bit patterns.  */
 static const struct opcode32 thumb32_opcodes[] =
 {
+  /* Arm v8.1-M Mainline Pointer Authentication and Branch Target
+     Identification Extension.  */
+  {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
+   0xf3af800f, 0xffffffff, "bti"},
+
   /* Armv8.1-M Mainline and Armv8.1-M Mainline Security Extensions
      instructions.  */
   {ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_1M_MAIN),
-- 
2.20.1


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2021-08-17 12:59 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-20 15:38 PATCH [1/10] arm: add 'bti' instruction for Armv8.1-M pacbti extension 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 [7/10] arm: add 'bxaut' instruction for Armv8.1-M pacbti extension Andrea Corallo
2021-07-20 15:38 ` PATCH [8/10] arm: add 'autg' " 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 [9/10] arm: add 'pacg' instruction for Armv8.1-M pacbti extension Andrea Corallo
2021-07-20 15:38 ` PATCH [3/4] arm: Add Tag_BTI_use build attribute Andrea Corallo
2021-07-20 15:38 ` PATCH [2/4] arm: Add Tag_BTI_extension " Andrea Corallo
2021-07-20 15:38 ` PATCH [4/4] arm: Add Tag_PACRET_use " Andrea Corallo
2021-07-20 15:38 ` PATCH [4/10] arm: add 'pac' 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 [3/10] arm: add 'aut' " Andrea Corallo
2021-07-21 14:31 ` PATCH [1/10] arm: add 'bti' " 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

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).