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

[XEN][PATCH v5 11/17] asm/smp.h: Fix circular dependency for device_tree.h and rwlock.h


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Vikram Garhwal <vikram.garhwal@xxxxxxx>
  • Date: Tue, 11 Apr 2023 12:16:12 -0700
  • 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
  • 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=x1PNAnqijXbZmLbaJTz/bnk2u6mRzrBSQaqCUQeSU5s=; b=jaL9+qOMzRad5tarJg4rEj4AKXrLNbMCDZlevdOeN1RNicT0Vj4aGC2TpobcwtvzX7YLo5mFaIpM/8ulm1opSE0QM2dTfcTf+xjX0o/MfWBBCLKrIfMG4b3D39A3YuA0fhCjqtpKPBGsMN/cjpUibFTkyhbO+SToa+IxsW4Vu2rS7dD6RbdMLXSMN3IF1G05npHhRVG9BabpwY7H+D6HQI0DUuznXWTDFXOS2Tx//5JnZtFgOpDe9Ck2R9xUkNMQmOz+Y2p0ORVooRxFOIzonSG/hvi6aJR7+oABL/WNh62YxFEGv7Frl7HiY+NUrkun81OMteRtRID/tKwmaCyugw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EE2Ctn9GNlCFsItgMw8F9HmYXg17oJOdiP9I9XI4gGGOLXsCtSbDBSqC61H+Dq+MLsM7lxptVaIo+tOpPZPzzMDUlCj/wE4F6cekg2BKBn6/Lo9J9ZDhfqwtpK/9IY1089A9Q867ER7/LITYmQibC71RbKQVmwQGce9+X5tjUYl3mShbhsOu8sRmoCVk/82SwIkHBA0S/pxssD5JCg+BWCV4HX/8NOUZm+GqDJPV/BsZhURrKd9nJXFRya41E9vv9DuOzNDjwYbJ5xo+9I8FY/BzeL3GPEYu4G6QlZSHWIXlZp5tfgNRPLpwRbKvetPtBqkQF/6ytR5INCV8dx6KlQ==
  • Cc: <sstabellini@xxxxxxxxxx>, Vikram Garhwal <vikram.garhwal@xxxxxxx>, "Julien Grall" <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 11 Apr 2023 19:17:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Dynamic programming ops will modify the dt_host and there might be other
function which are browsing the dt_host at the same time. To avoid the race
conditions, adding rwlock for browsing the dt_host. But adding rwlock in
device_tree.h causes following circular dependency:
    device_tree.h->rwlock.h->smp.h->asm/smp.h->device_tree.h

To fix this, removed the "#include <xen/device_tree.h> and forward declared
"struct dt_device_node".

Signed-off-by: Vikram Garhwal <vikram.garhwal@xxxxxxx>
---
 xen/arch/arm/include/asm/smp.h | 3 ++-
 xen/arch/arm/smpboot.c         | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/include/asm/smp.h b/xen/arch/arm/include/asm/smp.h
index 8133d5c295..afe6129276 100644
--- a/xen/arch/arm/include/asm/smp.h
+++ b/xen/arch/arm/include/asm/smp.h
@@ -3,13 +3,14 @@
 
 #ifndef __ASSEMBLY__
 #include <xen/cpumask.h>
-#include <xen/device_tree.h>
 #include <asm/current.h>
 #endif
 
 DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_mask);
 DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
 
+struct dt_device_node;
+
 #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
 
 #define smp_processor_id() get_processor_id()
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 412ae22869..336a7d418b 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -11,6 +11,7 @@
 #include <xen/cpumask.h>
 #include <xen/delay.h>
 #include <xen/domain_page.h>
+#include <xen/device_tree.h>
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/mm.h>
-- 
2.17.1




 


Rackspace

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