]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
KVM: vmx: hack set_cr0_no_modeswitch() to actually do modeswitch
authorJoerg Roedel <joerg.roedel@amd.com>
Mon, 19 Feb 2007 12:37:46 +0000 (14:37 +0200)
committerAvi Kivity <avi@qumranet.com>
Sun, 4 Mar 2007 09:12:39 +0000 (11:12 +0200)
The whole thing is rotten, but this allows vmx to boot with the guest reboot
fix.

Signed-off-by: Markus Rechberger <markus.rechberger@amd.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/vmx.c

index ff3bfc5c390adf15056ec36cfa92061c6ff207b4..e02c59807a7e5ec7e881d78018e197e35d6e0197 100644 (file)
@@ -791,6 +791,9 @@ static void vmx_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0)
  */
 static void vmx_set_cr0_no_modeswitch(struct kvm_vcpu *vcpu, unsigned long cr0)
 {
+       if (!vcpu->rmode.active && !(cr0 & CR0_PE_MASK))
+               enter_rmode(vcpu);
+
        vcpu->rmode.active = ((cr0 & CR0_PE_MASK) == 0);
        update_exception_bitmap(vcpu);
        vmcs_writel(CR0_READ_SHADOW, cr0);