KVM: x86: clean/fix memory barriers in irqchip_in_kernel
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 29 Jul 2015 10:31:15 +0000 (12:31 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 30 Jul 2015 14:02:56 +0000 (16:02 +0200)
commit71ba994c94a81c37185ef2fb5190844286ba9aca
tree3eff9ec87d264f8e04fcbeffe3e8f5805f0688c3
parentdd489240a21afc3ff3962aba5d987229536cae63
KVM: x86: clean/fix memory barriers in irqchip_in_kernel

The memory barriers are trying to protect against concurrent RCU-based
interrupt injection, but the IRQ routing table is not valid at the time
kvm->arch.vpic is written.  Fix this by writing kvm->arch.vpic last.
kvm_destroy_pic then need not set kvm->arch.vpic to NULL; modify it
to take a struct kvm_pic* and reuse it if the IOAPIC creation fails.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/i8259.c
arch/x86/kvm/irq.h
arch/x86/kvm/x86.c