From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=34705 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OQyNw-00075h-GM for qemu-devel@nongnu.org; Tue, 22 Jun 2010 03:59:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OQyNu-0002Cg-Lj for qemu-devel@nongnu.org; Tue, 22 Jun 2010 03:59:08 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:41778) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OQyNu-0002CI-BI for qemu-devel@nongnu.org; Tue, 22 Jun 2010 03:59:06 -0400 Message-ID: <4C206D45.6090401@web.de> Date: Tue, 22 Jun 2010 09:59:01 +0200 From: Jan Kiszka MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH] fix smp with tcg mode and --enable-io-thread References: <4C1BA0B4.2010803@siemens.com> <4C1BCEB0.6050601@codemonkey.ws> <20100621193123.GA14083@amt.cnet> <4C1FCABA.3060207@web.de> <4C1FE40C.3070506@web.de> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig5B51FBD41013F4FC2FC8242B" Sender: jan.kiszka@web.de List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Glauber Costa , Marcelo Tosatti , qemu-devel This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5B51FBD41013F4FC2FC8242B Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Alexander Graf wrote: > On 22.06.2010, at 00:13, Jan Kiszka wrote: >=20 >> Jan Kiszka wrote: >>> And there is some race that cause a lock up in qemu_mutex_lock_iothre= ad >>> after a while (the cpu_unlink_tb seems to race with the linking - jus= t a >>> guess so far). >> This seems to fix a long-standing race between cpu_exec and >> signal-driven cpu_unlink_tb: >> >> diff --git a/cpu-exec.c b/cpu-exec.c >> index 026980a..bfc34e4 100644 >> --- a/cpu-exec.c >> +++ b/cpu-exec.c >> @@ -599,8 +598,9 @@ int cpu_exec(CPUState *env1) >> TB, but before it is linked into a potentially >> infinite loop and becomes env->current_tb. Avoid >> starting execution if there is a pending interrupt.= */ >> - if (!unlikely (env->exit_request)) { >> - env->current_tb =3D tb; >> + env->current_tb =3D tb; >> + asm(""); >=20 > This is just barrier(), no? >=20 Yes, thoughtlessly copied from other places in cpu-exec.c. Guess it's time to define this properly in qemu-barriers.h, also clobbering "memory"= =2E Jan --------------enig5B51FBD41013F4FC2FC8242B 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 iEYEARECAAYFAkwgbUgACgkQitSsb3rl5xQdhACfUZfb6ONfX7xtgr5dhBHT8WiJ p+MAoLnBqYsmMDtWSVj3cIQXV0oFy6mJ =jPFa -----END PGP SIGNATURE----- --------------enig5B51FBD41013F4FC2FC8242B--