[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 07/10] libxl: Only map legacy PCI IRQs if they are supported
- To: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Mon, 25 Oct 2021 15:46:04 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=5Ty06Uj7JfE65tSUpt28Gf14m7X0EBKkraud9zrsoVs=; b=ZNQSIcaOu1eKwJF7cynoFkEjr45FlM2zwOngqOaRST2Adt8xHLttcc8MwGr53/hNlBQRsAWbgNqNUWOkkmdiVmG1eVwQQKdPZ3XbWj0UQjGCN+Lr5vv6x0d4iIfwDvye7JhWoo9FreVQFVJb25+e7lu3mddMdW04UtTCzjcxpjuztW/rUKtIIPMR9sTaKxoUwkdClbtxpTHjZQMxx6AA7/llxDxb1Uh3UPnWwzEfsVRqN0QeI5ojhnmqcaDsUJ+ZlCw4mqr6MvfDdZ4MelwpbCGvHTcc0v+1LMQLmD5GglPKoBMJeJ9xIDIKYlNV0VHyqjrqFw1RzzgEMouOWJN4hQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZUF+3i38K3dyWSUKOJcuF31XvJxydR8trmzR3afw0ZFzn0rMJebcHD6x2gCF1HDPInLalj0fJSUGjbIeTdSi9puvRi9/mOSMR98WEYRUDzFpmQWgcozJp9NDgFd7VfBL+dn/OKSJoyqzn7+c4Sxuhkyd1SZpWN7Ybfohq9QIAlEYY6fs35kMBOjU1C80cIr8SnofFwx76++bSFTWIi0Gp08wP88wYDmj8R/id80+meJk4vzi6Dgz3fRh54JMBt2uj/QIsbU3SNbLE0uAonACQgdVY1HXFvAnHNPo+8gah9089nnFYE3A27YbOwXnlCAcGaDTbl7ZE0SU5++k7ygVfg==
- Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Artem Mygaiev <Artem_Mygaiev@xxxxxxxx>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>, "george.dunlap@xxxxxxxxxx" <george.dunlap@xxxxxxxxxx>, "paul@xxxxxxx" <paul@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, "jbeulich@xxxxxxxx" <jbeulich@xxxxxxxx>
- Delivery-date: Mon, 25 Oct 2021 13:46:37 +0000
- Ironport-data: A9a23:xw6T4qzFSYhp53ih4HR6t+f+wCrEfRIJ4+MujC+fZmUNrF6WrkUDy TZLUGGHPf6OazHwKdoiYdnj8kgBsJ6Hx4cwTwVtrSAxQypGp/SeCIXCJC8cHc8zwu4v7q5Dx 59DAjUVBJlsFhcwnvopW1TYhSEUOZugH9IQM8aZfHAuLeNYYH1500s6w7Rk2tcAbeWRWGthh /uj+6UzB3f9s9JEGjp8B3Wr8U4HUFza4Vv0j3RmDRx5lAa2e0o9VfrzEZqZPXrgKrS4K8bhL wr1IBNVyUuCl/slIovNfr8W6STmSJaKVeSF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RfCBkqp9VVH0ZipRDA+Dx2GSk8Ntoic1CVXhmlwyw8dyNYElnkN+ZohQ91P5v jCMK5viLZSJ/VmJZ5VFaMEW4+6G2bNSRXDPCabJknmDrgOPzbXp5v+8NwOlZWXkVwzve4Pcb j6ISJlXF8JCjDT4Je1reN2Gzj2MRWAYQg=
- Ironport-sdr: PwBPMnbxubQsYOcLaIagNtn4GwZBb+NjNy7d6+s2v59Hy1u8M6GEilUJ2RRCYioXFYNjY27LxZ JmqmD4oVDPXlyB15GJ4eSodEmQkLVxmbrLuoXqMrx1IERM4sIb1RxUMRx1jT2OTBARZkTA26gR 3aq01jSHjs5dOvOCW0EGEpAPmCh6pzr5rV3N883iXWxZlW015Orivqf1dAfxn7wOL/7QUaubcL CCUstlcgVX4gjzoRZZo2xgh161h/rxws/pVfqPW24C8UtmUf42RdeWXbh2VCmXipqnvQ2zDy9s QF2YFW5kWU2y8P0NlnIUWGyJ
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Mon, Oct 25, 2021 at 01:38:19PM +0000, Oleksandr Andrushchenko wrote:
> Hi, Roger!
>
> On 25.10.21 16:22, Roger Pau Monné wrote:
> > On Fri, Oct 08, 2021 at 08:55:32AM +0300, Oleksandr Andrushchenko wrote:
> >> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
> >>
> >> Arm's PCI passthrough implementation doesn't support legacy interrupts,
> >> but MSI/MSI-X. This can be the case for other platforms too.
> >> For that reason introduce a new CONFIG_PCI_SUPP_LEGACY_IRQ and add
> >> it to the CFLAGS and compile the relevant code in the toolstack only if
> >> applicable.
> >>
> >> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
> >> Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> >> Reviewed-by: Rahul Singh <rahul.singh@xxxxxxx>
> >> Tested-by: Rahul Singh <rahul.singh@xxxxxxx>
> >> ---
> >> Cc: Ian Jackson <iwj@xxxxxxxxxxxxxx>
> >> Cc: Juergen Gross <jgross@xxxxxxxx>
> >>
> >> Since v1:
> >> - Minimized #idefery by introducing pci_supp_legacy_irq function
> >> for relevant checks
> >> ---
> >> tools/libs/light/Makefile | 4 ++++
> >> tools/libs/light/libxl_pci.c | 13 +++++++++++++
> >> 2 files changed, 17 insertions(+)
> >>
> >> diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
> >> index 7d8c51d49242..bd3f6be2a183 100644
> >> --- a/tools/libs/light/Makefile
> >> +++ b/tools/libs/light/Makefile
> >> @@ -46,6 +46,10 @@ CFLAGS += -Wno-format-zero-length
> >> -Wmissing-declarations \
> >> -Wno-declaration-after-statement -Wformat-nonliteral
> >> CFLAGS += -I.
> >>
> >> +ifeq ($(CONFIG_X86),y)
> >> +CFLAGS += -DCONFIG_PCI_SUPP_LEGACY_IRQ
> >> +endif
> > TBH, since CONFIG_PCI_SUPP_LEGACY_IRQ is used in a single place in the
> > source I would consider just using CONFIG_X86, as I think it would be
> > clear enough that some arches support legacy interrupt while others
> > don't. Not sure it's worth going through the obfuscation of defining a
> > separate one.
> The idea behind not using CONFIG_X86 is to be arch agnostic,
> so CONFIG_PCI_SUPP_LEGACY_IRQ makes more sense with this
> respect
I'm not going to insist, but you could have avoided modifying the
Makefile at all by just using:
static bool pci_supp_legacy_irq(void)
{
#ifdef CONFIG_X86
return true;
#else
return false;
#endif
}
Which IMO is clearer than the current approach since it's a single
place where CONFIG_PCI_SUPP_LEGACY_IRQ gets used.
> >> +
> >> SRCS-$(CONFIG_X86) += libxl_cpuid.c
> >> SRCS-$(CONFIG_X86) += libxl_x86.c
> >> SRCS-$(CONFIG_X86) += libxl_psr.c
> >> diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
> >> index 59f3686fc85e..4c2d7aeefbb2 100644
> >> --- a/tools/libs/light/libxl_pci.c
> >> +++ b/tools/libs/light/libxl_pci.c
> >> @@ -1364,6 +1364,15 @@ static void pci_add_timeout(libxl__egc *egc,
> >> libxl__ev_time *ev,
> >> pci_add_dm_done(egc, pas, rc);
> >> }
> >>
> >> +static bool pci_supp_legacy_irq(void)
> > A naming more inline with the PCI specification (since we insisted on
> > using ECAM instead of MCFG) would be intx, ie: pci_supports_intx.
> This will require a follow up patch if we all agree this change is needed.
> @Jan, are you ok with the rename?
Didn't realize it was already committed, in which case I guess we could
leave it as-is.
Thanks, Roger.
|