[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: Mon, 7 Aug 2023 17:39:53 +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=5a0aGsgMCp4OKHVf3eaemHU1LFdujOUFiyGq8ijI+ww=; b=GDVmFR3hkfbhw4YYvca2uq/mxNWA1UJFaEjjjNM7gtlLupcpGmTvZG1QtGjjV7ibxY/BaIU3YySDJ0yh795YvGzXMiiGHncOq8JF1+EHcVfhHqqz2G2DU5oVQO4vgYU69VpigXfrf6UNlYL3AuCO8U02l2U4wo/PKiZ2nTXmuOHopz91z9PkRkxwfYYmWQKwyavrnbuRbVllr/ZqqUI1QDJbA2jW3Cm6s3p4NbdQpk1073HOhhvXuqyO90G4HYbnbYOjyiEMB4TJuTTx5D66RuiEQPzaioEmm2LOJeJ9ycJKTb/T/qezeCHgTYzI11WZ6L1IFK5lG2k33Ru/+Be8cQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n83PtR4euJ/pDChSm8mmzYO7BLj+YLUyWp+vayTnhJmRntmawKgWToC48evGZeAye6mfMMz3njTbpcVDmFCdOS1PPTldopfpyohCyg51i2YRAE8RVPb9z3Vf7402EMn1F9I550d+u1jHG3WcRr1wsb72CRqdGAn329mZcCAdNKYUB8YJ4CftT+1uzrWyVOzS8wXLZTuaWfYLWO48R+0Lfl3aaxGKAu17UwIUacCif0F6B0MTmZSVJSdYBhhq0YCLG8cVsgfkCL9Kw5iSlAwSqT3hdnwe6mq/pySho4/zSO+xEkjXT9l4uFGD3nvRyfO4OQr48iteVLF8xLztTUqJ6A==
  • 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: Mon, 07 Aug 2023 15:40:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03.08.2023 01:02, Shawn Anastasio wrote:
> A few files treewide depend on defininitions in headers that they
> don't include. This works when arch headers end up including the
> required headers by chance, but broke on ppc64 with only minimal/stub
> arch headers.
> 
> Signed-off-by: Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>

I'm okay with the changes in principle, but I'd like to ask a question
nevertheless, perhaps also for other REST maintainers (whom you should
have Cc-ed, btw) to chime in.

> --- 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 ...

> --- 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?

> --- 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.

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.

Jan



 


Rackspace

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