linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: hv: fix "spurious APIC interrupt" due to new vector reservation mode
@ 2017-10-14  3:01 Dexuan Cui
  2017-10-16 22:06 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Dexuan Cui @ 2017-10-14  3:01 UTC (permalink / raw)
  To: Bjorn Helgaas, Thomas Gleixner, KY Srinivasan, Stephen Hemminger,
	linux-pci
  Cc: devel, linux-kernel, Josh Poulson, Haiyang Zhang, Simon Xiao,
	Saeed Mahameed, Mihai Costache (Cloudbase Solutions SRL),
	Jork Loeser


Last month the vector management code was reworked, and as a result of the
changes, e.g. commit 22d0b12f3560 ("genirq/irqdomain: Add force
reactivation flag to irq domains"), commit 4900be83602b ("x86/vector/msi:
Switch to global reservation mode") etc, now we must add this new flag
MSI_FLAG_MUST_REACTIVATE when calling pci_msi_create_irq_domain() on x86,
otherwise Hyper-V PCIe pass-through can't work, and we get:
"spurious APIC interrupt through vector ff on CPU#0, should never happen",
this is because no valid MSI/MSI-X vector is allocated.

Signed-off-by: Dexuan Cui <decui@microsoft.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
---

Currently the "reservation mode" patchset has not been in Linus's tree yet, so
today's mainline hasn't shown the issue, but today's linux-next has shown the
issue (PCIe pass-through on Hyper-V can't work).

I think any caller of pci_msi_create_irq_domain() that runs on x86 needs to
be updated, but besides pci-hyper I'm not sure which callers run on x86.

 drivers/pci/host/pci-hyperv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
index 0fe3ea1..35a7683 100644
--- a/drivers/pci/host/pci-hyperv.c
+++ b/drivers/pci/host/pci-hyperv.c
@@ -1196,7 +1196,8 @@ static int hv_pcie_init_irq_domain(struct hv_pcibus_device *hbus)
 	hbus->msi_info.ops = &hv_msi_ops;
 	hbus->msi_info.flags = (MSI_FLAG_USE_DEF_DOM_OPS |
 		MSI_FLAG_USE_DEF_CHIP_OPS | MSI_FLAG_MULTI_PCI_MSI |
-		MSI_FLAG_PCI_MSIX);
+		MSI_FLAG_PCI_MSIX |
+		MSI_FLAG_MUST_REACTIVATE);
 	hbus->msi_info.handler = handle_edge_irq;
 	hbus->msi_info.handler_name = "edge";
 	hbus->msi_info.data = hbus;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] PCI: hv: fix "spurious APIC interrupt" due to new vector reservation mode
  2017-10-14  3:01 [PATCH] PCI: hv: fix "spurious APIC interrupt" due to new vector reservation mode Dexuan Cui
@ 2017-10-16 22:06 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2017-10-16 22:06 UTC (permalink / raw)
  To: Dexuan Cui
  Cc: Bjorn Helgaas, KY Srinivasan, Stephen Hemminger, linux-pci,
	devel, linux-kernel, Josh Poulson, Haiyang Zhang, Simon Xiao,
	Saeed Mahameed, Mihai Costache (Cloudbase Solutions SRL),
	Jork Loeser

On Sat, 14 Oct 2017, Dexuan Cui wrote:
> Last month the vector management code was reworked, and as a result of the
> changes, e.g. commit 22d0b12f3560 ("genirq/irqdomain: Add force
> reactivation flag to irq domains"), commit 4900be83602b ("x86/vector/msi:
> Switch to global reservation mode") etc, now we must add this new flag
> MSI_FLAG_MUST_REACTIVATE when calling pci_msi_create_irq_domain() on x86,
> otherwise Hyper-V PCIe pass-through can't work, and we get:
> "spurious APIC interrupt through vector ff on CPU#0, should never happen",
> this is because no valid MSI/MSI-X vector is allocated.
> 
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: K. Y. Srinivasan <kys@microsoft.com>
> Cc: Haiyang Zhang <haiyangz@microsoft.com>
> Cc: Stephen Hemminger <sthemmin@microsoft.com>
> ---
> 
> Currently the "reservation mode" patchset has not been in Linus's tree yet, so
> today's mainline hasn't shown the issue, but today's linux-next has shown the
> issue (PCIe pass-through on Hyper-V can't work).
> 
> I think any caller of pci_msi_create_irq_domain() that runs on x86 needs to
> be updated, but besides pci-hyper I'm not sure which callers run on x86.

I'm sure I thought about adding something to pci_msi_create_irq_domain() in
the first place, but then forgot about it again. I'll have a look tomorrow
morning.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-16 22:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-14  3:01 [PATCH] PCI: hv: fix "spurious APIC interrupt" due to new vector reservation mode Dexuan Cui
2017-10-16 22:06 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).