From patchwork Sun Sep 9 21:04:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 182691 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 AB8062C0084 for ; Mon, 10 Sep 2012 08:30:26 +1000 (EST) Received: from localhost ([::1]:58148 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAolv-0003SV-5p for incoming@patchwork.ozlabs.org; Sun, 09 Sep 2012 17:10:27 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAoid-0007PR-H4 for qemu-devel@nongnu.org; Sun, 09 Sep 2012 17:07:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TAoic-0005z8-Aa for qemu-devel@nongnu.org; Sun, 09 Sep 2012 17:07:03 -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 1TAoib-0005pO-WD for qemu-devel@nongnu.org; Sun, 09 Sep 2012 17:07:02 -0400 Received: by mail-pz0-f45.google.com with SMTP id n15so968311dad.4 for ; Sun, 09 Sep 2012 14:07:01 -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=CIr8gbW7TTj4WB0Bxe+RE0i9A7XxNlp6CIOFM13k75A=; b=W6iRsGLxDIA9oU2rG7+WaLzE0oWk0vlSVyqpBPAN89L8ETlm7SpuCn6rq8nfO8B0Re BkAikhVFrNuZodl4WfQ/hx0xrr5aPEG3auUC5iZOhxkFc5CCdwX1i/9bICgn8aw/nwuO Z0LNS3QA7/uf0PmMqsne8IrWLRacI95/TeQuElEdQmQR+UeY/uMAwi7mcFIoAWvyx30z 4J+K3pDnnRRdQc/FWyjhX+H+QfZuDD3XaKd4Jy1K4FPnwdRMQIupxpCzSxLnW1kBA+p5 GVzojmqKpa3dUrGf6IEG1uUGA6DfemUOXyQmTLABdoevGsu8x41i+d3JZBR8SZYUuoEs 2s6g== Received: by 10.66.74.3 with SMTP id p3mr18053953pav.49.1347224821758; Sun, 09 Sep 2012 14:07:01 -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.00 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Sep 2012 14:07:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 9 Sep 2012 14:04:51 -0700 Message-Id: <1347224784-19472-34-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 033/126] target-s390: Convert SUPERVISOR CALL 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 | 3 +++ target-s390x/translate.c | 34 +++++++++++++++++++--------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/target-s390x/insn-data.def b/target-s390x/insn-data.def index 267050f..ab014ff 100644 --- a/target-s390x/insn-data.def +++ b/target-s390x/insn-data.def @@ -337,6 +337,9 @@ C(0xe399, SLB, RXY_a, Z, r1, m2_32u, new, r1_32, subb, subb32) C(0xe389, SLBG, RXY_a, Z, r1, m2_64, r1, 0, subb, subb64) +/* SUPERVISOR CALL */ + C(0x0a00, SVC, I, Z, 0, 0, 0, 0, svc, 0) + /* TEST UNDER MASK */ C(0x9100, TM, SI, Z, m1_8u, i2_8u, 0, 0, 0, tm32) C(0xeb51, TMY, SIY, LD, m1_8u, i2_8u, 0, 0, 0, tm32) diff --git a/target-s390x/translate.c b/target-s390x/translate.c index ccba739..00b6266 100644 --- a/target-s390x/translate.c +++ b/target-s390x/translate.c @@ -2364,21 +2364,6 @@ static void disas_s390_insn(DisasContext *s) LOG_DISAS("opc 0x%x\n", opc); switch (opc) { - case 0xa: /* SVC I [RR] */ - insn = ld_code2(s->pc); - debug_insn(insn); - i = insn & 0xff; - update_psw_addr(s); - gen_op_calc_cc(s); - tmp32_1 = tcg_const_i32(i); - tmp32_2 = tcg_const_i32(s->next_pc - s->pc); - tcg_gen_st_i32(tmp32_1, cpu_env, offsetof(CPUS390XState, int_svc_code)); - tcg_gen_st_i32(tmp32_2, cpu_env, offsetof(CPUS390XState, int_svc_ilc)); - gen_exception(EXCP_SVC); - s->is_jmp = DISAS_EXCP; - tcg_temp_free_i32(tmp32_1); - tcg_temp_free_i32(tmp32_2); - break; case 0xe: /* MVCL R1,R2 [RR] */ insn = ld_code2(s->pc); decode_rr(s, insn, &r1, &r2); @@ -3664,6 +3649,25 @@ static ExitStatus op_subb(DisasContext *s, DisasOps *o) return NO_EXIT; } +static ExitStatus op_svc(DisasContext *s, DisasOps *o) +{ + TCGv_i32 t; + + update_psw_addr(s); + gen_op_calc_cc(s); + + t = tcg_const_i32(get_field(s->fields, i1) & 0xff); + tcg_gen_st_i32(t, cpu_env, offsetof(CPUS390XState, int_svc_code)); + tcg_temp_free_i32(t); + + t = tcg_const_i32(s->next_pc - s->pc); + tcg_gen_st_i32(t, cpu_env, offsetof(CPUS390XState, int_svc_ilc)); + tcg_temp_free_i32(t); + + gen_exception(EXCP_SVC); + return EXIT_NORETURN; +} + static ExitStatus op_xor(DisasContext *s, DisasOps *o) { tcg_gen_xor_i64(o->out, o->in1, o->in2);