All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
Cc: <sstabellini@kernel.org>, <stefano.stabellini@amd.com>,
	<julien@xen.org>, <Volodymyr_Babchuk@epam.com>,
	<bertrand.marquis@arm.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Subject: [XEN v1 9/9] xen/arm: Introduce ARM_PA_32 to support 32 bit physical address
Date: Thu, 15 Dec 2022 19:32:45 +0000	[thread overview]
Message-ID: <20221215193245.48314-10-ayan.kumar.halder@amd.com> (raw)
In-Reply-To: <20221215193245.48314-1-ayan.kumar.halder@amd.com>

We have introduced a new config option to support 32 bit physical address.
By default, it is disabled.
ARM_PA_32 cannot be enabled on ARM_64 as the memory management unit works
on 48bit physical addresses.
On ARM_32, it can be used on systems where large page address extension is
not supported.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
 xen/arch/arm/Kconfig                 | 9 +++++++++
 xen/arch/arm/include/asm/page-bits.h | 2 ++
 xen/arch/arm/include/asm/types.h     | 7 +++++++
 3 files changed, 18 insertions(+)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 239d3aed3c..aeb0f7252e 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -39,6 +39,15 @@ config ACPI
 config ARM_EFI
 	bool
 
+config ARM_PA_32
+	bool "32 bit Physical Address"
+	depends on ARM_32
+	default n
+	---help---
+
+	  Support 32 bit physical addresses.
+	  If unsure, say N
+
 config GICV3
 	bool "GICv3 driver"
 	depends on !NEW_VGIC
diff --git a/xen/arch/arm/include/asm/page-bits.h b/xen/arch/arm/include/asm/page-bits.h
index 5d6477e599..8f4dcebcfd 100644
--- a/xen/arch/arm/include/asm/page-bits.h
+++ b/xen/arch/arm/include/asm/page-bits.h
@@ -5,6 +5,8 @@
 
 #ifdef CONFIG_ARM_64
 #define PADDR_BITS              48
+#elif CONFIG_ARM_PA_32
+#define PADDR_BITS              32
 #else
 #define PADDR_BITS              40
 #endif
diff --git a/xen/arch/arm/include/asm/types.h b/xen/arch/arm/include/asm/types.h
index 083acbd151..f9595b9098 100644
--- a/xen/arch/arm/include/asm/types.h
+++ b/xen/arch/arm/include/asm/types.h
@@ -37,9 +37,16 @@ typedef signed long long s64;
 typedef unsigned long long u64;
 typedef u32 vaddr_t;
 #define PRIvaddr PRIx32
+#if defined(CONFIG_ARM_PA_32)
+typedef u32 paddr_t;
+#define INVALID_PADDR (~0UL)
+#define PADDR_SHIFT BITS_PER_LONG
+#define PRIpaddr PRIx32
+#else
 typedef u64 paddr_t;
 #define INVALID_PADDR (~0ULL)
 #define PRIpaddr "016llx"
+#endif
 typedef u32 register_t;
 #define PRIregister "08x"
 #elif defined (CONFIG_ARM_64)
-- 
2.17.1



      parent reply	other threads:[~2022-12-15 19:33 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15 19:32 [XEN v1 0/9] Add support for 32 bit physical address Ayan Kumar Halder
2022-12-15 19:32 ` [XEN v1 1/9] xen/arm: Remove the extra assignment Ayan Kumar Halder
2022-12-16  7:56   ` Jan Beulich
2022-12-16  9:41   ` Julien Grall
2022-12-15 19:32 ` [XEN v1 2/9] xen/arm: Define translate_dt_address_size() for the translation between u64 and paddr_t Ayan Kumar Halder
2022-12-16  9:51   ` Julien Grall
2022-12-17  0:46     ` Stefano Stabellini
2022-12-17  8:42       ` Julien Grall
2022-12-22 23:20         ` Stefano Stabellini
2022-12-23 10:01           ` Ayan Kumar Halder
2022-12-23 10:17             ` Julien Grall
2023-01-04 23:56               ` Stefano Stabellini
2022-12-15 19:32 ` [XEN v1 3/9] xen/arm: Always use 'u64' instead of 'paddr_t' for address and size in DT Ayan Kumar Halder
2022-12-16  9:57   ` Julien Grall
2022-12-16 10:49     ` Ayan Kumar Halder
2022-12-16 11:12       ` Julien Grall
2022-12-16 11:13         ` Julien Grall
2022-12-15 19:32 ` [XEN v1 4/9] xen/arm: Use translate_dt_address_size() to translate between device tree addr/size and paddr_t Ayan Kumar Halder
2022-12-15 19:32 ` [XEN v1 5/9] xen/arm: Use 'PRIpaddr' to display 'paddr_t' variable Ayan Kumar Halder
2022-12-15 19:32 ` [XEN v1 6/9] xen/arm: Use 'u64' to represent 'unsigned long long' Ayan Kumar Halder
2022-12-16 10:04   ` Julien Grall
2022-12-15 19:32 ` [XEN v1 7/9] xen/arm: Restrict zeroeth_table_offset for ARM_64 Ayan Kumar Halder
2022-12-15 22:08   ` Julien Grall
2022-12-15 19:32 ` [XEN v1 8/9] xen/arm: Other adaptations required to support 32bit paddr Ayan Kumar Halder
2022-12-16 10:23   ` Julien Grall
2022-12-20 15:24     ` Ayan Kumar Halder
2022-12-20 16:22       ` Julien Grall
2022-12-15 19:32 ` Ayan Kumar Halder [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221215193245.48314-10-ayan.kumar.halder@amd.com \
    --to=ayan.kumar.halder@amd.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=stefano.stabellini@amd.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.