Skip to content

Commit

Permalink
KVM: VMX: Reset mmu context when entering real mode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eddie Dong authored and Avi Kivity committed Oct 22, 2007
1 parent 1b6269d commit 8668a3c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions drivers/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 8668a3c

Please sign in to comment.