From patchwork Thu Sep 27 23:42:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 187563 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 B6F8D2C00B7 for ; Fri, 28 Sep 2012 09:42:58 +1000 (EST) Received: from localhost ([::1]:51120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THNjM-00023m-Td for incoming@patchwork.ozlabs.org; Thu, 27 Sep 2012 19:42:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THNjG-00022t-0e for qemu-devel@nongnu.org; Thu, 27 Sep 2012 19:42:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THNjE-0006Ym-SV for qemu-devel@nongnu.org; Thu, 27 Sep 2012 19:42:49 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:33952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THNjE-0006Yh-Lx for qemu-devel@nongnu.org; Thu, 27 Sep 2012 19:42:48 -0400 Received: by pbbrp2 with SMTP id rp2so4317739pbb.4 for ; Thu, 27 Sep 2012 16:42:48 -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=Yvl1ZQT1ue2UO6gKEY8GC/jT2y/H1P2N9qEzPNdavJY=; b=gNj1D2HTxxAabuTSYc5xAWSVrrV4rsa5XhPOfPoB6EiRR9LUTtEYZuJ5IeTLZu5KVY RKjJcl7ISfeTfo1oRtgLGK5UnTnMaQ4W4o6RHKzzQbixfetXplgJ17oGRtLmAKjeDYHn 0YSUo2vSQRmujMWqxdvQMQZJ3MKCoejDNf1wGsj1RAowAZhnjuI4wYUlRDQr0vm1tJoT mWnil3eMFERZOoNED0xCWWx2Tmm1sfOAoKWS7N4ptS63b4XhMNV4QaEV9PXKWn586nu2 SclkrA7nU/Fr+Vnq5sn86V6gjM6WX6DyR5BqXWPfTBN1mSuZrdJlKp3wNCZtI1vjPjZG mukw== Received: by 10.68.138.163 with SMTP id qr3mr15457668pbb.161.1348789367961; Thu, 27 Sep 2012 16:42:47 -0700 (PDT) Received: from anchor.twiddle.home.com ([173.160.232.49]) by mx.google.com with ESMTPS id y5sm4441638pav.36.2012.09.27.16.42.47 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 16:42:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 27 Sep 2012 16:42:44 -0700 Message-Id: <1348789364-24843-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 051/147] target-s390: Convert DIAGNOSE 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 | 33 ++++++++++++++++----------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/target-s390x/insn-data.def b/target-s390x/insn-data.def index b0bee9b..0a0ec0a 100644 --- a/target-s390x/insn-data.def +++ b/target-s390x/insn-data.def @@ -379,6 +379,8 @@ D(0xa701, TMLL, RI_a, Z, r1_o, i2_16u_shl, 0, 0, 0, tm64, 0) #ifndef CONFIG_USER_ONLY +/* DIAGNOSE (KVM hypercall) */ + 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) /* SET ADDRESSING MODE */ diff --git a/target-s390x/translate.c b/target-s390x/translate.c index ea876a0..49e3599 100644 --- a/target-s390x/translate.c +++ b/target-s390x/translate.c @@ -2355,23 +2355,6 @@ static void disas_s390_insn(CPUS390XState *env, DisasContext *s) LOG_DISAS("opc 0x%x\n", opc); switch (opc) { -#ifndef CONFIG_USER_ONLY - case 0x83: /* DIAG R1,R3,D2 [RS] */ - /* Diagnose call (KVM hypercall) */ - check_privileged(s); - potential_page_fault(s); - insn = ld_code4(env, s->pc); - decode_rs(s, insn, &r1, &r3, &b2, &d2); - tmp32_1 = tcg_const_i32(insn & 0xfff); - tmp2 = load_reg(2); - tmp3 = load_reg(1); - gen_helper_diag(tmp2, cpu_env, tmp32_1, tmp2, tmp3); - store_reg(2, tmp2); - tcg_temp_free_i32(tmp32_1); - tcg_temp_free_i64(tmp2); - tcg_temp_free_i64(tmp3); - break; -#endif case 0x88: /* SRL R1,D2(B2) [RS] */ case 0x89: /* SLL R1,D2(B2) [RS] */ case 0x8a: /* SRA R1,D2(B2) [RS] */ @@ -3327,6 +3310,22 @@ static ExitStatus op_cvd(DisasContext *s, DisasOps *o) return NO_EXIT; } +#ifndef CONFIG_USER_ONLY +static ExitStatus op_diag(DisasContext *s, DisasOps *o) +{ + TCGv_i32 tmp; + + check_privileged(s); + potential_page_fault(s); + + /* We pretend the format is RX_a so that D2 is the field we want. */ + tmp = tcg_const_i32(get_field(s->fields, d2) & 0xfff); + gen_helper_diag(regs[2], cpu_env, tmp, regs[2], regs[1]); + tcg_temp_free_i32(tmp); + return NO_EXIT; +} +#endif + static ExitStatus op_divs32(DisasContext *s, DisasOps *o) { gen_helper_divs32(o->out2, cpu_env, o->in1, o->in2);