[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] xen: avoid generation of stub <asm/pci.h> header
- To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Thu, 2 Nov 2023 09:39:11 +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=gnNEdTC2b5YoH4KGuowk3NrtAXlJ6IAvhCBVPgYMI+E=; b=WO0/cx+Vl9NcFtOaOPUixi6yu0AXKJEbnFKqvm6W8P0qzdfXvJDvKoitgGR6PgFBPaFlShJ4KCc32CBpunVwKHgUBPcaXMpZP3UhXLs5cvKFs6i+e3sWYrRpRpWjOF2kmUa9Rm5HCHIFtDAmXVM7V5mjCb4hboZ5yJ3eigSS9bI2CIcBs+w3v6MyfL3PfqgV5WHerVXAwVzZBHsZ0TwI0jWQRTj9j5rO+cpXGUfYqqogsBIb3zKBpEdtBjzdlc/eZJedVFFWIhWnEimqVH6ej0CAYFfMwmlox/WOhVXFK0xn6x7F8MwhVjo6c92OJ3/NPPGG3IWHJdMZ4ny/hhs5xA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fdQgSt7/y8p1DK9N/P+T2cgTJ7OmD88EyfvlgmsqjlV5TI9kq6vDJuUP3v4x5AzIan3vPhqQMpvztH5rv5+PuAzmCbL67Sjp3O/9olMNQCXWvzohFkh+WA0V24s1KPmbwWj7Zq+ZuVyK5h6gWFzOBfmXfJafWj0xLF5lVa1ZBWqmI2LUplXVtX17ebRMoIlD8+Y8/uog03qHKSiOXDH7OcySt48v5VGw3QvbvknqLiEGmeMckdv5ZoAOwSTU38K2AtdtM997+uKnJk1fECJ10yzvumd5r0Ut/RIz3HDoO2FEdhyNgszOW1pekj7Q0WFVTAvPEwGP0lz50/O+9nifvA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@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>, Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Thu, 02 Nov 2023 08:39:20 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 01.11.2023 11:15, Oleksii Kurochko wrote:
> Platforms which doesn't have HAS_PCI enabled it is needed to
> have <asm/pci.h>, which contains only an empty definition of
> struct arch_pci_dev ( except ARM, it introduces several
> ARM-specific functions ).
>
> Also, for architectures ( such as PPC or RISC-V ) on initial
> stages of adding support, it is needed to generate <asm/pci.h>
> for only define the mentioned above arch_pci_dev structure.
>
> For the Arm-only stubs ( mentioned in <asm/pci.h> for disabled
> HAS_PCI and ARM-specific) will be needed
> to add <asm/pci.h> directly alongside <xen/pci.h>. Only to
> <arm/domain.c> <asm/pci.h> was added.
>
> Suggested-by: Jan Beulich <jbeulich@xxxxxxxx>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
albeit with two remarks:
> --- a/xen/include/xen/pci.h
> +++ b/xen/include/xen/pci.h
> @@ -68,7 +68,18 @@ typedef union {
> };
> } pci_sbdf_t;
>
> +#ifdef CONFIG_HAS_PCI
> #include <asm/pci.h>
> +#else
This minimal scope of the #ifdef will do for now, but will likely want
extending down the road. Even what's visible in context is already an
entity which should be entirely unused in the code base when !HAS_PCI.
> +struct arch_pci_dev { };
> +
> +static always_inline bool is_pci_passthrough_enabled(void)
Perhaps s/always_inline/inline/ as this is moved here. We really shouldn't
use always_inline unless actually have a clear purpose.
Jan
|