Skip to contentSkip to conversation

xen/events: Use PIRQ instead of GSI value when unmapping MSI/MSI-X irqs.

PATCH In review Konrad Rzeszutek Wilk 2 participants 2 messages Nov 19, 2010 – Nov 23, 2010 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/events: Use PIRQ instead of GSI value when unmapping MSI/MSI-X irqs.

When we allocate a vector for MSI/MSI-X we save away the PIRQ, and the vector value. When we unmap (de-allocate) the MSI/MSI-X vector(s) we need to provide the PIRQ and the vector value. What we did instead was to provide the GSI (which was zero) and the vector value, and we got these unhappy error messages:

(XEN) irq.c:1575: dom0: pirq 0 not mapped

[    7.733415] unmap irq failed -22

This patches fixes this and we use the PIRQ value instead of the GSI value.

P.S.
Stefano, I've tested this on domain zero. The path on PVonHVM looks correct, but I would appreciate you taking a look at this.

---
 drivers/xen/events.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/xen/events.c +1 -1
index 321a0c8..7eb720b 100644
@@ -752,7 +752,7 @@ int xen_destroy_irq(int irq)
 		goto out;
 
 	if (xen_initial_domain()) {
-		unmap_irq.pirq = info->u.pirq.gsi;
+		unmap_irq.pirq = info->u.pirq.pirq;
 		unmap_irq.domid = DOMID_SELF;
 		rc = HYPERVISOR_physdev_op(PHYSDEVOP_unmap_pirq, &unmap_irq);
 		if (rc) {
Signature · 1 line
1.7.1
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Konrad Rzeszutek Wilk

When we allocate a vector for MSI/MSI-X we save away the PIRQ, and the vector value. When we unmap (de-allocate) the MSI/MSI-X vector(s) we need to provide the PIRQ and the vector value. What we did instead was to provide the GSI (which was zero) and the vector value, and we got these unhappy error messages:

(XEN) irq.c:1575: dom0: pirq 0 not mapped

[    7.733415] unmap irq failed -22

This patches fixes this and we use the PIRQ value instead of the GSI value.

Quoted 6 lines

P.S.
Stefano, I've tested this on domain zero. The path on PVonHVM looks correct, but I would appreciate you taking a look at this.