• Paolo Bonzini's avatar
    KVM: x86: drop PIO from unregistered devices · 35ab3b77
    Paolo Bonzini authored
    KVM protects the device list with SRCU, and therefore different calls
    to kvm_io_bus_read()/kvm_io_bus_write() can very well see different
    incarnations of kvm->buses.  If userspace unregisters a device while
    vCPUs are running there is no well-defined result.  This patch applies
    a safe fallback by returning early from emulator_pio_in_out().  This
    corresponds to returning zeroes from IN, and dropping the writes on
    the floor for OUT.
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    35ab3b77
x86.c 351 KB