|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] arm64/mmu: Fix PT_PT table descriptor value and comment
On 17-May-26 21:44, Gabriel Quintáns Souto wrote: > 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 */ Looking at ARMv8A ARM M.a, figure D8-12 bits [11:2] of a VMSAv8-64 table descriptor are IGNORED by hardware (see xen/arch/arm/include/asm/lpae.h as well). The change therefore has no functional effect on ARMv8-A hardware Xen runs on. The arm32 head.S has the identical misleading definition and comment; the ARMv7 LPAE table-descriptor format shares the "ignored in table entries" property. After this patch the two siblings diverge. Update arm32 to match, or leave both alone. If the goal is "only relevant bits set", the minimum is 0x3 (T=1 P=1). 0x403 if you want AF as future-proofing for FEAT_HAFT (ARMv9 I believe). ~Michal
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |