[PATCH 3/7] vfio/pci: Add qcom-vfio-pci variant driver
Jason Gunthorpe
jgg at ziepe.ca
Wed Sep 30 08:12:29 PDT 2026
On Wed, Sep 30, 2026 at 04:08:29PM +0200, Jose Ignacio Tornos Martinez wrote:
> Add VFIO variant driver for Qualcomm PCIe devices that require
> MSI address passthrough for VM operation.
>
> Qualcomm ath11k and ath12k WiFi devices have embedded interrupt
> controllers that require physical host MSI addresses programmed to
> device registers. In VMs, the driver only sees virtualized guest
> addresses, causing firmware initialization to fail.
>
> This variant driver:
> 1. Caches physical host MSI values after allocation
> 2. Writes them to extended config space with magic signature "QMSI"
> 3. VM drivers discover and use these values automatically
You should probably explain a little be more here
1) Linux VM driver fills up the normal MSI-X table
2) HW has some non-MSI-X table registers
3) Linux VM driver pokes into the interrupt layer and extracts
one of the MSX-X table entries addr/data pair
4) Linux VM driver now programs that copied addr/data pair into #2
This is, of course, all wrong. These days it should be using one of
our mechanisms to allow devices to have their own private MSI
registers.
I forget if this is the right way for PCI, but the driver can call
platform_device_msi_init_and_alloc_irqs()
And directly program the MSI registers with their own special
interrupts vectors, no copying from MSI-X.
If the driver is fixed to work like this, as it should be, then it
fully breaks the scheme you propose here. That's not good.
The problem here is not really a qcom problem, and treating it as a
qcom quirk is why it keeps being stuck, IMHO.
The real issue is that this device MSI scheme does not work in VMs at
all. It does not work because the VM IRQ design requires the VM to
trap and modify all the MSI addr/data pairs at the register write.
The technically clean solution is to redo the VMMs so they don't
require that, ie use interrupt remapping so the VM's view of the
addr/data pair matches physical. That's super hard and will probably
never happen.
But! Now that we have these device MSI domains I wonder if there is
some half option to provide a hypercall so the device MSI domains can
call out to the hypervisor to get the true physical addr/data pair to
program?
This is fundamentally an irq layer issue in Linux, not a qcom one.
Jason
More information about the ath12k
mailing list