diff options
author | Marc Zyngier <[email protected]> | 2020-02-07 16:34:10 +0000 |
---|---|---|
committer | Paolo Bonzini <[email protected]> | 2020-02-12 12:19:35 +0100 |
commit | 1f03b2bcd0d7cad4af107339cdef80ed377fe2a8 (patch) | |
tree | c2b7086cba02b146916fb93fde7d4ae9d2195469 /net/lapb/lapb_iface.c | |
parent | bab0c318ba3da32483da8aad37b9ef98fd8edafb (diff) |
KVM: Disable preemption in kvm_get_running_vcpu()
Accessing a per-cpu variable only makes sense when preemption is
disabled (and the kernel does check this when the right debug options
are switched on).
For kvm_get_running_vcpu(), it is fine to return the value after
re-enabling preemption, as the preempt notifiers will make sure that
this is kept consistent across task migration (the comment above the
function hints at it, but lacks the crucial preemption management).
While we're at it, move the comment from the ARM code, which explains
why the whole thing works.
Fixes: 7495e22bb165 ("KVM: Move running VCPU from ARM to common code").
Cc: Paolo Bonzini <[email protected]>
Reported-by: Zenghui Yu <[email protected]>
Tested-by: Zenghui Yu <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Message-id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Diffstat (limited to 'net/lapb/lapb_iface.c')
0 files changed, 0 insertions, 0 deletions