diff options
author | Radim Krčmář <rkrcmar@redhat.com> | 2015-07-01 16:31:49 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-07-03 19:55:17 +0300 |
commit | 42720138b06301cc8a7ee8a495a6d021c4b6a9bc (patch) | |
tree | fbffa8a4feceef419b8d1f56cd521148095a8ba5 /arch/x86/kvm/i8254.c | |
parent | 2ecd9d29abb171d6e97a4f3eb29d7456a11401b7 (diff) | |
download | linux-42720138b06301cc8a7ee8a495a6d021c4b6a9bc.tar.xz |
KVM: x86: make vapics_in_nmi_mode atomic
Writes were a bit racy, but hard to turn into a bug at the same time.
(Particularly because modern Linux doesn't use this feature anymore.)
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
[Actually the next patch makes it much, much easier to trigger the race
so I'm including this one for stable@ as well. - Paolo]
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/i8254.c')
-rw-r--r-- | arch/x86/kvm/i8254.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index 4dce6f8b6129..f90952f64e79 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c @@ -305,7 +305,7 @@ static void pit_do_work(struct kthread_work *work) * LVT0 to NMI delivery. Other PIC interrupts are just sent to * VCPU0, and only if its LVT0 is in EXTINT mode. */ - if (kvm->arch.vapics_in_nmi_mode > 0) + if (atomic_read(&kvm->arch.vapics_in_nmi_mode) > 0) kvm_for_each_vcpu(i, vcpu, kvm) kvm_apic_nmi_wd_deliver(vcpu); } |