From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: BUG with Win7 and user-return-notifier Date: Thu, 29 Oct 2009 09:06:55 +0100 Message-ID: <4AE94D1F.2060503@web.de> References: <4AE6ED18.9040901@siemens.com> <4AE6F17C.1070403@redhat.com> <4AE6F1EE.5090207@siemens.com> <4AE6F4A3.3050903@redhat.com> <4AE6F4C4.3000802@redhat.com> <4AE7FE3B.2070802@redhat.com> <4AE84EB4.1010603@siemens.com> <4AE86AA0.1060802@redhat.com> <4AE8AC20.50506@web.de> <4AE9462E.5050409@redhat.com> <4AE94C63.2070300@web.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig34013CE59F4071E87696AA50" Cc: kvm-devel To: Avi Kivity Return-path: Received: from fmmailgate02.web.de ([217.72.192.227]:40220 "EHLO fmmailgate02.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752502AbZJ2IG5 (ORCPT ); Thu, 29 Oct 2009 04:06:57 -0400 In-Reply-To: <4AE94C63.2070300@web.de> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig34013CE59F4071E87696AA50 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Jan Kiszka wrote: > Avi Kivity wrote: >> On 10/28/2009 10:40 PM, Jan Kiszka wrote: >>>> [you can get longer, more detailed traces by using >>>> /sys/kernel/debug/tracing/trace instead of dmesg] >>>> >>>> Oct 28 14:29:56 mchn012c kernel: qemu-sys-7200 0...1. 676996395us= : >>>> kvm_msr: msr_read c0000080 =3D 0x500 >>>> Oct 28 14:29:56 mchn012c kernel: qemu-sys-7200 0...1. 676996403us= : >>>> kvm_msr: msr_write c0000080 =3D 0xd01 >>>> >>>> So Windows is setting EFER.SCE and EFER.NX while in long mode - >>>> perfectly reasonable. Can you rerun with the attached debug patch? >>>> >>>> =20 >>> Log attached. >>> =20 >> So the last bits are: >> >> Oct 28 21:26:41 mchn012c kernel: update_transition_efer: efer_offset 4= >> efer d01 >> Oct 28 21:26:41 mchn012c kernel: update_transition_efer: ignoring all = bits >> Oct 28 21:26:41 mchn012c kernel: setup_msrs: marking efer for no reloa= d >> >> We're not reloading efer (correctly, as guest efer =3D=3D host efer), = yet >> vmx_save_host_state() fails while loading efer. I've looked at >> move_msr_up() (which is used by setup_msrs() to partition the msr spac= e >> into reloaded and non-reloaded msrs), and it seems correct. >> >> Can you see any way where update_transition_efer() returns false, yet >> efer turns up in the first save_nmsrs entries of vmx->guest_msrs? >> >=20 > Without understanding the code completely yet: When you push the slot > containing EFER around, do you also update msr_offset_efer? diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 4264e09..0b1f461 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -928,8 +928,10 @@ static void setup_msrs(struct vcpu_vmx *vmx) } #endif vmx->msr_offset_efer =3D index =3D __find_msr_index(vmx, MSR_EFER); - if (index >=3D 0 && update_transition_efer(vmx)) + if (index >=3D 0 && update_transition_efer(vmx)) { + vmx->msr_offset_efer =3D save_nmsrs; move_msr_up(vmx, index, save_nmsrs++); + } =20 vmx->save_nmsrs =3D save_nmsrs; =20 ? Untested as I don't want to crash my notebook ATM. :) Jan --------------enig34013CE59F4071E87696AA50 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkrpTR8ACgkQitSsb3rl5xSqmgCeI+1e1bVMz26fs7Su80EAf+jy OHQAniV9ALK2PUtIPjRhktdBvoX4Xx+x =zI4Q -----END PGP SIGNATURE----- --------------enig34013CE59F4071E87696AA50--