From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755593AbXLMHGz (ORCPT ); Thu, 13 Dec 2007 02:06:55 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1762185AbXLMG4u (ORCPT ); Thu, 13 Dec 2007 01:56:50 -0500 Received: from pentafluge.infradead.org ([213.146.154.40]:55299 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757486AbXLMG4t (ORCPT ); Thu, 13 Dec 2007 01:56:49 -0500 Date: Wed, 12 Dec 2007 22:52:14 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, kvm-devel@lists.sourceforge.net, Avi Kivity , Eddie Dong , Qing He Subject: [patch 26/60] KVM: VMX: Reset mmu context when entering real mode Message-ID: <20071213065214.GA6867@kroah.com> References: <20071213064518.328162328@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="kvm-vmx-reset-mmu-context-when-entering-real-mode.patch" In-Reply-To: <20071213065039.GA6867@kroah.com> User-Agent: Mutt/1.5.16 (2007-06-09) X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject. Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2.6.23-stable review patch. If anyone has any objections, please let us know. ------------------ From: Eddie Dong 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 Signed-off-by: Qing He Signed-off-by: Avi Kivity Signed-off-by: Greg Kroah-Hartman --- drivers/kvm/mmu.c | 1 + drivers/kvm/vmx.c | 1 + 2 files changed, 2 insertions(+) --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c @@ -1066,6 +1066,7 @@ int kvm_mmu_reset_context(struct kvm_vcp destroy_kvm_mmu(vcpu); return init_kvm_mmu(vcpu); } +EXPORT_SYMBOL_GPL(kvm_mmu_reset_context); int kvm_mmu_load(struct kvm_vcpu *vcpu) { --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -957,6 +957,7 @@ static void enter_rmode(struct kvm_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); } -- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Subject: [patch 26/60] KVM: VMX: Reset mmu context when entering real mode Date: Wed, 12 Dec 2007 22:52:14 -0800 Message-ID: <20071213065214.GA6867@kroah.com> References: <20071213064518.328162328@mini.kroah.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Theodore Ts'o , Zwane Mwaikambo , Qing He , kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, Justin Forbes , Domenico Andreoli , Chris Wedgwood , Randy Dunlap , Michael Krufky , Avi Kivity , Chuck Ebbert , Dave Jones , Chuck Wolber , akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, alan-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org To: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org Return-path: Content-Disposition: inline; filename="kvm-vmx-reset-mmu-context-when-entering-real-mode.patch" In-Reply-To: <20071213065039.GA6867-U8xfFu+wG4EAvxtiuMwx3w@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 2.6.23-stable review patch. If anyone has any objections, please let us know. ------------------ From: Eddie Dong 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 Signed-off-by: Qing He Signed-off-by: Avi Kivity Signed-off-by: Greg Kroah-Hartman --- drivers/kvm/mmu.c | 1 + drivers/kvm/vmx.c | 1 + 2 files changed, 2 insertions(+) --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c @@ -1066,6 +1066,7 @@ int kvm_mmu_reset_context(struct kvm_vcp destroy_kvm_mmu(vcpu); return init_kvm_mmu(vcpu); } +EXPORT_SYMBOL_GPL(kvm_mmu_reset_context); int kvm_mmu_load(struct kvm_vcpu *vcpu) { --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -957,6 +957,7 @@ static void enter_rmode(struct kvm_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); } -- ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace