aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2021-11-30 17:50:24 +0000
committerRichard Sandiford <richard.sandiford@arm.com>2021-11-30 17:50:24 +0000
commit1864b6578bd96bee057ed4ce5f69917c9ad9abc9 (patch)
tree6dc19b9e2e0f6f5b33c26f5d65f36f86730e958c /gas
parent31a8056f2f519fda71682cffd0eac6ba87a59c8e (diff)
downloadgdb-1864b6578bd96bee057ed4ce5f69917c9ad9abc9.zip
gdb-1864b6578bd96bee057ed4ce5f69917c9ad9abc9.tar.gz
gdb-1864b6578bd96bee057ed4ce5f69917c9ad9abc9.tar.bz2
aarch64: Mark PMSIDR_EL1 as read-only
We were incorrectly allowing writes to PMSIDR_EL1, which is a read-only register. [https://developer.arm.com/documentation/ddi0595/2021-09/AArch64-Registers/PMSIDR-EL1--Sampling-Profiling-ID-Register?lang=en] opcodes/ * aarch64-opc.c (aarch64_sys_regs): Make pmsidr_el1 as F_REG_READ. gas/ * testsuite/gas/aarch64/msr.s: Remove write to pmsidr_el1. * testsuite/gas/aarch64/msr.d: Update accordingly. * testsuite/gas/aarch64/illegal-sysreg-2.s, * testsuite/gas/aarch64/illegal-sysreg-2.d, * testsuite/gas/aarch64/illegal-sysreg-2.l: New test.
Diffstat (limited to 'gas')
-rw-r--r--gas/testsuite/gas/aarch64/illegal-sysreg-2.d2
-rw-r--r--gas/testsuite/gas/aarch64/illegal-sysreg-2.l2
-rw-r--r--gas/testsuite/gas/aarch64/illegal-sysreg-2.s3
-rw-r--r--gas/testsuite/gas/aarch64/msr.d3
-rw-r--r--gas/testsuite/gas/aarch64/msr.s1
5 files changed, 8 insertions, 3 deletions
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..bff7ea7
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/illegal-sysreg-2.d
@@ -0,0 +1,2 @@
+#source: illegal-sysreg-2.s
+#warning_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..60aa5c2
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/illegal-sysreg-2.l
@@ -0,0 +1,2 @@
+.*: Assembler messages:
+.*: Warning: specified register cannot be written to at operand 1 -- `msr pmsidr_el1,x0'
diff --git a/gas/testsuite/gas/aarch64/illegal-sysreg-2.s b/gas/testsuite/gas/aarch64/illegal-sysreg-2.s
new file mode 100644
index 0000000..f95584c
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/illegal-sysreg-2.s
@@ -0,0 +1,3 @@
+/* Write to R/O system registers. */
+.arch armv8.2-a+profile
+msr pmsidr_el1, x0
diff --git a/gas/testsuite/gas/aarch64/msr.d b/gas/testsuite/gas/aarch64/msr.d
index 4d5e630..fedf2ee 100644
--- a/gas/testsuite/gas/aarch64/msr.d
+++ b/gas/testsuite/gas/aarch64/msr.d
@@ -24,5 +24,4 @@ Disassembly of section \.text:
3c: d5300040 mrs x0, osdtrrx_el1
40: d5100340 msr osdtrtx_el1, x0
44: d5300340 mrs x0, osdtrtx_el1
- 48: d51899e0 msr pmsidr_el1, x0
- 4c: d53899e0 mrs x0, pmsidr_el1
+ 48: d53899e0 mrs x0, pmsidr_el1
diff --git a/gas/testsuite/gas/aarch64/msr.s b/gas/testsuite/gas/aarch64/msr.s
index 5e8ae85..36ebfe4 100644
--- a/gas/testsuite/gas/aarch64/msr.s
+++ b/gas/testsuite/gas/aarch64/msr.s
@@ -47,5 +47,4 @@ func:
msr osdtrtx_el1, x0
mrs x0, osdtrtx_el1
- msr pmsidr_el1, x0
mrs x0, pmsidr_el1