• Cédric Le Goater's avatar
    KVM: PPC: Book3S HV: XIVE: Fix page offset when clearing ESB pages · bcaa3110
    Cédric Le Goater authored
    Under XIVE, the ESB pages of an interrupt are used for interrupt
    management (EOI) and triggering. They are made available to guests
    through a mapping of the XIVE KVM device.
    
    When a device is passed-through, the passthru_irq helpers,
    kvmppc_xive_set_mapped() and kvmppc_xive_clr_mapped(), clear the ESB
    pages of the guest IRQ number being mapped and let the VM fault
    handler repopulate with the correct page.
    
    The ESB pages are mapped at offset 4 (KVM_XIVE_ESB_PAGE_OFFSET) in the
    KVM device mapping. Unfortunately, this offset was not taken into
    account when clearing the pages. This lead to issues with the
    passthrough devices for which the interrupts were not functional under
    some guest configuration (tg3 and single CPU) or in any configuration
    (e1000e adapter).
    Reviewed-by: default avatarGreg Kurz <groug@kaod.org>
    Tested-by: default avatarGreg Kurz <groug@kaod.org>
    Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    bcaa3110
book3s_xive_native.c 30 KB