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

[XEN v6 12/12] xen/arm: p2m: Enable support for 32bit IPA for ARM_32


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • Date: Fri, 28 Apr 2023 18:55:43 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=z6Q5ypvhP+q/whBG3MtdTSywgqoOEnfxXXcGmqYwu3k=; b=Y7N8UCp3DlCAIXy4CpTb+Ek6w93IpEGfox2FUgYPecwBpV6t0GVBNTPwFcbExIKYNhAhro9qwlJwtTKKwMaDIDni20K2d/YGUIVfgoMDNab6SyFBOgiOeIvYnTrEuwFM9Np492LEDHWbqBN3eZCP2mKrSD22TelGcIj1nP9wFxafx4DN8nCOSLumUleNemDzkDmystlzbuMJfnGxMaDNNueC/7jVl2eOU8bPGnZKP7lLvlnLtX17qdftzazCU2T361sokcvE4ajjSyeDxMKsV2KZSfIA2+okQnzGhz/3WsXaBtshb408Tb2hUamFxrRCUsGOlFJIzVrUUV3fDy+4Rw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZNJFPjwP0pZxrbqYJFpKRMh++hOK7cQZCZ1R7MIqhcdVpBTHrQfKWfiWykIV1RQMB2sJ88Gc668TW3520fee6QG66UA5gc3gw4V0VRcyq7sLAxkGWhdxrr/H5yEWuOcC94blk4KlWURuwbvoiOZG0KT3TQD/uX7V+/L7DyiVORZ+fok/pG6lDbRJdngiUMXwt3yYtbfGSaA5EP4KE2qhRwOzUdyt5ixduvWS7w+rMFAtiEwXloxFsTzNkdPfX+eB7yv2dpTepeRTKzzQF8BQihYxCX2iSS3D5dfv0aC4wViDYznNYFcDdJdQVZgV95Ns6oKFtjio5pVph07ONeoPUw==
  • Cc: <sstabellini@xxxxxxxxxx>, <stefano.stabellini@xxxxxxx>, <julien@xxxxxxx>, <Volodymyr_Babchuk@xxxxxxxx>, <bertrand.marquis@xxxxxxx>, <andrew.cooper3@xxxxxxxxxx>, <george.dunlap@xxxxxxxxxx>, <jbeulich@xxxxxxxx>, <wl@xxxxxxx>, <rahul.singh@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • Delivery-date: Fri, 28 Apr 2023 18:09:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Refer ARM DDI 0406C.d ID040418, B3-1345,

"A stage 2 translation with an input address range of 31-34 bits can
start the translation either:

- With a first-level lookup, accessing a first-level translation
  table with 2-16 entries.

- With a second-level lookup, accessing a set of concatenated
  second-level translation tables"

Thus, for 32 bit IPA, there will be no concatenated root level tables.
So, the root-order is 0.

Also, Refer ARM DDI 0406C.d ID040418, B3-1348
"Determining the required first lookup level for stage 2 translations

For a stage 2 translation, the output address range from the stage 1
translations determines the required input address range for the stage 2
translation. The permitted values of VTCR.SL0 are:
0b00 Stage 2 translation lookup must start at the second level.
0b01 Stage 2 translation lookup must start at the first level.

VTCR.T0SZ must indicate the required input address range. The size of
the input address region is 2^(32-T0SZ) bytes."

Thus VTCR.SL0 = 1 (maximum value) and VTCR.T0SZ = 0 when the size of
input address region is 2^32 bytes.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
---
Changes from -

v1 - New patch.

v2 - 1. Added Ack.

v3 - 1. Dropped Ack. 
2. Rebased the patch based on the previous change.

v4 - 1. t0sz is 0 for 32-bit IPA on Arm32.
2. Updated the commit message to explain t0sz, sl0 and root_order.

v5 - 1. Rebased on top of the changes in the previous patch.

 xen/arch/arm/p2m.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 1fe3cccf46..6e13772cbc 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -2265,7 +2265,7 @@ void __init setup_virt_paging(void)
         [6] = { 52,      12/*12*/,  4,          2 },
         [7] = { 0 }  /* Invalid */
 #else
-        [0] = { 0 },  /* Invalid */
+        [0] = { 32,      0/*0*/,    0,          1 },
         [1] = { 0 },  /* Invalid */
         [3] = { 0 }  /* Invalid */
 #endif
-- 
2.17.1




 


Rackspace

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