Skip to content
  • Andre Przywara's avatar
    MSI-X: update GSI routing after changed MSI-X configuration · 6518065a
    Andre Przywara authored
    
    
    When we set up GSI routing to map MSIs to KVM's GSI numbers, we
    write the current device's MSI setup into the kernel routing table.
    However the device driver in the guest can use PCI configuration space
    accesses to change the MSI configuration (address and/or payload data).
    Whenever this happens after we have setup the routing table already,
    we must amend the previously sent data.
    So when MSI-X PCI config space accesses write address or payload,
    find the associated GSI number and the matching routing table entry
    and update the kernel routing table (only if the data has changed).
    
    This fixes vhost-net, where the queue's IRQFD was setup before the
    MSI vectors.
    
    To avoid issues, we ignore writes to the PBA region. The spec says:
    "Software should never write, and should only read Pending Bits.
    If software writes to Pending Bits, the result is undefined."
    
    Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
    Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    6518065a