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

[PATCH v1 2/4] xen: arm: make VMAP only support in MMU system


  • To: <sstabellini@xxxxxxxxxx>, <bertrand.marquis@xxxxxxx>, <michal.orzel@xxxxxxx>, <ayan.kumar.halder@xxxxxxx>, <Volodymyr_Babchuk@xxxxxxxx>, <julien@xxxxxxx>
  • From: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • Date: Fri, 2 Aug 2024 13:14:41 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=rcvevutIA8wF3Pys0d5aki/QrgNfXYtD6SWLs8zRKls=; b=s5Ci7QnURzu2TDqqaDr1RrFfgjmrZ9xIerqJbMEEBS9OOLA1rN8lw3s4cywh7UnV+sR9lPTUe7J6puKVb7YPa58od76QczKiNcrm5BMqOLcdc5ZbGZu3Nd+vVFFJ+uGOuOn+CzcVBq/gAUhk72kuEzCIHXzgB1rcSoUKUgjsVeo3A27c4rt++ewmFPEX5A903JBZJZ/d7Y6LWqj4QjNmpsPqov5UeYQ7cc1FxRmkYHigT8GYTYcMDQYOI/rMa96onn9flL7YEZou+XsO0aMhBTR5r6delas4vS4ow5wPNjHAZxuYx8zRu1XxyilEvCU+FrD0spZWRLWHtsXzi6i5bw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UKrWA47OVwAZllrifdvyN+cgcSIDqdM1MG5hepUF9ujI2nffKoMNvzW5tVDz3KTpfndkhNj/9ftZ/PK0eKGv5QZREpTAJ54cVuspoyVGZ2/sLHsDnaPxxsLOeWiXijSfmrg3j8+DLr66d0/pxkZ+C+qUzUPnt7TAYRe1PLRmvNdZUtGQFKDi19Ul/ETadMnx9rx7lhOVxW73nroeqFrZInqXOLwfJcg/XXgpwcktGZxTgxwvgtqg10sd2Hpa/bxrJF8ngC83W6EAR2PEUc/Un4/OVyAEwcdy/0umRKmo+tzac0O7QZ6sSd4PwTD3JujrkszC+ydVSVF6v4NkxniG4g==
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Penny Zheng <penny.zheng@xxxxxxx>, "Wei Chen" <wei.chen@xxxxxxx>
  • Delivery-date: Fri, 02 Aug 2024 12:15:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

From: Penny Zheng <penny.zheng@xxxxxxx>

VMAP is widely used in ALTERNATIVE feature, CPUERRATA feature, etc to
remap a range of memory with new memory attributes. Since this is
highly dependent on virtual address translation, we choose to fold VMAP
in MMU system.

In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it
only support in MMU system on ARM architecture. And we make features
like ALTERNATIVE, CPUERRATA, etc, now depend on VMAP.

Split 
"https://patchwork.kernel.org/project/xen-devel/patch/20230626033443.2943270-16-Penny.Zheng@xxxxxxx/";
into Arm specific

Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>
Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
---
 xen/arch/arm/Kconfig   | 6 +++++-
 xen/arch/arm/Makefile  | 2 +-
 xen/arch/arm/setup.c   | 4 ++++
 xen/arch/arm/smpboot.c | 2 ++
 xen/include/xen/vmap.h | 6 ++++++
 5 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 21d03d9f44..c8d417298c 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -12,7 +12,7 @@ config ARM_64
 config ARM
        def_bool y
        select FUNCTION_ALIGNMENT_4B
-       select HAS_ALTERNATIVE
+       select HAS_ALTERNATIVE if HAS_VMAP
        select HAS_DEVICE_TREE
        select HAS_PASSTHROUGH
        select HAS_UBSAN
@@ -58,9 +58,13 @@ config PADDR_BITS
        default 40 if ARM_PA_BITS_40
        default 48 if ARM_64
 
+config HAS_VMAP
+       def_bool y
+
 config MMU
        def_bool y
        select HAS_PMAP
+       select HAS_VMAP
 
 source "arch/Kconfig"
 
diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 45dc29ea53..6882814d38 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -11,7 +11,7 @@ obj-$(CONFIG_HAS_VPCI) += vpci.o
 
 obj-$(CONFIG_HAS_ALTERNATIVE) += alternative.o
 obj-y += bootfdt.init.o
-obj-y += cpuerrata.o
+obj-$(CONFIG_HAS_VMAP) += cpuerrata.o
 obj-y += cpufeature.o
 obj-y += decode.o
 obj-y += device.o
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 0c2fdaceaf..9d34ac7f64 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -804,11 +804,13 @@ void asmlinkage __init start_xen(unsigned long 
boot_phys_offset,
     nr_cpu_ids = smp_get_max_cpus();
     printk(XENLOG_INFO "SMP: Allowing %u CPUs\n", nr_cpu_ids);
 
+#ifdef CONFIG_HAS_VMAP
     /*
      * Some errata relies on SMCCC version which is detected by psci_init()
      * (called from smp_init_cpus()).
      */
     check_local_cpu_errata();
+#endif
 
     check_local_cpu_features();
 
@@ -879,8 +881,10 @@ void asmlinkage __init start_xen(unsigned long 
boot_phys_offset,
      * It needs to be called after do_initcalls to be able to use
      * stop_machine (tasklets initialized via an initcall).
      */
+#ifdef CONFIG_HAS_VMAP
     apply_alternatives_all();
     enable_errata_workarounds();
+#endif
     enable_cpu_features();
 
     /* Create initial domain 0. */
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 04e363088d..999afc028e 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -406,7 +406,9 @@ void asmlinkage start_secondary(void)
 
     local_abort_enable();
 
+#ifdef CONFIG_HAS_VMAP
     check_local_cpu_errata();
+#endif
     check_local_cpu_features();
 
     printk(XENLOG_DEBUG "CPU %u booted.\n", smp_processor_id());
diff --git a/xen/include/xen/vmap.h b/xen/include/xen/vmap.h
index fdae37e950..84797acfc0 100644
--- a/xen/include/xen/vmap.h
+++ b/xen/include/xen/vmap.h
@@ -138,10 +138,16 @@ static inline void iounmap(void __iomem *va)
 /* Pointer to 1 octet past the end of the VMAP_DEFAULT virtual area */
 void *arch_vmap_virt_end(void);
 
+#ifdef CONFIG_MMU
 /* Initialises the VMAP_DEFAULT virtual range */
 static inline void vm_init(void)
 {
     vm_init_type(VMAP_DEFAULT, (void *)VMAP_VIRT_START, arch_vmap_virt_end());
 }
+#else
+static inline void vm_init(void)
+{
+}
+#endif
 
 #endif /* __XEN_VMAP_H__ */
-- 
2.25.1




 


Rackspace

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