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

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


  • To: Vikram Garhwal <vikram.garhwal@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Mon, 17 Apr 2023 11:41:59 +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
  • 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=jwxDBkwwAOkhG7T9g8ihpMC8ekDPONtAy2podrYq4lA=; b=ZXBSUpWHOEtHhrf7Q01jx6J5XqIvSXr1Qvxw4mWHECTKyTnOZ7+TBoskA3TES/awPJmQieqtXcWFMtuMTDfTi+xu6mCAx51Hk6hWg/h6vnERqbjJQ0PB2Fl21jFPyIS+Rj6owL+BeADJdlH4SaTTgVO7l9np9OQQGpRn2cQ5dQG0mxMHctJJnT7jxGYu324kbuPBUi5j5MfdARqjfHsBkM57ThDVhx85Jk5XWFZ1FZwHegO0luIRujYMn9uOf3m8Ah6jXLoAjZF3VzSJVeCOkA89oFYBHnr90+LdFxe/tXKkHjo5HAV7IiYp8nfCQnR6W2BhDc42AbjmL3ORvfAlcw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JEi8DUJjviYeEcDBk3mkvqlkEtQA9Sxt+CuiJhCyQtopQutGoRTcLXa+nFl89XBfjwK1FMjG0AF8H8l5FZzKXavRAVM+C1iKV9n1Fj6997New7XKMxsFv1lwMgDPtWTZePDJnJC1fAbIOuS6L7Ut7zxcc4uZbLN0I+eqAfZa1bnEVU3RBxOfAe0zdHvqqxgrPX2UJOEYailALXfqPn3HeHA9ZiRdibDuO812Nz9LVjnqWX7AnSkZqeO3NywljibBt02/YURt/uZEFGry8Z06Ior36FVWIR/bIldD+FMbIdWl7ed5JjSneAJc9rUuvdyZJxNMqbAMGRqSs1nMoYNmqQ==
  • Cc: <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 17 Apr 2023 09:42:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Vikram,

On 11/04/2023 21:16, Vikram Garhwal wrote:
> 
> 
> 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>
Headers should be listed in alphabetical order, so device_tree.h goes before 
domain_page.h

Other than that:
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>

~Michal



 


Rackspace

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