Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45293
b: refs/heads/master
c: d21225e
h: refs/heads/master
i:
  45291: 60269bd
v: v3
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Jan 6, 2007
1 parent bbd2032 commit 020be46
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 760db773fbd0ad2ece89393218c4a4213b5bae6a
refs/heads/master: d21225ee2b6fa9f7669526927f2e0bedebd90940
14 changes: 13 additions & 1 deletion trunk/drivers/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,19 @@ void set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)

vcpu->cr3 = cr3;
spin_lock(&vcpu->kvm->lock);
vcpu->mmu.new_cr3(vcpu);
/*
* Does the new cr3 value map to physical memory? (Note, we
* catch an invalid cr3 even in real-mode, because it would
* cause trouble later on when we turn on paging anyway.)
*
* A real CPU would silently accept an invalid cr3 and would
* attempt to use it - with largely undefined (and often hard
* to debug) behavior on the guest side.
*/
if (unlikely(!gfn_to_memslot(vcpu->kvm, cr3 >> PAGE_SHIFT)))
inject_gp(vcpu);
else
vcpu->mmu.new_cr3(vcpu);
spin_unlock(&vcpu->kvm->lock);
}
EXPORT_SYMBOL_GPL(set_cr3);
Expand Down

0 comments on commit 020be46

Please sign in to comment.