]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: VMX: Read Posted Interrupt "control" exactly once per loop iteration
authorSean Christopherson <seanjc@google.com>
Sat, 9 Oct 2021 02:12:19 +0000 (19:12 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Dec 2021 09:24:56 +0000 (04:24 -0500)
commit28a583fd346c8c1d8dfe1f3ddbdfabd39b3cdd89
treedfa6705d3a1ecddcf6072651370dbbfd127f5ba4
parentab248291e2b1700c1a203dd4a3cd2a0d729d7c1d
KVM: VMX: Read Posted Interrupt "control" exactly once per loop iteration

Use READ_ONCE() when loading the posted interrupt descriptor control
field to ensure "old" and "new" have the same base value.  If the
compiler emits separate loads, and loads into "new" before "old", KVM
could theoretically drop the ON bit if it were set between the loads.

Fixes: b5c9afac3864 ("KVM: Update Posted-Interrupts Descriptor when vCPU is preempted")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211009021236.4122790-27-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/posted_intr.c