aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm_main.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2006-12-29 19:49:37 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-30 13:56:44 -0500
commita9058ecd3cd72634cf548588ce79b3f225c9ca32 (patch)
tree11d1edd2dfdcec03ba6b54b3b06d41cae826b940 /drivers/kvm/kvm_main.c
parent1e885461f02259d75e7480a70d291d2d8aaa938e (diff)
[PATCH] KVM: Simplify is_long_mode()
Instead of doing tricky stuff with the arch dependent virtualization registers, take a peek at the guest's efer. This simlifies some code, and fixes some confusion in the mmu branch. Signed-off-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/kvm/kvm_main.c')
-rw-r--r--drivers/kvm/kvm_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 9f24f22e4cb2..38375e2bb703 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -398,7 +398,7 @@ void set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
398 return; 398 return;
399 } 399 }
400 400
401 if (kvm_arch_ops->is_long_mode(vcpu)) { 401 if (is_long_mode(vcpu)) {
402 if (!(cr4 & CR4_PAE_MASK)) { 402 if (!(cr4 & CR4_PAE_MASK)) {
403 printk(KERN_DEBUG "set_cr4: #GP, clearing PAE while " 403 printk(KERN_DEBUG "set_cr4: #GP, clearing PAE while "
404 "in long mode\n"); 404 "in long mode\n");
@@ -425,7 +425,7 @@ EXPORT_SYMBOL_GPL(set_cr4);
425 425
426void set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3) 426void set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)
427{ 427{
428 if (kvm_arch_ops->is_long_mode(vcpu)) { 428 if (is_long_mode(vcpu)) {
429 if ( cr3 & CR3_L_MODE_RESEVED_BITS) { 429 if ( cr3 & CR3_L_MODE_RESEVED_BITS) {
430 printk(KERN_DEBUG "set_cr3: #GP, reserved bits\n"); 430 printk(KERN_DEBUG "set_cr3: #GP, reserved bits\n");
431 inject_gp(vcpu); 431 inject_gp(vcpu);