From patchwork Sun Sep 9 21:05:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 182690 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 C13CC2C0084 for ; Mon, 10 Sep 2012 08:29:50 +1000 (EST) Received: from localhost ([::1]:34597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAq0i-0005X8-U4 for incoming@patchwork.ozlabs.org; Sun, 09 Sep 2012 18:29:48 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAoj5-0008MV-9d for qemu-devel@nongnu.org; Sun, 09 Sep 2012 17:07:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TAoj4-00068k-39 for qemu-devel@nongnu.org; Sun, 09 Sep 2012 17:07:31 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:63059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAoj3-0005pO-Tb for qemu-devel@nongnu.org; Sun, 09 Sep 2012 17:07:30 -0400 Received: by mail-pz0-f45.google.com with SMTP id n15so968311dad.4 for ; Sun, 09 Sep 2012 14:07:29 -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=g3WFf6YgYRAd967tzsPiH4J2Q3Cjv8MFhDDK5X90V1U=; b=ot+2kd/gYApVJHojvFDQMBk8C2Q4ySG4VviGOwtnvPaDd19QRrY3aHTIrY0bkn/HJm mmwx0ffEtsCwbyoItFmmriKfJrEFQsP3jBlrnKmXmNr9pdglNi51Lu8JFi4ShhGk46J4 /3MwZN5JMWIkxJFZ8dFqCCeGNycXIOjCVbZVZFEo6SvI+32yw11iKc/6zEJWyvFChu58 yq+ZWwlOB2U6zkhyc62CWWTeB/QC/U+RjdkkzyF7oOjUJrZC+VmGiEyMrVaL6xhf7TNb IhRCj/u6BYPoI74Wf/9D8+Ksx1c+aqmpbS7tSZc+hNyfB/5LfRevJDP1Ebh8QNd8rK18 7gZA== Received: by 10.68.130.131 with SMTP id oe3mr2022766pbb.102.1347224849639; Sun, 09 Sep 2012 14:07:29 -0700 (PDT) Received: from anchor.twiddle.home ([173.160.232.49]) by mx.google.com with ESMTPS id tw5sm662053pbc.48.2012.09.09.14.07.28 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Sep 2012 14:07:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 9 Sep 2012 14:05:23 -0700 Message-Id: <1347224784-19472-66-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1347224784-19472-1-git-send-email-rth@twiddle.net> References: <1347224784-19472-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.210.45 Cc: Alexander Graf Subject: [Qemu-devel] [PATCH 065/126] target-s390: Convert LOAD CONTROL, part 2 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 Signed-off-by: Richard Henderson --- target-s390x/insn-data.def | 2 ++ target-s390x/translate.c | 75 ++++++++++++++-------------------------------- 2 files changed, 25 insertions(+), 52 deletions(-) diff --git a/target-s390x/insn-data.def b/target-s390x/insn-data.def index 92dbf26..ed28d2d 100644 --- a/target-s390x/insn-data.def +++ b/target-s390x/insn-data.def @@ -484,6 +484,7 @@ C(0x8300, DIAG, RX_a, Z, 0, 0, 0, 0, diag, 0) /* LOAD CONTROL */ C(0xb700, LCTL, RS_a, Z, 0, a2, 0, 0, lctl, 0) + C(0xeb2f, LCTLG, RSY_a, Z, 0, a2, 0, 0, lctlg, 0) /* LOAD PSW */ C(0x8200, LPSW, S, Z, 0, a2, 0, 0, lpsw, 0) /* LOAD REAL ADDRESS */ @@ -504,6 +505,7 @@ C(0xae00, SIGP, RS_a, Z, r3_o, a2, 0, 0, sigp, 0) /* STORE CONTROL */ C(0xb600, STCTL, RS_a, Z, 0, a2, 0, 0, stctl, 0) + C(0xeb25, STCTG, RSY_a, Z, 0, a2, 0, 0, stctg, 0) /* STORE THEN AND SYSTEM MASK */ C(0xac00, STNSM, SI, Z, la1, 0, new, m1_8, stnsm, 0) /* STORE THEN OR SYSTEM MASK */ diff --git a/target-s390x/translate.c b/target-s390x/translate.c index 7a912ca..9277081 100644 --- a/target-s390x/translate.c +++ b/target-s390x/translate.c @@ -1070,47 +1070,6 @@ static void disas_e3(DisasContext* s, int op, int r1, int x2, int b2, int d2) tcg_temp_free_i64(addr); } -static void disas_eb(DisasContext *s, int op, int r1, int r3, int b2, int d2) -{ - TCGv_i64 tmp; - TCGv_i32 tmp32_1, tmp32_2; - - LOG_DISAS("disas_eb: op 0x%x r1 %d r3 %d b2 %d d2 0x%x\n", - op, r1, r3, b2, d2); - switch (op) { -#ifndef CONFIG_USER_ONLY - case 0x2f: /* LCTLG R1,R3,D2(B2) [RSE] */ - /* Load Control */ - check_privileged(s); - tmp = get_address(s, 0, b2, d2); - tmp32_1 = tcg_const_i32(r1); - tmp32_2 = tcg_const_i32(r3); - potential_page_fault(s); - gen_helper_lctlg(cpu_env, tmp32_1, tmp, tmp32_2); - tcg_temp_free_i64(tmp); - tcg_temp_free_i32(tmp32_1); - tcg_temp_free_i32(tmp32_2); - break; - case 0x25: /* STCTG R1,R3,D2(B2) [RSE] */ - /* Store Control */ - check_privileged(s); - tmp = get_address(s, 0, b2, d2); - tmp32_1 = tcg_const_i32(r1); - tmp32_2 = tcg_const_i32(r3); - potential_page_fault(s); - gen_helper_stctg(cpu_env, tmp32_1, tmp, tmp32_2); - tcg_temp_free_i64(tmp); - tcg_temp_free_i32(tmp32_1); - tcg_temp_free_i32(tmp32_2); - break; -#endif - default: - LOG_DISAS("illegal eb operation 0x%x\n", op); - gen_illegal_opcode(s); - break; - } -} - static void disas_ed(DisasContext *s, int op, int r1, int x2, int b2, int d2, int r1b) { @@ -1961,17 +1920,6 @@ static void disas_s390_insn(DisasContext *s) | ((insn << 4) & 0xff000)) << 12)) >> 12; disas_e3(s, op, r1, x2, b2, d2 ); break; - case 0xeb: - insn = ld_code6(s->pc); - debug_insn(insn); - op = insn & 0xff; - r1 = (insn >> 36) & 0xf; - r3 = (insn >> 32) & 0xf; - b2 = (insn >> 28) & 0xf; - d2 = ((int)((((insn >> 16) & 0xfff) - | ((insn << 4) & 0xff000)) << 12)) >> 12; - disas_eb(s, op, r1, r3, b2, d2); - break; case 0xed: insn = ld_code6(s->pc); debug_insn(insn); @@ -2768,6 +2716,17 @@ static ExitStatus op_lctl(DisasContext *s, DisasOps *o) return NO_EXIT; } +static ExitStatus op_lctlg(DisasContext *s, DisasOps *o) +{ + TCGv_i32 r1 = tcg_const_i32(get_field(s->fields, r1)); + TCGv_i32 r3 = tcg_const_i32(get_field(s->fields, r3)); + check_privileged(s); + potential_page_fault(s); + gen_helper_lctlg(cpu_env, r1, o->in2, r3); + tcg_temp_free_i32(r1); + tcg_temp_free_i32(r3); + return NO_EXIT; +} static ExitStatus op_lra(DisasContext *s, DisasOps *o) { check_privileged(s); @@ -3085,6 +3044,18 @@ static ExitStatus op_stctl(DisasContext *s, DisasOps *o) return NO_EXIT; } +static ExitStatus op_stctg(DisasContext *s, DisasOps *o) +{ + TCGv_i32 r1 = tcg_const_i32(get_field(s->fields, r1)); + TCGv_i32 r3 = tcg_const_i32(get_field(s->fields, r3)); + check_privileged(s); + potential_page_fault(s); + gen_helper_stctg(cpu_env, r1, o->in2, r3); + tcg_temp_free_i32(r1); + tcg_temp_free_i32(r3); + return NO_EXIT; +} + static ExitStatus op_stnsm(DisasContext *s, DisasOps *o) { uint64_t i2 = get_field(s->fields, i2);