2020-02-10 09:06:03

by Zha Bin

[permalink] [raw]
Subject: [PATCH v2 5/5] x86: virtio-mmio: support virtio-mmio with MSI for x86

From: Liu Jiang <[email protected]>

virtio-mmio supports a generic MSI irq domain for all archs. This
patch adds the x86 architecture support.

Signed-off-by: Liu Jiang <[email protected]>
Co-developed-by: Zha Bin <[email protected]>
Signed-off-by: Zha Bin <[email protected]>
Co-developed-by: Jing Liu <[email protected]>
Signed-off-by: Jing Liu <[email protected]>
Co-developed-by: Chao Peng <[email protected]>
Signed-off-by: Chao Peng <[email protected]>
---
arch/x86/kernel/apic/msi.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c
index 159bd0c..2fcd602 100644
--- a/arch/x86/kernel/apic/msi.c
+++ b/arch/x86/kernel/apic/msi.c
@@ -45,7 +45,11 @@ static void __irq_msi_compose_msg(struct irq_cfg *cfg, struct msi_msg *msg)
MSI_DATA_VECTOR(cfg->vector);
}

-static void irq_msi_compose_msg(struct irq_data *data, struct msi_msg *msg)
+/*
+ * x86 PCI-MSI/HPET/DMAR related method.
+ * Also can be used as arch specific method for virtio-mmio MSI.
+ */
+void irq_msi_compose_msg(struct irq_data *data, struct msi_msg *msg)
{
__irq_msi_compose_msg(irqd_cfg(data), msg);
}
@@ -166,6 +170,11 @@ static void irq_msi_update_msg(struct irq_data *irqd, struct irq_cfg *cfg)
return ret;
}

+struct irq_domain *arch_msi_root_irq_domain(void)
+{
+ return x86_vector_domain;
+}
+
/*
* IRQ Chip for MSI PCI/PCI-X/PCI-Express Devices,
* which implement the MSI or MSI-X Capability Structure.
--
1.8.3.1


2020-02-11 11:50:29

by Michael S. Tsirkin

[permalink] [raw]
Subject: Re: [PATCH v2 5/5] x86: virtio-mmio: support virtio-mmio with MSI for x86

On Mon, Feb 10, 2020 at 05:05:21PM +0800, Zha Bin wrote:
> From: Liu Jiang <[email protected]>
>
> virtio-mmio supports a generic MSI irq domain for all archs. This
> patch adds the x86 architecture support.
>
> Signed-off-by: Liu Jiang <[email protected]>
> Co-developed-by: Zha Bin <[email protected]>
> Signed-off-by: Zha Bin <[email protected]>
> Co-developed-by: Jing Liu <[email protected]>
> Signed-off-by: Jing Liu <[email protected]>
> Co-developed-by: Chao Peng <[email protected]>
> Signed-off-by: Chao Peng <[email protected]>
> ---
> arch/x86/kernel/apic/msi.c | 11 ++++++++++-

Patches like this need to CC x86 maintainers.


> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c
> index 159bd0c..2fcd602 100644
> --- a/arch/x86/kernel/apic/msi.c
> +++ b/arch/x86/kernel/apic/msi.c
> @@ -45,7 +45,11 @@ static void __irq_msi_compose_msg(struct irq_cfg *cfg, struct msi_msg *msg)
> MSI_DATA_VECTOR(cfg->vector);
> }
>
> -static void irq_msi_compose_msg(struct irq_data *data, struct msi_msg *msg)
> +/*
> + * x86 PCI-MSI/HPET/DMAR related method.
> + * Also can be used as arch specific method for virtio-mmio MSI.
> + */
> +void irq_msi_compose_msg(struct irq_data *data, struct msi_msg *msg)
> {
> __irq_msi_compose_msg(irqd_cfg(data), msg);
> }
> @@ -166,6 +170,11 @@ static void irq_msi_update_msg(struct irq_data *irqd, struct irq_cfg *cfg)
> return ret;
> }
>
> +struct irq_domain *arch_msi_root_irq_domain(void)
> +{
> + return x86_vector_domain;
> +}
> +
> /*
> * IRQ Chip for MSI PCI/PCI-X/PCI-Express Devices,
> * which implement the MSI or MSI-X Capability Structure.


So there's a new non-static functions with no callers here,
and a previously static irq_msi_compose_msg is not longer
static. No callers so how does this help anyone?
And how does this achieve the goal of enabling virtio mmio?


> --
> 1.8.3.1