From patchwork Thu Sep 27 23:56:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 187580 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6F4592C00B4 for ; Fri, 28 Sep 2012 09:56:52 +1000 (EST) Received: from localhost ([::1]:51223 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THNwo-0001Hk-MT for incoming@patchwork.ozlabs.org; Thu, 27 Sep 2012 19:56:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THNwh-0001H3-Jx for qemu-devel@nongnu.org; Thu, 27 Sep 2012 19:56:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THNwg-00030P-99 for qemu-devel@nongnu.org; Thu, 27 Sep 2012 19:56:43 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:60458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THNwg-00030K-3H for qemu-devel@nongnu.org; Thu, 27 Sep 2012 19:56:42 -0400 Received: by pbbrp2 with SMTP id rp2so4330134pbb.4 for ; Thu, 27 Sep 2012 16:56:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=q2aLySYQVcSrfuUva+8sQFkc0mujDXbrJ1oyUBD98SU=; b=k1HxYAyGCvqMp6stlvnrhqmR/u2vxthyD1goJ3rvRn9eX2XFltmiCH+GaYuEYosalM 6N6Sr28KBVaQNZGS9I2fyjXt2PkJoYJNcITPkEy7xIOjY4HHuT5quph5k/+x3lNlkocZ tmZDCQczoYQTPUGQy7gAaqg6DXVkiJj43UOK08r/RvLHmZIuk8a10kylD2JLmy12wk8f CNrBe/Q/4TYTsyMh8zucXHN7+iLv5ly1wNoauYLWVX9FN3NW7g5aZ9I1294VcIsoirpA 3qn3+vTB653sJzwvySRh4JdKm98XIK5vmwo7uNT9LmWuxtXK0picwnNhUcIcvl9t+nbF eF8A== Received: by 10.68.230.232 with SMTP id tb8mr15725321pbc.19.1348790201336; Thu, 27 Sep 2012 16:56:41 -0700 (PDT) Received: from anchor.twiddle.home.com ([173.160.232.49]) by mx.google.com with ESMTPS id h10sm4466866pav.28.2012.09.27.16.56.40 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 16:56:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 27 Sep 2012 16:56:38 -0700 Message-Id: <1348790198-25405-1-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1348785610-23418-1-git-send-email-rth@twiddle.net> References: <1348785610-23418-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.45 Cc: Alexander Graf Subject: [Qemu-devel] [PATCH 064/147] target-s390: Convert LRA X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Note that truncating the store to r1 based on PSW_MASK_64 is incorrect. We always modify the entire register. Signed-off-by: Richard Henderson --- target-s390x/helper.h | 2 +- target-s390x/insn-data.def | 4 ++++ target-s390x/mem_helper.c | 13 +++---------- target-s390x/translate.c | 20 +++++++++----------- 4 files changed, 17 insertions(+), 22 deletions(-) diff --git a/target-s390x/helper.h b/target-s390x/helper.h index 260d4f3..c0de601 100644 --- a/target-s390x/helper.h +++ b/target-s390x/helper.h @@ -133,7 +133,7 @@ DEF_HELPER_4(sigp, i32, env, i64, i32, i64) DEF_HELPER_2(sacf, void, env, i64) DEF_HELPER_FLAGS_3(ipte, TCG_CALL_CONST, void, env, i64, i64) DEF_HELPER_FLAGS_1(ptlb, TCG_CALL_CONST, void, env) -DEF_HELPER_3(lra, i32, env, i64, i32) +DEF_HELPER_2(lra, i64, env, i64) DEF_HELPER_3(stura, void, env, i64, i32) #endif diff --git a/target-s390x/insn-data.def b/target-s390x/insn-data.def index 65f0bfd..a83ce95 100644 --- a/target-s390x/insn-data.def +++ b/target-s390x/insn-data.def @@ -461,6 +461,10 @@ C(0x8300, DIAG, RX_a, Z, 0, 0, 0, 0, diag, 0) /* LOAD PSW */ C(0x8200, LPSW, S, Z, 0, a2, 0, 0, lpsw, 0) +/* LOAD REAL ADDRESS */ + C(0xb100, LRA, RX_a, Z, 0, a2, r1, 0, lra, 0) + C(0xe313, LRAY, RXY_a, LD, 0, a2, r1, 0, lra, 0) + C(0xe303, LRAG, RXY_a, Z, 0, a2, r1, 0, lra, 0) /* MOVE TO PRIMARY */ C(0xda00, MVCP, SS_d, Z, la1, a2, 0, 0, mvcp, 0) /* MOVE TO SECONDARY */ diff --git a/target-s390x/mem_helper.c b/target-s390x/mem_helper.c index 00dbd54..2c2b105 100644 --- a/target-s390x/mem_helper.c +++ b/target-s390x/mem_helper.c @@ -1133,7 +1133,7 @@ void HELPER(stura)(CPUS390XState *env, uint64_t addr, uint32_t v1) } /* load real address */ -uint32_t HELPER(lra)(CPUS390XState *env, uint64_t addr, uint32_t r1) +uint64_t HELPER(lra)(CPUS390XState *env, uint64_t addr) { uint32_t cc = 0; int old_exc = env->exception_index; @@ -1157,14 +1157,7 @@ uint32_t HELPER(lra)(CPUS390XState *env, uint64_t addr, uint32_t r1) } env->exception_index = old_exc; - if (!(env->psw.mask & PSW_MASK_64)) { - env->regs[r1] = (env->regs[r1] & 0xffffffff00000000ULL) | - (ret & 0xffffffffULL); - } else { - env->regs[r1] = ret; - } - - return cc; + env->cc_op = cc; + return ret; } - #endif diff --git a/target-s390x/translate.c b/target-s390x/translate.c index dadf36c..550d6bb 100644 --- a/target-s390x/translate.c +++ b/target-s390x/translate.c @@ -2022,17 +2022,6 @@ static void disas_s390_insn(CPUS390XState *env, DisasContext *s) tcg_temp_free_i64(tmp2); tcg_temp_free_i32(tmp32_1); break; - case 0xb1: /* LRA R1,D2(X2, B2) [RX] */ - check_privileged(s); - insn = ld_code4(env, s->pc); - tmp = decode_rx(s, insn, &r1, &x2, &b2, &d2); - tmp32_1 = tcg_const_i32(r1); - potential_page_fault(s); - gen_helper_lra(cc_op, cpu_env, tmp, tmp32_1); - set_cc_static(s); - tcg_temp_free_i64(tmp); - tcg_temp_free_i32(tmp32_1); - break; #endif case 0xb2: insn = ld_code4(env, s->pc); @@ -2938,6 +2927,15 @@ static ExitStatus op_ld64(DisasContext *s, DisasOps *o) } #ifndef CONFIG_USER_ONLY +static ExitStatus op_lra(DisasContext *s, DisasOps *o) +{ + check_privileged(s); + potential_page_fault(s); + gen_helper_lra(o->out, cpu_env, o->in2); + set_cc_static(s); + return NO_EXIT; +} + static ExitStatus op_lpsw(DisasContext *s, DisasOps *o) { TCGv_i64 t1, t2;