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

[PATCH v6 05/11] xen/arm: define Xen start address for FVP BaseR platform


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Wei Chen <wei.chen@xxxxxxx>
  • Date: Fri, 4 Nov 2022 18:07:35 +0800
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org 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=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=2; 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=c83sPn5waglt7AsZTsybdIkX6p9bIApiwcHQJUpCiHU=; b=OIQbVMba5Cdi42TdiUIitbOeW2LuH4HdVXuic81y02gdX12se7obqllaHnS3AAAJpbtxRVpybYrWT1oMRX/ToEv4FWaZfs5RhtMsbMlik7TqcdEg3y8TmTVF+fwQ9PK1kje3r20G0iygwGrHrDXxxV0DsiesTWznkMuZZzgiZTqOKrLGwZN9i72vHTBPDq8OZ1jsuUcwEUy8UJ/OF+wVkJtorxKyMchYpPqngPiIQKpJcJl4Ner/bFInXN0vpeZDET9C4GL1KCsG30m1vmQ6jvAd5V6HATdbAQ8h7kY4LZrKMAjkGmPMlzD+dqIYbmSle/ZOWCy9GVSvZBTOYZ2PLA==
  • 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=c83sPn5waglt7AsZTsybdIkX6p9bIApiwcHQJUpCiHU=; b=JLt9yKjsTeWz62ETNaQBlLHAIwtnbKzytXrn5aYFhzUTj3NsGV47bUuNKBhZaoeHbk8Dy7kbPbeQkXhnwXxn4PlmtQ5yp/1PtOCIiM9rcxpL1K4SNbDOyMu+kICIb3toZDotnBEYY+WhzzsUCUw0XA/fU6xR4RHH9ICIoPm+fyXZ/HMCGWCV6ICUTTQmyimKFA+fvQDYMRKNE9BW/BJf6ixOWdg0vX+cSjTZyF0SRBAErFrcYN/5DFYCo7p7YbYI0Gy6ejdUj5OctgzhckzqcNMuPlDKBkcr+Gmq8gDm5vC+fyQQTfo1vNBwPDPA4O/Ftz2o0IxtmMQWicBpp5O27A==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=mZGKPaCnTQ1vhG7A/dG8/YoQhSII2/mrNKUNrxWEFQDCDtLxWie9vJ5oG0XcSRiLpEyPGWYoUujZmjFUVWF95sXSJcxPxYat+qCpW5f16Puo85DfuuXrsHdE9oicLMeAvgdG0Fy6EgF84KfWcMsDujU+Zw2tN0cpRg/lsUX8fCIylvBMbgRmQrmBuVjKV6coMYLsHjBlmFX1PRTPjgHWauYiT+6pPTKGAja/02rveRoCRyiEaLuo3/A/sxVfMkmxOILvA3VaIbrNrwFX7Inna9rgoknLCFdWdG5Zyh8rI3gQ1HJTVAPt2GZzmrJd/vnNpNyMv/PQODI98oSLHde6Tg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GYJUt2LLR4GT62crYVzvdmvWP2Dt/5qknnC+LjR1PO0V8jPNJR96WTltiNqxHldBsQ3rXV3DQBJR9le0P7kDqCxnpnyEtkYUa8LuPYCfJUuO1AWxMRwGk4TLHczivVXkNw2roTEKdAnvVXj3Q8sG+PWgPvOeSoULM8AWa0htZtI2os/Aj7p9am3XjRRTj8uSkbbV5Qf23ox2E9a+43aBj5FpYBPvUi/yyz7F1Y1AdWpvQkKRzGseEnfr4PIJ0+RtyQ4nCXTfatsFbtOANGXonNBK5ruYZiy7q8HsEc9vqmpq0oTFihcWPfiyksKgb4L6ZWtiBzjxvD8HgAdpRVHsRw==
  • Cc: <nd@xxxxxxx>, Wei Chen <wei.chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, "Jiamei . Xie" <jiamei.xie@xxxxxxx>
  • Delivery-date: Fri, 04 Nov 2022 10:08:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

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 FVP BaseR platform's parameters. So we define default
`XEN_START_ADDRESS` for FVP BaseR in its platform file.

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.

