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

Re: [PATCH v2] arm: 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 20:14:27 +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=yzm3e4yjm5WtkXAclJVN1ira0VPRFR9VSV1Cj2+Y8uo=; b=cCUmV2Ba8Mk/MeI7MKZFr930EJOrkS6IWigglHKDIJcO4RWo6UCo27CzfBVqrH/Js0kziHkfrdkDXzUQ1NEcisH6NMIuUn4QOAtPNPzIEKBhZ5NBkXKR4iZvKV0U0HLT5UQYiSR4NNOgVgU3F6YdHbsLNpUTVx86ICnCqPZ4VwBr+NV0Rk98vxDttw45r8QYgx8/9H9fGVsm44LKl8oStBx+wjNEXDLWXSHtM9w5GqDVxfOS9jdfkbmYD/Pcy/WNecPUqEazNj9URmMWR4BcZKgykyYLtm9B/yj3iFzhtHDixzOZDEyhp6X7sNbLcfB0uV4XqeZ2kIE1Hez0/vrxEw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hIv7wOpp6HfNmmLE/fsknYOpt25VQ2CRvi/ODEvWPxno/2ZDCisIl5QeNhmdpT0wjgygJCyqh6yCEQUekItlx2YML+SuEaqAv80AFjS+lBIkQ77knzCoYLhVxhMo1Fzt9tojH2E8yiyDmGyveVgwR5xcHazfNijmCV4dcNXAismQkPrC2yMdbUhnir6lXDzWz2wX0Q/bLIlkNyh9Oszvg6cbqHU5TxHDqLOVQK7LUJ3B06hvWs0btVS7ymaUxlfwgWeIkPzqaDD8Wj9dYB16V6qnQhugw8U8sQVWGW+cD4ULQD/ri9MF7ftt0khkwHVx817VtIuh5CX+hJRZu8yZzA==
  • 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 18:14:48 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 18-May-26 13:45, Gabriel Quintáns Souto wrote:
> Per ARMv7-A/ARMv8-A ARM, bits [11:2] of table descriptors are ignored by 
> hardware. The original comment incorrectly described block/page descriptor 
> fields (nG, SH, AP, NS, ATTR) which do not 
Please trim lines to 80 chars

exist in the table descriptor format.
> 
> Set PT_PT to 0x403:
>  - Bit 0 (P): Valid bit (required)
>  - Bit 1 (T): Table descriptor type (required)
>  - Bit 10 (AF): Access flag (future-proof for FEAT_HAFT)
There's no FEAT_HAFT on AArch32, bit 10 is purely ignored, so why setting it
also for arm32? On arm32 it should be 0x3. On arm64, thinking more about it,
setting AF for table descriptor would make sense only if we enable HAFT in TCR
which we don't. Therefore, for consistency you should use 0x3 for both arm32 and
arm64.
> 
> Hardware ignores bits [11:2] but setting AF prepares for ARMv9's FEAT_HAFT. 
> Using 0x403 rather than minimal 0x3 provides forward compatibility while 
> avoiding unnecessary reserved bits.
> 
> This updates both arm32 and arm64 for consistency.
> 
> Signed-off-by: Gabriel Quintáns Souto <gabi.qs.mail@xxxxxxxxx>
> 
> ---
> Changes in v2:
> - Apply fix to both arm32 and arm64
> - Use 0x403 instead of 0x743
> ---
>  xen/arch/arm/arm32/mmu/head.S | 2 +-
>  xen/arch/arm/arm64/mmu/head.S | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/arm/arm32/mmu/head.S b/xen/arch/arm/arm32/mmu/head.S
> index 5032e6c075..cab7be0621 100644
> --- a/xen/arch/arm/arm32/mmu/head.S
> +++ b/xen/arch/arm/arm32/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     0x403 /* AF=1 T=1 P=1 (bits [11:2] ignored in table 
> descriptors) */
Don't exceed 80 chars line length. Also, you don't need to provide reasoning
here for ignored bits.

~Michal




 


Rackspace

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