From patchwork Fri Jun 3 15:45:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Horak X-Patchwork-Id: 9153505 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 1160560221 for ; Fri, 3 Jun 2016 16:10:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 031D325EF7 for ; Fri, 3 Jun 2016 16:10:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBF4228309; Fri, 3 Jun 2016 16:10:41 +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 380D025EF7 for ; Fri, 3 Jun 2016 16:10:41 +0000 (UTC) Received: from localhost ([::1]:56529 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8rgG-0001xX-BY for patchwork-qemu-devel@patchwork.kernel.org; Fri, 03 Jun 2016 12:10:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8rIO-00069L-1t for qemu-devel@nongnu.org; Fri, 03 Jun 2016 11:46:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8rIJ-0007T9-Rw for qemu-devel@nongnu.org; Fri, 03 Jun 2016 11:45:59 -0400 Received: from ibawizard.net ([82.208.49.253]:60568 helo=mengele.ibawizard.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8rIJ-0007T5-LB for qemu-devel@nongnu.org; Fri, 03 Jun 2016 11:45:55 -0400 Received: by mengele.ibawizard.net (Postfix, from userid 1001) id 770C51D3605F; Fri, 3 Jun 2016 17:45:49 +0200 (CEST) Date: Fri, 3 Jun 2016 17:45:49 +0200 From: Jakub Horak To: qemu-devel@nongnu.org Message-ID: <20160603154549.GA31406@ibawizard> MIME-Version: 1.0 Content-Disposition: inline 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 X-Mailman-Approved-At: Fri, 03 Jun 2016 12:10:19 -0400 Subject: [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: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 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);