Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <markus.rechberger@amd.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>

authored by

Joerg Roedel and committed by
Avi Kivity
de979caa d27d4aca

+3
+3
drivers/kvm/vmx.c
··· 791 791 */ 792 792 static void vmx_set_cr0_no_modeswitch(struct kvm_vcpu *vcpu, unsigned long cr0) 793 793 { 794 + if (!vcpu->rmode.active && !(cr0 & CR0_PE_MASK)) 795 + enter_rmode(vcpu); 796 + 794 797 vcpu->rmode.active = ((cr0 & CR0_PE_MASK) == 0); 795 798 update_exception_bitmap(vcpu); 796 799 vmcs_writel(CR0_READ_SHADOW, cr0);