From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH v3 04/10] qemu-kvm: Clean up mpstate synchronization Date: Thu, 25 Feb 2010 01:02:01 +0100 Message-ID: <4B85BDF9.2070801@web.de> References: <4f4d544e5c032561bca4efa483084451683b22fd.1267021065.git.jan.kiszka@siemens.com> <20100224224419.GA15712@amt.cnet> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigBB685902623BE09A00A7C095" Cc: Avi Kivity , kvm@vger.kernel.org, qemu-devel@nongnu.org, Gleb Natapov To: Marcelo Tosatti Return-path: Received: from fmmailgate03.web.de ([217.72.192.234]:47872 "EHLO fmmailgate03.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758646Ab0BYACB (ORCPT ); Wed, 24 Feb 2010 19:02:01 -0500 In-Reply-To: <20100224224419.GA15712@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigBB685902623BE09A00A7C095 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Marcelo Tosatti wrote: > On Wed, Feb 24, 2010 at 03:17:52PM +0100, Jan Kiszka wrote: >> Push mpstate reading/writing into kvm_arch_load/save_regs and, on x86,= >> properly synchronize with halted in the accessor functions. >> >> Signed-off-by: Jan Kiszka >=20 >> @@ -1290,6 +1318,7 @@ int kvm_arch_init_vcpu(CPUState *cenv) >> #ifdef KVM_EXIT_TPR_ACCESS >> kvm_tpr_vcpu_start(cenv); >> #endif >> + kvm_reset_mpstate(cenv); >> return 0; >> } >> =20 >> @@ -1363,15 +1392,10 @@ void kvm_arch_cpu_reset(CPUState *env) >> { >> kvm_arch_reset_vcpu(env); >> kvm_put_vcpu_events(env); >> - if (!cpu_is_bsp(env)) { >> - if (kvm_irqchip_in_kernel()) { >> -#ifdef KVM_CAP_MP_STATE >> - kvm_reset_mpstate(env); >> -#endif >> - } else { >> - env->interrupt_request &=3D ~CPU_INTERRUPT_HARD; >> - env->halted =3D 1; >> - } >> + kvm_reset_mpstate(env); >> + if (!cpu_is_bsp(env) && !kvm_irqchip_in_kernel()) { >> + env->interrupt_request &=3D ~CPU_INTERRUPT_HARD; >> + env->halted =3D 1; >> } >> } >=20 > Why are these two needed? Now that initialization of mp_state=20 > happens via synchronize_state(init/reset) -> arch_load_regs? Maybe correct. env->halted is also reset on load, not sure about the interrupt_request reset impact yet. This is (or at least was) hairy stuff, /me has to sleep about it again. Jan --------------enigBB685902623BE09A00A7C095 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 iEYEARECAAYFAkuFvfkACgkQitSsb3rl5xRtUgCfbuwALcxie6GN1v2ba0UAp5Ru ptsAoIWeKe//ag2bmrmKRs1BSwNqP/X2 =VDAc -----END PGP SIGNATURE----- --------------enigBB685902623BE09A00A7C095--