Received: from eggs.gnu.org ([2001:4830:134:3::10]:55002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSzmD-0007t9-NG for qemu-devel@nongnu.org; Fri, 29 Jul 2016 00:52:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSzm6-0002YY-OO for qemu-devel@nongnu.org; Fri, 29 Jul 2016 00:52:00 -0400 From: David Gibson Date: Fri, 29 Jul 2016 14:53:42 +1000 Message-Id: <1469768024-32108-5-git-send-email-david@gibson.dropbear.id.au> In-Reply-To: <1469768024-32108-1-git-send-email-david@gibson.dropbear.id.au> References: <1469768024-32108-1-git-send-email-david@gibson.dropbear.id.au> Subject: [Qemu-devel] [PULL 4/6] ppc: Fix fault PC reporting for lve*/stve* VMX instructions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: agraf@suse.de, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, imammedo@redhat.com, ehabkost@redhat.com, pkrempa@redhat.com, Benjamin Herrenschmidt , David Gibson From: Benjamin Herrenschmidt We forgot to do gen_update_nip() for these like we do with other helpers. Fix this, but in a more efficient way by passing the RA to the accessors instead so the overhead is only taken on faults. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: David Gibson --- target-ppc/mem_helper.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/target-ppc/mem_helper.c b/target-ppc/mem_helper.c index e4de86b..e4ed377 100644 --- a/target-ppc/mem_helper.c +++ b/target-ppc/mem_helper.c @@ -232,16 +232,16 @@ target_ulong helper_lscbx(CPUPPCState *env, target_ulong addr, uint32_t reg, \ if (needs_byteswap(env)) { \ r->element[LO_IDX ? index : (adjust - index)] = \ - swap(access(env, addr)); \ + swap(access(env, addr, GETPC())); \ } else { \ r->element[LO_IDX ? index : (adjust - index)] = \ - access(env, addr); \ + access(env, addr, GETPC()); \ } \ } #define I(x) (x) -LVE(lvebx, cpu_ldub_data, I, u8) -LVE(lvehx, cpu_lduw_data, bswap16, u16) -LVE(lvewx, cpu_ldl_data, bswap32, u32) +LVE(lvebx, cpu_ldub_data_ra, I, u8) +LVE(lvehx, cpu_lduw_data_ra, bswap16, u16) +LVE(lvewx, cpu_ldl_data_ra, bswap32, u32) #undef I #undef LVE @@ -259,16 +259,17 @@ LVE(lvewx, cpu_ldl_data, bswap32, u32) \ if (needs_byteswap(env)) { \ access(env, addr, swap(r->element[LO_IDX ? index : \ - (adjust - index)])); \ + (adjust - index)]), \ + GETPC()); \ } else { \ access(env, addr, r->element[LO_IDX ? index : \ - (adjust - index)]); \ + (adjust - index)], GETPC()); \ } \ } #define I(x) (x) -STVE(stvebx, cpu_stb_data, I, u8) -STVE(stvehx, cpu_stw_data, bswap16, u16) -STVE(stvewx, cpu_stl_data, bswap32, u32) +STVE(stvebx, cpu_stb_data_ra, I, u8) +STVE(stvehx, cpu_stw_data_ra, bswap16, u16) +STVE(stvewx, cpu_stl_data_ra, bswap32, u32) #undef I #undef LVE -- 2.7.4