diff options
author | Jan Kiszka <jan.kiszka@web.de> | 2009-07-01 14:52:03 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-09-10 01:33:09 -0400 |
commit | dc7e795e3dd2a763e5ceaa1615f307e808cf3932 (patch) | |
tree | 63902e12c372d61e9b15121accce70334c12fd46 /arch/x86/kvm/x86.c | |
parent | 6098ca939ee5ceb81d6628b9130112516bae7400 (diff) |
Revert "KVM: x86: check for cr3 validity in ioctl_set_sregs"
This reverts commit 6c20e1442bb1c62914bb85b7f4a38973d2a423ba.
To my understanding, it became obsolete with the advent of the more
robust check in mmu_alloc_roots (89da4ff17f). Moreover, it prevents
the conceptually safe pattern
1. set sregs
2. register mem-slots
3. run vcpu
by setting a sticky triple fault during step 1.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 6dde99ca743e..0e74d98641a0 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -4326,13 +4326,7 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, | |||
4326 | 4326 | ||
4327 | vcpu->arch.cr2 = sregs->cr2; | 4327 | vcpu->arch.cr2 = sregs->cr2; |
4328 | mmu_reset_needed |= vcpu->arch.cr3 != sregs->cr3; | 4328 | mmu_reset_needed |= vcpu->arch.cr3 != sregs->cr3; |
4329 | 4329 | vcpu->arch.cr3 = sregs->cr3; | |
4330 | down_read(&vcpu->kvm->slots_lock); | ||
4331 | if (gfn_to_memslot(vcpu->kvm, sregs->cr3 >> PAGE_SHIFT)) | ||
4332 | vcpu->arch.cr3 = sregs->cr3; | ||
4333 | else | ||
4334 | set_bit(KVM_REQ_TRIPLE_FAULT, &vcpu->requests); | ||
4335 | up_read(&vcpu->kvm->slots_lock); | ||
4336 | 4330 | ||
4337 | kvm_set_cr8(vcpu, sregs->cr8); | 4331 | kvm_set_cr8(vcpu, sregs->cr8); |
4338 | 4332 | ||