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

Re: [PATCH 1/9] xen/common: Add missing #includes treewide


  • To: Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 9 Aug 2023 08:42:41 +0200
  • 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=8/qv8RzdLGkHNogzIJrzcZKa6WYQvuP94xlgxFUFJqQ=; b=nG5b59+BDfokVxFwcodbAH6dNrj74IeSvILCktyTWTXw/X745X9QMjM/8ulEUXOf0XIrtiyf4zjVdxLpXQb0c6YqeyM9OzDL7D1yQ+uW+7ERdo1OoXIHDNpzG1fXZ0qEbWGw52fIjuJRAIPRgf38N0okw9vsrEbHmPxYVH54RKiLDpRGrhEv02X8ziwzfycHEcQRZhexjnSkdOoLZ+DQxsVW0f+GSTc/TlxImEmetfZeMWeNZUI6JgQOGGbvAmByBbK7O5Y1c0E2evz1hPW05i7TquuqMIHrhZFJZIUgskUE5gu9KLzbXc2TgLkuxX3z071aPbh7AVp4KjvqbLRktg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XrZBk/vck8q8iXLXfSQP1WZ4CxT4GbKrap82cWGmskOb/yGfqau0uvjZoqio96wCc030Ax2icJ6MNV3eJQeEJV44fzmAPnwR7ygoh1LleqnFJDKem71YsqEOqL7V+is8DoObfPRAc1S1XBSXUUYcheX/KQik1yZMMIehwV/dypAFtA2EGD0/9VtQItKdXNqhPtknm7/Dqg6yy1pMH/viQjTNnsy0rm+dFTeFPY+GqnFel+EBdMei0bDsF0AevEhKck+3uHYj2+vMarVYy6pgH2k4iQgMhBklfVC1ji21dTLynI7GmvNTihquxxl7PctPZ2FvYayQp1mEYMmK0bJk8g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Timothy Pearson <tpearson@xxxxxxxxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 09 Aug 2023 06:42:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.08.2023 18:49, Shawn Anastasio wrote:
> On 8/7/23 10:39 AM, Jan Beulich wrote:
>> On 03.08.2023 01:02, Shawn Anastasio wrote:
>>> --- a/xen/common/memory.c
>>> +++ b/xen/common/memory.c
>>> @@ -28,6 +28,7 @@
>>>  #include <asm/current.h>
>>>  #include <asm/hardirq.h>
>>>  #include <asm/p2m.h>
>>> +#include <asm/page.h>
>>>  #include <public/memory.h>
>>>  #include <xsm/xsm.h>
>>
>> I realize there are several asm/*.h being included here already. Yet
>> generally I think common .c files would better not include any of
>> them directly; only xen/*.h ones should (and even there one might see
>> possible restrictions on what's "legitimate"). Do you recall what it
>> was that's needed from asm/page.h here ...
> 
> The references to invalidate_icache (memory.c:310), clear_page
> (memory.c:1867), and copy_page (memory.c:1876) all need asm/page.h to be
> included somehow. I'm not sure which file ends up including asm/page.h
> for build to work on x86/arm, but with my minimal PPC headers it wasn't
> getting incidentally included and build was failing.

Okay, that's unavoidable then.

>>> --- a/xen/common/xmalloc_tlsf.c
>>> +++ b/xen/common/xmalloc_tlsf.c
>>> @@ -27,6 +27,7 @@
>>>  #include <xen/mm.h>
>>>  #include <xen/pfn.h>
>>>  #include <asm/time.h>
>>> +#include <asm/page.h>
>>
>> ... and here?
> 
> Here it's the PAGE_ALIGN used at xmalloc_tlsf.c:549

Hmm, PAGE_ALIGN() really shouldn't be a per-arch #define.

>>> --- a/xen/include/xen/domain.h
>>> +++ b/xen/include/xen/domain.h
>>> @@ -4,6 +4,7 @@
>>>  
>>>  #include <xen/types.h>
>>>  
>>> +#include <public/domctl.h>
>>>  #include <public/xen.h>
>>
>> While following our sorting guidelines, this still looks a little odd.
>> We typically would include public/xen.h first, but then almost all other
>> public headers include it anyway. So I'm inclined to suggest to replace
>> (rather than amend) the existing #include here.
> 
> To be clear, you're suggesting replacing the include of <public/xen.h>
> to <public/domctl.h>?

Yes (but see below).

> I've tested this and it works fine, as expected.

Good.

>> Then again I wonder why this include is needed. xen/domain.h is
>> effectively included everywhere, yet I would have hoped public/domctl.h
>> isn't.
> 
> domctl.h is required because of the reference to `struct
> xen_domctl_createdomain` on domain.h:84. Alternatively, we could get
> away with a forward declaration of the struct.

This is always the preferred solution, when available.

Jan



 


Rackspace

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