From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: [PATCH 10/10] KVM: VMX: Reset mmu context when entering real mode Date: Sun, 2 Dec 2007 13:18:47 +0200 Message-ID: <11965943271835-git-send-email-avi@qumranet.com> References: <1196594327338-git-send-email-avi@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, Avi Kivity , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Qing He To: stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org Return-path: In-Reply-To: <1196594327338-git-send-email-avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org From: Eddie Dong 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 Signed-off-by: Qing He Signed-off-by: Avi Kivity --- drivers/kvm/mmu.c | 1 + drivers/kvm/vmx.c | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index 23965aa..56ab369 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 c158a2d..916da29 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); } -- 1.5.3 ------------------------------------------------------------------------- SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4