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

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


  • To: Wei Chen <wei.chen@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • Date: Mon, 14 Nov 2022 18:52:40 +0000
  • 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=dQFWV1AW5IPthzY9LgpThqWkLLvMASjgxOJcwcV3N50=; b=Dphy/8RbFhSGJoO65mRwltj4+WjzJ4UXWRyPt/ay2seni+9bhpRIhcpDaC1AjYuZDTuthXCMyAOBRP1j1M7bI3ANqf7gv2OjNvJ1tSK+596aXDQ7TERyDNfcyC/rU5/DY+l0cUNCm1Uyn0E+1EIvqxzUAorfb0YylYPHg0Eg2VoK1DSJVRoTCMZuQYKgHXb07Oi1ilKQ1uDLLrhuecj6f1GWoatk9sc//XwvEijt46R8JcN/OAz1Qw+44WS9DqC9MYyWJQ5vGsxoAaQwd/nVKiUm3JaOQNmOwgOIbhjF9kEhpbCOz/I/9oj2iWuIX1qfRBL/InYTFRQg1ncRlB9qCA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V4s/1LIMjtGDpyZNShAssITKgFPxU3Ir4ytXnw63ll2U/xvzZchl6+4u+Psmd+I4OZGoscdgG7jwVIH4qsn9Qf7vPjdOoKdj017SWjuDPgjZtN5xGelkAoDt2jfIC2MrXOSFFQo/CFwB+geGbuN2UsVP3F/4QBV+T06eNl5QLla0G6Ss+sukAxiwxe1q1fZ8R177vaxiqqa0TtVSoKdHIvXmkqo2qA3peWgMJMJWkGT8eY682i5e8UypO8/tR23+tcefKMAh1eLSgXZ3w88GWQ137vzfG41AyinkiiXm2IFnO+RPHGm6lwGbwCEdsPVBR3NEBQdO5X/g6oWEHQEixA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: nd@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: Mon, 14 Nov 2022 18:53:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Wei,

On 04/11/2022 10:07, Wei Chen 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.


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

I could not spot the patch which introduced ARM_V8R.

Can you rename this to ARM64_V8R ? The reason being the underlying code is specific to R82 ie 64 bit V8R.

- Ayan

         ---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®.