From 651657fa61aa0a2946d56063295a7ce8d73f803b Mon Sep 17 00:00:00 2001 From: Matthew Wahab Date: Thu, 14 Jan 2016 10:55:11 +0000 Subject: [PATCH] [AArch64] Fix missing architecture checks for ARMv8.2 system registers. 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. gas/ 2016-01-14 Matthew Wahab * testsuite/gas/aarch64/illegal-sysreg-2.l: New. * testsuite/gas/aarch64/illegal-sysreg-2.d: New. opcodes/ 2016-01-14 Matthew Wahab * 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. Change-Id: I66b590ea49c1eb6b0e5c93e0dc2bc9c4e79a52fe --- gas/ChangeLog | 5 +++ gas/testsuite/gas/aarch64/illegal-sysreg-2.d | 3 ++ gas/testsuite/gas/aarch64/illegal-sysreg-2.l | 49 ++++++++++++++++++++++++++++ opcodes/ChangeLog | 6 ++++ opcodes/aarch64-opc.c | 16 ++++----- 5 files changed, 70 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/ChangeLog b/gas/ChangeLog index a86a071..97f3a03 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2016-01-14 Matthew Wahab + + * testsuite/gas/aarch64/illegal-sysreg-2.l: New. + * testsuite/gas/aarch64/illegal-sysreg-2.d: New. + 2016-01-13 Maciej W. Rozycki * config/tc-nios2.c (output_movia): Preset `code' to 0. 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/ChangeLog b/opcodes/ChangeLog index 333bac5..37e9a6e 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +2016-01-14 Matthew Wahab + + * 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. + 2016-01-12 Matthew Wahab * arm-dis.c (arm_opcodes): Add "esb". 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.7.4