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

Re: [XEN][RFC PATCH v4 10/16] asm/smp.h: move cpu related function to asm/cpu.h


  • To: Vikram Garhwal <vikram.garhwal@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 8 Dec 2022 09:18:46 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; 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=8Twr3rPDWQxKKsaGbgrKmuLfBBGG9ktZ6vuFlieuLMI=; b=YReByP+fk0d9soC5mcHS4CcMhtDcsTHsn7pvw5w62WwC7B+Pe4t2EY4tyzTFhGsHqtJrCH7aM6dOlHNYu08exZrWUhqlfuxIYK7bsQa5wEAnsoZzZX+QiCwyqwHWDZ69wV8JH56Jm4bxwZlRIO4VQOq9svXwQQb9+3UZ4XefrXXCYTaOOOCCUjLVakvGonz8VYhjCSjxkQP0JWQkOS8jKwpAAeGXaR+FJ6Z2MG4Zfzt9LVcPEZADUZmvpl9gQHlUulXA0ZzYqilFzeNs8/mBvCetwPjuMMoEXBibAGspLDCNbwJiwDs51SZmtPMq3zaENd3U9t9K46GfJLf+m55MVA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m7y/em2azCI/HRfB5eLmnlpRX0BbEPTw5xHdypUG9s7hClQ0sulB5FoYJmdEQlc3BcS0VvbbcTxsaGqulTHu2OBHvFqcbPl+15pwuuOCW1RpK1/qlDzp0/uT+NtEPL2+bifUywvyHOjt0ZMJqk6f0qfn9csgGiAk0RV8pjhJcftWb/lhvwnOs1RaPigGQDiCdVbtn0+Fb2qGVqew4VmAflpo2OeBUF+k+nDx9/HcNcee1HZKGdgo4X1DZcMOSmaG4/Dp1/yC0kByevOi/YCtrZmZEM38Rf0Wh2gsY9x9ga7n6fNGbrbUQC8mAAVsYW22o7VrigAsmLImQoHQkFgPEw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: sstabellini@xxxxxxxxxx, Luca.Fancellu@xxxxxxx, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <julien@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 08 Dec 2022 08:18:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.12.2022 20:39, Vikram Garhwal wrote:
> Hi Julien
> 
> On 12/7/22 8:28 AM, Julien Grall wrote:
>> Hi Vikram,
>>
>> On 07/12/2022 06:18, 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
>>>
>>> Inside arch/arm/include/asm/smp.h, there is one function which needs
>>> device_tree.h, moved the cpu related function to a new file:
>>> arch/arm/include/asm/cpu.h
>>
>> Given there is only one function, I don't really see the benefits of 
>> splitting smp.h and then adding #ifdef CONFIG_ARM in the common code.
>>
>> Instead, it would be better if we don't include device_tree.h in the 
>> header but in the c files that need to call arch_cpu_init() and 
>> forward declare dt_device_node.
>>
> This was my initial approach also and there were less changes(compare to 
> my v4) but then though someone might have issues with forward 
> declaration of dt_device_node in smp.h.

We use forward declarations of struct/union is many places, precisely to
limit dependencies among headers.

Jan



 


Rackspace

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