summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEddie Dong <eddie.dong@intel.com>2007-12-02 13:18:47 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2007-12-14 09:50:57 -0800
commit0fe8f9b280a5f7a65aebc51ab6b5200a8bf05e13 (patch)
tree194db8b8d5e9986ebfe9737793d41a9308e6ff63
parent9ec0e2f614c0b29e87ff0b451aa1201498309bd7 (diff)
KVM: VMX: Reset mmu context when entering real mode
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>
-rw-r--r--drivers/kvm/mmu.c1
-rw-r--r--drivers/kvm/vmx.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c
index 23965aa5ee78..56ab369beafd 100644
--- a/drivers/kvm/mmu.c
+++ b/drivers/kvm/mmu.c
@@ -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)
{
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index c158a2d33ae1..916da2983c66 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -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);
}