Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit aefdc2ed authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

KVM: Avoid atomic operations when kicking the running vCPU


If we do have the vcpu mutex, as is the case if kvm_running_vcpu is set
to the target vcpu of the kick, changes to vcpu->mode do not need atomic
operations; cmpxchg is only needed _outside_ the mutex to ensure that
the IN_GUEST_MODE->EXITING_GUEST_MODE change does not race with the vcpu
thread going OUTSIDE_GUEST_MODE.

Use this to optimize the case of a vCPU sending an interrupt to itself.

Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent fb43496c
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment