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

Re: [XEN v4 11/11] xen/arm: p2m: Enable support for 32bit IPA for ARM_32


  • To: Julien Grall <julien@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • Date: Tue, 4 Apr 2023 11:38:56 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; 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=mn9NBNAoabzJLeGf/m8W6pLeV0k6QC8ZkTvUpnBKvq8=; b=K8+yFpC4hhBR/yCCnHbIfGySPaUmXZB+ffbK9984YecKI6cOakh18kFba9oNb5VBdbhC0UyPWMKVqEaWOTvOOdyNn1TkTHwVuwMG/8l9oZmHjUiAU3f43w7FKO+BkMhemRWjQqwiupQGsZxPGgqSS6bSsJTNc28g9CzW5ic6kYyUlakEiZvcgGgssfQQAacju97bHBDbOCOyAXbBel9jLXDbaKDimZO4zqJscGR2GLI8rTwA7nRI63K6u6sJucJkHw7lm6gXrZPqKtdSvhrpgaDe3dIGIqWaPWIRSeYEI8t6BJKgmv2BV6ack67nQfBu3FBXCgp0IqD1Ss0Ci+l0Nw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NXqgMz10bGgqY66STra7jb2YSy1QRnFJf5ND73tU/fZnwwmUK2yFwgdliZwYHi2r3uuYoohm9hfyDJPrgAyS53lkD4ApdTePlcXVn6ZpnKad2DB9XRcF9RIcH+/SgQOjalbHYaPcdLHrzsHZaJx9Go4vd8JRgU8gzKvp0yePkiJg2TacslqwblncNwAaIJCUy2PgXiC3eXjnx2m8SkD9S6W/QHk/il/dA/NVamkX7ld02fxvLMQgywx12JnYYpb1Ph11vTZ8hgUrnm3lNZMdGuH7kI/P3RWdhxk+KuOqqzonqjFQ5vAvZAoJwgTiopWtBcSiz9RS3s2ZIFYTx3ILWA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: sstabellini@xxxxxxxxxx, stefano.stabellini@xxxxxxx, Volodymyr_Babchuk@xxxxxxxx, bertrand.marquis@xxxxxxx, andrew.cooper3@xxxxxxxxxx, george.dunlap@xxxxxxxxxx, jbeulich@xxxxxxxx, wl@xxxxxxx, rahul.singh@xxxxxxx
  • Delivery-date: Tue, 04 Apr 2023 10:39:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 30/03/2023 22:45, Julien Grall wrote:
CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.


Hi Ayan,

Hi Julien,

I need some clarifications.


On 21/03/2023 14:03, Ayan Kumar Halder wrote:
The pabits, t0sz, root_order and sl0 values are the same as those for
ARM_64.

To me this read as the line should be common. But you still duplicate it.

In any case, you should justify this change with a pointer to the Arm
Arm. Not just saying they are common.

Does the following commit message read fine ?

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

0.

   "Use of concatenated second-level translation tables

   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 only one root level translation tables. This is because as the paragraph explains above,  35 bit IPA is the minimum required to support two root level translation tables.

The root order for 32 bit IPA will be 0. (Refer xen/arch/arm/p2m.c "#define P2M_ROOT_PAGES (1<<P2M_ROOT_ORDER)")

Please clarify if I misunderstood something.

- Ayan



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.

  xen/arch/arm/p2m.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index f34b6e6f11..20beecc6e8 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -2272,8 +2272,9 @@ void __init setup_virt_paging(void)
          unsigned int sl0;    /* Desired SL0, maximum in comment */
      } pa_range_info[] __initconst = {
  #ifdef CONFIG_ARM_32
-        [0] = { 40,      24/*24*/,  1,          1 },
-        [1] = { 0 } /* Invalid */
+        [0] = { 32,      32/*32*/,  0,          1 },

As I pointed out in one of the previous version, the root order is
different than ...

+        [1] = { 40,      24/*24*/, 1,          1 },

... here. Yet, you still keep P2M_ROOT_ORDER and P2M_ROOT_LEVEL
hardcoded. Your previous patch wants to define p2M_root_order and
p2m_root_level (lower-case intended). IOW making more code common
between arm64 and arm32.

Cheers,

--
Julien Grall




 


Rackspace

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