KVM: MMU: Ignore reserved bits in cr3 in non-pae mode
authorRyan Harper <ryanh@us.ibm.com>
Tue, 18 Sep 2007 19:05:16 +0000 (14:05 -0500)
committerAvi Kivity <avi@qumranet.com>
Wed, 30 Jan 2008 15:52:48 +0000 (17:52 +0200)
This patch removes the fault injected when the guest attempts to set reserved
bits in cr3.  X86 hardware doesn't generate a fault when setting reserved bits.
The result of this patch is that vmware-server, running within a kvm guest,
boots and runs memtest from an iso.

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/kvm_main.c

index 82cc7ae0fc83ad9f0d562522bfea8a0f55534ca0..2d55bab41634b089dd3cdc517aa2a2af1d9319fa 100644 (file)
@@ -554,14 +554,11 @@ void set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)
                                inject_gp(vcpu);
                                return;
                        }
-               } else {
-                       if (cr3 & CR3_NONPAE_RESERVED_BITS) {
-                               printk(KERN_DEBUG
-                                      "set_cr3: #GP, reserved bits\n");
-                               inject_gp(vcpu);
-                               return;
-                       }
                }
+               /*
+                * We don't check reserved bits in nonpae mode, because
+                * this isn't enforced, and VMware depends on this.
+                */
        }
 
        mutex_lock(&vcpu->kvm->lock);