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

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


  • To: Gabriel Quintáns Souto <gabi.qs.mail@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Mon, 18 May 2026 07:12:15 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Nv5iQWa/xWVYAN35Lws2CuxZeo7Snq0MAjiQRnR2FGo=; b=ie8NoO7ec6/2G7QAxhV3x4fz1TA7lNi0JBucWsmzTjYVIxVI7xVTKOFcRKItGrd2JS4xc4MHu1w2Ff/CrawTYDKbAYKXX8rjwgM/hyWpjGSWajR/2CoLhV4MsCMbBERnlC2pRw4nURIdiJ0VgxK1+sRx/dCHEbkupNI77aFhyK08G8QShqSwwsrbUuLS4c3VX/6GQP2nCNsOnh80i/c+hNhdbGuVx8FeyNADLRDin7Gl4R3XGtAJZdkbra8ImUDsLEbuoncD8VZV2OBQ2ytzM8QHge2ee0wkS8aA2RAWd2O/Mfh6WNyOhwmBLW5QyW7JX/D9ZY+I0t1s7vNJ+3PQAQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=f1/pgSgVi33lbm2q20ZBn0Q5R/OItl5VSThoiccxzllPOPelURe7ZtMhq15LLpZPeQJCVtbnJPjME4JbkzyPsrUrZdQyAoHsNSCXyib8ThrKLqfek8nYytJ2ZomqZkcDqypRbGOX/p1bK72Y5NQnHdgN9bBIrKKAT0kI93/sodNG/JKOKfawyEmSA7WtycuRhlnviPPQf+iLfyCvVxdntIsuCPQodb4XeLT3un8TVWEOuZx/4FZusapaBxX6hgkHCMLtYOAxS7yv1rzGOhQC6kE0eiC3PmxreCREKDge2b3EnediC8onT3YWVm1ez3Zo8B0+yXP08sRfZlOM03dwug==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: <sstabellini@xxxxxxxxxx>, <julien@xxxxxxx>, <bertrand.marquis@xxxxxxx>
  • Delivery-date: Mon, 18 May 2026 05:12:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


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




 


Rackspace

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