summaryrefslogtreecommitdiff
path: root/virt/kvm/kvm_main.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2021-10-09 05:11:55 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2021-12-08 12:24:45 +0300
commit91b01895071770ed0c256869d0f94d69a2fb8ecf (patch)
tree89250072fc71715415021a23fab3e8a2f0e918fa /virt/kvm/kvm_main.c
parent1831fa44df743a7cdffdf1c12c799bf6f3c12b8c (diff)
downloadlinux-91b01895071770ed0c256869d0f94d69a2fb8ecf.tar.xz
KVM: SVM: Ensure target pCPU is read once when signalling AVIC doorbell
Ensure vcpu->cpu is read once when signalling the AVIC doorbell. If the compiler rereads the field and the vCPU is migrated between the check and writing the doorbell, KVM would signal the wrong physical CPU. Functionally, signalling the wrong CPU in this case is not an issue as task migration means the vCPU has exited and will pick up any pending interrupts on the next VMRUN. Add the READ_ONCE() purely to clean up the code. Opportunistically add a comment explaining the task migration behavior, and rename cpuid=>cpu to avoid conflating the CPU number with KVM's more common usage of CPUID. Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20211009021236.4122790-3-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'virt/kvm/kvm_main.c')
0 files changed, 0 insertions, 0 deletions