[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87bkb6xu4d.ffs@tglx>
Date: Mon, 04 Dec 2023 09:13:54 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Jiqian Chen <Jiqian.Chen@....com>, Juergen Gross <jgross@...e.com>,
Stefano Stabellini <sstabellini@...nel.org>,
Oleksandr Tyshchenko <oleksandr_tyshchenko@...m.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Len Brown <lenb@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Roger Pau Monné <roger.pau@...rix.com>,
xen-devel@...ts.xenproject.org, linux-kernel@...r.kernel.org,
linux-acpi@...r.kernel.org
Cc: Stefano Stabellini <stefano.stabellini@....com>,
Alex Deucher <Alexander.Deucher@....com>,
Christian Koenig <Christian.Koenig@....com>,
Stewart Hildebrand <Stewart.Hildebrand@....com>,
Xenia Ragiadakou <xenia.ragiadakou@....com>,
Honglei Huang <Honglei1.Huang@....com>,
Julia Zhang <Julia.Zhang@....com>,
Huang Rui <Ray.Huang@....com>,
Jiqian Chen <Jiqian.Chen@....com>,
Huang Rui <ray.huang@....com>
Subject: Re: [RFC KERNEL PATCH v2 2/3] xen/pvh: Unmask irq for passthrough
device in PVH dom0
On Fri, Nov 24 2023 at 18:31, Jiqian Chen wrote:
> diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
> index 5a96b6c66c07..b83d02bcc76c 100644
> --- a/drivers/xen/xen-pciback/pci_stub.c
> +++ b/drivers/xen/xen-pciback/pci_stub.c
> @@ -357,6 +357,7 @@ static int pcistub_match(struct pci_dev *dev)
> static int pcistub_init_device(struct pci_dev *dev)
> {
> struct xen_pcibk_dev_data *dev_data;
> + struct irq_desc *desc = NULL;
> int err = 0;
>
> dev_dbg(&dev->dev, "initializing...\n");
> @@ -399,6 +400,12 @@ static int pcistub_init_device(struct pci_dev *dev)
> if (err)
> goto config_release;
>
> + if (xen_initial_domain() && xen_pvh_domain()) {
> + if (dev->irq <= 0 || !(desc = irq_to_desc(dev->irq)))
Driver code has absolutely no business to access irq_desc.
> + goto config_release;
> + unmask_irq(desc);
Or to invoke any internal function.
> --- a/kernel/irq/chip.c
> +++ b/kernel/irq/chip.c
> @@ -439,6 +439,7 @@ void unmask_irq(struct irq_desc *desc)
> irq_state_clr_masked(desc);
> }
> }
> +EXPORT_SYMBOL_GPL(unmask_irq);
Not going to happen.
> --- a/kernel/irq/irqdesc.c
> +++ b/kernel/irq/irqdesc.c
> @@ -380,7 +380,7 @@ struct irq_desc *irq_to_desc(unsigned int irq)
> {
> return mtree_load(&sparse_irqs, irq);
> }
> -#ifdef CONFIG_KVM_BOOK3S_64_HV_MODULE
> +#if defined CONFIG_KVM_BOOK3S_64_HV_MODULE || defined CONFIG_XEN_PVH
Neither that.
This all smells badly like a XEN internal issue and we are not going to
hack around it by exposing interrupt internals.
Thanks,
tglx
Powered by blists - more mailing lists