From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bS1U6-0003p3-Qp for qemu-devel@nongnu.org; Tue, 26 Jul 2016 08:29:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bS1U1-0005Q7-QJ for qemu-devel@nongnu.org; Tue, 26 Jul 2016 08:29:17 -0400 Received: from gate.crashing.org ([63.228.1.57]:48835) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bS1U1-0005Q3-Fp for qemu-devel@nongnu.org; Tue, 26 Jul 2016 08:29:13 -0400 Message-ID: <1469536137.5978.79.camel@kernel.crashing.org> From: Benjamin Herrenschmidt Date: Tue, 26 Jul 2016 22:28:57 +1000 In-Reply-To: <1469493760-4205-1-git-send-email-rth@twiddle.net> References: <1469493760-4205-1-git-send-email-rth@twiddle.net> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] tcg: Merge GETPC and GETRA List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, leon.alrae@imgtec.com On Tue, 2016-07-26 at 06:12 +0530, Richard Henderson wrote: > The return address argument to the softmmu template helpers was > confused.=C2=A0=C2=A0In the legacy case, we wanted to indicate that the= re > is no return address, and so passed in NULL.=C2=A0=C2=A0However, we the= n > immediately subtracted GETPC_ADJ from NULL, resulting in a non-zero > value, indicating the presence of an (invalid) return address. >=20 > Push the GETPC_ADJ subtraction down to the only point it's required: > immediately before use within cpu_restore_state, after all NULL > pointer > checks have been completed.=C2=A0=C2=A0This makes GETPC and GETRA ident= ical. >=20 > Remove GETRA as the lesser used macro, replacing all uses with GETPC. >=20 > Signed-off-by: Richard Henderson > --- >=20 > Ben, this should fix the "-2" problem that you reported.=C2=A0=C2=A0Of = course, > as also discussed in that thread, this won't fix the whole issue. I haven't had a chance to review the details of the patch but I verified that all my test OSes still boot with it applied ;-) Cheers, Ben.