From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NkRB7-0005wm-SD for qemu-devel@nongnu.org; Wed, 24 Feb 2010 19:02:05 -0500 Received: from [199.232.76.173] (port=40277 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NkRB7-0005wO-CS for qemu-devel@nongnu.org; Wed, 24 Feb 2010 19:02:05 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NkRB4-0003F3-2g for qemu-devel@nongnu.org; Wed, 24 Feb 2010 19:02:04 -0500 Received: from fmmailgate03.web.de ([217.72.192.234]:47875) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NkRB3-0003Et-H0 for qemu-devel@nongnu.org; Wed, 24 Feb 2010 19:02:01 -0500 Message-ID: <4B85BDF9.2070801@web.de> Date: Thu, 25 Feb 2010 01:02:01 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <4f4d544e5c032561bca4efa483084451683b22fd.1267021065.git.jan.kiszka@siemens.com> <20100224224419.GA15712@amt.cnet> In-Reply-To: <20100224224419.GA15712@amt.cnet> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigBB685902623BE09A00A7C095" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH v3 04/10] qemu-kvm: Clean up mpstate synchronization List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcelo Tosatti Cc: Gleb Natapov , Avi Kivity , kvm@vger.kernel.org, qemu-devel@nongnu.org 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--