From patchwork Mon Jun 6 08:47:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Horak X-Patchwork-Id: 9157477 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DB71760467 for ; Mon, 6 Jun 2016 08:47:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1A702015F for ; Mon, 6 Jun 2016 08:47:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C687526907; Mon, 6 Jun 2016 08:47:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B4D222015F for ; Mon, 6 Jun 2016 08:47:53 +0000 (UTC) Received: from localhost ([::1]:40798 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9qCO-0000yH-Hg for patchwork-qemu-devel@patchwork.kernel.org; Mon, 06 Jun 2016 04:47:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9qC9-0000xz-6M for qemu-devel@nongnu.org; Mon, 06 Jun 2016 04:47:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9qC5-0002tK-Vn for qemu-devel@nongnu.org; Mon, 06 Jun 2016 04:47:37 -0400 Received: from ibawizard.net ([82.208.49.253]:54999 helo=mengele.ibawizard.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9qC5-0002sk-Or; Mon, 06 Jun 2016 04:47:33 -0400 Received: by mengele.ibawizard.net (Postfix, from userid 1001) id 0FFF21D36050; Mon, 6 Jun 2016 10:47:29 +0200 (CEST) Date: Mon, 6 Jun 2016 10:47:28 +0200 From: Jakub Horak To: David Gibson Message-ID: <20160606084728.GB24720@ibawizard> References: <20160603154549.GA31406@ibawizard> <20160606013441.GF9226@voom.fritz.box> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160606013441.GF9226@voom.fritz.box> User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 82.208.49.253 Subject: Re: [Qemu-devel] Bug in ppc/BookE wait instruction X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hello, David Gibson (david@gibson.dropbear.id.au) wrote: > On Fri, Jun 03, 2016 at 05:45:49PM +0200, Jakub Horak wrote: > > Hello, > > I think there's a bug in "wait" instruction code generator for PowerPC > > architecture. It doesn't make sense to store a non-initialized register. > > > > Best regards, > > Jakub Horak > > The fix looks correct, but I need a Signed-off-by line in order to > apply it. Here you go: Fixed bug in code generator. Signed-off-by: Jakub Horak > > In future, please send such patches to myself and Alex Graf > (target-ppc maintainers) the qemu-ppc list as well as qemu-devel. I > wouldn't have spotted this if Marc Cave-Ayland hadn't copied it to me. Sorry, I'll be more thoughtful next time. Best regards, Jakub > > > > > > > diff --git a/target-ppc/translate.c b/target-ppc/translate.c > > index f5ceae5..6af567b 100644 > > --- a/target-ppc/translate.c > > +++ b/target-ppc/translate.c > > @@ -3439,7 +3439,7 @@ static void gen_sync(DisasContext *ctx) > > /* wait */ > > static void gen_wait(DisasContext *ctx) > > { > > - TCGv_i32 t0 = tcg_temp_new_i32(); > > + TCGv_i32 t0 = tcg_const_i32(1); > > tcg_gen_st_i32(t0, cpu_env, > > -offsetof(PowerPCCPU, env) + offsetof(CPUState, halted)); > > tcg_temp_free_i32(t0); > > > > -- > David Gibson | I'll have my music baroque, and my code > david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ > | _way_ _around_! > http://www.ozlabs.org/~dgibson diff --git a/target-ppc/translate.c b/target-ppc/translate.c index f5ceae5..6af567b 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -3439,7 +3439,7 @@ static void gen_sync(DisasContext *ctx) /* wait */ static void gen_wait(DisasContext *ctx) { - TCGv_i32 t0 = tcg_temp_new_i32(); + TCGv_i32 t0 = tcg_const_i32(1); tcg_gen_st_i32(t0, cpu_env, -offsetof(PowerPCCPU, env) + offsetof(CPUState, halted)); tcg_temp_free_i32(t0);