This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[AArch64] Fix missing architecture checks for ARMv8.2 system registers.


Hello,

Some of the RAS system registers added to binutils as part of the ARMv8.2
support are missing the feature checks to warn when they aren't
supported by the target.

This patch adds the missing feature checks with a test to check that
the correct warnings are given for all the ARMv8.2 system registers.

Tested for aarch64-none-linux with cross-compiled check-binutils and check-gas.

Ok for trunk?
Matthew

gas/testsuite
2016-01-11  Matthew Wahab  <matthew.wahab@arm.com>

	* gas/aarch64/illegal-sysreg-2.l: New.
	* gas/aarch64/illegal-sysreg-2.d: New.

opcodes/
2016-01-11  Matthew Wahab  <matthew.wahab@arm.com>

	* aarch64-opc.c (aarch64_sys_reg_supported_p): Merge conditionals
	testing for RAS support.  Add checks for erxfr_el1, erxctlr_el1,
	erxtatus_el1 and erxaddr_el1.

>From 675851eb2268cb0c79646941ba43296e0e3432c1 Mon Sep 17 00:00:00 2001
From: Matthew Wahab <matthew.wahab@arm.com>
Date: Fri, 8 Jan 2016 10:54:34 +0000
Subject: [PATCH] [AArch64] Fix missing feature checks for ARMv8.2 system
 register.

Change-Id: I5e7d14d79fac7b3161b7f924465b31be356ac940
---
 gas/testsuite/gas/aarch64/illegal-sysreg-2.d |  3 ++
 gas/testsuite/gas/aarch64/illegal-sysreg-2.l | 49 ++++++++++++++++++++++++++++
 opcodes/aarch64-opc.c                        | 16 ++++-----
 3 files changed, 59 insertions(+), 9 deletions(-)
 create mode 100644 gas/testsuite/gas/aarch64/illegal-sysreg-2.d
 create mode 100644 gas/testsuite/gas/aarch64/illegal-sysreg-2.l

diff --git a/gas/testsuite/gas/aarch64/illegal-sysreg-2.d b/gas/testsuite/gas/aarch64/illegal-sysreg-2.d
new file mode 100644
index 0000000..5306efb
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/illegal-sysreg-2.d
@@ -0,0 +1,3 @@
+#as: -march=armv8-a
+#source: sysreg-2.s
+#error-output: illegal-sysreg-2.l
diff --git a/gas/testsuite/gas/aarch64/illegal-sysreg-2.l b/gas/testsuite/gas/aarch64/illegal-sysreg-2.l
new file mode 100644
index 0000000..f059611
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/illegal-sysreg-2.l
@@ -0,0 +1,49 @@
+[^:]*: Assembler messages:
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'id_aa64mmfr2_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'erridr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'errselr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'errselr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxfr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxctlr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxctlr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxstatus_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxstatus_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxaddr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxaddr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxmisc0_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxmisc0_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxmisc1_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'erxmisc1_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'vsesr_el2'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'disr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'disr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'vdisr_el2'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'cvap'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 's1e1rp'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 's1e1wp'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmblimitr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmblimitr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmbptr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmbptr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmbsr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmbsr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmbidr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmbidr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmscr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmscr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmsicr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmsicr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmsirr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmsirr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmsfcr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmsfcr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmsevfr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmsevfr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmslatfr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmslatfr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmscr_el2'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmscr_el2'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmscr_el12'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmscr_el12'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmbidr_el1'
+[^:]*:[0-9]+: Error: selected processor does not support system register name 'pmsidr_el1'
diff --git a/opcodes/aarch64-opc.c b/opcodes/aarch64-opc.c
index 83c4dbb..1cd5c1b 100644
--- a/opcodes/aarch64-opc.c
+++ b/opcodes/aarch64-opc.c
@@ -3222,18 +3222,16 @@ aarch64_sys_reg_supported_p (const aarch64_feature_set features,
 
   /* RAS extension.  */
 
-  /* ERRIDR_EL1 and ERRSELR_EL1.  */
+  /* ERRIDR_EL1, ERRSELR_EL1, ERXFR_EL1, ERXCTLR_EL1, ERXSTATUS_EL, ERXADDR_EL1,
+     ERXMISC0_EL1 AND ERXMISC1_EL1.  */
   if ((reg->value == CPENC (3, 0, C5, C3, 0)
-       || reg->value == CPENC (3, 0, C5, C3, 1))
-      && !AARCH64_CPU_HAS_FEATURE (features, AARCH64_FEATURE_RAS))
-    return FALSE;
-
-  /* ERXFR_EL1, ERXCTLR_EL1, ERXSTATUS_EL, ERXADDR_EL1, ERXMISC0_EL1 AND
-     ERXMISC1_EL1.  */
-  if ((reg->value == CPENC (3, 0, C5, C3, 0)
-       || reg->value == CPENC (3, 0, C5, C3 ,1)
+       || reg->value == CPENC (3, 0, C5, C3, 1)
        || reg->value == CPENC (3, 0, C5, C3, 2)
        || reg->value == CPENC (3, 0, C5, C3, 3)
+       || reg->value == CPENC (3, 0, C5, C4, 0)
+       || reg->value == CPENC (3, 0, C5, C4, 1)
+       || reg->value == CPENC (3, 0, C5, C4, 2)
+       || reg->value == CPENC (3, 0, C5, C4, 3)
        || reg->value == CPENC (3, 0, C5, C5, 0)
        || reg->value == CPENC (3, 0, C5, C5, 1))
       && !AARCH64_CPU_HAS_FEATURE (features, AARCH64_FEATURE_RAS))
-- 
2.1.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]