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

[PATCH v2] xen/arm: Drop process_shm_chosen()


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Wed, 2 Apr 2025 10:42:33 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=TZljzGrNQy2MisI0mWr7E+MgWiJzUwr6Rox2FFdPBos=; b=o9r7bWLt4ElxKAq09CtCWBQkDjpHMTqqALK/hAOYSO1aVe71QLjcuHLSHRBEOcqe+hGQkKcwFlu2YlVQ9Nrw9iMU5++EwF/mZsFyE+mbXc8U+/vIMozyUZvoi2qn4Mo0dB7mTD913XNJ/eUQv4s9Plfsd7jBwV1LGqIGKViGLug/LmP8zRrE8KdnSpuGwwI/EahoJwLLLvfPp6+X5qf+JczCuzAA6Sqa42vpu/K6sLMtE0r8Up/9J85wP0D53YScdxTJW4VdrB2gwlsK+V5rqHG3uUd9CCWwxcYitRIqeoDeeZewgg70O1vrSuJccN+GVfDksL6AgP5K4GFgLV4uiw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ci2VW9F6hTyqDnA0aSBAhnFMY2WMqBjEoCzrH5zl26y9/NBSg4dNkSZBQLsPv3qbRDpVYImnmiQwlAEhXhiU3qzhh4gTpvgi3HDWPookGYP/vI3xbJHjvENbNtZ++si0ucHzKB05Y6W0JoIE5IzV+SO2IwMWjflaOTYFOkhP5s7T04qagutKkSM5XNJq3U57dnmQEH5nQT+nEujwxu5M+7B4qwWfZPuGEptnbkEWW6SLz4Q2b3LsH3umHbefo/m+AWT731lMV6pZqDHGZ83aPBWedvtHvxK9OmJdhwd8q/Gzcu5cRbtet+6iFv2Qyx9s/4t5K2nfrk9W3xd4CBJb9w==
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 02 Apr 2025 08:43:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

There's no benefit in having process_shm_chosen() next to process_shm().
The former is just a helper to pass "/chosen" node to the latter for
hwdom case. Drop process_shm_chosen() and instead use process_shm()
passing NULL as node parameter, which will result in searching for and
using /chosen to find shm node (the DT full path search is done in
process_shm() to avoid expensive lookup if !CONFIG_STATIC_SHM). This
will simplify future handling of hw/control domain separation.

Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
Changes in v2:
 - rebase on ACPI fix
 - add BUG_ON for !/chosen
---
 xen/arch/arm/domain_build.c             |  2 +-
 xen/arch/arm/include/asm/static-shmem.h | 14 --------------
 xen/arch/arm/static-shmem.c             |  7 +++++++
 3 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 85f423214a44..634333cddef3 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2327,7 +2327,7 @@ int __init construct_hwdom(struct kernel_info *kinfo)
 
     if ( acpi_disabled )
     {
-        rc = process_shm_chosen(d, kinfo);
+        rc = process_shm(d, kinfo, NULL);
         if ( rc < 0 )
             return rc;
     }
diff --git a/xen/arch/arm/include/asm/static-shmem.h 
b/xen/arch/arm/include/asm/static-shmem.h
index fd0867c4f26b..94eaa9d500f9 100644
--- a/xen/arch/arm/include/asm/static-shmem.h
+++ b/xen/arch/arm/include/asm/static-shmem.h
@@ -18,14 +18,6 @@ int make_resv_memory_node(const struct kernel_info *kinfo, 
int addrcells,
 int process_shm(struct domain *d, struct kernel_info *kinfo,
                 const struct dt_device_node *node);
 
-static inline int process_shm_chosen(struct domain *d,
-                                     struct kernel_info *kinfo)
-{
-    const struct dt_device_node *node = dt_find_node_by_path("/chosen");
-
-    return process_shm(d, kinfo, node);
-}
-
 int process_shm_node(const void *fdt, int node, uint32_t address_cells,
                      uint32_t size_cells);
 
@@ -74,12 +66,6 @@ static inline int process_shm(struct domain *d, struct 
kernel_info *kinfo,
     return 0;
 }
 
-static inline int process_shm_chosen(struct domain *d,
-                                     struct kernel_info *kinfo)
-{
-    return 0;
-}
-
 static inline void init_sharedmem_pages(void) {};
 
 static inline int remove_shm_from_rangeset(const struct kernel_info *kinfo,
diff --git a/xen/arch/arm/static-shmem.c b/xen/arch/arm/static-shmem.c
index c74fa13d4847..e8d4ca3ba3ff 100644
--- a/xen/arch/arm/static-shmem.c
+++ b/xen/arch/arm/static-shmem.c
@@ -297,6 +297,13 @@ int __init process_shm(struct domain *d, struct 
kernel_info *kinfo,
 {
     struct dt_device_node *shm_node;
 
+    /* Hwdom case - shm node under /chosen */
+    if ( !node )
+    {
+        node = dt_find_node_by_path("/chosen");
+        BUG_ON(!node);
+    }
+
     dt_for_each_child_node(node, shm_node)
     {
         const struct membank *boot_shm_bank;
-- 
2.25.1




 


Rackspace

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