From patchwork Mon Apr 1 10:29:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 161528 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp279514jan; Mon, 1 Apr 2019 03:32:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxd9jgI7WukYodVSGa5uyzk1709UKSZLjnS/qfEf3vTG+GFLSWukGU7D0uTXlFFysHaFmz5 X-Received: by 2002:a25:3583:: with SMTP id c125mr13849371yba.387.1554114766490; Mon, 01 Apr 2019 03:32:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554114766; cv=none; d=google.com; s=arc-20160816; b=dhCQktPC0yX/CE81q+x2xADAAFHRFIys5nYs9e1oR2HVFYfVtu563M6qt3r9RVdpJc CV7ZioV/mnfeHY4I6cWisrwdjOXijP8bWtmKx8AOze6fNuRuMKgUzQxlniB/19hxz6YD oSGgOwRDGpE9aGPoFnFnGFdvbR0a2mloUKZNY+yo8wXv6R396FC5wfWZc+IPm4s1gVQg Z0tTAI5nPlm8wvyEQnOdUOWnPBtHQ6YteViKml55ekJTmyoXzKPCVGNq5LUQgOJMDVpP osW3pr06uGNF2k2az+tXRskf1/3b9/55iGYY05019MTx7OuBocoDmHskQSufDGe2f7GP ecAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=Yz8DAxsrRXzHRxEOLvSMklz9lTz3OIJJsST46IFWOXk=; b=srHsmf0zX4ltZSfjtm37R2YUPsFICs66sqEF3HV0jduFbF1yB7b0hYrLQqhCaVHhkp 7RJrcUCCmJWGoAA4afDSjEZA0nxR1bS0yogc1cH7BSJ4PyZaQ7b6MUsrdERnN3kb7RQO toS9L2lN8lUZFiOsmXhaNzbUHDgxDhYkt5hJi4+eOqPR77+6SetEegX7jFAU+TFCXTM9 yQaskqk2KKpJMe/vFPPblCms+MYDsQdkiaIscW018A/fXB1ZkwjZ/bEQ4t+ahptcjkzN S3vKRp/a12T5XEo1JW12Tywx6BUjGHcQ/+1wLNcBulNkLO6s9WJVmUKYo+nL3MGkPtCw GXHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Y47DSz/w"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f8si6324378ywa.411.2019.04.01.03.32.46 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 03:32:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Y47DSz/w"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:55882 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAuFC-0005z8-1j for patch@linaro.org; Mon, 01 Apr 2019 06:32:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAuBv-0003Hs-FB for qemu-devel@nongnu.org; Mon, 01 Apr 2019 06:29:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hAuBu-0005qg-7W for qemu-devel@nongnu.org; Mon, 01 Apr 2019 06:29:23 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:34143) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hAuBu-0005qB-1K for qemu-devel@nongnu.org; Mon, 01 Apr 2019 06:29:22 -0400 Received: by mail-pg1-x543.google.com with SMTP id v12so4557052pgq.1 for ; Mon, 01 Apr 2019 03:29:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Yz8DAxsrRXzHRxEOLvSMklz9lTz3OIJJsST46IFWOXk=; b=Y47DSz/wvU1QWU3Q4tjcTCYMBTRi1SdQPlfAlwUzid7VuYJPFlhv2whxqYUkD0LltC Nnq6HImQWAoWbvgAvEPfEjFKtJZPx9rberpLEtTeBfwKOzkMe5D4BIkKBlclIsguaNPq 0Ybsz7mQ2OhE1xThT04CY03n5UQD0zi/03hkY9gDP8RZn2FR2ZUi0tqLqlDN4ve6WgAN oC46LrzGHRb/yRIK/Kr9VHpnoEmc15f2v1PLk7b5q4CDLn3gF3GvRTwj56Iec7NJv2cd GdGqIhyi0RRxT2VPwo5fp+bOWeYgbLNwkj0sngy4LCQoJtRvW1rAK5aZlRWL27JyArBC yiPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Yz8DAxsrRXzHRxEOLvSMklz9lTz3OIJJsST46IFWOXk=; b=ZoTI53NVfgoH0w2XpBHIK5K3sNOq7AF/xsU5IRIrd0Rds2jfa7elV0sYkEHSdEr1Zb ZLTRgFJ7dZXpysuOsO5OTM/tGUcTR/Ete+/7hD28wb+EUQfycHR/GfPdKLCNShUBA/bI 7zp4cjErPzcju8xlen4Bt20IyIbFN+qLuHOE+Gep+aNMkZ65HJ1uO8ib4jQh9LHCiWzg 0AZGEa4KcMXcHkZv2l0Re7jb1dPgZrorOA2FOqTEuO4f2WDZO5m+qffj67XoDJ8Ab/0K IeoYVaX3V15EGO7cIL3cy8HqkQW66waKNU50z+26hnqF6UHvJ544wu8r26YXD99Zycvk 9WjA== X-Gm-Message-State: APjAAAVuNcQe2JB4LqHYnh+RSAmbJf+LcLcG9qo7IGL7oGgNk6b+px+B Dy4FHgIGwZ8ZmJgoIEEedOZSGfqPjJfyyw== X-Received: by 2002:a65:5b44:: with SMTP id y4mr42830088pgr.446.1554114560556; Mon, 01 Apr 2019 03:29:20 -0700 (PDT) Received: from cloudburst.imgcgcw.net ([147.50.13.10]) by smtp.gmail.com with ESMTPSA id c134sm20048203pfc.87.2019.04.01.03.29.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Apr 2019 03:29:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 17:29:06 +0700 Message-Id: <20190401102911.8685-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401102911.8685-1-richard.henderson@linaro.org> References: <20190401102911.8685-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::543 Subject: [Qemu-devel] [PATCH for-4.1 1/6] target/s390x: Truncate 32-bit psw_addr before creating TB X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-s390x@nongnu.org, cohuck@redhat.com, david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" If, somehow, the psw_addr is out of range, truncate early rather than after we get into gen_intermediate_code. Signed-off-by: Richard Henderson --- target/s390x/cpu.h | 26 +++++++++++++++++++------- target/s390x/translate.c | 6 ------ 2 files changed, 19 insertions(+), 13 deletions(-) -- 2.17.1 Reviewed-by: David Hildenbrand diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index cb6d77053a..6ccf41fc45 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -368,18 +368,30 @@ static inline int cpu_mmu_index(CPUS390XState *env, bool ifetch) } } -static inline void cpu_get_tb_cpu_state(CPUS390XState* env, target_ulong *pc, - target_ulong *cs_base, uint32_t *flags) +static inline void cpu_get_tb_cpu_state(CPUS390XState* env, + target_ulong *p_pc, + target_ulong *cs_base, + uint32_t *p_flags) { - *pc = env->psw.addr; - *cs_base = env->ex_value; - *flags = (env->psw.mask >> FLAG_MASK_PSW_SHIFT) & FLAG_MASK_PSW; + uint32_t flags; + uint64_t pc; + + flags = (env->psw.mask >> FLAG_MASK_PSW_SHIFT) & FLAG_MASK_PSW; if (env->cregs[0] & CR0_AFP) { - *flags |= FLAG_MASK_AFP; + flags |= FLAG_MASK_AFP; } if (env->cregs[0] & CR0_VECTOR) { - *flags |= FLAG_MASK_VECTOR; + flags |= FLAG_MASK_VECTOR; } + + pc = env->psw.addr; + if (!(flags & FLAG_MASK_64)) { + pc &= 0x7fffffff; + } + + *p_pc = pc; + *cs_base = env->ex_value; + *p_flags = flags; } /* PER bits from control register 9 */ diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 0afa8f7ca5..d22d0f7643 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -6442,12 +6442,6 @@ static void s390x_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) { DisasContext *dc = container_of(dcbase, DisasContext, base); - /* 31-bit mode */ - if (!(dc->base.tb->flags & FLAG_MASK_64)) { - dc->base.pc_first &= 0x7fffffff; - dc->base.pc_next = dc->base.pc_first; - } - dc->cc_op = CC_OP_DYNAMIC; dc->ex_value = dc->base.tb->cs_base; dc->do_debug = dc->base.singlestep_enabled; From patchwork Mon Apr 1 10:29:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 161532 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp282091jan; Mon, 1 Apr 2019 03:35:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqqdWi/Ha0oliG3caCbop3RW5IfjHhTPW+NpsVwHWIDr6TxC5qVkZ19X5ko7GZWgSkNvPz X-Received: by 2002:a81:9982:: with SMTP id q124mr51839681ywg.390.1554114919433; Mon, 01 Apr 2019 03:35:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554114919; cv=none; d=google.com; s=arc-20160816; b=MCpvTWUa58XGGW3RmZZfH9pLKeYTs9IlN/Sdnz62MU0297WbpnJbJB8Yf2hkxhQfjV TsmCKbqb/S6PbeobWgKZ8CPAVLQ7QKxjvupuqPBpLwil2b76f+xQgPQD52uJkgK5IMQo ZzRw0WpWRlDhYkUQpjdSUmxNiku/W2J182gc5HcBlaVj1J0HkGRtonSKB1iNnsUZfP93 PH3QSUicab0YimBx70XT9e5YJpdhERjVavp9l/iO9Y8ZlNbddzFmfnKNxGtwjsBilYOR v/vJ2twqKyv+QOnRInbYzFzdpJd8GK2yX3IdHvBEH/uLcvPSLfgbzNav2VlGRDVvirbw VK2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=DkfMTjWk07PiP5fZQCny13Xy5ICPwt1EBc+DLoGeLtk=; b=uRlfRmaTW37F/dXtT/YJn9ii4EKdLxYnBew/VkvNOramzSFj3vS0lN5cZUutnMM6hg Vx3xqPnIVnHfkf1dS2OZiuxBU97+8JIaVjNIsMAdy9VzALgUfccQS+TuvelXOpP4FpRh /MlQVEj8bUTseZhyRFt2a7jJruiqmg16/loR2EcOvuuftc5E5D+B2hgIGP/t9VvNykZH ImfZTrKwtfRpJvJXz79O2gxyqTa2G7xKaO14lZiHDH7BHHoqkpCYiFaFTkMLGZ3Nv3nE /rRVtT7JTm2Mkg94lh+UsPcB1wETJfnVdgjHNgw157mhFIlsYIDVCmGr7ki/dbQDIa2m URgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FPjW9UfY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u18si5782292ywu.334.2019.04.01.03.35.19 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 03:35:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FPjW9UfY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:56508 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAuHe-000879-Ta for patch@linaro.org; Mon, 01 Apr 2019 06:35:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAuBy-0003LW-1i for qemu-devel@nongnu.org; Mon, 01 Apr 2019 06:29:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hAuBw-0005s4-QM for qemu-devel@nongnu.org; Mon, 01 Apr 2019 06:29:26 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:36144) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hAuBw-0005rf-K1 for qemu-devel@nongnu.org; Mon, 01 Apr 2019 06:29:24 -0400 Received: by mail-pf1-x441.google.com with SMTP id z5so3326264pfn.3 for ; Mon, 01 Apr 2019 03:29:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DkfMTjWk07PiP5fZQCny13Xy5ICPwt1EBc+DLoGeLtk=; b=FPjW9UfY7KAK1XY6aZ6BxeeGjR8Qd8qBJdn3hEiG0OIdaVAt2x4JHjQvzzyKfuKERO 9r4v+wjIGmVqZPjrmWmM4spBVuih1bXvVH3ewCB8jLTiAR4fbQVtImoJnapKutdro6d1 9xlVQm8Mdowao+PJBZAsFZayQay0SCDxKJQs8pjzd8xalygRBwvDzulVyNULnEJ3MnDO mNNArm/S3OGSxN8R38rlGy3Jh1uyPzVSV/tVbqWABW8rcMCat4MDIdwthlA9mPrU9bkU daU18YatjrbB/+dSryyxUnxDrB337uWZ2oTVnrsJfpDw6r1ddQqTX2sEkPQWn9gYOd1M cvcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DkfMTjWk07PiP5fZQCny13Xy5ICPwt1EBc+DLoGeLtk=; b=sSRaVGYJjo2rTtJSLpFHtVmfeo89vn1Vy0+S803p0d0r3NGEwPOc5GmQGFuIl9q5iF lxJsEP+pEcZLWqHBNaEnHXt8Z2jB6FjP9FtkpvChD3kl/b/8XApoJ9i9e9u8OyQH7DsZ EUaKW6yUNyn26fwxu6kYhjDqVUvQcML95ZAh+v6TXYA6hgSiDi69SLG97eTwLf1+9ttg z1PLK1bgXYQDZTbTH0Xs0SrbJEL1H/wCbLQhJl0ZAvJJfYdKT3ab5qVizAf+tGSBxQsV XTO9/KtfeylSmP5R2h+8Y0e93XAAeTpuPZ0Ul4VL1TsarKx/YXVElNz44+QyqGcsU4W0 vNHg== X-Gm-Message-State: APjAAAXxcmnzKeNqfJXH62amJTMdJGX1+L+cLHXHQYHBvfGmjadWVMtI bbPC/sUwgSAXmFIG0tQunX8HlQI3hJwmnQ== X-Received: by 2002:a65:51c8:: with SMTP id i8mr9751852pgq.175.1554114563359; Mon, 01 Apr 2019 03:29:23 -0700 (PDT) Received: from cloudburst.imgcgcw.net ([147.50.13.10]) by smtp.gmail.com with ESMTPSA id c134sm20048203pfc.87.2019.04.01.03.29.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Apr 2019 03:29:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 17:29:07 +0700 Message-Id: <20190401102911.8685-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401102911.8685-1-richard.henderson@linaro.org> References: <20190401102911.8685-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::441 Subject: [Qemu-devel] [PATCH for-4.1 2/6] target/s390x: Add ilen to unwind data X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-s390x@nongnu.org, cohuck@redhat.com, Richard Henderson , david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Use ILEN_UNWIND to signal that we have in fact that cpu_restore_state will have been called by the time we arrive in do_program_interrupt. Signed-off-by: Richard Henderson --- target/s390x/cpu.h | 4 +++- target/s390x/internal.h | 2 +- target/s390x/interrupt.c | 7 +++++-- target/s390x/translate.c | 10 +++++++++- 4 files changed, 18 insertions(+), 5 deletions(-) -- 2.17.1 Reviewed-by: David Hildenbrand diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 6ccf41fc45..1498f3b7f4 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -44,7 +44,7 @@ #include "exec/cpu-all.h" #define NB_MMU_MODES 4 -#define TARGET_INSN_START_EXTRA_WORDS 1 +#define TARGET_INSN_START_EXTRA_WORDS 2 #define MMU_MODE0_SUFFIX _primary #define MMU_MODE1_SUFFIX _secondary @@ -787,6 +787,8 @@ int cpu_s390x_signal_handler(int host_signum, void *pinfo, void *puc); void s390_crw_mchk(void); void s390_io_interrupt(uint16_t subchannel_id, uint16_t subchannel_nr, uint32_t io_int_parm, uint32_t io_int_word); +/* instruction length set by unwind info */ +#define ILEN_UNWIND 0 /* automatically detect the instruction length */ #define ILEN_AUTO 0xff #define RA_IGNORED 0 diff --git a/target/s390x/internal.h b/target/s390x/internal.h index 3b4855c175..5f7901da5e 100644 --- a/target/s390x/internal.h +++ b/target/s390x/internal.h @@ -312,7 +312,7 @@ void cpu_unmap_lowcore(LowCore *lowcore); /* interrupt.c */ -void trigger_pgm_exception(CPUS390XState *env, uint32_t code, uint32_t ilen); +void trigger_pgm_exception(CPUS390XState *env, uint32_t code, int ilen); void cpu_inject_clock_comparator(S390CPU *cpu); void cpu_inject_cpu_timer(S390CPU *cpu); void cpu_inject_emergency_signal(S390CPU *cpu, uint16_t src_cpu_addr); diff --git a/target/s390x/interrupt.c b/target/s390x/interrupt.c index a17eff5ebc..901cd713de 100644 --- a/target/s390x/interrupt.c +++ b/target/s390x/interrupt.c @@ -21,13 +21,16 @@ #endif /* Ensure to exit the TB after this call! */ -void trigger_pgm_exception(CPUS390XState *env, uint32_t code, uint32_t ilen) +void trigger_pgm_exception(CPUS390XState *env, uint32_t code, int ilen) { CPUState *cs = CPU(s390_env_get_cpu(env)); cs->exception_index = EXCP_PGM; env->int_pgm_code = code; - env->int_pgm_ilen = ilen; + /* If ILEN_UNWIND, int_pgm_ilen already has the correct value. */ + if (ilen != ILEN_UNWIND) { + env->int_pgm_ilen = ilen; + } } void s390_program_interrupt(CPUS390XState *env, uint32_t code, int ilen, diff --git a/target/s390x/translate.c b/target/s390x/translate.c index d22d0f7643..6f9cd19126 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -57,6 +57,7 @@ struct DisasContext { DisasContextBase base; const DisasInsn *insn; DisasFields *fields; + TCGOp *insn_start; uint64_t ex_value; /* * During translate_one(), pc_tmp is used to determine the instruction @@ -6220,6 +6221,7 @@ static const DisasInsn *extract_insn(CPUS390XState *env, DisasContext *s, } s->pc_tmp = s->base.pc_next + ilen; s->ilen = ilen; + tcg_set_insn_param(s->insn_start, 2, ilen); /* We can't actually determine the insn format until we've looked up the full insn opcode. Which we can't do without locating the @@ -6455,7 +6457,12 @@ static void s390x_tr_insn_start(DisasContextBase *dcbase, CPUState *cs) { DisasContext *dc = container_of(dcbase, DisasContext, base); - tcg_gen_insn_start(dc->base.pc_next, dc->cc_op); + /* + * ??? Alternately, delay emitting insn_start until after we + * have computed the insn length in extract_insn. + */ + tcg_gen_insn_start(dc->base.pc_next, dc->cc_op, 0); + dc->insn_start = tcg_last_op(); } static bool s390x_tr_breakpoint_check(DisasContextBase *dcbase, CPUState *cs, @@ -6561,4 +6568,5 @@ void restore_state_to_opc(CPUS390XState *env, TranslationBlock *tb, if ((cc_op != CC_OP_DYNAMIC) && (cc_op != CC_OP_STATIC)) { env->cc_op = cc_op; } + env->int_pgm_ilen = data[2]; } From patchwork Mon Apr 1 10:29:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 161531 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp281944jan; Mon, 1 Apr 2019 03:35:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqznNOUJRaD49zkcHFvX9Oijq35f+Xtoy0t2nmiB1SkIYYgTqYg+h8nbkFavgp14L+Zdr+yh X-Received: by 2002:a0d:ee41:: with SMTP id x62mr50966902ywe.58.1554114910941; Mon, 01 Apr 2019 03:35:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554114910; cv=none; d=google.com; s=arc-20160816; b=a/4GJonCHKhVryGpbV+CldzaeY2feRxn6P8ZhqLMp2YiHEMf8pNZWWaECIBpfAn67d nL4OeVKiWvQmz/2RGaBbEHwEMMQLnEF3WARVKSVbJTuN7lMbGblv9qPcLYDl6AMrklNA AZILtyEtUuhOxbz4JKM/AC/2mdnUa3kaZJYKkZjqZQdyZpHfBmAxCrGgksmKqHiNo3Pt rO/Gd4B1g80SZkjqYlvVGecmdrxUw9rmbKw+fjMQT4p8mfNVxZtZVJ+2w5k7sagHWiqX qye/WNho3J0nWWOaOYMDR4IwrVHLS1hIgETimdky+Nqf76NjM9PFRKFznfnX9+ZtiE9H twfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=Jp1/VUgyjqrL8dxRFSOofHTbpcGwFWwuHNUvyQPNYt0=; b=DOPjbq2/B9xi/8INQGKN513McJ37Hy87R4bpnX/Nupui+dCZS1oPvRgFhLGxw3eZpN KV76UhXkfQrbSrrv2iN1U4NZAs3keDOfhIVZqO+ZkuEO94fgL/itmJTJoTPahS+79crl zBqIqqA/AiVO37aes0Gqqe0N/5L2CKo3RQkINoYRc9LhPCJZT0XKaY6fh/Nmh7/KjccZ jwDhXbXXncHDZQ6pmkZuaTaftApUTJc0Xt6P7SVw/MCuuVYpdxYNPxOydAZ7BszhZBTq 4tk4DseK61yRTG98hcIyLakKe3FtCtjjKETsPQnI7HX+NwwBc8nAsPzhh2QbHttIioL9 8Elw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IoVWgxEs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 145si5852209ywe.301.2019.04.01.03.35.10 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 03:35:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IoVWgxEs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:56469 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAuHW-0007zm-Hs for patch@linaro.org; Mon, 01 Apr 2019 06:35:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAuC0-0003QX-4u for qemu-devel@nongnu.org; Mon, 01 Apr 2019 06:29:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hAuBz-0005ua-9g for qemu-devel@nongnu.org; Mon, 01 Apr 2019 06:29:28 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:43375) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hAuBz-0005uF-3w for qemu-devel@nongnu.org; Mon, 01 Apr 2019 06:29:27 -0400 Received: by mail-pg1-x543.google.com with SMTP id z9so4534228pgu.10 for ; Mon, 01 Apr 2019 03:29:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Jp1/VUgyjqrL8dxRFSOofHTbpcGwFWwuHNUvyQPNYt0=; b=IoVWgxEs0IKcFJUxCYPjxadjF8wD2G7n+K66JhrzMeGdu1tdjMuaW7tWpHJ9Dj2/zX gaQMUZeEndfAZ3hbwxKdSd/Xt+/h7h6c2sAr59qjBsMeTo/XoLVNa1HFh7FQ1kggMd60 cvW9NAhl/pAV82FtIJA2RgHVH9R2Oe11Kr0bNqBKUiEfm0A9JYODY/nldWQV+nsqHhdi fGdcoxRRSM1/arC0ukgztwdWKneX1MSoYh+5AFk/eY8iWKwkIyCMxfOQdSwdxMC6UFdy TF+GPjlwkZPoZv93J9ABuvGZrYjA3kGSEfxVqL96hCo1oKr5YG/jvKzxTU+pF9e67ZE9 EOQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Jp1/VUgyjqrL8dxRFSOofHTbpcGwFWwuHNUvyQPNYt0=; b=G7c5Mz/ZpBcH0XU+I+XTXJqWqP4krJ7Fe4ijGl0z+crIgjsFvPja4XA9H1yZ04CbFl YF4gQi/ePGu14RZt21hFRLp7pzGURs+r1aqx7NxcFZznEldKI/w3/LeK0/tu3DvQXi5B eFGU4LmEK4Yr4T+l8MBlbO4KmTSztC6GK0+DpcdWv2K7na4ehdz2j3c2xl8xFzCpN62A U9845ks/3CZdE2evdORQuaPMB4k3rDg7jxHBgWObLHSJLSQAXit7UBdq94aPbMSEonwP 39zkDACJ3X5Ms4K1bYfjwgsewj9mT0dQuYSI1zpJfY+xZ8gtDRWZ/pg6k8180xhf0adU 21Wg== X-Gm-Message-State: APjAAAVt2Eo9qZihaCU9oX7EbMxddPpV7uZPYw5F6srn2OgclTtgMBz/ wnMrIosRpERkB38hldX7b9+isbVSfBdPEw== X-Received: by 2002:a63:ed11:: with SMTP id d17mr59776213pgi.211.1554114565973; Mon, 01 Apr 2019 03:29:25 -0700 (PDT) Received: from cloudburst.imgcgcw.net ([147.50.13.10]) by smtp.gmail.com with ESMTPSA id c134sm20048203pfc.87.2019.04.01.03.29.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Apr 2019 03:29:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 17:29:08 +0700 Message-Id: <20190401102911.8685-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401102911.8685-1-richard.henderson@linaro.org> References: <20190401102911.8685-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::543 Subject: [Qemu-devel] [PATCH for-4.1 3/6] target/s390x: Use ilen from unwind in tlb_fill X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-s390x@nongnu.org, cohuck@redhat.com, Richard Henderson , david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson --- target/s390x/mem_helper.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index 3f76a8abfd..838c32fc96 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -44,7 +44,20 @@ void tlb_fill(CPUState *cs, target_ulong addr, int size, { int ret = s390_cpu_handle_mmu_fault(cs, addr, size, access_type, mmu_idx); if (unlikely(ret != 0)) { - cpu_loop_exit_restore(cs, retaddr); + cpu_restore_state(cs, retaddr, true); + + /* + * Note that handle_mmu_fault sets ilen to either 2 (for code) + * or AUTO (for data). We can resolve AUTO now, as if it was + * set to UNWIND -- that will have been done via assignment + * in cpu_restore_state. Otherwise re-examine access_type. + */ + if (access_type == MMU_INST_FETCH) { + CPUS390XState *env = cs->env_ptr; + env->int_pgm_ilen = 2; + } + + cpu_loop_exit(cs); } } From patchwork Mon Apr 1 10:29:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 161533 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp283557jan; Mon, 1 Apr 2019 03:36:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEkJH45zd5NHEWgrUeaa8lUGBVCTQqkk85tqS8pFMcZZgWZXIrlfqrcoHL/hD99UFwr+ks X-Received: by 2002:a0d:dd50:: with SMTP id g77mr50731824ywe.309.1554115016336; Mon, 01 Apr 2019 03:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554115016; cv=none; d=google.com; s=arc-20160816; b=nayBRUsFDeH0TkFSv9ck6wDfdjgAt6NoRfdYtGgdib7CwcnzemvoSm2HCymFVHyreI bZacQYZx6ATVF+hFmzFIt8y+NGUb/SqMYB6pjZxnIDLVhz/ZkhPlJkK6we6pjwpe/1Kw VkVnVMbr8isc6kPKBXOBsDwwGCkVRAW6hK41peu6drB5WYUjaIPdvDntRIt3gqEjan7p blw7o7mYrV5CQB4XGYkoEiK/BK9DQni5QkAvKyuWuwez8lgbJrkx4qug2evU1L32ohUN KiujeOg4bjOosoI7MB5M23fr+N5R/mUssL/ncPMMsq9pNSTf5WzQPggyeJVlXM/kVj8G axtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=9Mhum0qrevd5IF4CeetlRqrhth82koesUwWb3BUb1N0=; b=I4Y/uq/MMm2K7K4lL0dsqlXOH1pFq3GJPzg057ZFBuAR6tC3zWo7R/VOAEcNxOsuCY 0T0BgNsnr5SJby7dqJfkBtGVKEnr+Z25eaMH7Sg7rgv8flx6RMB9SvZW+UzydWOpQNnU XRbsEbEOMYCj1ZAus0LATJhFzwI0f9NtxHG2OctRlP1q7mLDcUpgnBJbT2p8cvJ1/FLa S8qIBITOw0q8xSfNngjBeCXcnb6xM260eOs7Y9f8Ca9Y/zRvTunuP0SJZzSy+K8nxtMY ebDkAjReDKyGxJIBGhfKvuVMJWHOrX4tSWQL5poH6T7GPn3KwpMgZnvN6IfM7BJVj/vY xbEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iEnRXyCe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e65si546812ybb.222.2019.04.01.03.36.56 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 03:36:56 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iEnRXyCe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:56945 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAuJD-00018w-Re for patch@linaro.org; Mon, 01 Apr 2019 06:36:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAuC3-0003VN-PT for qemu-devel@nongnu.org; Mon, 01 Apr 2019 06:29:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hAuC2-0005vn-1Y for qemu-devel@nongnu.org; Mon, 01 Apr 2019 06:29:31 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:46712) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hAuC1-0005vQ-LT for qemu-devel@nongnu.org; Mon, 01 Apr 2019 06:29:29 -0400 Received: by mail-pg1-x543.google.com with SMTP id q1so4527598pgv.13 for ; Mon, 01 Apr 2019 03:29:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9Mhum0qrevd5IF4CeetlRqrhth82koesUwWb3BUb1N0=; b=iEnRXyCeAEJYpg0l0EnXp1P93tdlKbL4hc9RF5jRi51Y4tmZa+L4OfyFazj/qwaZEt 36PV9kKeHFVQ5bixlkI/y5deDVHkq5ezIAgHaRk8WWCgUvFvkCZTS8WmDmdZrewmRzzd uuZQRfdg9fctHAdhvw/8LDnLoOY8tdlt5+fwt1nhRu0zUC8yPJ4e/QDqLcE9l9fo9fXV pwW9vwj1t7IpvSRsE33xutYMdmZ31ayr8WhMai8ZnWtylyoiX3QUPjdG0ZQ3oTLC2iOc agTsbnLbNLrEP2KP50S+X4Fy+E1Aq6hnooSlAmP82uB2IeN5i0HwwumOQc7ghLQPrj4h ayvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9Mhum0qrevd5IF4CeetlRqrhth82koesUwWb3BUb1N0=; b=BEEVfPzJp5m1yx+MVeGz/i2wqhkSJzWU4bkqCEvAJDQKAPcyheIsLPwq6yNHMAReVq rVWdI93tFRqIe2LCAJd98nMGJwN4X0IsIkEGmW+Cl0u+JR6k/GtmrrHMwbT5HvCCvDyA Vb8On0tZAjpa/VpWhjPQUNt/gl1alvLqYijxA4VXx0j9aqXTiRviw9q9UmEEONejUD5s YQi0HY4sRQuffUzy+K2M9sZRX6soYz8yHjCcKu7ZjSdJ0NUczNXpu/Azau5+0LHZMjw8 +ORXV9mqBPPU0srZumlmHNL3XxS0RbMWj4/76KMsFSGxFO9a9BmnEgAhL0UR2IM+5L0x 4djg== X-Gm-Message-State: APjAAAXDB9TrnFX7Mr04UXzmZcsB2VKvIBjxY8u1r+OXk685wrt/7Qg5 6PJVa20Qcs0RQkG4835uvLMZZVubOyLBWA== X-Received: by 2002:aa7:8d49:: with SMTP id s9mr60354426pfe.248.1554114568308; Mon, 01 Apr 2019 03:29:28 -0700 (PDT) Received: from cloudburst.imgcgcw.net ([147.50.13.10]) by smtp.gmail.com with ESMTPSA id c134sm20048203pfc.87.2019.04.01.03.29.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Apr 2019 03:29:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 17:29:09 +0700 Message-Id: <20190401102911.8685-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401102911.8685-1-richard.henderson@linaro.org> References: <20190401102911.8685-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::543 Subject: [Qemu-devel] [PATCH for-4.1 4/6] target/s390x: Remove ilen parameter from tcg_s390_program_interrupt X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-s390x@nongnu.org, cohuck@redhat.com, david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Since we begin the operation with an unwind, we have the proper value of ilen immediately available. Signed-off-by: Richard Henderson --- target/s390x/tcg_s390x.h | 4 ++-- target/s390x/excp_helper.c | 8 ++++---- target/s390x/interrupt.c | 2 +- target/s390x/tcg-stub.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/target/s390x/tcg_s390x.h b/target/s390x/tcg_s390x.h index ab2c4ba703..931ca5196c 100644 --- a/target/s390x/tcg_s390x.h +++ b/target/s390x/tcg_s390x.h @@ -14,8 +14,8 @@ #define TCG_S390X_H void tcg_s390_tod_updated(CPUState *cs, run_on_cpu_data opaque); -void QEMU_NORETURN tcg_s390_program_interrupt(CPUS390XState *env, uint32_t code, - int ilen, uintptr_t ra); +void QEMU_NORETURN tcg_s390_program_interrupt(CPUS390XState *env, + uint32_t code, uintptr_t ra); void QEMU_NORETURN tcg_s390_data_exception(CPUS390XState *env, uint32_t dxc, uintptr_t ra); diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c index f84bfb1284..c30872ef4f 100644 --- a/target/s390x/excp_helper.c +++ b/target/s390x/excp_helper.c @@ -33,15 +33,15 @@ #include "hw/s390x/s390_flic.h" #endif -void QEMU_NORETURN tcg_s390_program_interrupt(CPUS390XState *env, uint32_t code, - int ilen, uintptr_t ra) +void QEMU_NORETURN tcg_s390_program_interrupt(CPUS390XState *env, + uint32_t code, uintptr_t ra) { CPUState *cs = CPU(s390_env_get_cpu(env)); cpu_restore_state(cs, ra, true); qemu_log_mask(CPU_LOG_INT, "program interrupt at %#" PRIx64 "\n", env->psw.addr); - trigger_pgm_exception(env, code, ilen); + trigger_pgm_exception(env, code, ILEN_UNWIND); cpu_loop_exit(cs); } @@ -59,7 +59,7 @@ void QEMU_NORETURN tcg_s390_data_exception(CPUS390XState *env, uint32_t dxc, if (env->cregs[0] & CR0_AFP) { env->fpc = deposit32(env->fpc, 8, 8, dxc); } - tcg_s390_program_interrupt(env, PGM_DATA, ILEN_AUTO, ra); + tcg_s390_program_interrupt(env, PGM_DATA, ra); } void HELPER(data_exception)(CPUS390XState *env, uint32_t dxc) diff --git a/target/s390x/interrupt.c b/target/s390x/interrupt.c index 901cd713de..e24a757368 100644 --- a/target/s390x/interrupt.c +++ b/target/s390x/interrupt.c @@ -41,7 +41,7 @@ void s390_program_interrupt(CPUS390XState *env, uint32_t code, int ilen, if (kvm_enabled()) { kvm_s390_program_interrupt(cpu, code); } else if (tcg_enabled()) { - tcg_s390_program_interrupt(env, code, ilen, ra); + tcg_s390_program_interrupt(env, code, ra); } else { g_assert_not_reached(); } diff --git a/target/s390x/tcg-stub.c b/target/s390x/tcg-stub.c index 32adb7276a..d22c898802 100644 --- a/target/s390x/tcg-stub.c +++ b/target/s390x/tcg-stub.c @@ -18,8 +18,8 @@ void tcg_s390_tod_updated(CPUState *cs, run_on_cpu_data opaque) { } -void QEMU_NORETURN tcg_s390_program_interrupt(CPUS390XState *env, uint32_t code, - int ilen, uintptr_t ra) +void QEMU_NORETURN tcg_s390_program_interrupt(CPUS390XState *env, + uint32_t code, uintptr_t ra) { g_assert_not_reached(); } From patchwork Mon Apr 1 10:29:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 161530 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp280365jan; Mon, 1 Apr 2019 03:33:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6hGnNruvcJQX5kR3CBC/LjCwr3w+IyBnWboV16GFZj2a41V6qTY6LBd6EKW7uc19g9fkf X-Received: by 2002:a25:2d44:: with SMTP id s4mr50531600ybe.520.1554114814730; Mon, 01 Apr 2019 03:33:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554114814; cv=none; d=google.com; s=arc-20160816; b=qvU8jMo6BsIMWPtey9QKZHR4RFLjc6o7Rou2fTlgLYN0WWW8zhLR35whvnHiKtXNE5 8lUl86+bTttpCUgdmq6d5Md4SvK2B1Bp5F5swLXwg5AnMggBSQBXatrDNVixyHUJuZin rZ0kR5zuCrzdZ9wNyJP1gj5Z8gy2mpTr+GRulu1z5EvZi2vRsZ+D/zcvHaSESYTbEfCZ 5yLMz11HgNU5BI8ktp5Fe5q8QgUIOAyxF9VV1fJM3GanhPCahhhNSmanjGFuOYw7WPEP XPeSW0YNfqe4BHbXaxFB/VGhjafMSSCYJ0h7TGOzDvFLefgcPi6wYeRXFxiX3ohGxUmK 2IdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=Gl/bU+kaPGXyj2MxaHl4a5gWo+HNayDDNQ5nIPkghSI=; b=ivoWvqPqtnL3bwJqqwX9Wu/zLjD5Y5xQuoX5sxwexH3XTcTrD4SmrzKSXvu18zmZQQ JFFmUpLBAv40Zx6fl8yrvPUBxj9aYGceaJScJjP4jXr2H0nDc9oiRD2G/X2YunK2AAaH qDTIk1kvRjQw9F+eOdqYuhz9oiYlLQpC/dhyR2bHKpFHmhnXtpVuZaXBIdSjvBqx5SJ8 LTZX3HpjYjDu7TOgHJ8SdG3a2LOhY2CsIwETViU1OJMdRKpQMRVJfR1XSoLEZR1tLGnX N21zrf9oBxrrtJgJUoXYyjI8CkE/3El7R8uwmFk8xeIOld06AInWhUpXeHhF32bH3G95 qgXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="XyMdM2a/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j67si5717992ywj.306.2019.04.01.03.33.34 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 03:33:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="XyMdM2a/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:56053 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAuFy-0006f7-57 for patch@linaro.org; Mon, 01 Apr 2019 06:33:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAuCC-0003bP-DX for qemu-devel@nongnu.org; Mon, 01 Apr 2019 06:29:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hAuC6-0005yE-R2 for qemu-devel@nongnu.org; Mon, 01 Apr 2019 06:29:39 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:38898) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hAuC5-0005x4-ON for qemu-devel@nongnu.org; Mon, 01 Apr 2019 06:29:34 -0400 Received: by mail-pl1-x644.google.com with SMTP id g37so4279606plb.5 for ; Mon, 01 Apr 2019 03:29:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Gl/bU+kaPGXyj2MxaHl4a5gWo+HNayDDNQ5nIPkghSI=; b=XyMdM2a/k6yuEgraqLDA9pvIx/ytvnxWehP4cGdRBkmJC3T+/Wc+c44dS+BGH320Vu 0RCWrHDQoa6nC7HPuoguL3zwLGSGGZrKWOg1HfFRse6mSlQZzjq3px7zt+483qvvGsLT sf/OY/1z598KQertn/T3pAz9+I4SIvdamnmDesraoWaM2f/otKvtlT6h9+l9mcydTrPv pNpNQ8G5H8PE+Qne4WkWB6+mOoRYCx6Rsd0RlMWV6yZpQSgll77DiIGAjujF6PlEL18O X5vsLjButmPtTUnBYLLokDvf1LeUfN2JYjpewGh0DSLu0C+MRjpw7+itzqxGt2lASrik ZIgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Gl/bU+kaPGXyj2MxaHl4a5gWo+HNayDDNQ5nIPkghSI=; b=gvIFQaSl1lVhAndAG1DZojgjynX3Uc6/ZQ/wGeT9QAaMGEprtvimoHUIz3WSzzqdsh QYPa6P9GReh3Jd+nZan0LHPJzfPF9+wCDfO9TQV+Som8t+4QXT+y9ct3B/qlRs40AmRU AyzY8gaE1uOh7Vov02VKSYOahmol9GRhfMXXerg0luqOyrXE38D4bmWWrN/OM4rITi0y xcQ73vssriAXfgotY8bBMAy02HoiegLJJD5zUzgQWzx4swCjyt8MUCovRA2QzTyz3HXC 6LNHTe4oiP3NvQRnATK/c9iJW5axXmtAwmTTqLPXU9HP4D+cnepwfUaeSIkBOieJUJvv +NxQ== X-Gm-Message-State: APjAAAW7NRHL0YG21v7nf/GAmcE1XQUujyIWzQyparwL9G3k0nc/MuDG /Tu3cAGS/1EqTiL7ogtH6NxGoyl+e1QSvg== X-Received: by 2002:a17:902:be09:: with SMTP id r9mr10784164pls.215.1554114571497; Mon, 01 Apr 2019 03:29:31 -0700 (PDT) Received: from cloudburst.imgcgcw.net ([147.50.13.10]) by smtp.gmail.com with ESMTPSA id c134sm20048203pfc.87.2019.04.01.03.29.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Apr 2019 03:29:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 17:29:10 +0700 Message-Id: <20190401102911.8685-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401102911.8685-1-richard.henderson@linaro.org> References: <20190401102911.8685-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::644 Subject: [Qemu-devel] [PATCH for-4.1 5/6] target/s390x: Remove ilen parameter from s390_program_interrupt X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-s390x@nongnu.org, cohuck@redhat.com, david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is no longer used, and many of the existing uses -- particularly within hw/s390x -- seem questionable. Signed-off-by: Richard Henderson --- target/s390x/cpu.h | 3 +- hw/s390x/s390-pci-inst.c | 58 ++++++++++++++++++------------------ target/s390x/cc_helper.c | 2 +- target/s390x/crypto_helper.c | 4 +-- target/s390x/diag.c | 14 ++++----- target/s390x/excp_helper.c | 2 +- target/s390x/fpu_helper.c | 6 ++-- target/s390x/int_helper.c | 14 ++++----- target/s390x/interrupt.c | 3 +- target/s390x/ioinst.c | 40 ++++++++++++------------- target/s390x/mem_helper.c | 36 +++++++++++----------- target/s390x/misc_helper.c | 27 ++++++----------- 12 files changed, 99 insertions(+), 110 deletions(-) -- 2.17.1 diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 1498f3b7f4..fbd54f96c4 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -792,8 +792,7 @@ void s390_io_interrupt(uint16_t subchannel_id, uint16_t subchannel_nr, /* automatically detect the instruction length */ #define ILEN_AUTO 0xff #define RA_IGNORED 0 -void s390_program_interrupt(CPUS390XState *env, uint32_t code, int ilen, - uintptr_t ra); +void s390_program_interrupt(CPUS390XState *env, uint32_t code, uintptr_t ra); /* service interrupts are floating therefore we must not pass an cpustate */ void s390_sclp_extint(uint32_t parm); diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index be2896232d..395c4a1a47 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -157,7 +157,7 @@ int clp_service_call(S390CPU *cpu, uint8_t r2, uintptr_t ra) int i; if (env->psw.mask & PSW_MASK_PSTATE) { - s390_program_interrupt(env, PGM_PRIVILEGED, 4, ra); + s390_program_interrupt(env, PGM_PRIVILEGED, ra); return 0; } @@ -168,7 +168,7 @@ int clp_service_call(S390CPU *cpu, uint8_t r2, uintptr_t ra) reqh = (ClpReqHdr *)buffer; req_len = lduw_p(&reqh->len); if (req_len < 16 || req_len > 8184 || (req_len % 8 != 0)) { - s390_program_interrupt(env, PGM_OPERAND, 4, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return 0; } @@ -180,11 +180,11 @@ int clp_service_call(S390CPU *cpu, uint8_t r2, uintptr_t ra) resh = (ClpRspHdr *)(buffer + req_len); res_len = lduw_p(&resh->len); if (res_len < 8 || res_len > 8176 || (res_len % 8 != 0)) { - s390_program_interrupt(env, PGM_OPERAND, 4, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return 0; } if ((req_len + res_len) > 8192) { - s390_program_interrupt(env, PGM_OPERAND, 4, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return 0; } @@ -389,12 +389,12 @@ int pcilg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2, uintptr_t ra) uint8_t pcias; if (env->psw.mask & PSW_MASK_PSTATE) { - s390_program_interrupt(env, PGM_PRIVILEGED, 4, ra); + s390_program_interrupt(env, PGM_PRIVILEGED, ra); return 0; } if (r2 & 0x1) { - s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); return 0; } @@ -428,25 +428,25 @@ int pcilg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2, uintptr_t ra) switch (pcias) { case ZPCI_IO_BAR_MIN...ZPCI_IO_BAR_MAX: if (!len || (len > (8 - (offset & 0x7)))) { - s390_program_interrupt(env, PGM_OPERAND, 4, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return 0; } result = zpci_read_bar(pbdev, pcias, offset, &data, len); if (result != MEMTX_OK) { - s390_program_interrupt(env, PGM_OPERAND, 4, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return 0; } break; case ZPCI_CONFIG_BAR: if (!len || (len > (4 - (offset & 0x3))) || len == 3) { - s390_program_interrupt(env, PGM_OPERAND, 4, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return 0; } data = pci_host_config_read_common( pbdev->pdev, offset, pci_config_size(pbdev->pdev), len); if (zpci_endian_swap(&data, len)) { - s390_program_interrupt(env, PGM_OPERAND, 4, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return 0; } break; @@ -487,12 +487,12 @@ int pcistg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2, uintptr_t ra) uint8_t pcias; if (env->psw.mask & PSW_MASK_PSTATE) { - s390_program_interrupt(env, PGM_PRIVILEGED, 4, ra); + s390_program_interrupt(env, PGM_PRIVILEGED, ra); return 0; } if (r2 & 0x1) { - s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); return 0; } @@ -534,13 +534,13 @@ int pcistg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2, uintptr_t ra) * A length of 0 is invalid and length should not cross a double word */ if (!len || (len > (8 - (offset & 0x7)))) { - s390_program_interrupt(env, PGM_OPERAND, 4, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return 0; } result = zpci_write_bar(pbdev, pcias, offset, data, len); if (result != MEMTX_OK) { - s390_program_interrupt(env, PGM_OPERAND, 4, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return 0; } break; @@ -548,7 +548,7 @@ int pcistg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2, uintptr_t ra) /* ZPCI uses the pseudo BAR number 15 as configuration space */ /* possible access lengths are 1,2,4 and must not cross a word */ if (!len || (len > (4 - (offset & 0x3))) || len == 3) { - s390_program_interrupt(env, PGM_OPERAND, 4, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return 0; } /* len = 1,2,4 so we do not need to test */ @@ -620,12 +620,12 @@ int rpcit_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2, uintptr_t ra) hwaddr start, end; if (env->psw.mask & PSW_MASK_PSTATE) { - s390_program_interrupt(env, PGM_PRIVILEGED, 4, ra); + s390_program_interrupt(env, PGM_PRIVILEGED, ra); return 0; } if (r2 & 0x1) { - s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); return 0; } @@ -707,7 +707,7 @@ int pcistb_service_call(S390CPU *cpu, uint8_t r1, uint8_t r3, uint64_t gaddr, uint8_t buffer[128]; if (env->psw.mask & PSW_MASK_PSTATE) { - s390_program_interrupt(env, PGM_PRIVILEGED, 6, ra); + s390_program_interrupt(env, PGM_PRIVILEGED, ra); return 0; } @@ -770,7 +770,7 @@ int pcistb_service_call(S390CPU *cpu, uint8_t r1, uint8_t r3, uint64_t gaddr, if (!memory_region_access_valid(mr, offset, len, true, MEMTXATTRS_UNSPECIFIED)) { - s390_program_interrupt(env, PGM_OPERAND, 6, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return 0; } @@ -784,7 +784,7 @@ int pcistb_service_call(S390CPU *cpu, uint8_t r1, uint8_t r3, uint64_t gaddr, ldq_p(buffer + i * 8), 8, MEMTXATTRS_UNSPECIFIED); if (result != MEMTX_OK) { - s390_program_interrupt(env, PGM_OPERAND, 6, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return 0; } } @@ -795,7 +795,7 @@ int pcistb_service_call(S390CPU *cpu, uint8_t r1, uint8_t r3, uint64_t gaddr, return 0; specification_error: - s390_program_interrupt(env, PGM_SPECIFICATION, 6, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); return 0; } @@ -869,14 +869,14 @@ static int reg_ioat(CPUS390XState *env, S390PCIIOMMU *iommu, ZpciFib fib, pba &= ~0xfff; pal |= 0xfff; if (pba > pal || pba < ZPCI_SDMA_ADDR || pal > ZPCI_EDMA_ADDR) { - s390_program_interrupt(env, PGM_OPERAND, 6, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return -EINVAL; } /* currently we only support designation type 1 with translation */ if (!(dt == ZPCI_IOTA_RTTO && t)) { error_report("unsupported ioat dt %d t %d", dt, t); - s390_program_interrupt(env, PGM_OPERAND, 6, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return -EINVAL; } @@ -1001,7 +1001,7 @@ int mpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, uint64_t cc = ZPCI_PCI_LS_OK; if (env->psw.mask & PSW_MASK_PSTATE) { - s390_program_interrupt(env, PGM_PRIVILEGED, 6, ra); + s390_program_interrupt(env, PGM_PRIVILEGED, ra); return 0; } @@ -1010,7 +1010,7 @@ int mpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, fh = env->regs[r1] >> 32; if (fiba & 0x7) { - s390_program_interrupt(env, PGM_SPECIFICATION, 6, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); return 0; } @@ -1038,7 +1038,7 @@ int mpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, } if (fib.fmt != 0) { - s390_program_interrupt(env, PGM_OPERAND, 6, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return 0; } @@ -1149,7 +1149,7 @@ int mpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, break; } default: - s390_program_interrupt(&cpu->env, PGM_OPERAND, 6, ra); + s390_program_interrupt(&cpu->env, PGM_OPERAND, ra); cc = ZPCI_PCI_LS_ERR; } @@ -1169,7 +1169,7 @@ int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, uint64_t cc = ZPCI_PCI_LS_OK; if (env->psw.mask & PSW_MASK_PSTATE) { - s390_program_interrupt(env, PGM_PRIVILEGED, 6, ra); + s390_program_interrupt(env, PGM_PRIVILEGED, ra); return 0; } @@ -1183,7 +1183,7 @@ int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar, } if (fiba & 0x7) { - s390_program_interrupt(env, PGM_SPECIFICATION, 6, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); return 0; } diff --git a/target/s390x/cc_helper.c b/target/s390x/cc_helper.c index 0e467bf2b6..d35ff08f59 100644 --- a/target/s390x/cc_helper.c +++ b/target/s390x/cc_helper.c @@ -572,7 +572,7 @@ void HELPER(sacf)(CPUS390XState *env, uint64_t a1) break; default: HELPER_LOG("unknown sacf mode: %" PRIx64 "\n", a1); - s390_program_interrupt(env, PGM_SPECIFICATION, 2, GETPC()); + s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); break; } } diff --git a/target/s390x/crypto_helper.c b/target/s390x/crypto_helper.c index 5c79790187..1f83987e9d 100644 --- a/target/s390x/crypto_helper.c +++ b/target/s390x/crypto_helper.c @@ -34,7 +34,7 @@ uint32_t HELPER(msa)(CPUS390XState *env, uint32_t r1, uint32_t r2, uint32_t r3, case S390_FEAT_TYPE_PCKMO: case S390_FEAT_TYPE_PCC: if (mod) { - s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); return 0; } break; @@ -42,7 +42,7 @@ uint32_t HELPER(msa)(CPUS390XState *env, uint32_t r1, uint32_t r2, uint32_t r3, s390_get_feat_block(type, subfunc); if (!test_be_bit(fc, subfunc)) { - s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); return 0; } diff --git a/target/s390x/diag.c b/target/s390x/diag.c index aafa740f61..ba6739937f 100644 --- a/target/s390x/diag.c +++ b/target/s390x/diag.c @@ -61,12 +61,12 @@ void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3, uintptr_t ra) IplParameterBlock *iplb; if (env->psw.mask & PSW_MASK_PSTATE) { - s390_program_interrupt(env, PGM_PRIVILEGED, ILEN_AUTO, ra); + s390_program_interrupt(env, PGM_PRIVILEGED, ra); return; } if ((subcode & ~0x0ffffULL) || (subcode > 6)) { - s390_program_interrupt(env, PGM_SPECIFICATION, ILEN_AUTO, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); return; } @@ -82,13 +82,13 @@ void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3, uintptr_t ra) break; case 5: if ((r1 & 1) || (addr & 0x0fffULL)) { - s390_program_interrupt(env, PGM_SPECIFICATION, ILEN_AUTO, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); return; } if (!address_space_access_valid(&address_space_memory, addr, sizeof(IplParameterBlock), false, MEMTXATTRS_UNSPECIFIED)) { - s390_program_interrupt(env, PGM_ADDRESSING, ILEN_AUTO, ra); + s390_program_interrupt(env, PGM_ADDRESSING, ra); return; } iplb = g_new0(IplParameterBlock, 1); @@ -112,13 +112,13 @@ out: return; case 6: if ((r1 & 1) || (addr & 0x0fffULL)) { - s390_program_interrupt(env, PGM_SPECIFICATION, ILEN_AUTO, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); return; } if (!address_space_access_valid(&address_space_memory, addr, sizeof(IplParameterBlock), true, MEMTXATTRS_UNSPECIFIED)) { - s390_program_interrupt(env, PGM_ADDRESSING, ILEN_AUTO, ra); + s390_program_interrupt(env, PGM_ADDRESSING, ra); return; } iplb = s390_ipl_get_iplb(); @@ -130,7 +130,7 @@ out: } return; default: - s390_program_interrupt(env, PGM_SPECIFICATION, ILEN_AUTO, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); break; } } diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c index c30872ef4f..f42af4de91 100644 --- a/target/s390x/excp_helper.c +++ b/target/s390x/excp_helper.c @@ -573,7 +573,7 @@ void s390x_cpu_do_unaligned_access(CPUState *cs, vaddr addr, S390CPU *cpu = S390_CPU(cs); CPUS390XState *env = &cpu->env; - s390_program_interrupt(env, PGM_SPECIFICATION, ILEN_AUTO, retaddr); + s390_program_interrupt(env, PGM_SPECIFICATION, retaddr); } #endif /* CONFIG_USER_ONLY */ diff --git a/target/s390x/fpu_helper.c b/target/s390x/fpu_helper.c index 1be68bafea..4c107c9e37 100644 --- a/target/s390x/fpu_helper.c +++ b/target/s390x/fpu_helper.c @@ -827,7 +827,7 @@ void HELPER(sfpc)(CPUS390XState *env, uint64_t fpc) { if (fpc_to_rnd[fpc & 0x7] == -1 || fpc & 0x03030088u || (!s390_has_feat(S390_FEAT_FLOATING_POINT_EXT) && fpc & 0x4)) { - s390_program_interrupt(env, PGM_SPECIFICATION, ILEN_AUTO, GETPC()); + s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); } /* Install everything in the main FPC. */ @@ -845,7 +845,7 @@ void HELPER(sfas)(CPUS390XState *env, uint64_t fpc) if (fpc_to_rnd[fpc & 0x7] == -1 || fpc & 0x03030088u || (!s390_has_feat(S390_FEAT_FLOATING_POINT_EXT) && fpc & 0x4)) { - s390_program_interrupt(env, PGM_SPECIFICATION, ILEN_AUTO, GETPC()); + s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); } /* @@ -882,7 +882,7 @@ void HELPER(sfas)(CPUS390XState *env, uint64_t fpc) void HELPER(srnm)(CPUS390XState *env, uint64_t rnd) { if (rnd > 0x7 || fpc_to_rnd[rnd & 0x7] == -1) { - s390_program_interrupt(env, PGM_SPECIFICATION, ILEN_AUTO, GETPC()); + s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); } env->fpc = deposit32(env->fpc, 0, 3, rnd); diff --git a/target/s390x/int_helper.c b/target/s390x/int_helper.c index abbbc20d9c..7027f51b44 100644 --- a/target/s390x/int_helper.c +++ b/target/s390x/int_helper.c @@ -39,7 +39,7 @@ int64_t HELPER(divs32)(CPUS390XState *env, int64_t a, int64_t b64) int64_t q; if (b == 0) { - s390_program_interrupt(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC()); + s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); } ret = q = a / b; @@ -47,7 +47,7 @@ int64_t HELPER(divs32)(CPUS390XState *env, int64_t a, int64_t b64) /* Catch non-representable quotient. */ if (ret != q) { - s390_program_interrupt(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC()); + s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); } return ret; @@ -60,7 +60,7 @@ uint64_t HELPER(divu32)(CPUS390XState *env, uint64_t a, uint64_t b64) uint64_t q; if (b == 0) { - s390_program_interrupt(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC()); + s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); } ret = q = a / b; @@ -68,7 +68,7 @@ uint64_t HELPER(divu32)(CPUS390XState *env, uint64_t a, uint64_t b64) /* Catch non-representable quotient. */ if (ret != q) { - s390_program_interrupt(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC()); + s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); } return ret; @@ -79,7 +79,7 @@ int64_t HELPER(divs64)(CPUS390XState *env, int64_t a, int64_t b) { /* Catch divide by zero, and non-representable quotient (MIN / -1). */ if (b == 0 || (b == -1 && a == (1ll << 63))) { - s390_program_interrupt(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC()); + s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); } env->retxl = a % b; return a / b; @@ -92,7 +92,7 @@ uint64_t HELPER(divu64)(CPUS390XState *env, uint64_t ah, uint64_t al, uint64_t ret; /* Signal divide by zero. */ if (b == 0) { - s390_program_interrupt(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC()); + s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); } if (ah == 0) { /* 64 -> 64/64 case */ @@ -106,7 +106,7 @@ uint64_t HELPER(divu64)(CPUS390XState *env, uint64_t ah, uint64_t al, env->retxl = a % b; ret = q; if (ret != q) { - s390_program_interrupt(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC()); + s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); } #else S390CPU *cpu = s390_env_get_cpu(env); diff --git a/target/s390x/interrupt.c b/target/s390x/interrupt.c index e24a757368..ff17ee80c7 100644 --- a/target/s390x/interrupt.c +++ b/target/s390x/interrupt.c @@ -33,8 +33,7 @@ void trigger_pgm_exception(CPUS390XState *env, uint32_t code, int ilen) } } -void s390_program_interrupt(CPUS390XState *env, uint32_t code, int ilen, - uintptr_t ra) +void s390_program_interrupt(CPUS390XState *env, uint32_t code, uintptr_t ra) { S390CPU *cpu = s390_env_get_cpu(env); diff --git a/target/s390x/ioinst.c b/target/s390x/ioinst.c index 83c164a168..c437a1d8c6 100644 --- a/target/s390x/ioinst.c +++ b/target/s390x/ioinst.c @@ -44,7 +44,7 @@ void ioinst_handle_xsch(S390CPU *cpu, uint64_t reg1, uintptr_t ra) SubchDev *sch; if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid)) { - s390_program_interrupt(&cpu->env, PGM_OPERAND, 4, ra); + s390_program_interrupt(&cpu->env, PGM_OPERAND, ra); return; } trace_ioinst_sch_id("xsch", cssid, ssid, schid); @@ -62,7 +62,7 @@ void ioinst_handle_csch(S390CPU *cpu, uint64_t reg1, uintptr_t ra) SubchDev *sch; if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid)) { - s390_program_interrupt(&cpu->env, PGM_OPERAND, 4, ra); + s390_program_interrupt(&cpu->env, PGM_OPERAND, ra); return; } trace_ioinst_sch_id("csch", cssid, ssid, schid); @@ -80,7 +80,7 @@ void ioinst_handle_hsch(S390CPU *cpu, uint64_t reg1, uintptr_t ra) SubchDev *sch; if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid)) { - s390_program_interrupt(&cpu->env, PGM_OPERAND, 4, ra); + s390_program_interrupt(&cpu->env, PGM_OPERAND, ra); return; } trace_ioinst_sch_id("hsch", cssid, ssid, schid); @@ -116,7 +116,7 @@ void ioinst_handle_msch(S390CPU *cpu, uint64_t reg1, uint32_t ipb, uintptr_t ra) addr = decode_basedisp_s(env, ipb, &ar); if (addr & 3) { - s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); return; } if (s390_cpu_virt_mem_read(cpu, addr, ar, &schib, sizeof(schib))) { @@ -125,7 +125,7 @@ void ioinst_handle_msch(S390CPU *cpu, uint64_t reg1, uint32_t ipb, uintptr_t ra) } if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid) || !ioinst_schib_valid(&schib)) { - s390_program_interrupt(env, PGM_OPERAND, 4, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return; } trace_ioinst_sch_id("msch", cssid, ssid, schid); @@ -173,7 +173,7 @@ void ioinst_handle_ssch(S390CPU *cpu, uint64_t reg1, uint32_t ipb, uintptr_t ra) addr = decode_basedisp_s(env, ipb, &ar); if (addr & 3) { - s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); return; } if (s390_cpu_virt_mem_read(cpu, addr, ar, &orig_orb, sizeof(orb))) { @@ -183,7 +183,7 @@ void ioinst_handle_ssch(S390CPU *cpu, uint64_t reg1, uint32_t ipb, uintptr_t ra) copy_orb_from_guest(&orb, &orig_orb); if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid) || !ioinst_orb_valid(&orb)) { - s390_program_interrupt(env, PGM_OPERAND, 4, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return; } trace_ioinst_sch_id("ssch", cssid, ssid, schid); @@ -205,7 +205,7 @@ void ioinst_handle_stcrw(S390CPU *cpu, uint32_t ipb, uintptr_t ra) addr = decode_basedisp_s(env, ipb, &ar); if (addr & 3) { - s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); return; } @@ -236,7 +236,7 @@ void ioinst_handle_stsch(S390CPU *cpu, uint64_t reg1, uint32_t ipb, addr = decode_basedisp_s(env, ipb, &ar); if (addr & 3) { - s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); return; } @@ -247,7 +247,7 @@ void ioinst_handle_stsch(S390CPU *cpu, uint64_t reg1, uint32_t ipb, * access execption if it is not) first. */ if (!s390_cpu_virt_mem_check_write(cpu, addr, ar, sizeof(schib))) { - s390_program_interrupt(env, PGM_OPERAND, 4, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); } else { s390_cpu_virt_mem_handle_exc(cpu, ra); } @@ -299,13 +299,13 @@ int ioinst_handle_tsch(S390CPU *cpu, uint64_t reg1, uint32_t ipb, uintptr_t ra) uint8_t ar; if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid)) { - s390_program_interrupt(env, PGM_OPERAND, 4, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return -EIO; } trace_ioinst_sch_id("tsch", cssid, ssid, schid); addr = decode_basedisp_s(env, ipb, &ar); if (addr & 3) { - s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); return -EIO; } @@ -613,7 +613,7 @@ void ioinst_handle_chsc(S390CPU *cpu, uint32_t ipb, uintptr_t ra) addr = env->regs[reg]; /* Page boundary? */ if (addr & 0xfff) { - s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); return; } /* @@ -629,7 +629,7 @@ void ioinst_handle_chsc(S390CPU *cpu, uint32_t ipb, uintptr_t ra) len = be16_to_cpu(req->len); /* Length field valid? */ if ((len < 16) || (len > 4088) || (len & 7)) { - s390_program_interrupt(env, PGM_OPERAND, 4, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return; } memset((char *)req + len, 0, TARGET_PAGE_SIZE - len); @@ -678,7 +678,7 @@ void ioinst_handle_schm(S390CPU *cpu, uint64_t reg1, uint64_t reg2, trace_ioinst("schm"); if (SCHM_REG1_RES(reg1)) { - s390_program_interrupt(env, PGM_OPERAND, 4, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return; } @@ -687,7 +687,7 @@ void ioinst_handle_schm(S390CPU *cpu, uint64_t reg1, uint64_t reg2, dct = SCHM_REG1_DCT(reg1); if (update && (reg2 & 0x000000000000001f)) { - s390_program_interrupt(env, PGM_OPERAND, 4, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return; } @@ -700,7 +700,7 @@ void ioinst_handle_rsch(S390CPU *cpu, uint64_t reg1, uintptr_t ra) SubchDev *sch; if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid)) { - s390_program_interrupt(&cpu->env, PGM_OPERAND, 4, ra); + s390_program_interrupt(&cpu->env, PGM_OPERAND, ra); return; } trace_ioinst_sch_id("rsch", cssid, ssid, schid); @@ -724,7 +724,7 @@ void ioinst_handle_rchp(S390CPU *cpu, uint64_t reg1, uintptr_t ra) CPUS390XState *env = &cpu->env; if (RCHP_REG1_RES(reg1)) { - s390_program_interrupt(env, PGM_OPERAND, 4, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return; } @@ -747,7 +747,7 @@ void ioinst_handle_rchp(S390CPU *cpu, uint64_t reg1, uintptr_t ra) break; default: /* Invalid channel subsystem. */ - s390_program_interrupt(env, PGM_OPERAND, 4, ra); + s390_program_interrupt(env, PGM_OPERAND, ra); return; } setcc(cpu, cc); @@ -758,6 +758,6 @@ void ioinst_handle_sal(S390CPU *cpu, uint64_t reg1, uintptr_t ra) { /* We do not provide address limit checking, so let's suppress it. */ if (SAL_REG1_INVALID(reg1) || reg1 & 0x000000000000ffff) { - s390_program_interrupt(&cpu->env, PGM_OPERAND, 4, ra); + s390_program_interrupt(&cpu->env, PGM_OPERAND, ra); } } diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index 838c32fc96..6c5754a2bf 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -98,7 +98,7 @@ static inline void check_alignment(CPUS390XState *env, uint64_t v, int wordsize, uintptr_t ra) { if (v % wordsize) { - s390_program_interrupt(env, PGM_SPECIFICATION, 6, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); } } @@ -556,7 +556,7 @@ void HELPER(srst)(CPUS390XState *env, uint32_t r1, uint32_t r2) /* Bits 32-55 must contain all 0. */ if (env->regs[0] & 0xffffff00u) { - s390_program_interrupt(env, PGM_SPECIFICATION, 6, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); } str = get_address(env, r2); @@ -593,7 +593,7 @@ void HELPER(srstu)(CPUS390XState *env, uint32_t r1, uint32_t r2) /* Bits 32-47 of R0 must be zero. */ if (env->regs[0] & 0xffff0000u) { - s390_program_interrupt(env, PGM_SPECIFICATION, 6, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); } str = get_address(env, r2); @@ -708,7 +708,7 @@ void HELPER(lam)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3) if (a2 & 0x3) { /* we either came here by lam or lamy, which have different lengths */ - s390_program_interrupt(env, PGM_SPECIFICATION, ILEN_AUTO, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); } for (i = r1;; i = (i + 1) % 16) { @@ -728,7 +728,7 @@ void HELPER(stam)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3) int i; if (a2 & 0x3) { - s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); } for (i = r1;; i = (i + 1) % 16) { @@ -1627,7 +1627,7 @@ static uint32_t do_csst(CPUS390XState *env, uint32_t r3, uint64_t a1, return cc; spec_exception: - s390_program_interrupt(env, PGM_SPECIFICATION, 6, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); g_assert_not_reached(); } @@ -1652,7 +1652,7 @@ void HELPER(lctlg)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3) uint32_t i; if (src & 0x7) { - s390_program_interrupt(env, PGM_SPECIFICATION, 6, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); } for (i = r1;; i = (i + 1) % 16) { @@ -1686,7 +1686,7 @@ void HELPER(lctl)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3) uint32_t i; if (src & 0x3) { - s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); } for (i = r1;; i = (i + 1) % 16) { @@ -1717,7 +1717,7 @@ void HELPER(stctg)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3) uint32_t i; if (dest & 0x7) { - s390_program_interrupt(env, PGM_SPECIFICATION, 6, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); } for (i = r1;; i = (i + 1) % 16) { @@ -1737,7 +1737,7 @@ void HELPER(stctl)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3) uint32_t i; if (dest & 0x3) { - s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); } for (i = r1;; i = (i + 1) % 16) { @@ -1941,7 +1941,7 @@ void HELPER(idte)(CPUS390XState *env, uint64_t r1, uint64_t r2, uint32_t m4) uint16_t entries, i, index = 0; if (r2 & 0xff000) { - s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); } if (!(r2 & 0x800)) { @@ -2089,7 +2089,7 @@ uint64_t HELPER(lra)(CPUS390XState *env, uint64_t addr) /* XXX incomplete - has more corner cases */ if (!(env->psw.mask & PSW_MASK_64) && (addr >> 32)) { - s390_program_interrupt(env, PGM_SPECIAL_OP, 2, GETPC()); + s390_program_interrupt(env, PGM_SPECIAL_OP, GETPC()); } old_exc = cs->exception_index; @@ -2258,7 +2258,7 @@ uint32_t HELPER(mvcos)(CPUS390XState *env, uint64_t dest, uint64_t src, __func__, dest, src, len); if (!(env->psw.mask & PSW_MASK_DAT)) { - s390_program_interrupt(env, PGM_SPECIAL_OP, 6, ra); + s390_program_interrupt(env, PGM_SPECIAL_OP, ra); } /* OAC (operand access control) for the first operand -> dest */ @@ -2289,14 +2289,14 @@ uint32_t HELPER(mvcos)(CPUS390XState *env, uint64_t dest, uint64_t src, } if (dest_a && dest_as == AS_HOME && (env->psw.mask & PSW_MASK_PSTATE)) { - s390_program_interrupt(env, PGM_SPECIAL_OP, 6, ra); + s390_program_interrupt(env, PGM_SPECIAL_OP, ra); } if (!(env->cregs[0] & CR0_SECONDARY) && (dest_as == AS_SECONDARY || src_as == AS_SECONDARY)) { - s390_program_interrupt(env, PGM_SPECIAL_OP, 6, ra); + s390_program_interrupt(env, PGM_SPECIAL_OP, ra); } if (!psw_key_valid(env, dest_key) || !psw_key_valid(env, src_key)) { - s390_program_interrupt(env, PGM_PRIVILEGED, 6, ra); + s390_program_interrupt(env, PGM_PRIVILEGED, ra); } len = wrap_length(env, len); @@ -2310,7 +2310,7 @@ uint32_t HELPER(mvcos)(CPUS390XState *env, uint64_t dest, uint64_t src, (env->psw.mask & PSW_MASK_PSTATE)) { qemu_log_mask(LOG_UNIMP, "%s: AR-mode and PSTATE support missing\n", __func__); - s390_program_interrupt(env, PGM_ADDRESSING, 6, ra); + s390_program_interrupt(env, PGM_ADDRESSING, ra); } /* FIXME: a) LAP @@ -2643,7 +2643,7 @@ void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len, #ifdef CONFIG_USER_ONLY if (!h2g_valid(addr) || !h2g_valid(addr + len - 1) || page_check_range(addr, len, PAGE_WRITE) < 0) { - s390_program_interrupt(env, PGM_ADDRESSING, ILEN_AUTO, ra); + s390_program_interrupt(env, PGM_ADDRESSING, ra); } #else /* test the actual access, not just any access to the page due to LAP */ diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c index ee67c1fa0c..fd2ed885a5 100644 --- a/target/s390x/misc_helper.c +++ b/target/s390x/misc_helper.c @@ -106,7 +106,7 @@ uint32_t HELPER(servc)(CPUS390XState *env, uint64_t r1, uint64_t r2) int r = sclp_service_call(env, r1, r2); qemu_mutex_unlock_iothread(); if (r < 0) { - s390_program_interrupt(env, -r, 4, GETPC()); + s390_program_interrupt(env, -r, GETPC()); } return r; } @@ -143,7 +143,7 @@ void HELPER(diag)(CPUS390XState *env, uint32_t r1, uint32_t r3, uint32_t num) } if (r) { - s390_program_interrupt(env, PGM_SPECIFICATION, ILEN_AUTO, GETPC()); + s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); } } @@ -222,7 +222,7 @@ void HELPER(sckpf)(CPUS390XState *env, uint64_t r0) uint32_t val = r0; if (val & 0xffff0000) { - s390_program_interrupt(env, PGM_SPECIFICATION, 2, GETPC()); + s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); } env->todpr = val; } @@ -266,7 +266,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, uint64_t r0, uint64_t r1) } if ((r0 & STSI_R0_RESERVED_MASK) || (r1 & STSI_R1_RESERVED_MASK)) { - s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); } if ((r0 & STSI_R0_FC_MASK) == STSI_R0_FC_CURRENT) { @@ -276,7 +276,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, uint64_t r0, uint64_t r1) } if (a0 & ~TARGET_PAGE_MASK) { - s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); } /* count the cpus and split them into configured and reserved ones */ @@ -509,7 +509,7 @@ uint32_t HELPER(tpi)(CPUS390XState *env, uint64_t addr) LowCore *lowcore; if (addr & 0x3) { - s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); } qemu_mutex_lock_iothread(); @@ -573,17 +573,8 @@ void HELPER(chsc)(CPUS390XState *env, uint64_t inst) #ifndef CONFIG_USER_ONLY void HELPER(per_check_exception)(CPUS390XState *env) { - uint32_t ilen; - if (env->per_perc_atmid) { - /* - * FIXME: ILEN_AUTO is most probably the right thing to use. ilen - * always has to match the instruction referenced in the PSW. E.g. - * if a PER interrupt is triggered via EXECUTE, we have to use ilen - * of EXECUTE, while per_address contains the target of EXECUTE. - */ - ilen = get_ilen(cpu_ldub_code(env, env->per_address)); - s390_program_interrupt(env, PGM_PER, ilen, GETPC()); + s390_program_interrupt(env, PGM_PER, GETPC()); } } @@ -673,7 +664,7 @@ uint32_t HELPER(stfle)(CPUS390XState *env, uint64_t addr) int i; if (addr & 0x7) { - s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); + s390_program_interrupt(env, PGM_SPECIFICATION, ra); } prepare_stfl(); @@ -739,7 +730,7 @@ void HELPER(sic)(CPUS390XState *env, uint64_t r1, uint64_t r3) qemu_mutex_unlock_iothread(); /* css_do_sic() may actually return a PGM_xxx value to inject */ if (r) { - s390_program_interrupt(env, -r, 4, GETPC()); + s390_program_interrupt(env, -r, GETPC()); } } From patchwork Mon Apr 1 10:29:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 161529 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp280144jan; Mon, 1 Apr 2019 03:33:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7ywid069Go608o2hi9uObDWKN0Ou7g9Hg1ve2zT3x+u4KdwX4RCdLjVgfqyXIiDMlzpmi X-Received: by 2002:a81:3116:: with SMTP id x22mr53074309ywx.234.1554114801649; Mon, 01 Apr 2019 03:33:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554114801; cv=none; d=google.com; s=arc-20160816; b=HbUeuSDG+c7AWVTUHA3jXTa5kYOGJgCDfForJDjstSlfUf43RNG1dsFcQUuxUpkIPg fmIjYbYFJtbK1eCEX25dx07Sfpx5C1w6yUsDw46NFJ6zMN0kFWACQ3zqGrARdVzMprSs pCyKEV2nNWEuYqaVFV8LXPVfdgAe9rZ0e2FwFaJXsJ4GzdCLkHtZ/07vZor1f730NvTQ dqtoCwk3OkHQ+KaB5zSvJZuALSn+nxOMSfDR1bUlSNecsgInYSzInGByg9zze+NjqQgx D/HUS3LeWMUrrElzhMi9xQ5yQrCo9hnh5PQbn51jpSsiw09gAa4fv0farqXtmZCrnAnh MHOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=cWsNGvIuS95370VpDRk2td5IgCeyWmdh3lN0D/KNU0s=; b=GDLbREkc7lmwAKyb6BRSwZ7qmXtTYITGnk7raYdF5UiCqAf+PPf1vH1ayofogtTXej D1lz4vZhsQNbeLM3b+dICjvuYsWIPY6fzyQhRmczxCtlMiXOI0pIYJe8p2BgRpgbkzY4 R6/m7Q2EskZoaZx11Cmq05R0Gp5IOJTJZZLnDfh0gVw99Pp4T4ZtGu1m+zLQOmVu53wX 67BBFLhXXcyfsBqVCyfDOGro7fSqBS6wwVkaTxqnq2jHUp6XIF7qBcCA5YZb7vy6HKeb 9q/1wq9jQh71gTKX2EqvuoBetSWVYcH0pn43PJsVdNkC6FOqBgQjpxSkGG/dTHdCOCNE mOIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wmI+yMkb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 123si5592837ybi.168.2019.04.01.03.33.21 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 01 Apr 2019 03:33:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wmI+yMkb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:55999 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAuFl-0006Tr-46 for patch@linaro.org; Mon, 01 Apr 2019 06:33:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAuCB-0003an-KZ for qemu-devel@nongnu.org; Mon, 01 Apr 2019 06:29:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hAuC7-0005yq-SB for qemu-devel@nongnu.org; Mon, 01 Apr 2019 06:29:38 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:41421) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hAuC7-0005yI-Al for qemu-devel@nongnu.org; Mon, 01 Apr 2019 06:29:35 -0400 Received: by mail-pf1-x443.google.com with SMTP id 188so4349258pfd.8 for ; Mon, 01 Apr 2019 03:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cWsNGvIuS95370VpDRk2td5IgCeyWmdh3lN0D/KNU0s=; b=wmI+yMkbnsYl9Mxi9HcfZlup4AE146o1LyleutyxWLyJXDtLpatBchj9MfsrXoSarW TRfbQfR3Yg5Jp2Qe2424WEbDpUK8M5toNH5Q95qwCxhrVzpcDHQ3vwfyjgKqHpL2pygO +RkRjkhgESvn1fI9PBl7vEvJ45UO+kCZOx/oXeou8Dwk15z+rF57rlma3Cq5an4v7ByU 9eR/IbBj7V6YxGxciYmONxdWfCeBkrgjhCC7+Q0bjh7KAD0hjUoAZBNDLWtrPIvIU57B 3uCSIHgTGw583OI8D5SFFPxLyeaWmrB0/XRJ101M/w0ZlzjGd2HvuvSGKSAOOYq8XlW/ csHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cWsNGvIuS95370VpDRk2td5IgCeyWmdh3lN0D/KNU0s=; b=pqCcypOJrRXZ8IiXpPidgUtvtJ5al38wrzMrs9B35Z7OLvB/R+NT6xMH+qnDYX3Qh0 23qkD/vaMLSRfP0uOPPyF3plIOOxAe9+coZwaZGZy8lFYb+KB6c4Z97iQbBPfbVXQTda AOam7CrWX5zEi/wdpcyHlty9/lKyJ7eiuSsPxmDAmb1jeTe3ybM4f7+uBVYFAmIbMweY NSSJgHQtDTsTh35l/R8qwVB+/RsMtJPegJKehOk+1j1Ce7f5LybboE9bv9W7D0QmOlmb XaTCYTmM1gsAuk1JDMqR+K3wwBKudz0CjhLuS5EwGRGGT7nJNG2Qr9egiCJVIvesItDg t4zA== X-Gm-Message-State: APjAAAXn+jxoCOfxXfN3wwaQiMfcaVo36husCdYKQqeReOBGeJf6T5Te /ycSjiSUiL+JW/9y2d7GBVnWvbG/nZ+33Q== X-Received: by 2002:a63:618d:: with SMTP id v135mr60178495pgb.2.1554114573943; Mon, 01 Apr 2019 03:29:33 -0700 (PDT) Received: from cloudburst.imgcgcw.net ([147.50.13.10]) by smtp.gmail.com with ESMTPSA id c134sm20048203pfc.87.2019.04.01.03.29.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Apr 2019 03:29:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 17:29:11 +0700 Message-Id: <20190401102911.8685-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401102911.8685-1-richard.henderson@linaro.org> References: <20190401102911.8685-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::443 Subject: [Qemu-devel] [PATCH for-4.1 6/6] target/s390x: Use tcg_s390_program_interrupt in TCG helpers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-s390x@nongnu.org, cohuck@redhat.com, david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Replace all uses of s390_program_interrupt within files that are marked CONFIG_TCG. These are necessarily tcg-only. This lets each of these users benefit from the QEMU_NORETURN attribute on tcg_s390_program_interrupt. Signed-off-by: Richard Henderson --- target/s390x/cc_helper.c | 4 ++-- target/s390x/crypto_helper.c | 7 +++---- target/s390x/excp_helper.c | 2 +- target/s390x/fpu_helper.c | 6 +++--- target/s390x/int_helper.c | 15 +++++++------- target/s390x/mem_helper.c | 38 ++++++++++++++++++------------------ target/s390x/misc_helper.c | 18 ++++++++--------- 7 files changed, 45 insertions(+), 45 deletions(-) -- 2.17.1 Acked-by: David Hildenbrand diff --git a/target/s390x/cc_helper.c b/target/s390x/cc_helper.c index d35ff08f59..9199b4c9bc 100644 --- a/target/s390x/cc_helper.c +++ b/target/s390x/cc_helper.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "cpu.h" #include "internal.h" +#include "tcg_s390x.h" #include "exec/exec-all.h" #include "exec/helper-proto.h" #include "qemu/host-utils.h" @@ -572,8 +573,7 @@ void HELPER(sacf)(CPUS390XState *env, uint64_t a1) break; default: HELPER_LOG("unknown sacf mode: %" PRIx64 "\n", a1); - s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); - break; + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); } } #endif diff --git a/target/s390x/crypto_helper.c b/target/s390x/crypto_helper.c index 1f83987e9d..ff3fbc3950 100644 --- a/target/s390x/crypto_helper.c +++ b/target/s390x/crypto_helper.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "qemu/main-loop.h" #include "internal.h" +#include "tcg_s390x.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" #include "exec/cpu_ldst.h" @@ -34,16 +35,14 @@ uint32_t HELPER(msa)(CPUS390XState *env, uint32_t r1, uint32_t r2, uint32_t r3, case S390_FEAT_TYPE_PCKMO: case S390_FEAT_TYPE_PCC: if (mod) { - s390_program_interrupt(env, PGM_SPECIFICATION, ra); - return 0; + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, ra); } break; } s390_get_feat_block(type, subfunc); if (!test_be_bit(fc, subfunc)) { - s390_program_interrupt(env, PGM_SPECIFICATION, ra); - return 0; + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, ra); } switch (fc) { diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c index f42af4de91..bc781c14c3 100644 --- a/target/s390x/excp_helper.c +++ b/target/s390x/excp_helper.c @@ -573,7 +573,7 @@ void s390x_cpu_do_unaligned_access(CPUState *cs, vaddr addr, S390CPU *cpu = S390_CPU(cs); CPUS390XState *env = &cpu->env; - s390_program_interrupt(env, PGM_SPECIFICATION, retaddr); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, retaddr); } #endif /* CONFIG_USER_ONLY */ diff --git a/target/s390x/fpu_helper.c b/target/s390x/fpu_helper.c index 4c107c9e37..4d3fe962cd 100644 --- a/target/s390x/fpu_helper.c +++ b/target/s390x/fpu_helper.c @@ -827,7 +827,7 @@ void HELPER(sfpc)(CPUS390XState *env, uint64_t fpc) { if (fpc_to_rnd[fpc & 0x7] == -1 || fpc & 0x03030088u || (!s390_has_feat(S390_FEAT_FLOATING_POINT_EXT) && fpc & 0x4)) { - s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); } /* Install everything in the main FPC. */ @@ -845,7 +845,7 @@ void HELPER(sfas)(CPUS390XState *env, uint64_t fpc) if (fpc_to_rnd[fpc & 0x7] == -1 || fpc & 0x03030088u || (!s390_has_feat(S390_FEAT_FLOATING_POINT_EXT) && fpc & 0x4)) { - s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); } /* @@ -882,7 +882,7 @@ void HELPER(sfas)(CPUS390XState *env, uint64_t fpc) void HELPER(srnm)(CPUS390XState *env, uint64_t rnd) { if (rnd > 0x7 || fpc_to_rnd[rnd & 0x7] == -1) { - s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); } env->fpc = deposit32(env->fpc, 0, 3, rnd); diff --git a/target/s390x/int_helper.c b/target/s390x/int_helper.c index 7027f51b44..80150039b0 100644 --- a/target/s390x/int_helper.c +++ b/target/s390x/int_helper.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "cpu.h" #include "internal.h" +#include "tcg_s390x.h" #include "exec/exec-all.h" #include "qemu/host-utils.h" #include "exec/helper-proto.h" @@ -39,7 +40,7 @@ int64_t HELPER(divs32)(CPUS390XState *env, int64_t a, int64_t b64) int64_t q; if (b == 0) { - s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); + tcg_s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); } ret = q = a / b; @@ -47,7 +48,7 @@ int64_t HELPER(divs32)(CPUS390XState *env, int64_t a, int64_t b64) /* Catch non-representable quotient. */ if (ret != q) { - s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); + tcg_s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); } return ret; @@ -60,7 +61,7 @@ uint64_t HELPER(divu32)(CPUS390XState *env, uint64_t a, uint64_t b64) uint64_t q; if (b == 0) { - s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); + tcg_s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); } ret = q = a / b; @@ -68,7 +69,7 @@ uint64_t HELPER(divu32)(CPUS390XState *env, uint64_t a, uint64_t b64) /* Catch non-representable quotient. */ if (ret != q) { - s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); + tcg_s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); } return ret; @@ -79,7 +80,7 @@ int64_t HELPER(divs64)(CPUS390XState *env, int64_t a, int64_t b) { /* Catch divide by zero, and non-representable quotient (MIN / -1). */ if (b == 0 || (b == -1 && a == (1ll << 63))) { - s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); + tcg_s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); } env->retxl = a % b; return a / b; @@ -92,7 +93,7 @@ uint64_t HELPER(divu64)(CPUS390XState *env, uint64_t ah, uint64_t al, uint64_t ret; /* Signal divide by zero. */ if (b == 0) { - s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); + tcg_s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); } if (ah == 0) { /* 64 -> 64/64 case */ @@ -106,7 +107,7 @@ uint64_t HELPER(divu64)(CPUS390XState *env, uint64_t ah, uint64_t al, env->retxl = a % b; ret = q; if (ret != q) { - s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); + tcg_s390_program_interrupt(env, PGM_FIXPT_DIVIDE, GETPC()); } #else S390CPU *cpu = s390_env_get_cpu(env); diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index 6c5754a2bf..d54907696d 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "cpu.h" #include "internal.h" +#include "tcg_s390x.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" #include "exec/cpu_ldst.h" @@ -98,7 +99,7 @@ static inline void check_alignment(CPUS390XState *env, uint64_t v, int wordsize, uintptr_t ra) { if (v % wordsize) { - s390_program_interrupt(env, PGM_SPECIFICATION, ra); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, ra); } } @@ -556,7 +557,7 @@ void HELPER(srst)(CPUS390XState *env, uint32_t r1, uint32_t r2) /* Bits 32-55 must contain all 0. */ if (env->regs[0] & 0xffffff00u) { - s390_program_interrupt(env, PGM_SPECIFICATION, ra); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, ra); } str = get_address(env, r2); @@ -593,7 +594,7 @@ void HELPER(srstu)(CPUS390XState *env, uint32_t r1, uint32_t r2) /* Bits 32-47 of R0 must be zero. */ if (env->regs[0] & 0xffff0000u) { - s390_program_interrupt(env, PGM_SPECIFICATION, ra); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, ra); } str = get_address(env, r2); @@ -708,7 +709,7 @@ void HELPER(lam)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3) if (a2 & 0x3) { /* we either came here by lam or lamy, which have different lengths */ - s390_program_interrupt(env, PGM_SPECIFICATION, ra); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, ra); } for (i = r1;; i = (i + 1) % 16) { @@ -728,7 +729,7 @@ void HELPER(stam)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3) int i; if (a2 & 0x3) { - s390_program_interrupt(env, PGM_SPECIFICATION, ra); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, ra); } for (i = r1;; i = (i + 1) % 16) { @@ -1627,8 +1628,7 @@ static uint32_t do_csst(CPUS390XState *env, uint32_t r3, uint64_t a1, return cc; spec_exception: - s390_program_interrupt(env, PGM_SPECIFICATION, ra); - g_assert_not_reached(); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, ra); } uint32_t HELPER(csst)(CPUS390XState *env, uint32_t r3, uint64_t a1, uint64_t a2) @@ -1652,7 +1652,7 @@ void HELPER(lctlg)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3) uint32_t i; if (src & 0x7) { - s390_program_interrupt(env, PGM_SPECIFICATION, ra); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, ra); } for (i = r1;; i = (i + 1) % 16) { @@ -1686,7 +1686,7 @@ void HELPER(lctl)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3) uint32_t i; if (src & 0x3) { - s390_program_interrupt(env, PGM_SPECIFICATION, ra); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, ra); } for (i = r1;; i = (i + 1) % 16) { @@ -1717,7 +1717,7 @@ void HELPER(stctg)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3) uint32_t i; if (dest & 0x7) { - s390_program_interrupt(env, PGM_SPECIFICATION, ra); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, ra); } for (i = r1;; i = (i + 1) % 16) { @@ -1737,7 +1737,7 @@ void HELPER(stctl)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3) uint32_t i; if (dest & 0x3) { - s390_program_interrupt(env, PGM_SPECIFICATION, ra); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, ra); } for (i = r1;; i = (i + 1) % 16) { @@ -1941,7 +1941,7 @@ void HELPER(idte)(CPUS390XState *env, uint64_t r1, uint64_t r2, uint32_t m4) uint16_t entries, i, index = 0; if (r2 & 0xff000) { - s390_program_interrupt(env, PGM_SPECIFICATION, ra); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, ra); } if (!(r2 & 0x800)) { @@ -2089,7 +2089,7 @@ uint64_t HELPER(lra)(CPUS390XState *env, uint64_t addr) /* XXX incomplete - has more corner cases */ if (!(env->psw.mask & PSW_MASK_64) && (addr >> 32)) { - s390_program_interrupt(env, PGM_SPECIAL_OP, GETPC()); + tcg_s390_program_interrupt(env, PGM_SPECIAL_OP, GETPC()); } old_exc = cs->exception_index; @@ -2258,7 +2258,7 @@ uint32_t HELPER(mvcos)(CPUS390XState *env, uint64_t dest, uint64_t src, __func__, dest, src, len); if (!(env->psw.mask & PSW_MASK_DAT)) { - s390_program_interrupt(env, PGM_SPECIAL_OP, ra); + tcg_s390_program_interrupt(env, PGM_SPECIAL_OP, ra); } /* OAC (operand access control) for the first operand -> dest */ @@ -2289,14 +2289,14 @@ uint32_t HELPER(mvcos)(CPUS390XState *env, uint64_t dest, uint64_t src, } if (dest_a && dest_as == AS_HOME && (env->psw.mask & PSW_MASK_PSTATE)) { - s390_program_interrupt(env, PGM_SPECIAL_OP, ra); + tcg_s390_program_interrupt(env, PGM_SPECIAL_OP, ra); } if (!(env->cregs[0] & CR0_SECONDARY) && (dest_as == AS_SECONDARY || src_as == AS_SECONDARY)) { - s390_program_interrupt(env, PGM_SPECIAL_OP, ra); + tcg_s390_program_interrupt(env, PGM_SPECIAL_OP, ra); } if (!psw_key_valid(env, dest_key) || !psw_key_valid(env, src_key)) { - s390_program_interrupt(env, PGM_PRIVILEGED, ra); + tcg_s390_program_interrupt(env, PGM_PRIVILEGED, ra); } len = wrap_length(env, len); @@ -2310,7 +2310,7 @@ uint32_t HELPER(mvcos)(CPUS390XState *env, uint64_t dest, uint64_t src, (env->psw.mask & PSW_MASK_PSTATE)) { qemu_log_mask(LOG_UNIMP, "%s: AR-mode and PSTATE support missing\n", __func__); - s390_program_interrupt(env, PGM_ADDRESSING, ra); + tcg_s390_program_interrupt(env, PGM_ADDRESSING, ra); } /* FIXME: a) LAP @@ -2643,7 +2643,7 @@ void probe_write_access(CPUS390XState *env, uint64_t addr, uint64_t len, #ifdef CONFIG_USER_ONLY if (!h2g_valid(addr) || !h2g_valid(addr + len - 1) || page_check_range(addr, len, PAGE_WRITE) < 0) { - s390_program_interrupt(env, PGM_ADDRESSING, ra); + tcg_s390_program_interrupt(env, PGM_ADDRESSING, ra); } #else /* test the actual access, not just any access to the page due to LAP */ diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c index fd2ed885a5..7ea0202341 100644 --- a/target/s390x/misc_helper.c +++ b/target/s390x/misc_helper.c @@ -106,7 +106,7 @@ uint32_t HELPER(servc)(CPUS390XState *env, uint64_t r1, uint64_t r2) int r = sclp_service_call(env, r1, r2); qemu_mutex_unlock_iothread(); if (r < 0) { - s390_program_interrupt(env, -r, GETPC()); + tcg_s390_program_interrupt(env, -r, GETPC()); } return r; } @@ -143,7 +143,7 @@ void HELPER(diag)(CPUS390XState *env, uint32_t r1, uint32_t r3, uint32_t num) } if (r) { - s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); } } @@ -222,7 +222,7 @@ void HELPER(sckpf)(CPUS390XState *env, uint64_t r0) uint32_t val = r0; if (val & 0xffff0000) { - s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); } env->todpr = val; } @@ -266,7 +266,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, uint64_t r0, uint64_t r1) } if ((r0 & STSI_R0_RESERVED_MASK) || (r1 & STSI_R1_RESERVED_MASK)) { - s390_program_interrupt(env, PGM_SPECIFICATION, ra); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, ra); } if ((r0 & STSI_R0_FC_MASK) == STSI_R0_FC_CURRENT) { @@ -276,7 +276,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, uint64_t r0, uint64_t r1) } if (a0 & ~TARGET_PAGE_MASK) { - s390_program_interrupt(env, PGM_SPECIFICATION, ra); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, ra); } /* count the cpus and split them into configured and reserved ones */ @@ -509,7 +509,7 @@ uint32_t HELPER(tpi)(CPUS390XState *env, uint64_t addr) LowCore *lowcore; if (addr & 0x3) { - s390_program_interrupt(env, PGM_SPECIFICATION, ra); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, ra); } qemu_mutex_lock_iothread(); @@ -574,7 +574,7 @@ void HELPER(chsc)(CPUS390XState *env, uint64_t inst) void HELPER(per_check_exception)(CPUS390XState *env) { if (env->per_perc_atmid) { - s390_program_interrupt(env, PGM_PER, GETPC()); + tcg_s390_program_interrupt(env, PGM_PER, GETPC()); } } @@ -664,7 +664,7 @@ uint32_t HELPER(stfle)(CPUS390XState *env, uint64_t addr) int i; if (addr & 0x7) { - s390_program_interrupt(env, PGM_SPECIFICATION, ra); + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, ra); } prepare_stfl(); @@ -730,7 +730,7 @@ void HELPER(sic)(CPUS390XState *env, uint64_t r1, uint64_t r3) qemu_mutex_unlock_iothread(); /* css_do_sic() may actually return a PGM_xxx value to inject */ if (r) { - s390_program_interrupt(env, -r, GETPC()); + tcg_s390_program_interrupt(env, -r, GETPC()); } }