Commit f55750e4 authored by Cédric Le Goater's avatar Cédric Le Goater Committed by David Gibson
Browse files

spapr/xive: Mask the EAS when allocating an IRQ



If an IRQ is allocated and not configured, such as a MSI requested by
a PCI driver, it can be saved in its default state and possibly later
on restored using the same state. If not initially MASKED, KVM will
try to find a matching priority/target tuple for the interrupt and
fail to restore the VM because 0/0 is not a valid target.

When allocating a IRQ number, the EAS should be set to a sane default :
VALID and MASKED.

Reported-by: default avatarSatheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
Message-Id: <20190813164420.9829-1-clg@kaod.org>
Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
parent fd38b162
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -536,7 +536,10 @@ bool spapr_xive_irq_claim(SpaprXive *xive, uint32_t lisn, bool lsi)
        return false;
    }

    xive->eat[lisn].w |= cpu_to_be64(EAS_VALID);
    /*
     * Set default values when allocating an IRQ number
     */
    xive->eat[lisn].w |= cpu_to_be64(EAS_VALID | EAS_MASKED);
    if (lsi) {
        xive_source_irq_set_lsi(xsrc, lisn);
    }