Commit 0fe8f9b2 authored by Eddie Dong's avatar Eddie Dong Committed by Greg Kroah-Hartman

KVM: VMX: Reset mmu context when entering real mode

patch 8668a3c4 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: default avatarYaozu (Eddie) Dong <eddie.dong@intel.com>
Signed-off-by: default avatarQing He <qing.he@intel.com>
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9ec0e2f6
...@@ -1066,6 +1066,7 @@ int kvm_mmu_reset_context(struct kvm_vcpu *vcpu) ...@@ -1066,6 +1066,7 @@ int kvm_mmu_reset_context(struct kvm_vcpu *vcpu)
destroy_kvm_mmu(vcpu); destroy_kvm_mmu(vcpu);
return init_kvm_mmu(vcpu); return init_kvm_mmu(vcpu);
} }
EXPORT_SYMBOL_GPL(kvm_mmu_reset_context);
int kvm_mmu_load(struct kvm_vcpu *vcpu) int kvm_mmu_load(struct kvm_vcpu *vcpu)
{ {
......
...@@ -957,6 +957,7 @@ static void enter_rmode(struct kvm_vcpu *vcpu) ...@@ -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_GS, &vcpu->rmode.gs);
fix_rmode_seg(VCPU_SREG_FS, &vcpu->rmode.fs); fix_rmode_seg(VCPU_SREG_FS, &vcpu->rmode.fs);
kvm_mmu_reset_context(vcpu);
init_rmode_tss(vcpu->kvm); init_rmode_tss(vcpu->kvm);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment