From patchwork Sun Sep 9 21:05:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 182697 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 A7CC02C009D for ; Mon, 10 Sep 2012 08:36:21 +1000 (EST) Received: from localhost ([::1]:42687 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAq71-0001oQ-Pn for incoming@patchwork.ozlabs.org; Sun, 09 Sep 2012 18:36:19 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAoin-0007sV-AM for qemu-devel@nongnu.org; Sun, 09 Sep 2012 17:07:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TAoil-00062b-QP for qemu-devel@nongnu.org; Sun, 09 Sep 2012 17:07:13 -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 1TAoil-0005pO-KH for qemu-devel@nongnu.org; Sun, 09 Sep 2012 17:07:11 -0400 Received: by mail-pz0-f45.google.com with SMTP id n15so968311dad.4 for ; Sun, 09 Sep 2012 14:07:11 -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=zwvt9rtF+AJEx7pzLOcFicXIRhFV8d57g5mKfXw0iB0=; b=pixaFYNRNYjC9q5QUEVAXj+FklW9sMaFVbj5oiBzZQRGnV/GW/rDc6tIJuAVo7srfg +PAWXbZOI6wK7RwLeMgWnMS/p78QgKTf87Gk1GSKRLo7oQ3pJwjA0SSMTcuDLSloXEji sppeTggOHWTrXOpiwhwwM7fmHrIssZhSKJuaWzJ0BiT4s0Y0HyM0/LQ05fh1g2Rt6JQr lJoCr5nO8Z5Lw+XYaS5AYxw5dFGxyUqVbvYPHbc7xmHKOEPb9fzomNyWZxk6lIvt1Ygn RNrFNFVgYgoS4FY42yvNKJ7MHPhC5nuT09kyPIs/IS7zNgngEmVCh7b2Gqa/SCEVHsxn 3OvQ== Received: by 10.66.85.71 with SMTP id f7mr18279400paz.5.1347224831372; Sun, 09 Sep 2012 14:07:11 -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.10 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Sep 2012 14:07:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 9 Sep 2012 14:05:02 -0700 Message-Id: <1347224784-19472-45-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 044/126] 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 f2ad737..ba9f094 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 8d285ee..d2e7a22 100644 --- a/target-s390x/translate.c +++ b/target-s390x/translate.c @@ -2348,23 +2348,6 @@ static void disas_s390_insn(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(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] */ @@ -3276,6 +3259,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);