]> err.no Git - linux-2.6/commitdiff
KVM: VMX: Reset mmu context when entering real mode
authorEddie Dong <eddie.dong@intel.com>
Wed, 10 Oct 2007 06:26:45 +0000 (14:26 +0800)
committerAvi Kivity <avi@qumranet.com>
Mon, 22 Oct 2007 10:03:28 +0000 (12:03 +0200)
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>
drivers/kvm/mmu.c
drivers/kvm/vmx.c

index 71716182d59dd542d2590fb9c7f10891be2d3f55..feb5ac986c5d0eb23480512193a706f247ccd4b3 100644 (file)
@@ -1049,6 +1049,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 bcc1e398a9766e3e9d318a34a92b6fc1d1bdacd4..f130c01422cf746cad8d2b372f6221775eef58b9 100644 (file)
@@ -1128,6 +1128,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);
 }