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

Re: [PATCH v1 2/4] xen/arm: mpu: Define Xen start address for MPU systems



Hi,

On 02/09/2024 15:48, Ayan Kumar Halder wrote:

On 28/08/2024 15:49, Julien Grall wrote:
Hi,
Hi Julien,

On 23/08/2024 17:31, Ayan Kumar Halder wrote:
From: Wei Chen <wei.chen@xxxxxxx>

On Armv8-A, Xen has a fixed virtual start address (link address
too) for all Armv8-A platforms. In an MMU based system, Xen can
map its loaded address to this virtual start address. So, on
Armv8-A platforms, the Xen start address does not need to be
configurable. But on Armv8-R platforms, there is no MMU to map
loaded address to a fixed virtual address and different platforms
will have very different address space layout. So Xen cannot use
a fixed physical address on MPU based system and need to have it
configurable.

So in this patch, we reuse the existing arm/platforms to store
Armv8-R platforms' parameters. And `XEN_START_ADDRESS` is one
kind of MPU based platform's parameters. So we define default
`XEN_START_ADDRESS` in the MPU specific header file.

This seems a left-over from as previous work?
Yes, this needs to be removed.


We also introduce one Kconfig option for users to override the
default Xen start address of selected platform, if they think
the default address doesn't suit their scenarios. For this
Kconfig option, we use an unaligned address "0xffffffff" as the
default value to indicate that users haven't used a customized
Xen start address.

Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
Signed-off-by: Jiamei.Xie <jiamei.xie@xxxxxxx>
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
---
  xen/arch/arm/Kconfig                  | 11 +++++++++++
  xen/arch/arm/include/asm/mpu/layout.h | 25 +++++++++++++++++++++++++
  2 files changed, 36 insertions(+)
  create mode 100644 xen/arch/arm/include/asm/mpu/layout.h

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 686948cefd..d722ca690c 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -23,6 +23,17 @@ config ARCH_DEFCONFIG
      default "arch/arm/configs/arm32_defconfig" if ARM_32
      default "arch/arm/configs/arm64_defconfig" if ARM_64
  +config XEN_START_ADDRESS
+    hex "Xen start address: keep default to use platform defined address"
+    default 0xFFFFFFFF
+    depends on MPU
+    help
+      This option is allowed to set customized address at which Xen will be
+      linked on MPU systems.

I don't quite understand what you mean by "allowed".

I will rephrase this as ...

"Used to set customized address at which which Xen will be linked

on MPU systems. This address must be aligned to a page size.
0xFFFFFFFF is used as the default value to indicate that user hasn't
customized this address."

Reading this comment, I would like to ask some clarification. In the context of the MPU how do you define a page size? The definition is pretty clear when using the MMU because the granularity if defined by the HW. But for the MPU, it is a bit blur. Is it still 4KB? If so, is it actually realistic (we don't have that many MPU regions)?

Cheers,

--
Julien Grall



 


Rackspace

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