Skip to content

Commit

Permalink
Revert "KVM: x86: check for cr3 validity in ioctl_set_sregs"
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
  • Loading branch information
jan-kiszka authored and avikivity committed Sep 10, 2009
1 parent 6098ca9 commit dc7e795
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -4326,13 +4326,7 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,

vcpu->arch.cr2 = sregs->cr2;
mmu_reset_needed |= vcpu->arch.cr3 != sregs->cr3;

down_read(&vcpu->kvm->slots_lock);
if (gfn_to_memslot(vcpu->kvm, sregs->cr3 >> PAGE_SHIFT))
vcpu->arch.cr3 = sregs->cr3;
else
set_bit(KVM_REQ_TRIPLE_FAULT, &vcpu->requests);
up_read(&vcpu->kvm->slots_lock);
vcpu->arch.cr3 = sregs->cr3;

kvm_set_cr8(vcpu, sregs->cr8);

Expand Down

0 comments on commit dc7e795

Please sign in to comment.