aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/x86.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index ffbb2c818d78..2bad49b535c8 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3993,7 +3993,13 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
3993 3993
3994 vcpu->arch.cr2 = sregs->cr2; 3994 vcpu->arch.cr2 = sregs->cr2;
3995 mmu_reset_needed |= vcpu->arch.cr3 != sregs->cr3; 3995 mmu_reset_needed |= vcpu->arch.cr3 != sregs->cr3;
3996 vcpu->arch.cr3 = sregs->cr3; 3996
3997 down_read(&vcpu->kvm->slots_lock);
3998 if (gfn_to_memslot(vcpu->kvm, sregs->cr3 >> PAGE_SHIFT))
3999 vcpu->arch.cr3 = sregs->cr3;
4000 else
4001 set_bit(KVM_REQ_TRIPLE_FAULT, &vcpu->requests);
4002 up_read(&vcpu->kvm->slots_lock);
3997 4003
3998 kvm_set_cr8(vcpu, sregs->cr8); 4004 kvm_set_cr8(vcpu, sregs->cr8);
3999 4005