mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
kvm: x86: Use fast CR3 switch for nested VMX
Use the fast CR3 switch mechanism to locklessly change the MMU root page when switching between L1 and L2. The switch from L2 to L1 should always go through the fast path, while the switch from L1 to L2 should go through the fast path if L1's CR3/EPTP for L2 hasn't changed since the last time. Signed-off-by: Junaid Shahid <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
This commit is contained in:
parent
1c53da3fa3
commit
50c28f21d0
4 changed files with 25 additions and 13 deletions
|
|
@ -2127,16 +2127,22 @@ static void shrink_halt_poll_ns(struct kvm_vcpu *vcpu)
|
|||
|
||||
static int kvm_vcpu_check_block(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
int ret = -EINTR;
|
||||
int idx = srcu_read_lock(&vcpu->kvm->srcu);
|
||||
|
||||
if (kvm_arch_vcpu_runnable(vcpu)) {
|
||||
kvm_make_request(KVM_REQ_UNHALT, vcpu);
|
||||
return -EINTR;
|
||||
goto out;
|
||||
}
|
||||
if (kvm_cpu_has_pending_timer(vcpu))
|
||||
return -EINTR;
|
||||
goto out;
|
||||
if (signal_pending(current))
|
||||
return -EINTR;
|
||||
goto out;
|
||||
|
||||
return 0;
|
||||
ret = 0;
|
||||
out:
|
||||
srcu_read_unlock(&vcpu->kvm->srcu, idx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue