From patchwork Sun Sep 9 21:05:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 182714 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 981962C00A0 for ; Mon, 10 Sep 2012 08:55:29 +1000 (EST) Received: from localhost ([::1]:41039 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAqPX-0000uK-R2 for incoming@patchwork.ozlabs.org; Sun, 09 Sep 2012 18:55:27 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAojT-0000Jp-73 for qemu-devel@nongnu.org; Sun, 09 Sep 2012 17:07:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TAojR-0006GK-Pd for qemu-devel@nongnu.org; Sun, 09 Sep 2012 17:07:55 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:59699) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAojR-0005pQ-K0 for qemu-devel@nongnu.org; Sun, 09 Sep 2012 17:07:53 -0400 Received: by mail-pb0-f45.google.com with SMTP id rp12so291958pbb.4 for ; Sun, 09 Sep 2012 14:07:53 -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=G3PF48kasAYzMlnZOpKTx6K0QA1mOZZ4PiAzIc+Fafc=; b=XHH7cPe45kOo1GezTqRgQMj4lmCvALxW74atB3O97hmizi+lCFqqDTDtCwuQAW1z8H tRtMqAuiYEZG0qNvq71iOCTxrOnkrqqO3wkGhVerYHhLMxBWpBmV/XF/Cz/ODGHck9z0 0RnoJBR2JeBylxtiDZjk6+70kiGH9bmZ573hplgQ/FFZp7exsDE+sKz7OS8P2yV1iKN0 fUs4UntP9BvQxcrpgY8115z/Sl/+xiqRbBCkRG9FFiQPNPccYEyT7dBsArBoHigTddiW unFzvJ4U6ALUR1DTTP9rWM+wMAWTJH6Y/YIfATtCFfqbisQs5awNJCjjsQpaqBCDpWkg n36Q== Received: by 10.68.212.70 with SMTP id ni6mr2032866pbc.22.1347224873373; Sun, 09 Sep 2012 14:07:53 -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.52 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Sep 2012 14:07:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 9 Sep 2012 14:05:50 -0700 Message-Id: <1347224784-19472-93-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.160.45 Cc: Alexander Graf Subject: [Qemu-devel] [PATCH 092/126] target-s390: Convert SPT, STPT 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/helper.h | 2 +- target-s390x/insn-data.def | 4 ++++ target-s390x/misc_helper.c | 8 +++----- target-s390x/translate.c | 32 ++++++++++++++------------------ 4 files changed, 22 insertions(+), 24 deletions(-) diff --git a/target-s390x/helper.h b/target-s390x/helper.h index 011e64e..13ceeec 100644 --- a/target-s390x/helper.h +++ b/target-s390x/helper.h @@ -97,7 +97,7 @@ DEF_HELPER_2(stcke, i32, env, i64) DEF_HELPER_FLAGS_2(sckc, TCG_CALL_CONST, void, env, i64) DEF_HELPER_FLAGS_1(stckc, TCG_CALL_CONST, i64, env) DEF_HELPER_FLAGS_2(spt, TCG_CALL_CONST, void, env, i64) -DEF_HELPER_FLAGS_2(stpt, TCG_CALL_CONST, void, env, i64) +DEF_HELPER_FLAGS_1(stpt, TCG_CALL_CONST, i64, env) DEF_HELPER_4(stsi, i32, env, i64, i32, i32) DEF_HELPER_4(lctl, void, env, i32, i64, i32) DEF_HELPER_4(lctlg, void, env, i32, i64, i32) diff --git a/target-s390x/insn-data.def b/target-s390x/insn-data.def index a2b4c73..29b3eb2 100644 --- a/target-s390x/insn-data.def +++ b/target-s390x/insn-data.def @@ -638,6 +638,8 @@ C(0xb204, SCK, S, Z, 0, 0, 0, 0, 0, 0) /* SET CLOCK COMPARATOR */ C(0xb206, SCKC, S, Z, 0, m2_64, 0, 0, sckc, 0) +/* SET CPU TIMER */ + C(0xb208, SPT, S, Z, 0, m2_64, 0, 0, spt, 0) /* SET SYSTEM MASK */ C(0x8000, SSM, S, Z, 0, m2_8u, 0, 0, ssm, 0) /* SIGNAL PROCESSOR */ @@ -652,6 +654,8 @@ C(0xeb25, STCTG, RSY_a, Z, 0, a2, 0, 0, stctg, 0) /* STORE CPU ID */ C(0xb202, STIDP, S, Z, la2, 0, new, m1_64, stidp, 0) +/* STORE CPU TIMER */ + C(0xb209, STPT, S, Z, la2, 0, new, m1_64, stpt, 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/misc_helper.c b/target-s390x/misc_helper.c index bdf3f09..d205259 100644 --- a/target-s390x/misc_helper.c +++ b/target-s390x/misc_helper.c @@ -795,10 +795,8 @@ uint64_t HELPER(stckc)(CPUS390XState *env) } /* Set CPU Timer */ -void HELPER(spt)(CPUS390XState *env, uint64_t a1) +void HELPER(spt)(CPUS390XState *env, uint64_t time) { - uint64_t time = cpu_ldq_data(env, a1); - if (time == -1ULL) { return; } @@ -810,10 +808,10 @@ void HELPER(spt)(CPUS390XState *env, uint64_t a1) } /* Store CPU Timer */ -void HELPER(stpt)(CPUS390XState *env, uint64_t a1) +uint64_t HELPER(stpt)(CPUS390XState *env) { /* XXX implement */ - cpu_stq_data(env, a1, 0); + return 0; } /* Store System Information */ diff --git a/target-s390x/translate.c b/target-s390x/translate.c index bcf0809..2043d6c 100644 --- a/target-s390x/translate.c +++ b/target-s390x/translate.c @@ -1030,24 +1030,6 @@ static void disas_b2(DisasContext *s, int op, uint32_t insn) LOG_DISAS("disas_b2: op 0x%x r1 %d r2 %d\n", op, r1, r2); switch (op) { - case 0x08: /* SPT D2(B2) [S] */ - /* Set CPU Timer */ - check_privileged(s); - decode_rs(s, insn, &r1, &r3, &b2, &d2); - tmp = get_address(s, 0, b2, d2); - potential_page_fault(s); - gen_helper_spt(cpu_env, tmp); - tcg_temp_free_i64(tmp); - break; - case 0x09: /* STPT D2(B2) [S] */ - /* Store CPU Timer */ - check_privileged(s); - decode_rs(s, insn, &r1, &r3, &b2, &d2); - tmp = get_address(s, 0, b2, d2); - potential_page_fault(s); - gen_helper_stpt(cpu_env, tmp); - tcg_temp_free_i64(tmp); - break; case 0x0a: /* SPKA D2(B2) [S] */ /* Set PSW Key from Address */ check_privileged(s); @@ -2889,6 +2871,20 @@ static ExitStatus op_stckc(DisasContext *s, DisasOps *o) return NO_EXIT; } +static ExitStatus op_spt(DisasContext *s, DisasOps *o) +{ + check_privileged(s); + gen_helper_spt(cpu_env, o->in2); + return NO_EXIT; +} + +static ExitStatus op_stpt(DisasContext *s, DisasOps *o) +{ + check_privileged(s); + gen_helper_stpt(o->out, cpu_env); + return NO_EXIT; +} + static ExitStatus op_stnsm(DisasContext *s, DisasOps *o) { uint64_t i2 = get_field(s->fields, i2);