aarch64: Allow writes to MFAR_EL3
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 30 Nov 2021 17:50:24 +0000 (17:50 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 30 Nov 2021 17:50:24 +0000 (17:50 +0000)
MFAR_EL3 is a read/write register, but was incorrectly marked as
read-only
[https://developer.arm.com/documentation/ddi0601/2021-09/AArch64-Registers/MFAR-EL3--PA-Fault-Address-Register?lang=en]

opcodes/
* aarch64-opc.c (aarch64_sys_regs): Mark mfar_el3 as read-write.

gas/
* testsuite/gas/aarch64/rme.s: Test writing to mfar_el3.
* testsuite/gas/aarch64/rme.d: Update accordingly.
* testsuite/gas/aarch64/rme-invalid.s: Delete.
* testsuite/gas/aarch64/rme-invalid.l: Likewise.
* testsuite/gas/aarch64/rme-invalid.d: Likewise.

gas/testsuite/gas/aarch64/rme-invalid.d [deleted file]
gas/testsuite/gas/aarch64/rme-invalid.l [deleted file]
gas/testsuite/gas/aarch64/rme-invalid.s [deleted file]
gas/testsuite/gas/aarch64/rme.d
gas/testsuite/gas/aarch64/rme.s
opcodes/aarch64-opc.c

diff --git a/gas/testsuite/gas/aarch64/rme-invalid.d b/gas/testsuite/gas/aarch64/rme-invalid.d
deleted file mode 100644 (file)
index 091f40c..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#name: Invalid RME System registers usage
-#source: rme-invalid.s
-#warning_output: rme-invalid.l
diff --git a/gas/testsuite/gas/aarch64/rme-invalid.l b/gas/testsuite/gas/aarch64/rme-invalid.l
deleted file mode 100644 (file)
index 7a9e3b2..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-.*: Assembler messages:
-.*: Warning: specified register cannot be written to at operand 1 -- `msr mfar_el3,x0'
diff --git a/gas/testsuite/gas/aarch64/rme-invalid.s b/gas/testsuite/gas/aarch64/rme-invalid.s
deleted file mode 100644 (file)
index d19ac9c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-/* Realm Management Extension.  */
-
-/* Illegal write to RME system registers.  */
-msr mfar_el3, x0
index a714b78c34653eea5c09616660bf1df5390348df..e46339ff9016cdaf57672d5aa9c4bcf22fc5c782 100644 (file)
@@ -7,14 +7,15 @@ Disassembly of section \.text:
 
 0+ <.*>:
 
-   0:  d53e60a0        mrs     x0, mfar_el3
-   4:  d53e21c0        mrs     x0, gpccr_el3
-   8:  d53e2180        mrs     x0, gptbr_el3
-   c:  d51e21c0        msr     gpccr_el3, x0
-  10:  d51e2180        msr     gptbr_el3, x0
-  14:  d50e7e20        dc      cipapa, x0
-  18:  d50e7ea0        dc      cigdpapa, x0
-  1c:  d50e8460        tlbi    rpaos, x0
-  20:  d50e84e0        tlbi    rpalos, x0
-  24:  d50e819f        tlbi    paallos
-  28:  d50e879f        tlbi    paall
+[^:]*: d53e60a0        mrs     x0, mfar_el3
+[^:]*: d53e21c0        mrs     x0, gpccr_el3
+[^:]*: d53e2180        mrs     x0, gptbr_el3
+[^:]*: d51e60a0        msr     mfar_el3, x0
+[^:]*: d51e21c0        msr     gpccr_el3, x0
+[^:]*: d51e2180        msr     gptbr_el3, x0
+[^:]*: d50e7e20        dc      cipapa, x0
+[^:]*: d50e7ea0        dc      cigdpapa, x0
+[^:]*: d50e8460        tlbi    rpaos, x0
+[^:]*: d50e84e0        tlbi    rpalos, x0
+[^:]*: d50e819f        tlbi    paallos
+[^:]*: d50e879f        tlbi    paall
index 21d9bd2deeb4ec45c01ae9642093184e6e4ec60f..d35687be99297f0c852e49eb704eca207a7645df 100644 (file)
@@ -6,6 +6,7 @@ mrs x0, gpccr_el3
 mrs x0, gptbr_el3
 
 /* Write to RME system registers.  */
+msr mfar_el3, x0
 msr gpccr_el3, x0
 msr gptbr_el3, x0
 
index 372101a86a7a61899147921cd0513c5f970de5a2..34b141eaed08af9b260ff01df5cf7b0275eff273 100644 (file)
@@ -4833,7 +4833,7 @@ const aarch64_sys_reg aarch64_sys_regs [] =
 
   SR_CORE ("accdata_el1",   CPENC (3,0,C13,C0,5), 0),
 
-  SR_CORE ("mfar_el3",      CPENC (3,6,C6,C0,5), F_REG_READ),
+  SR_CORE ("mfar_el3",      CPENC (3,6,C6,C0,5), 0),
   SR_CORE ("gpccr_el3",     CPENC (3,6,C2,C1,6), 0),
   SR_CORE ("gptbr_el3",     CPENC (3,6,C2,C1,4), 0),