From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Siluq-0002RT-GZ for qemu-devel@nongnu.org; Sun, 24 Jun 2012 08:27:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Siluo-0002Pw-68 for qemu-devel@nongnu.org; Sun, 24 Jun 2012 08:27:44 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:51419) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Silun-0002Oy-VW for qemu-devel@nongnu.org; Sun, 24 Jun 2012 08:27:42 -0400 Received: by mail-ob0-f173.google.com with SMTP id ta14so5216835obb.4 for ; Sun, 24 Jun 2012 05:27:41 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20120619023136.GA5187@tyr.buserror.net> References: <20120619023136.GA5187@tyr.buserror.net> From: Blue Swirl Date: Sun, 24 Jun 2012 12:27:20 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] tci: don't write zero for reloc in tci_out_label List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Scott Wood Cc: Stefan Weil , qemu-devel@nongnu.org Thanks, applied. On Tue, Jun 19, 2012 at 2:31 AM, Scott Wood wrote= : > If tci_out_label is called in the context of tcg_gen_code_search_pc, we > could be overwriting an already patched relocation with zero -- and not > repatch it because the set_label is past search_pc, causing a QEMU crash > when it tries to branch to a zero label. > > Not writing anything to the relocation area seems to be in line with what > other backends do from the couple I looked at (x86, ppc). > > Signed-off-by: Scott Wood > --- > =C2=A0tcg/tci/tcg-target.c | =C2=A0 =C2=A02 +- > =C2=A01 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/tcg/tci/tcg-target.c b/tcg/tci/tcg-target.c > index 453f187..3c6b0f5 100644 > --- a/tcg/tci/tcg-target.c > +++ b/tcg/tci/tcg-target.c > @@ -487,7 +487,7 @@ static void tci_out_label(TCGContext *s, TCGArg arg) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 assert(label->u.value); > =C2=A0 =C2=A0 } else { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 tcg_out_reloc(s, s->code_ptr, sizeof(tcg_targ= et_ulong), arg, 0); > - =C2=A0 =C2=A0 =C2=A0 =C2=A0tcg_out_i(s, 0); > + =C2=A0 =C2=A0 =C2=A0 =C2=A0s->code_ptr +=3D sizeof(tcg_target_ulong); > =C2=A0 =C2=A0 } > =C2=A0} > > -- > 1.7.5.4 > >