From patchwork Mon Feb 18 14:30:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 158635 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2622823jaa; Mon, 18 Feb 2019 07:30:07 -0800 (PST) X-Google-Smtp-Source: AHgI3IaLclDwDMqv0jzU7Q/+488Sh1ci+Ydgudb+dXY7wul7QmBEBWdVqJ3WAk8skXcaBGwGuYKX X-Received: by 2002:a25:c184:: with SMTP id r126mr19005854ybf.441.1550503807524; Mon, 18 Feb 2019 07:30:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550503807; cv=none; d=google.com; s=arc-20160816; b=FvYnrfcPLEI0vY0LAiVc76IQTqBmv8nSyQTC+JrBe3ROgbAo5rt5mnbe5sUes7r13e rDbWZvR31ZuiXDZiaL/mdOBq5A1SD3gdQrepGi+a2/fU/Sh6/ADXI55y/D/uV2ikKtK1 +j41jY9HEtkKieRW4DmcMsnwRgDKrQpL2+p7pK+IKLxMbO/LTHhBP7lmqqqIqd1tiKV7 zGZUzTxLFVY1d9ka56CsReiB0oQfJK2FHiVCtD8UUttyBkxaJMkrd5swwOzsYIJ/jP5r gHCaY94NilBim9jWT2m3GLT3jmMm7TmTfmqX8aVcnSBxu/ophSgNINMHgH/7zvQzl2Ov s2PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=t3Uc86jYMjnfrES2+IcjzgEYlXynWgKO0l2TKZFDPG4=; b=cI5UzoDNX2i8hFPaN3m7jmvFjRpg3NGVBMFj2gnbAHP+GAriWpaM8r8xEL4OeVqoNZ RrritgU2FQsaRNreNpb0x68pUsHotmM9dMrjK/k7JzhzdFG6YT2epUVzb2nTe/Nsa8yf ilbsX/xOaL8QkiWkXroyFXcvZKI87VGx28TTW/eiW6LHd+2kjmJE0uBRv3iyi4pqInLU fdufs6ftOPryMBkbOItPDnTwtP7pKo29jpZya7uHUBac+t1aA9rwep/2u8OaQHxluG4t WXDTOlbey/Y0siv1eK2T311ZTBQN4mmA22D9ulBUAG+7lHRUxHljRbeMvSquR9A4T62q 3nGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=YmtBb6p+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w4si8839443ywi.342.2019.02.18.07.30.07 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Feb 2019 07:30:07 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=YmtBb6p+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:60586 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkrv-0003JC-4F for patch@linaro.org; Mon, 18 Feb 2019 10:30:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjyZ-0007AH-Sk for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjyY-0003af-H3 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:55 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:46273) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjyX-0003Gg-OZ; Mon, 18 Feb 2019 09:32:54 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s35DG9z9sRd; Tue, 19 Feb 2019 01:31:18 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500279; bh=qMVNghwDiAdQeTyLXZkLNEGqOtqDcvrhaUV15aEGm7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YmtBb6p+HKuFiuy0XG0YgyvlIeY0G3ZuBQVBY+KNdFS9ALz/d76jKHGJneHjSOPJY tH435dlSjMVKmxiYalnvC74A7D6drre3XyWe7kj+kBP4iVXbKQUYwSxfowse/ahQHJ ceOTuRaRNWzwxk/5dUsKFyHmsiuu2x5o6WlKKkKA= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:44 +1100 Message-Id: <20190218143049.17142-39-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 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 38/43] target/ppc: Add helper_mfvscr 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: Richard Henderson , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson This is required before changing the representation of the register. Signed-off-by: Richard Henderson Acked-by: David Gibson Message-Id: <20190215100058.20015-13-mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson --- target/ppc/arch_dump.c | 3 ++- target/ppc/helper.h | 1 + target/ppc/int_helper.c | 5 +++++ target/ppc/translate/vmx-impl.inc.c | 2 +- target/ppc/translate_init.inc.c | 2 +- 5 files changed, 10 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/target/ppc/arch_dump.c b/target/ppc/arch_dump.c index 3a00606d01..9ab04b2c38 100644 --- a/target/ppc/arch_dump.c +++ b/target/ppc/arch_dump.c @@ -17,6 +17,7 @@ #include "elf.h" #include "sysemu/dump.h" #include "sysemu/kvm.h" +#include "exec/helper-proto.h" #ifdef TARGET_PPC64 #define ELFCLASS ELFCLASS64 @@ -175,7 +176,7 @@ static void ppc_write_elf_vmxregset(NoteFuncArg *arg, PowerPCCPU *cpu) vmxregset->avr[i].u64[1] = avr->u64[1]; } } - vmxregset->vscr.u32[3] = cpu_to_dump32(s, cpu->env.vscr); + vmxregset->vscr.u32[3] = cpu_to_dump32(s, helper_mfvscr(&cpu->env)); } static void ppc_write_elf_vsxregset(NoteFuncArg *arg, PowerPCCPU *cpu) diff --git a/target/ppc/helper.h b/target/ppc/helper.h index b3ffe28103..7dbb08b9dd 100644 --- a/target/ppc/helper.h +++ b/target/ppc/helper.h @@ -295,6 +295,7 @@ DEF_HELPER_5(vmsumshm, void, env, avr, avr, avr, avr) DEF_HELPER_5(vmsumshs, void, env, avr, avr, avr, avr) DEF_HELPER_4(vmladduhm, void, avr, avr, avr, avr) DEF_HELPER_FLAGS_2(mtvscr, TCG_CALL_NO_RWG, void, env, i32) +DEF_HELPER_FLAGS_1(mfvscr, TCG_CALL_NO_RWG, i32, env) DEF_HELPER_3(lvebx, void, env, avr, tl) DEF_HELPER_3(lvehx, void, env, avr, tl) DEF_HELPER_3(lvewx, void, env, avr, tl) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index aa6ad2ce7e..ec3ef9ff3f 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -463,6 +463,11 @@ void helper_mtvscr(CPUPPCState *env, uint32_t vscr) set_flush_to_zero((vscr >> VSCR_NJ) & 1, &env->vec_status); } +uint32_t helper_mfvscr(CPUPPCState *env) +{ + return env->vscr; +} + void helper_vaddcuw(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) { int i; diff --git a/target/ppc/translate/vmx-impl.inc.c b/target/ppc/translate/vmx-impl.inc.c index 182d3fc563..5e13edbf53 100644 --- a/target/ppc/translate/vmx-impl.inc.c +++ b/target/ppc/translate/vmx-impl.inc.c @@ -187,7 +187,7 @@ static void gen_mfvscr(DisasContext *ctx) tcg_gen_movi_i64(avr, 0); set_avr64(rD(ctx->opcode), avr, true); t = tcg_temp_new_i32(); - tcg_gen_ld_i32(t, cpu_env, offsetof(CPUPPCState, vscr)); + gen_helper_mfvscr(t, cpu_env); tcg_gen_extu_i32_i64(avr, t); set_avr64(rD(ctx->opcode), avr, false); tcg_temp_free_i32(t); diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c index ee574b342e..1657d88341 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -9573,7 +9573,7 @@ static int gdb_get_avr_reg(CPUPPCState *env, uint8_t *mem_buf, int n) return 16; } if (n == 32) { - stl_p(mem_buf, env->vscr); + stl_p(mem_buf, helper_mfvscr(env)); ppc_maybe_bswap_register(env, mem_buf, 4); return 4; }