From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: VMX: Use proper slot index for kvm_set_shared_msr Date: Thu, 29 Oct 2009 19:13:08 +0200 Message-ID: <4AE9CD24.8080800@redhat.com> References: <4AE9C894.2070601@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:22526 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755915AbZJ2RNL (ORCPT ); Thu, 29 Oct 2009 13:13:11 -0400 In-Reply-To: <4AE9C894.2070601@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: On 10/29/2009 06:53 PM, Jan Kiszka wrote: > We were missing one indirection here to translate from vmx-local to > x86 slot indices, and this caused subtle host crashes. > > Ahh, good catch. How did it work? > Signed-off-by: Jan Kiszka > --- > > IOW: Win7 boots for me again. > > arch/x86/kvm/vmx.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index a1976c9..6b818c0 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -660,7 +660,8 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu) > } > #endif > for (i = 0; i< vmx->save_nmsrs; ++i) > - kvm_set_shared_msr(i, vmx->guest_msrs[i].data); > + kvm_set_shared_msr(vmx->guest_msrs[i].index, > + vmx->guest_msrs[i].data); > } > > static void __vmx_load_host_state(struct vcpu_vmx *vmx) > -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.