From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRndt-0000gq-JR for qemu-devel@nongnu.org; Mon, 25 Jul 2016 17:42:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRndp-0003dz-Bh for qemu-devel@nongnu.org; Mon, 25 Jul 2016 17:42:28 -0400 Received: from gate.crashing.org ([63.228.1.57]:49570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRndp-0003c6-13 for qemu-devel@nongnu.org; Mon, 25 Jul 2016 17:42:25 -0400 Message-ID: <1469482923.5978.54.camel@kernel.crashing.org> From: Benjamin Herrenschmidt Date: Tue, 26 Jul 2016 07:42:03 +1000 In-Reply-To: References: <1469364141.8568.251.camel@kernel.crashing.org> <1469364697.8568.253.camel@kernel.crashing.org> <1469364745.8568.254.camel@kernel.crashing.org> <5eede4b0-cc3a-c24f-5de4-8473220385f9@twiddle.net> <1469407593.8568.265.camel@kernel.crashing.org> <1469407897.8568.268.camel@kernel.crashing.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] TCG problem with cpu_{st,ld}x_data ? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Christian Borntraeger On Mon, 2016-07-25 at 19:30 +0530, Richard Henderson wrote: > > Or can they also be called outside of that context ? >=20 > No, not without a valid return address. >=20 > E.g. it's not valid to have one helper call another, and for the second= helper=C2=A0 > use GETPC.=C2=A0 For this, typically, one must factor out a common func= tion which=C2=A0 > accepts a "retaddr" argument, which the callers must fill in with GETPC. Right, I've figured that out. I notice that the cpu_ldl_code() are sprinkled in parts that are "chancy". For example we have one in powerpc_excp() to read the faulting instruction, though that *should* never fail it's till not great. I haven't completely figured out what code path instruction translation faults take, I assume we longjmp out of the translation loop the same was as we do out of the execution loop ? Note: I've started cleaning that on ppc (but not fixing the -2 bug yet) in there: very much a work in progress but I'd be happy to have initial feedback (ignore patch 1 about MOL OSI, it's unrelated): https://github.com/ozbenh/qemu/commits/wip Cheers, Ben.