]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
KVM: VMX: Reset mmu context when entering real mode
authorEddie Dong <eddie.dong@intel.com>
Sun, 2 Dec 2007 11:18:47 +0000 (13:18 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 14 Dec 2007 17:50:57 +0000 (09:50 -0800)
patch 8668a3c468ed55d19514117a5a959d91d3d03823 in mainline.

Resetting an SMP guest will force AP enter real mode (RESET) with
paging enabled in protected mode. While current enter_rmode() can
only handle mode switch from nonpaging mode to real mode which leads
to SMP reboot failure.

Fix by reloading the mmu context on entering real mode.

Signed-off-by: Yaozu (Eddie) Dong <eddie.dong@intel.com>
Signed-off-by: Qing He <qing.he@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/kvm/mmu.c
drivers/kvm/vmx.c

index 23965aa5ee7807315aebecf5b03d0970fbd1efbe..56ab369beafda4deee0143a997f81364c00389c6 100644 (file)
@@ -1066,6 +1066,7 @@ int kvm_mmu_reset_context(struct kvm_vcpu *vcpu)
        destroy_kvm_mmu(vcpu);
        return init_kvm_mmu(vcpu);
 }
+EXPORT_SYMBOL_GPL(kvm_mmu_reset_context);
 
 int kvm_mmu_load(struct kvm_vcpu *vcpu)
 {
index c158a2d33ae1ae20ba2615d842057a1bf213ac7c..916da2983c669e636016826d5b0ae73fd4847cc1 100644 (file)
@@ -957,6 +957,7 @@ static void enter_rmode(struct kvm_vcpu *vcpu)
        fix_rmode_seg(VCPU_SREG_GS, &vcpu->rmode.gs);
        fix_rmode_seg(VCPU_SREG_FS, &vcpu->rmode.fs);
 
+       kvm_mmu_reset_context(vcpu);
        init_rmode_tss(vcpu->kvm);
 }