mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
KVM: Add "exiting guest mode" state
Currently we keep track of only two states: guest mode and host mode. This patch adds an "exiting guest mode" state that tells us that an IPI will happen soon, so unless we need to wait for the IPI, we can avoid it completely. Also 1: No need atomically to read/write ->mode in vcpu's thread 2: reorganize struct kvm_vcpu to make ->mode and ->requests in the same cache line explicitly Signed-off-by: Xiao Guangrong <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
This commit is contained in:
parent
d48ead8b0b
commit
6b7e2d0991
4 changed files with 35 additions and 12 deletions
|
|
@ -171,7 +171,12 @@ static bool make_all_cpus_request(struct kvm *kvm, unsigned int req)
|
|||
if (kvm_make_check_request(req, vcpu))
|
||||
continue;
|
||||
cpu = vcpu->cpu;
|
||||
if (cpus != NULL && cpu != -1 && cpu != me)
|
||||
|
||||
/* Set ->requests bit before we read ->mode */
|
||||
smp_mb();
|
||||
|
||||
if (cpus != NULL && cpu != -1 && cpu != me &&
|
||||
kvm_vcpu_exiting_guest_mode(vcpu) != OUTSIDE_GUEST_MODE)
|
||||
cpumask_set_cpu(cpu, cpus);
|
||||
}
|
||||
if (unlikely(cpus == NULL))
|
||||
|
|
|
|||
Loading…
Reference in a new issue