From: Joerg Roedel Date: Mon, 19 Feb 2007 12:37:46 +0000 (+0200) Subject: KVM: vmx: hack set_cr0_no_modeswitch() to actually do modeswitch X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=de979caacca51c929d2cc2f0f79611ee4a1bc8a5;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git KVM: vmx: hack set_cr0_no_modeswitch() to actually do modeswitch The whole thing is rotten, but this allows vmx to boot with the guest reboot fix. Signed-off-by: Markus Rechberger Signed-off-by: Joerg Roedel Signed-off-by: Avi Kivity --- diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index ff3bfc5c390a..e02c59807a7e 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -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);