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

[PATCH] xen/arm: Create GIC node using the node name from host dt


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Wed, 19 Feb 2025 18:29:46 +0100
  • 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=ZAPeOGg/lWgEcPYoLLPb9eya9FoS2OpA9Oj9nfKIrpg=; b=FelY9FNCUtI5hIEsEyf7gCJUFo9Dn5+cfmoxo5xb2OoW7p+/g/yiiXz+8y9iF2Uf6LGOPI2ajsqklfehWtbIxOoGrMsbWF8cKIKCg6ym5EW04NPA4/BY+UI5mAlTg9gMFM5UO59ANQnd2ZxXMTVOA+bdN2RxeO85J8mqMdyZj9xeoUbJnu/ZOplAA4d1mF2jut93kmTNLjTZKMVBcaT/fru2TZJEzFVIBjbfLkP83o9jIUcozOgPTS5l2jFZJ1tkgvWQcFnmis0tfcBIbbb4Ko1iekOnEVF3P56U86mBhQCmNddga9XjV9+ghrXrSVAIRrkDlSctWgo098gTKgkAVQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UxthUMThLqtgEE433xneGjLzgeOpFyVSHq+yYtr2VV0MnCXmU7L2VrwttLsO78XGH4oJE29HYIJIqd5F6AXN2vrCVOtVRIuSG2BU/vAg8ahrS52ltNSQY1PM+MtZRF6YL6j6MeF3te1WLuO0feIDEQ83yA77f3UqwMsgR9tH/2yiYBLtMoOVFaKsvF/9xyIlWPrmaqWlS6oRtrV6gAj2bgyMPgx9QupbZ6YJtDvgq+SldtfrQLrkSUJV9SD7h/vc26DacodUkWxHq3e7klUd7lkuLC0yLEE24QhDPVh+WzE4WV0fm/k/Dozhe1lvIye6wRzSPVWEEvvTe8Ab6+Vh0w==
  • 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, 19 Feb 2025 17:30:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

At the moment the GIC node we create for hwdom has a name
"interrupt-controller". Change it so that we use the same name as the
GIC node from host device tree. This is done for at least 2 purposes:
1) The convention in DT spec is that a node name with "reg" property
is formed "node-name@unit-address".
2) With DT overlay feature, many overlays refer to the GIC node using
the symbol under __symbols__ that we copy to hwdom 1:1. With the name
changed, the symbol is no longer valid and requires error prone manual
change by the user.

The unit-address part of the node name always refers to the first
address in the "reg" property which in case of GIC, always refers to
GICD and hwdom uses host memory layout.

Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
 xen/arch/arm/domain_build.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 7b47abade196..e760198d8609 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1615,6 +1615,7 @@ static int __init make_gic_node(const struct domain *d, 
void *fdt,
     int res = 0;
     const void *addrcells, *sizecells;
     u32 addrcells_len, sizecells_len;
+    const char *name;
 
     /*
      * Xen currently supports only a single GIC. Discard any secondary
@@ -1628,7 +1629,11 @@ static int __init make_gic_node(const struct domain *d, 
void *fdt,
 
     dt_dprintk("Create gic node\n");
 
-    res = fdt_begin_node(fdt, "interrupt-controller");
+    /* Use the same name as the GIC node in host device tree */
+    name = strrchr(gic->full_name, '/');
+    name = name ? name + 1 : gic->full_name;
+
+    res = fdt_begin_node(fdt, name);
     if ( res )
         return res;
 
-- 
2.25.1




 


Rackspace

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