From patchwork Tue Sep 6 03:42:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 9315573 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 D6A6E60760 for ; Tue, 6 Sep 2016 04:43:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C66BC2851D for ; Tue, 6 Sep 2016 04:43:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BAF732857F; Tue, 6 Sep 2016 04:43:10 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 4D7142851D for ; Tue, 6 Sep 2016 04:43:10 +0000 (UTC) Received: from localhost ([::1]:58471 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh8E1-0005yl-BD for patchwork-qemu-devel@patchwork.kernel.org; Tue, 06 Sep 2016 00:43:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh7GG-00033B-Tv for qemu-devel@nongnu.org; Mon, 05 Sep 2016 23:41:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bh7GC-0007qK-NT for qemu-devel@nongnu.org; Mon, 05 Sep 2016 23:41:24 -0400 Received: from ozlabs.org ([103.22.144.67]:39784) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh7GC-0007lN-Au; Mon, 05 Sep 2016 23:41:20 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3sSsp72v6Gz9t2n; Tue, 6 Sep 2016 13:41:17 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1473133279; bh=fZijJaLptISb/UbghrmvyRtvik2pG48aepSn7qJGkGQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pjjqp9s+4FWlAUtzaS3o0JH4fS7A/zcmjNPU+rEH/y7+oiNiJseeL7XYKjNDjv4Qa HuxXqJ0Tcn+TVRoV9sHyfLqIw7Tu+oTy7Gplv0dUGNXUjdRCBmoHdjaewrfq/zRmtp cSrsPfxFGvgdjKry2Ny/omglR9Pi5ak0x1fpiWCo= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 6 Sep 2016 13:42:47 +1000 Message-Id: <1473133396-18940-38-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473133396-18940-1-git-send-email-david@gibson.dropbear.id.au> References: <1473133396-18940-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 103.22.144.67 Subject: [Qemu-devel] [PULL 37/66] ppc: Don't update NIP in dcbz and lscbx 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: David Gibson , qemu-ppc@nongnu.org, agraf@suse.de, 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 From: Benjamin Herrenschmidt Instead, pass GETPC() result to the corresponding helpers. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: David Gibson --- target-ppc/mem_helper.c | 9 +++++---- target-ppc/translate.c | 4 ---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/target-ppc/mem_helper.c b/target-ppc/mem_helper.c index e20a53e..92a594c 100644 --- a/target-ppc/mem_helper.c +++ b/target-ppc/mem_helper.c @@ -141,13 +141,14 @@ void helper_stsw(CPUPPCState *env, target_ulong addr, uint32_t nb, } } -static void do_dcbz(CPUPPCState *env, target_ulong addr, int dcache_line_size) +static void do_dcbz(CPUPPCState *env, target_ulong addr, int dcache_line_size, + uintptr_t raddr) { int i; addr &= ~(dcache_line_size - 1); for (i = 0; i < dcache_line_size; i += 4) { - cpu_stl_data(env, addr + i, 0); + cpu_stl_data_ra(env, addr + i, 0, raddr); } if (env->reserve_addr == addr) { env->reserve_addr = (target_ulong)-1ULL; @@ -168,7 +169,7 @@ void helper_dcbz(CPUPPCState *env, target_ulong addr, uint32_t is_dcbzl) /* XXX add e500mc support */ - do_dcbz(env, addr, dcbz_size); + do_dcbz(env, addr, dcbz_size, GETPC()); } void helper_icbi(CPUPPCState *env, target_ulong addr) @@ -190,7 +191,7 @@ target_ulong helper_lscbx(CPUPPCState *env, target_ulong addr, uint32_t reg, d = 24; for (i = 0; i < xer_bc; i++) { - c = cpu_ldub_data(env, addr); + c = cpu_ldub_data_ra(env, addr, GETPC()); addr = addr_add(env, addr, 1); /* ra (if not 0) and rb are never modified */ if (likely(reg != rb && (ra == 0 || reg != ra))) { diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 6320ae5..bebd1cc 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -4055,8 +4055,6 @@ static void gen_dcbz(DisasContext *ctx) int is_dcbzl = ctx->opcode & 0x00200000 ? 1 : 0; gen_set_access_type(ctx, ACCESS_CACHE); - /* NIP cannot be restored if the memory exception comes from an helper */ - gen_update_nip(ctx, ctx->nip - 4); tcgv_addr = tcg_temp_new(); tcgv_is_dcbzl = tcg_const_i32(is_dcbzl); @@ -4584,8 +4582,6 @@ static void gen_lscbx(DisasContext *ctx) TCGv_i32 t3 = tcg_const_i32(rB(ctx->opcode)); gen_addr_reg_index(ctx, t0); - /* NIP cannot be restored if the memory exception comes from an helper */ - gen_update_nip(ctx, ctx->nip - 4); gen_helper_lscbx(t0, cpu_env, t0, t1, t2, t3); tcg_temp_free_i32(t1); tcg_temp_free_i32(t2);