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

Re: [PATCH v2 1/2] xen/pdx: account for frametable_base_pdx in generic pdx_to_page/page_to_pdx


  • To: Michal Orzel <michal.orzel@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Fri, 1 May 2026 09:41:50 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=amd.com smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; 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=k8iLryvx1fW21SxdaNFfhYgHa51F0iStH0NN+Yobfn8=; b=aDFsbDWDjQ9dq03m2u46nMgEt004vZdDXeieghRNhWFUbZ2QRTlrgYigdjiaWXDwMl8970gawfHZ9SMXXIszjMubM544OT83B/Sq7jnAwtZfoEv2EWtl9Rerl0C1rj3m9x7CAhHWvzbvpBpu/lipBUCrpJQmAoPphj4aSxoAskzw9s6fh43GShRLee1TUAsj8/smqYkXnZ+i5ZMLwIl+ROTAlPn2zXRr6DyzyvJgPnO/eQ2fb1KTd9Ymk73ssiD4P28P2ztlFSDCsbcq6Q6giqC51KlmCyusgu6DUpa2Qa3OAWq8ntkLiApQwlnmBo1RWNgGob4eagDVzvftg2LrHQ==
  • 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=k8iLryvx1fW21SxdaNFfhYgHa51F0iStH0NN+Yobfn8=; b=a50HFlASlE1XeNIiki7ipbOZ93ktDeQxALMBO4N8W98N5DsU5eDzfGnhIFcPkYuk8V6EczEzq/IZeIDVW2NnL8DlP8BugWg3c/HAhCw5dtC0FvgaAjJOIYWe4LeyIVR6mSXVfYMtiA+pNbYm/YLFvxpK6q1c3WCINjSXqkGcnR2ezygW5RoE4amborO4RJO/GSNN0a1clnCrbhklalJxEl2lcqYh0WC4hLxnfL3IBSCqY/bt+nQRnpJNZ4gnO06VRpQtY4ydjkxZY0q3H7M2cNKr3iAexPBshaq5P83XkuUpvaj8lOZwSmy7miHA++aZnRY15RMJ3UrD6HNxKHnAAQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=C6TALPBkLk9TvCMawRS7C0Tt0VXRCyJHDncwBXQjjTA0gWamtC71Nv7j/ECTXNP6fVRPfULHbSOAtUM6C7Mmmf6YPfFliA8ZZrQbV7DefSNFzjrh7wZUHQpVvKKknK1QjXvy7WxZMvr79gqCWjUBy+pYchIBZ+gAE8tgJETEwcRnPfwbYrf95A23x57vcdWpy2LcZra5vk22dUu9SqDDNiSP/GjL26OXM77Im3zXDZtC3f1jkuPzby0apDu2sDTV4zRn6Hqd/y+zLICG3/8l2sK82ogtJeJGzCZ+YLEiwyVuI7eKyxfv5z6sRIANcuUY1R27CcYLdaK+S7yNsDvS4Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QoagBfiCZ/5XXawhdC0RW7m9bPIP1/Ohq0V/fG+OAjuG5suxj7A2nfrcoiPxgyKhw4Nwvxj5p/FU6uUAen8GYwjKxYDyig8hV08OIewCNnY0KG75NX8TkKwkaPR9FHcDozs5dH7taGzqvhxKBfKWvgVB5+oRHqYqIDBBbKvCq6Tqf/94JfqiydiWlckxp+mmFL4MKDeAMPMPxEiunzGYWSIRZX9paafDdybitG7RRdhYD1Rmq1eD5gOp9eiYIhHwAuhVr9eZ+ZGb++Ven5xwou3h6Me3PsrVGKMc2HcS8Akq22r84+AbWm7StorwOLV3QhwPCVAMt8/A/eFqvB96Fg==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Timothy Pearson <tpearson@xxxxxxxxxxxxxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>
  • Delivery-date: Fri, 01 May 2026 09:43:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHc2KAtk6uvg3kMbkmyodn66STuo7X47BMA
  • Thread-topic: [PATCH v2 1/2] xen/pdx: account for frametable_base_pdx in generic pdx_to_page/page_to_pdx

Hi Michal,

> On 30 Apr 2026, at 13:51, Michal Orzel <michal.orzel@xxxxxxx> wrote:
> 
> The generic pdx_to_page() and page_to_pdx() macros in xen/pdx.h assume
> the frame table starts at PDX 0, which is only true on x86. ARM
> uses a non-zero frametable_base_pdx to offset into the frame table (PPC also
> defines it).
> 
> Fix the generic macros to subtract/add frametable_base_pdx, defaulting
> to 0 when the arch does not define it. This makes the generic macros
> correct for all architectures, even though they are only used on x86

“correct for all architectures” I think only RISC-V needs some work to 
eventually
be able to use the generic macros?

> today.
> 
> While at it, consolidate the arch-specific PDX definitions
> (frametable_base_pdx and PDX_GROUP_SHIFT) from the arch mm.h headers
> into new asm/pdx.h headers for ARM and PPC. The asm/pdx.h is included
> earlier in xen/pdx.h via __has_include, making these definitions available
> before they are needed.
> 
> Also decouple the __has_include(<asm/pdx.h>) check from the PFN-to-PDX
> translation override mechanism. Previously, the existence of asm/pdx.h
> was taken to mean the arch provides custom pdx_to_pfn / pfn_to_pdx
> implementations. This conflation would prevent ARM and PPC from having
> asm/pdx.h (for frametable_base_pdx) without also being forced to define
> the translation helpers. Replace the __has_include gate with an explicit
> ARCH_DEFINES_PDX_XLATE sentinel that only x86 defines.
> 
> No functional change.
> 
> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
> ---

The changes looks good to me, for the Arm and common part:

Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx> # arm, common

I’ve also tested on Arm64, Arm32, x86_64 with virtual platforms.

Cheers,
Luca


 


Rackspace

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