And as we introduced Armv8-R platforms to Xen, that means the
existed Arm64 platforms should not be listed in Armv8-R platform
list, so we add !ARM_V8R dependency for these platforms.

Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
Signed-off-by: Jiamei.Xie <jiamei.xie@xxxxxxx>
---
 xen/arch/arm/Kconfig                           | 11 +++++++++++
 xen/arch/arm/include/asm/platforms/fvp_baser.h | 14 ++++++++++++++
 xen/arch/arm/platforms/Kconfig                 | 16 +++++++++++++---
 3 files changed, 38 insertions(+), 3 deletions(-)
 create mode 100644 xen/arch/arm/include/asm/platforms/fvp_baser.h

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index ad592367bd..ac276307d6 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -138,6 +138,17 @@ config TEE
          This option enables generic TEE mediators support. It allows guests
          to access real TEE via one of TEE mediators implemented in XEN.
 
+config XEN_START_ADDRESS
+       hex "Xen start address: keep default to use platform defined address"
+       default 0xFFFFFFFF
+       depends on HAS_MPU
+       help
+         This option allows to set the customized address at which Xen will be
+         linked on MPU systems. This address must be aligned to a page size.
+         Use 0xFFFFFFFF as the default value to indicate that user hasn't
+         customized this address, and Xen use use the default value that has
+         been defined in platform files.
+
 source "arch/arm/tee/Kconfig"
 
 config STATIC_SHM
diff --git a/xen/arch/arm/include/asm/platforms/fvp_baser.h 
b/xen/arch/arm/include/asm/platforms/fvp_baser.h
new file mode 100644
index 0000000000..9450a411a9
--- /dev/null
+++ b/xen/arch/arm/include/asm/platforms/fvp_baser.h
@@ -0,0 +1,14 @@
+#ifndef __ASM_ARM_PLATFORMS_FVP_BASER_H__
+#define __ASM_ARM_PLATFORMS_FVP_BASER_H__
+
+/*
+ * 0xFFFFFFFF indicates users haven't customized XEN_START_ADDRESS,
+ * we will use platform defined default address.
+ */
+#if CONFIG_XEN_START_ADDRESS == 0xFFFFFFFF
+#define XEN_START_ADDRESS 0x200000
+#else
+#define XEN_START_ADDRESS CONFIG_XEN_START_ADDRESS
+#endif
+
+#endif /* __ASM_ARM_PLATFORMS_FVP_BASER_H__ */
diff --git a/xen/arch/arm/platforms/Kconfig b/xen/arch/arm/platforms/Kconfig
index c93a6b2756..0904793a0b 100644
--- a/xen/arch/arm/platforms/Kconfig
+++ b/xen/arch/arm/platforms/Kconfig
@@ -1,6 +1,7 @@
 choice
        prompt "Platform Support"
        default ALL_PLAT
+       default FVP_BASER if ARM_V8R
        ---help---
        Choose which hardware platform to enable in Xen.
 
@@ -8,13 +9,14 @@ choice
 
 config ALL_PLAT
        bool "All Platforms"
+       depends on !ARM_V8R
        ---help---
        Enable support for all available hardware platforms. It doesn't
        automatically select any of the related drivers.
 
 config QEMU
        bool "QEMU aarch virt machine support"
-       depends on ARM_64
+       depends on ARM_64 && !ARM_V8R
        select GICV3
        select HAS_PL011
        ---help---
@@ -23,7 +25,7 @@ config QEMU
 
 config RCAR3
        bool "Renesas RCar3 support"
-       depends on ARM_64
+       depends on ARM_64 && !ARM_V8R
        select HAS_SCIF
        select IPMMU_VMSA
        ---help---
@@ -31,14 +33,22 @@ config RCAR3
 
 config MPSOC
        bool "Xilinx Ultrascale+ MPSoC support"
-       depends on ARM_64
+       depends on ARM_64 && !ARM_V8R
        select HAS_CADENCE_UART
        select ARM_SMMU
        ---help---
        Enable all the required drivers for Xilinx Ultrascale+ MPSoC
 
+config FVP_BASER
+       bool "Fixed Virtual Platform BaseR support"
+       depends on ARM_V8R
+       help
+         Enable platform specific configurations for Fixed Virtual
+         Platform BaseR
+
 config NO_PLAT
        bool "No Platforms"
+       depends on !ARM_V8R
        ---help---
        Do not enable specific support for any platform.
 
-- 
2.25.1




 


Rackspace

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