[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] arm64/mmu: Fix PT_PT table descriptor value and comment



PT_PT is used to create table descriptors in create_table_entry_from_paddr.
The previous value (0xf7f) and comment incorrectly included attribute fields
(nG, SH, AP, NS, ATTR) that only exist in block/page descriptors, not in
table descriptors.

Per the ARMv8-A Architecture Reference Manual (DDI0487, Section D8.3.1),
table descriptors only define:
  - Bits [63:12]: Next-level table address
  - Bit [11]: Ignored
  - Bit [10]: AF (Access Flag, ARMv8.1+)
  - Bits [9:2]: Ignored or reserved for extensions
  - Bit [1]: Descriptor type (1 = Table)
  - Bit [0]: Valid bit (1 = Valid)

Update to 0x743 with only the relevant bits set:
  - Bit [10]: AF (Access Flag, ARMv8.1+)
  - Bits [9:8]: Reserved/extension bits
  - Bit [6]: SKL (ARMv9)
  - Bits [5:2]: Cleared (ignored by hardware)
  - Bit [1]: Table descriptor type
  - Bit [0]: Valid

Compile-tested and boot-tested in QEMU ARM64 (virt machine, cortex-a57).

Signed-off-by: Gabriel Quintáns Souto <gabi.qs.mail@xxxxxxxxx>
---
 xen/arch/arm/arm64/mmu/head.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/arm64/mmu/head.S b/xen/arch/arm/arm64/mmu/head.S
index d14780ad19..c3cb262e88 100644
--- a/xen/arch/arm/arm64/mmu/head.S
+++ b/xen/arch/arm/arm64/mmu/head.S
@@ -8,7 +8,7 @@
 #include <asm/page.h>
 #include <asm/early_printk.h>
 
-#define PT_PT     0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
+#define PT_PT     0x743 /* AF=1 RES=11 SKL=1 IGN=0000 T=1 P=1 */
 #define PT_MEM    0xf7d /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=0 P=1 */
 #define PT_MEM_L3 0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
 #define PT_DEV    0xe71 /* nG=1 AF=1 SH=10 AP=01 NS=1 ATTR=100 T=0 P=1 */
-- 
2.53.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.