[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 <andr2000@xxxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Mon, 25 Oct 2021 15:22:31 +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=z3XmvPIVlrJ7wzpYkZsw+kaaK2vyAPZ04wfI0gd/SsM=; b=Sjhgqcyit3P3bOV8Pylb1OSjl8nZ7g58xkFUO5zONXAoqoRzjWxFnFUl0KKqAped0TombCb8BXuslJGHiCpDX9QROOiRqEYSuBodcrlqOeP5BBqmWS8Njxv5A6CPs0wfE+5vGkP12TqX/6Z6Yh+KdTsUi7OhwsBRSYWe4EmX5qfj3cC5wBpUO5paSlAY1gGOEG1pPGYHN1vYcIDbdwFS0xckZXfn44bKbfxlbAI9EE7/1GG1218VmX6VdsxXYxW7yyos+ctoWAhoLhny/WUS127mLBCpRUa1V0VjRlMLlR8bqtySlpYx9VOI5HO5QA6lCL62nHCHL+Np7OfQRNjOUg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IJ40aC11ENc7AltmFdumDt0RYoet+EUfZ8ExjRd1ro7XPk4c/qQl2fI6tQv371Xtt0Kw4+RaIcAytP1UL0g/1IBkr7Zz9mMIaQ9Ks+FZPDS2yUC2Vh4HLpWzpBtEDgB6SD1ESQ4KBBt+2UO2ze1c173PKI9DcV/Ik7UuxLJd8yhdEqR+CYnP5PsMAdB74myw179Q0Dqerxnx6plWV51EXdHey7Or0PQtzCUuPdCtuTz3ddOKRut5xf0HsbTwtHo3eZKw1Ah3hMx4g8fHmLnEYCryRGi0s0lwMq1mtDVW24tZ7bsBKTkwjaFJQxMyJaxc4okCLbqW9WAvWS56mPWjrw==
- Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <julien@xxxxxxx>, <sstabellini@xxxxxxxxxx>, <oleksandr_tyshchenko@xxxxxxxx>, <volodymyr_babchuk@xxxxxxxx>, <Artem_Mygaiev@xxxxxxxx>, <jbeulich@xxxxxxxx>, <andrew.cooper3@xxxxxxxxxx>, <george.dunlap@xxxxxxxxxx>, <paul@xxxxxxx>, <bertrand.marquis@xxxxxxx>, <rahul.singh@xxxxxxx>, Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, "Juergen Gross" <jgross@xxxxxxxx>
- Delivery-date: Mon, 25 Oct 2021 13:22:47 +0000
- Ironport-data: A9a23:xMIyDKoQUeN27lYZw1DnZGJBQ3VeBmL9YxIvgKrLsJaIsI4StFCzt garIBmFaK2ONGD9Lop2ad/joUIAsZXRmtEwSwJp/31jEigWoJuZCYyVIHmrMnLJJKUvbq7GA +byyDXkBJppJpMJjk71atANlZT4vE2xbuKU5NTsY0idfic5Dnd+4f5fs7Rh2Ncx2YLkW1rlV e7a+KUzBnf0g1aYDUpMg06zgEsHUCPa4W5wUvQWPJinjXeG/5UnJMt3yZKZdhMUdrJ8DO+iL 9sv+Znilo/vE7XBPfv++lrzWhVirrc/pmFigFIOM0SpqkAqSiDfTs/XnRfTAKtao2zhojx/9 DlCnYW6cFk4ZIOLos8QUitfNT9ELa9AprCSdBBTseTLp6HHW37lwvEoB0AqJ4wIvO1wBAmi9 9RBdmpLNErawbvrnvTrEYGAhex6RCXvFJkYtXx6iynQEN4t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PF/79Gl8+7/eCRdeOByFiSp8KrppMdx6n bd96ZBOswHv2AA3NtumjzxP8zjeJHI3TKh65IoRB5Xmi1R3xwgaM4DcECL//LqGd85IbhsxO jaRiaeb3+Zcy0POfmAdD3/I2eYB150CtAoTlA0JJkiTm8qDjfgyhUUD/TMyRwVT7xNGz+MsZ TQ7axwrff2Dpm46itJCUmagHxB6KCeYokGhmUEUkGD5TlWzUjCfJmMKJuvQrlsS9HhRf2YH8 ejAmnrlSzvjYOr4wjA2BRx+s/XmQNF8ql/ClcSgE5jXFpU2e2O40KqnZG5OoBr7G8IhwkbAo LAyrup3bKT6Mw8WorE6VNbGhehBFkjcKTwQW+xl8YMIAXrYKWO71jW5Ikysft9Aeq7R+kiiB s0yfs9CWnxSDspVQuz30ULUH4JJoQ==
- Ironport-hdrordr: A9a23:t5ckBqCSzfGlguXlHemo55DYdb4zR+YMi2TDsHoBLiC9E/bo8/ xG+c5x6faaslossR0b9uxoW5PhfZq/z/BICOAqVN/JMTUO01HIEKhSqafk3j38C2nf24dmpM JdmnFFeb7N5I5B/KTH3DU=
- Ironport-sdr: CxEpbkzsiDagcuYOyAGPVFBeZAtQZUSU9sR9cMD5gQ0tc7IoWdlspxmfiJSCNi0/jSUYehCPr6 G2XnzlN2093Ux3h0UeznxQymfPUeAER8UA1l0i524Iy4Inz5h8ojEHHrLUmIFVvgN65I8PIXnF OzDEGTVxBGx3eb0Sep7hFow+M9mRlf/XJ/NnFjJTWJqHjFV4/d/LX7C4dij3MztCmxYaO8H5SL Wc2v8HDSIaM6m2E6CZ/nUda3Owbai5Z//RfEiPLxpq6Kb+dZ8rVbkHWkl4rXTfW7xHRgj9X9My 7xt1L9njHxdywoGojKCC1IRu
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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.
> +
> 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.
Thanks, Roger.
|