Warnings emitted when booting a KVM guest with kernel option `xive=off`

Problem

If a PCI device is attached (passed-through) to a pSeries KVM guest booted with “xive=off” then below repeated kernel warnings are emitted:

[  509.220349] kvmppc_set_passthru_irq_hv: Could not assign IRQ map for (58,4970)
[  509.220368] kvmppc_set_passthru_irq (irq 58, gsi 4970) fails: -2
[  509.220376] vfio-pci 0015:01:00.0: irq bypass producer (token 0000000090bc635b) registration fails: -2
...
[  509.291781] vfio-pci 0015:01:00.0: irq bypass producer (token 000000003822eed8) registration fails: -2

Cause

When a pSeries KVM guest (L2) is booted within an LPAR (L1) with the kernel boot parameter xive=off, it defaults to using emulated XICS controller. An attempt to establish host IRQ to guest GSI mappings via kvmppc_set_passthru_irq() on a PCI device hotplug (passhthrough) operation fail, returning -ENOENT. This failure occurs because only interrupts with EOI operations handled through OPAL calls (verified via is_pnv_opal_msi()) are currently supported.

Workarounds

The warnings are only observed if the guest is booted with xive=off i.e., with XICS controller.

There’s no warkaround available for this issue but a potential fix is under internal review and would post it upstream after the same.