Re: [PATCH 4/4] KVM: x86: clean/fix memory barriers in irqchip_in_kernel

2015-07-30 Thread Paolo Bonzini
On 30/07/2015 05:32, Steve Rutherford wrote: >> > + /* Write kvm->irq_routing before kvm->arch.vpic. */ >> > + smp_wmb(); > I assume this pairs with irqchip_in_kernel? Yes, see the comment added there by this same patch ("read kvm->arch.vpic before kvm->irq_routing"). Paolo

Re: [PATCH 4/4] KVM: x86: clean/fix memory barriers in irqchip_in_kernel

2015-07-29 Thread Steve Rutherford
On Wed, Jul 29, 2015 at 03:28:58PM +0200, Paolo Bonzini wrote: > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 2d62229aac26..23e47a0b054b 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -3626,30 +3626,25 @@ long kvm_arch_vm_ioctl(struct file *filp, >

[PATCH 4/4] KVM: x86: clean/fix memory barriers in irqchip_in_kernel

2015-07-29 Thread Paolo Bonzini
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 kv