From patchwork Tue Sep 6 03:40:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 9315513 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 6D11C601C0 for ; Tue, 6 Sep 2016 04:14:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4867328B47 for ; Tue, 6 Sep 2016 04:14:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2DFFE28B46; Tue, 6 Sep 2016 04:14:25 +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 406EE28B46 for ; Tue, 6 Sep 2016 04:14:24 +0000 (UTC) Received: from localhost ([::1]:58299 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh7mA-0006Hg-Hq for patchwork-qemu-devel@patchwork.kernel.org; Tue, 06 Sep 2016 00:14:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh7E5-0000qo-7z for qemu-devel@nongnu.org; Mon, 05 Sep 2016 23:39:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bh7E2-00076A-Cu for qemu-devel@nongnu.org; Mon, 05 Sep 2016 23:39:09 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:48566) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh7E1-0006zL-E3; Mon, 05 Sep 2016 23:39:06 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3sSslN2FXqz9vDc; Tue, 6 Sep 2016 13:38:52 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1473133136; bh=e68PoXjErUEALJ+L7OE03EMzJ+MgYs9RCZhfPRzJGH0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g0ZEWGpgS6gB/iIO7xAPlb8Qby/YgXzHx3LJaXaiinXdg6IffT3PE2eX57PYJ66d6 ZeQAuS/2D2pYZIEGjlxrC5nGd9wYsfEkQRYkpTzKMhy5YJScMAxSR8ksRDE8XK5L2E O+tKs0QQXMGSTpTnjRdbPcs/Ouz9ckZYC3XIzmZA= From: David Gibson To: peter.maydell@linearo.org Date: Tue, 6 Sep 2016 13:40:15 +1000 Message-Id: <1473133253-17598-29-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473133253-17598-1-git-send-email-david@gibson.dropbear.id.au> References: <1473133253-17598-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 28/66] ppc: Don't update NIP in lmw/stmw/icbi 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 | 11 ++++++----- target-ppc/translate.c | 6 ------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/target-ppc/mem_helper.c b/target-ppc/mem_helper.c index de96c91..e20a53e 100644 --- a/target-ppc/mem_helper.c +++ b/target-ppc/mem_helper.c @@ -57,9 +57,9 @@ void helper_lmw(CPUPPCState *env, target_ulong addr, uint32_t reg) { for (; reg < 32; reg++) { if (needs_byteswap(env)) { - env->gpr[reg] = bswap32(cpu_ldl_data(env, addr)); + env->gpr[reg] = bswap32(cpu_ldl_data_ra(env, addr, GETPC())); } else { - env->gpr[reg] = cpu_ldl_data(env, addr); + env->gpr[reg] = cpu_ldl_data_ra(env, addr, GETPC()); } addr = addr_add(env, addr, 4); } @@ -69,9 +69,10 @@ void helper_stmw(CPUPPCState *env, target_ulong addr, uint32_t reg) { for (; reg < 32; reg++) { if (needs_byteswap(env)) { - cpu_stl_data(env, addr, bswap32((uint32_t)env->gpr[reg])); + cpu_stl_data_ra(env, addr, bswap32((uint32_t)env->gpr[reg]), + GETPC()); } else { - cpu_stl_data(env, addr, (uint32_t)env->gpr[reg]); + cpu_stl_data_ra(env, addr, (uint32_t)env->gpr[reg], GETPC()); } addr = addr_add(env, addr, 4); } @@ -178,7 +179,7 @@ void helper_icbi(CPUPPCState *env, target_ulong addr) * (not a fetch) by the MMU. To be sure it will be so, * do the load "by hand". */ - cpu_ldl_data(env, addr); + cpu_ldl_data_ra(env, addr, GETPC()); } /* XXX: to be tested */ diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 568c1f8..dc5ebb1 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -2869,8 +2869,6 @@ static void gen_lmw(DisasContext *ctx) TCGv t0; TCGv_i32 t1; gen_set_access_type(ctx, ACCESS_INT); - /* NIP cannot be restored if the memory exception comes from an helper */ - gen_update_nip(ctx, ctx->nip - 4); t0 = tcg_temp_new(); t1 = tcg_const_i32(rD(ctx->opcode)); gen_addr_imm_index(ctx, t0, 0); @@ -2885,8 +2883,6 @@ static void gen_stmw(DisasContext *ctx) TCGv t0; TCGv_i32 t1; gen_set_access_type(ctx, ACCESS_INT); - /* NIP cannot be restored if the memory exception comes from an helper */ - gen_update_nip(ctx, ctx->nip - 4); t0 = tcg_temp_new(); t1 = tcg_const_i32(rS(ctx->opcode)); gen_addr_imm_index(ctx, t0, 0); @@ -4109,8 +4105,6 @@ static void gen_icbi(DisasContext *ctx) { TCGv t0; 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); t0 = tcg_temp_new(); gen_addr_reg_index(ctx, t0); gen_helper_icbi(cpu_env, t0);