From nobody Sun May 19 02:12:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1690217703; cv=none; d=zohomail.com; s=zohoarc; b=JqkOaiV/8pGunPaELLhJhbye7Fr28rRznPJeMMMmA+NUBbkMfC462/xw9mvlEERRPo3VuWEhaS4dDkChPh0VO+URRPhEvUJz8fSVfhdF/8JwcqyCEpPeiT220PE3TKEmMKBwt5UhE7O/RrUtt0b9UX/XGmUHUxShjtQXGOMP1Ho= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690217703; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xCaUIsRvWwrp7IryBZRbJmobbCU1sZgfhPxqHZN9ERI=; b=a+jh3UdTboKoOn4R3AgIJiupvDtQQ2NVWfvbqAV6YSQ4r94ObqMiotPj8OpaLlrUi00MpbnpuE1NaeH7BUxHgTsERtF5fNOjgFK5+0HCWVhw/8U8W1cR/2eZhpjK45qd77GoSsMuqxymfalwSLLXj/O6hBHsRWMwx9jxJhdBP20= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1690217703374618.400811162181; Mon, 24 Jul 2023 09:55:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNyou-0001F3-7Y; Mon, 24 Jul 2023 12:54:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyos-0001EC-34 for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyoo-0006t0-6V for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:00 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-540-1LqFmwPdPeCz2-ZSXcEaKA-1; Mon, 24 Jul 2023 12:53:54 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A64698030AC; Mon, 24 Jul 2023 16:53:53 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 702A7492CAC; Mon, 24 Jul 2023 16:53:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690217636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xCaUIsRvWwrp7IryBZRbJmobbCU1sZgfhPxqHZN9ERI=; b=W5CU1ZcXEYommISFjiu+2crasnMudRMbrDPP5n9O/MupCVeawaaXq6njhYpFF2EiHT04tR SKv4Wl9ZBE94lY5NR4zKhkfW1oA15AYgjZn4pYgYAcuJQo7zDgDYaruDS8VdJ2LHZQsyeK xKCWtrFvUPUmmpKFSWAO3zhlJgGaejo= X-MC-Unique: 1LqFmwPdPeCz2-ZSXcEaKA-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich , qemu-stable@nongnu.org, Richard Henderson , David Hildenbrand Subject: [PULL 01/16] target/s390x: Make CKSM raise an exception if R2 is odd Date: Mon, 24 Jul 2023 18:53:34 +0200 Message-Id: <20230724165349.55714-2-thuth@redhat.com> In-Reply-To: <20230724165349.55714-1-thuth@redhat.com> References: <20230724165349.55714-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1690217704348100002 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich R2 designates an even-odd register pair; the instruction should raise a specification exception when R2 is not even. Cc: qemu-stable@nongnu.org Fixes: e023e832d0ac ("s390x: translate engine for s390x CPU") Signed-off-by: Ilya Leoshkevich Message-Id: <20230724082032.66864-2-iii@linux.ibm.com> Reviewed-by: Richard Henderson Reviewed-by: David Hildenbrand Signed-off-by: Thomas Huth --- target/s390x/tcg/insn-data.h.inc | 2 +- target/s390x/tcg/translate.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/target/s390x/tcg/insn-data.h.inc b/target/s390x/tcg/insn-data.= h.inc index 457ed25d2f..86a509b0ac 100644 --- a/target/s390x/tcg/insn-data.h.inc +++ b/target/s390x/tcg/insn-data.h.inc @@ -157,7 +157,7 @@ C(0xb2fa, NIAI, E, EH, 0, 0, 0, 0, 0, 0) =20 /* CHECKSUM */ - C(0xb241, CKSM, RRE, Z, r1_o, ra2, new, r1_32, cksm, 0) + C(0xb241, CKSM, RRE, Z, r1_o, ra2_E, new, r1_32, cksm, 0) =20 /* COPY SIGN */ F(0xb372, CPSDR, RRF_b, FPSSH, f3, f2, new, f1, cps, 0, IF_AFP1 | IF= _AFP2 | IF_AFP3) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 6661b27efa..d6e8acee99 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -5779,6 +5779,12 @@ static void in2_ra2(DisasContext *s, DisasOps *o) } #define SPEC_in2_ra2 0 =20 +static void in2_ra2_E(DisasContext *s, DisasOps *o) +{ + return in2_ra2(s, o); +} +#define SPEC_in2_ra2_E SPEC_r2_even + static void in2_a2(DisasContext *s, DisasOps *o) { int x2 =3D have_field(s, x2) ? get_field(s, x2) : 0; --=20 2.39.3 From nobody Sun May 19 02:12:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1690217741; cv=none; d=zohomail.com; s=zohoarc; b=VtOg65xjGyfqgKpaIhDhNWHkNdCZNMATOAYE6j4eaK+SaY0cqI2e/0H2+PE3h3HzdaedXhqGKb34RMmAc6SrfmfuJzR+EK+P6VNVyqMIp4m4/iKtTYIQRrhUWevktfnu0U3QWnetUb0mFUUR38FNVNOVBPK6jGH8YIn3aIdP48k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690217741; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4qgi93289uepzkjshf/hYA5A3RmTT2kI+MG9i97Qsts=; b=DDO2ZMS1S4Tv1jVpBnlOdwQWq2gOl9IXE+OMOLq2nDbx18FqU4b7qxUCOxkJ9jNncOU5P3ZrebN4h9YxkAFxouCiSCVRTxcBmoJ+v6AvHHYMtI8UC0ZOAeVF5yKVTqBsJqwgU/JPUV5zis/v6ImO9dClALcm8ViOozDQLSBH1Kk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1690217741928240.12581071307568; Mon, 24 Jul 2023 09:55:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNyp8-0001Ka-Nq; Mon, 24 Jul 2023 12:54:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyp6-0001Iu-F5 for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyor-0006tS-EJ for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:16 -0400 Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-115-buBQl96JO5CvaSx-wTB2gQ-1; Mon, 24 Jul 2023 12:53:55 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2B2663C13500; Mon, 24 Jul 2023 16:53:55 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED18948FB01; Mon, 24 Jul 2023 16:53:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690217638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4qgi93289uepzkjshf/hYA5A3RmTT2kI+MG9i97Qsts=; b=MLs1OV5dZxbktif1+IqpspdZzmQERsb7iCTnWZcAWtqfc5c88wwTeFL9Cwv8+j9Vs/Ywy+ XI9H+5ybtsIR4PCO7LGb6GRzVmAqwrwBz6TGtXoXK07YnBuBZ3iCV792djDJ3onlK2uYm5 sGMMUFJXJQQNuA+qOmPv3RmLqConbV4= X-MC-Unique: buBQl96JO5CvaSx-wTB2gQ-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich , qemu-stable@nongnu.org, David Hildenbrand , Richard Henderson Subject: [PULL 02/16] target/s390x: Fix CLM with M3=0 Date: Mon, 24 Jul 2023 18:53:35 +0200 Message-Id: <20230724165349.55714-3-thuth@redhat.com> In-Reply-To: <20230724165349.55714-1-thuth@redhat.com> References: <20230724165349.55714-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1690217743507100001 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich When the mask is zero, access exceptions should still be recognized for 1 byte at the second-operand address. CC should be set to 0. Cc: qemu-stable@nongnu.org Fixes: defb0e3157af ("s390x: Implement opcode helpers") Reviewed-by: David Hildenbrand Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich Message-Id: <20230724082032.66864-3-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- target/s390x/tcg/mem_helper.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c index f417fb1183..84103251b9 100644 --- a/target/s390x/tcg/mem_helper.c +++ b/target/s390x/tcg/mem_helper.c @@ -667,6 +667,11 @@ uint32_t HELPER(clm)(CPUS390XState *env, uint32_t r1, = uint32_t mask, HELPER_LOG("%s: r1 0x%x mask 0x%x addr 0x%" PRIx64 "\n", __func__, r1, mask, addr); =20 + if (!mask) { + /* Recognize access exceptions for the first byte */ + probe_read(env, addr, 1, cpu_mmu_index(env, false), ra); + } + while (mask) { if (mask & 8) { uint8_t d =3D cpu_ldub_data_ra(env, addr, ra); --=20 2.39.3 From nobody Sun May 19 02:12:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1690217802; cv=none; d=zohomail.com; s=zohoarc; b=TvtgdSHP2I3Jyth9TaWL+dR9ZTC8buBgb+TljYNMyjxYEvGi25uLNDDWewvmp6qNY5jAkMhqUvKCJPQpLp72x1NCC5t4sIGyN1neFVi5dU0j9hgy5ljfOX7sTwC3K0LI5+2bIq+yvKruw6UTQ+b+mmTPctltNI0zt70nb6fu/g0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690217802; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ERUCIYKT5akT18Yn1fxNNKYgel0HSxbNwdqYnk0k/KQ=; b=K6kF9LlzFk0/82FH4T5foAQtKJc1egCfawzbXCd5ECL0gHeh9AU2YVJf1+Jioxijfzb2Fv7E8HzZLxe83gQURXnmJiRGD3E+tH+cDn2o3HQokgTnL5dk/sBVgVXxhqTmHpv/WpYf33uQHzkCpvoKjIetk8Nb/5tZvjaLtZl69n8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1690217802233629.0527898164382; Mon, 24 Jul 2023 09:56:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNypA-0001Lu-8u; Mon, 24 Jul 2023 12:54:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyp8-0001KS-Bf for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyos-0006ti-9G for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:18 -0400 Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-390-zpnVt5EFNKa-_OW-V6GSJQ-1; Mon, 24 Jul 2023 12:53:57 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AB9B2280BCA6; Mon, 24 Jul 2023 16:53:56 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 70D1148FB01; Mon, 24 Jul 2023 16:53:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690217641; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ERUCIYKT5akT18Yn1fxNNKYgel0HSxbNwdqYnk0k/KQ=; b=KzSfJ8LH6RwjepP6N8fXaByJ4wvla/oqhw7vD9uv+xyxa0oy/0KZKnSHKW0CcYY/4+Yo4i kb3++oG/BWAHkRdmE8+UcPAz9db1VvkOLIsgLkNpy47rBdnNfTaeNwjd1P7nf9ogIstwM1 9GRB9/L5JjhQfbEUtEPHaJhjnUkYBC4= X-MC-Unique: zpnVt5EFNKa-_OW-V6GSJQ-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich , qemu-stable@nongnu.org, David Hildenbrand , Richard Henderson Subject: [PULL 03/16] target/s390x: Fix CONVERT TO LOGICAL/FIXED with out-of-range inputs Date: Mon, 24 Jul 2023 18:53:36 +0200 Message-Id: <20230724165349.55714-4-thuth@redhat.com> In-Reply-To: <20230724165349.55714-1-thuth@redhat.com> References: <20230724165349.55714-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1690217803222100001 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich CONVERT TO LOGICAL/FIXED deviate from IEEE 754 in that they raise an inexact exception on out-of-range inputs. float_flag_invalid_cvti aligns nicely with that behavior, so convert it to S390_IEEE_MASK_INEXACT. Cc: qemu-stable@nongnu.org Fixes: defb0e3157af ("s390x: Implement opcode helpers") Reviewed-by: David Hildenbrand Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich Message-Id: <20230724082032.66864-4-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- target/s390x/tcg/fpu_helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/s390x/tcg/fpu_helper.c b/target/s390x/tcg/fpu_helper.c index 4b7fa58af3..3d941ed2d2 100644 --- a/target/s390x/tcg/fpu_helper.c +++ b/target/s390x/tcg/fpu_helper.c @@ -52,7 +52,8 @@ uint8_t s390_softfloat_exc_to_ieee(unsigned int exc) s390_exc |=3D (exc & float_flag_divbyzero) ? S390_IEEE_MASK_DIVBYZERO = : 0; s390_exc |=3D (exc & float_flag_overflow) ? S390_IEEE_MASK_OVERFLOW : = 0; s390_exc |=3D (exc & float_flag_underflow) ? S390_IEEE_MASK_UNDERFLOW = : 0; - s390_exc |=3D (exc & float_flag_inexact) ? S390_IEEE_MASK_INEXACT : 0; + s390_exc |=3D (exc & (float_flag_inexact | float_flag_invalid_cvti)) ? + S390_IEEE_MASK_INEXACT : 0; =20 return s390_exc; } --=20 2.39.3 From nobody Sun May 19 02:12:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1690217721; cv=none; d=zohomail.com; s=zohoarc; b=CkM1KQu/1y+wH65ni1swZWwFEVmzcXA3c++5T2y6OxGqnO1jQnUVldzEDxttZQyGEXB2GS4Dnf+WOiTcDrgifkhAw5Rj0kuBB7jOYdyqHmfCqFUCMjqYTQDWXD3e9JRypd/f5XQ+ilYQ5nKSkFom93R6IXQ8ba/0aNyBCUw8KhE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690217721; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3ZmbYdDFqccamKq8A2kfeK1Gl4OALNcmdUD8XakNB/c=; b=Ez2g7s3cITOwpMA6QF4jSh7QIatgVpdqesNNeicY+oLmM4okjY5kgmPtVqPvjB5L9LKqYj8FmcuwpI/rpYCxFXsVPO28AeG44fbAjTHIvTGQ+3r5JOUSniYQxDJX6hepbQNG0kRkz7pNzSbY+uF1uM+MQ5FNXLRopngzIstg9+Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1690217721754896.4634799779527; Mon, 24 Jul 2023 09:55:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNyp4-0001HF-PW; Mon, 24 Jul 2023 12:54:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyou-0001FF-JC for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyos-0006tv-Rb for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:04 -0400 Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-686-meairBbvMUuMiDJdJdsYxw-1; Mon, 24 Jul 2023 12:53:58 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 270513C13507; Mon, 24 Jul 2023 16:53:58 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id F21B7492CAC; Mon, 24 Jul 2023 16:53:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690217642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3ZmbYdDFqccamKq8A2kfeK1Gl4OALNcmdUD8XakNB/c=; b=d7O4soDFW7Ly1plGOslUOc8YAPQCtIijOAAQfgy0gTozvuS2yWfMicV1lZ8dEmvoATT72Z KU840zRjZZ/tdvsBL6aKjimrZEfAZZER/uPmeMI+t6XRQFgqXJaxdmmEP+4HLujy3oSvlf j4ldTyPxyefysOdDmQRWBhHfxTmKI2Q= X-MC-Unique: meairBbvMUuMiDJdJdsYxw-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich , qemu-stable@nongnu.org, David Hildenbrand , Richard Henderson Subject: [PULL 04/16] target/s390x: Fix ICM with M3=0 Date: Mon, 24 Jul 2023 18:53:37 +0200 Message-Id: <20230724165349.55714-5-thuth@redhat.com> In-Reply-To: <20230724165349.55714-1-thuth@redhat.com> References: <20230724165349.55714-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1690217723426100001 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich When the mask is zero, access exceptions should still be recognized for 1 byte at the second-operand address. CC should be set to 0. Cc: qemu-stable@nongnu.org Fixes: e023e832d0ac ("s390x: translate engine for s390x CPU") Reviewed-by: David Hildenbrand Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich Message-Id: <20230724082032.66864-5-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- target/s390x/tcg/translate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index d6e8acee99..244e61ad2e 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -2515,6 +2515,12 @@ static DisasJumpType op_icm(DisasContext *s, DisasOp= s *o) ccm =3D ((1ull << len) - 1) << pos; break; =20 + case 0: + /* Recognize access exceptions for the first byte. */ + tcg_gen_qemu_ld_i64(tmp, o->in2, get_mem_index(s), MO_UB); + gen_op_movi_cc(s, 0); + return DISAS_NEXT; + default: /* This is going to be a sequence of loads and inserts. */ pos =3D base + 32 - 8; --=20 2.39.3 From nobody Sun May 19 02:12:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1690217753; cv=none; d=zohomail.com; s=zohoarc; b=dpa/0qaLhNC0ggrvYQGwHV2OJUlUhMsTKQ9lb1fKhR0+j4J6qtAP3NP/pJxahMyZHFXgmaeeXb9/rfh0HjwskJfOjZaO0oTGbCTdgJn13Q65b1ekgLdtQo0tyUCkTeh4G+k1n/HIFNJ6IoB9PFKwx25+Mi9VrizA0ruSRatVy5U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690217753; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QQl7HRL94axMnGZRFFRaqybzWgZPGl6KbF3ideB+fxY=; b=l5lgSSMpAJ1N1Se6ExMkIlb+Ki/7vqxmHSeWezgZNNovtshElibrRN1O657+/02BRLzkVe+b8iAvUs9YBTXyFSADlFgZwzedjBLgJM8s0hzI/vw5J/HQTE70MUTgvDkOP596csgNyXGcKJ8JumIy5WL6mnhlFz3wRjzSl3dkCLQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169021775390343.648426987430526; Mon, 24 Jul 2023 09:55:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNyp6-0001Im-43; Mon, 24 Jul 2023 12:54:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyov-0001Fs-Pi for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyot-0006uP-Vd for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:05 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-692-25g39919OeyuTF0XyvaPpQ-1; Mon, 24 Jul 2023 12:54:00 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 97F8C185A792; Mon, 24 Jul 2023 16:53:59 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 70345492CAC; Mon, 24 Jul 2023 16:53:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690217643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QQl7HRL94axMnGZRFFRaqybzWgZPGl6KbF3ideB+fxY=; b=fSoEo8GJXnl30c7WnapUYlI4o8QU1FpFz/dMqdnfzxf1IjhaZ895CkhzjtJAWmOyZ9nNl8 JbAC6DZYzL0Mb4PCyXhS08Oo2pZeWhhpw/RZuizwgGFhQ6PSaxj3X7NCVMwGIv7NhDtt8y ctZJUEJZJ6HbsKYd2NNXn8ZvsQibCtE= X-MC-Unique: 25g39919OeyuTF0XyvaPpQ-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich , qemu-stable@nongnu.org, David Hildenbrand , Richard Henderson Subject: [PULL 05/16] target/s390x: Make MC raise specification exception when class >= 16 Date: Mon, 24 Jul 2023 18:53:38 +0200 Message-Id: <20230724165349.55714-6-thuth@redhat.com> In-Reply-To: <20230724165349.55714-1-thuth@redhat.com> References: <20230724165349.55714-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1690217754707100001 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich MC requires bit positions 8-11 (upper 4 bits of class) to be zeros, otherwise it must raise a specification exception. Cc: qemu-stable@nongnu.org Fixes: 20d143e2cab8 ("s390x/tcg: Implement MONITOR CALL") Reviewed-by: David Hildenbrand Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich Message-Id: <20230724082032.66864-6-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- target/s390x/tcg/excp_helper.c | 2 +- target/s390x/tcg/translate.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/s390x/tcg/excp_helper.c b/target/s390x/tcg/excp_helper.c index 228aa9f237..3da337f7c7 100644 --- a/target/s390x/tcg/excp_helper.c +++ b/target/s390x/tcg/excp_helper.c @@ -639,7 +639,7 @@ void monitor_event(CPUS390XState *env, void HELPER(monitor_call)(CPUS390XState *env, uint64_t monitor_code, uint32_t monitor_class) { - g_assert(monitor_class <=3D 0xff); + g_assert(monitor_class <=3D 0xf); =20 if (env->cregs[8] & (0x8000 >> monitor_class)) { monitor_event(env, monitor_code, monitor_class, GETPC()); diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 244e61ad2e..84d76f1cea 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -3177,9 +3177,9 @@ static DisasJumpType op_lcbb(DisasContext *s, DisasOp= s *o) =20 static DisasJumpType op_mc(DisasContext *s, DisasOps *o) { - const uint16_t monitor_class =3D get_field(s, i2); + const uint8_t monitor_class =3D get_field(s, i2); =20 - if (monitor_class & 0xff00) { + if (monitor_class & 0xf0) { gen_program_exception(s, PGM_SPECIFICATION); return DISAS_NORETURN; } --=20 2.39.3 From nobody Sun May 19 02:12:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1690217759; cv=none; d=zohomail.com; s=zohoarc; b=jkGI2C9IAT8DubtiVPUOzL7YBp4bYKp4VCApGtzppgl8w32ZwNjrHkV6+RzHPE4YpeFUPwCgmZuZrlo/3zPJ542VhWbLqgBChzTcy48TGXALGPSO8+2FVlv4zfQDFtpAlYKnz5fdyafFL3hQRXk9shfRKlMMjQpvSWK63owI86Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690217759; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ojy6QdvxUObvLh2yi/UgugXDkK6eWkZAG4LI5UhfOn4=; b=aTv6fISboHvIkC+YpsGCQ5S7ufj7QBRwdfNhgNyFLEzh1zRfe1EAHEm0fUP4pERLW/Y2GrqPZITdTMnbiZPqIOUJoKoljev3N4u3Bh1gVG4MCps4xH+ZPIKolD+c3OowTMmAM3G2EYuWGckjmcEEgI4X61wuGovdxgvONadygBE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169021775911390.34465624886434; Mon, 24 Jul 2023 09:55:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNyp5-0001Id-DJ; Mon, 24 Jul 2023 12:54:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyow-0001Fx-TR for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyov-0006ur-Df for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:06 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-156-q6sHrjtMPpaYVcCwr1dxvw-1; Mon, 24 Jul 2023 12:54:01 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 12CDF856F66; Mon, 24 Jul 2023 16:54:01 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9D4A492CAC; Mon, 24 Jul 2023 16:53:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690217644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ojy6QdvxUObvLh2yi/UgugXDkK6eWkZAG4LI5UhfOn4=; b=RpGnAuDiDbGaPV2XojI0UYOXjQkDvRFsVK68gFSI8vgi+rMybNBlxagojqVZoQ6nu2DoLe GwV6AT+UZWCn29xOyRTSIzzMzruzJ1y+L7r7ijqNhhfnam+vlNrWhJ8hNIa4CPTluwNJhy BeKbe8EpdC7HlIKfjjKcEvPVjjnGHbs= X-MC-Unique: q6sHrjtMPpaYVcCwr1dxvw-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich , qemu-stable@nongnu.org, David Hildenbrand , Richard Henderson Subject: [PULL 06/16] target/s390x: Fix assertion failure in VFMIN/VFMAX with type 13 Date: Mon, 24 Jul 2023 18:53:39 +0200 Message-Id: <20230724165349.55714-7-thuth@redhat.com> In-Reply-To: <20230724165349.55714-1-thuth@redhat.com> References: <20230724165349.55714-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1690217760689100011 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Type 13 is reserved, so using it should result in specification exception. Due to an off-by-1 error the code triggers an assertion at a later point in time instead. Cc: qemu-stable@nongnu.org Fixes: da4807527f3b ("s390x/tcg: Implement VECTOR FP (MAXIMUM|MINIMUM)") Reviewed-by: David Hildenbrand Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich Message-Id: <20230724082032.66864-8-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- target/s390x/tcg/translate_vx.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/tcg/translate_vx.c.inc b/target/s390x/tcg/transla= te_vx.c.inc index 43dfbfd03f..f8df121d3d 100644 --- a/target/s390x/tcg/translate_vx.c.inc +++ b/target/s390x/tcg/translate_vx.c.inc @@ -3047,7 +3047,7 @@ static DisasJumpType op_vfmax(DisasContext *s, DisasO= ps *o) const uint8_t m5 =3D get_field(s, m5); gen_helper_gvec_3_ptr *fn; =20 - if (m6 =3D=3D 5 || m6 =3D=3D 6 || m6 =3D=3D 7 || m6 > 13) { + if (m6 =3D=3D 5 || m6 =3D=3D 6 || m6 =3D=3D 7 || m6 >=3D 13) { gen_program_exception(s, PGM_SPECIFICATION); return DISAS_NORETURN; } --=20 2.39.3 From nobody Sun May 19 02:12:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1690217777; cv=none; d=zohomail.com; s=zohoarc; b=VKFdf5o4lK9cBEG/zmF/hSR075PxspqkLL1hxHql/vs1XcMSiaJAU5sdOQYU4PC+X5a6syaKK9oaI8rMRFgNgvmrukMAkMRvqgd3s6sfcCuUMobIcr9GggzmoabAwsfjf1gNCBW9/iA53BGoDhtMbBu+EYa2e3fTed4X3rlbaVo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690217777; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Pmz9Qpoovh22tNLepJxxJ6o/buzGYcVypZvG43zOmhQ=; b=LF0p7tZvAqwyIl/iD1urYRZT4AYfWQL2NpGJ07oaukiKpGa9yTCJZI++mbZ4TLluu5LVIcUhanZqrPqwuk3PPG/3X370F8fcGU3iNT4zTkwjJZTOeQEqFhozIJ2d6YH//yQ2YFcTXD80rGWhDVQ5nPwl4M8fE85K+mDQFIGDhaE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1690217777422980.3906420200802; Mon, 24 Jul 2023 09:56:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNyp6-0001Il-0W; Mon, 24 Jul 2023 12:54:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyox-0001Fy-D9 for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyow-0006uu-1U for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:07 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-17-BQOMgNejNvO7kDSCKFIYsw-1; Mon, 24 Jul 2023 12:54:02 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1DF37104458D; Mon, 24 Jul 2023 16:54:02 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 57FA148FB01; Mon, 24 Jul 2023 16:54:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690217645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Pmz9Qpoovh22tNLepJxxJ6o/buzGYcVypZvG43zOmhQ=; b=NUok/y50cUVtf3pZVpnjCi7xv8NlHnbiCGWMmAN9agXr8Z4xuA542aG3xbyOlh5t6h8q8G xtXsT+41VIJmyJmB3oSX4s2wVNus1QoSZimP3au1IKy0r7K4RxsXIrAb0n5Pjz4sl3U7Jx sLYBtzjVc51Daao3zWs91GwVumLepyM= X-MC-Unique: BQOMgNejNvO7kDSCKFIYsw-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich Subject: [PULL 07/16] tests/tcg/s390x: Test CKSM Date: Mon, 24 Jul 2023 18:53:40 +0200 Message-Id: <20230724165349.55714-8-thuth@redhat.com> In-Reply-To: <20230724165349.55714-1-thuth@redhat.com> References: <20230724165349.55714-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1690217779402100003 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich Message-Id: <20230724082032.66864-9-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/cksm.S | 29 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 tests/tcg/s390x/cksm.S diff --git a/tests/tcg/s390x/Makefile.softmmu-target b/tests/tcg/s390x/Make= file.softmmu-target index 242c7b0f83..e813e318db 100644 --- a/tests/tcg/s390x/Makefile.softmmu-target +++ b/tests/tcg/s390x/Makefile.softmmu-target @@ -16,6 +16,7 @@ LDFLAGS=3D-nostdlib -static =20 ASM_TESTS =3D = \ bal = \ + cksm = \ exrl-ssm-early = \ sam = \ lpsw = \ diff --git a/tests/tcg/s390x/cksm.S b/tests/tcg/s390x/cksm.S new file mode 100644 index 0000000000..563fd3d233 --- /dev/null +++ b/tests/tcg/s390x/cksm.S @@ -0,0 +1,29 @@ + .org 0x8e +program_interruption_code: + .org 0x1d0 /* program new PSW */ + .quad 0,pgm + .org 0x200 /* lowcore padding */ + .globl _start +_start: + lmg %r0,%r1,cksm_args + cksm %r2,%r0 + c %r2,cksm_exp + jne failure + .insn rre,0xb2410000,%r2,%r15 /* cksm %r2,%r15 */ +failure: + lpswe failure_psw +pgm: + chhsi program_interruption_code,6 /* specification exception? */ + jne failure + lpswe success_psw +cksm_args: + .quad cksm_buf, 16 +cksm_buf: + .quad 0xaaaabbbbcccc0000, 0x12345678 +cksm_exp: + .long 0x89ab1234 + .align 8 +success_psw: + .quad 0x2000000000000,0xfff /* see is_special_wait_psw() */ +failure_psw: + .quad 0x2000000000000,0 /* disabled wait */ --=20 2.39.3 From nobody Sun May 19 02:12:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1690217769; cv=none; d=zohomail.com; s=zohoarc; b=Q08gVwdRRoe1MvXDhH3Klm0cXCFJ4QPbefvYEReyD2P1Np+rzqlseMiEGG6Jd5Tl6txgBrgGZZqkLKKn56HPoQxu37W+zAzzBEUiBvJkJ8jtEec/fJzGzyeo+dlXZb4zVZhXySPkcYt66peKhelu+VYBKRbfD3rxTXnNyGFKTLg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690217769; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1gKAXEgra0HgR6HbcyPx5/kEbB9cmaWV7cNn3wXt68Q=; b=T00utDEdjk+bmdRZ1DPfG2sXtNG+Irs1LuOKmFps3co+MnMLsb7bWuDbBbjcimd5g6BkAplBXtZxBFoDEnESjeKSpuLGmhvfahXIRz+yNreeKRuLNrH9wheBPUTO1yyw7YcPk4G2UHrgDBwgIPCBr16whFmpsst2RjqCQ4MYp9g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1690217769464399.9183480987813; Mon, 24 Jul 2023 09:56:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNyp7-0001Js-3x; Mon, 24 Jul 2023 12:54:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyoz-0001G3-S8 for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyox-0006ve-NN for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:09 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-378-qgduR8boOLuuFpNW7hEr8Q-1; Mon, 24 Jul 2023 12:54:03 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 33956881B27; Mon, 24 Jul 2023 16:54:03 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65CEB492CAC; Mon, 24 Jul 2023 16:54:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690217647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1gKAXEgra0HgR6HbcyPx5/kEbB9cmaWV7cNn3wXt68Q=; b=gSXj+3Wdgp/zkWKqWM3z1IEQd5HVWJWPPnQv+ZoKYrdKI1nfIq8DwPlCTR8J50hdTYycVE qlMn5uDXJN0i9vRnFYd9AP7IWoEha21GYBwLYojo9Sl9caHzJ4Xwy4APW0d42Gk78E+Ifi d9AVzgx6w7wdNVhy23AOq1T5OaUB2H4= X-MC-Unique: qgduR8boOLuuFpNW7hEr8Q-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich Subject: [PULL 08/16] tests/tcg/s390x: Test CLGEBR and CGEBRA Date: Mon, 24 Jul 2023 18:53:41 +0200 Message-Id: <20230724165349.55714-9-thuth@redhat.com> In-Reply-To: <20230724165349.55714-1-thuth@redhat.com> References: <20230724165349.55714-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1690217770907100003 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Add a small test to prevent regressions. Tested-by: Thomas Huth Signed-off-by: Ilya Leoshkevich Message-Id: <20230724082032.66864-10-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/tcg/s390x/cgebra.c | 32 ++++++++++++++++++++++++++++++++ tests/tcg/s390x/clgebr.c | 32 ++++++++++++++++++++++++++++++++ tests/tcg/s390x/Makefile.target | 5 +++++ 3 files changed, 69 insertions(+) create mode 100644 tests/tcg/s390x/cgebra.c create mode 100644 tests/tcg/s390x/clgebr.c diff --git a/tests/tcg/s390x/cgebra.c b/tests/tcg/s390x/cgebra.c new file mode 100644 index 0000000000..f91e10d2d3 --- /dev/null +++ b/tests/tcg/s390x/cgebra.c @@ -0,0 +1,32 @@ +/* + * Test the CGEBRA instruction. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include +#include +#include + +int main(void) +{ + float r2 =3D 1E+300; + long long r1; + int cc; + + feclearexcept(FE_ALL_EXCEPT); + asm("cgebra %[r1],%[m3],%[r2],%[m4]\n" + "ipm %[cc]\n" + : [r1] "=3Dr" (r1) + , [cc] "=3Dr" (cc) + : [m3] "i" (5) /* round toward 0 */ + , [r2] "f" (r2) + , [m4] "i" (8) /* bit 0 is set, but must be ignored; XxC is not se= t */ + : "cc"); + cc >>=3D 28; + + assert(r1 =3D=3D 0x7fffffffffffffffLL); + assert(cc =3D=3D 3); + assert(fetestexcept(FE_ALL_EXCEPT) =3D=3D (FE_INVALID | FE_INEXACT)); + + return EXIT_SUCCESS; +} diff --git a/tests/tcg/s390x/clgebr.c b/tests/tcg/s390x/clgebr.c new file mode 100644 index 0000000000..d491899b56 --- /dev/null +++ b/tests/tcg/s390x/clgebr.c @@ -0,0 +1,32 @@ +/* + * Test the CLGEBR instruction. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include +#include +#include + +int main(void) +{ + float r2 =3D -1; + long long r1; + int cc; + + feclearexcept(FE_ALL_EXCEPT); + asm("clgebr %[r1],%[m3],%[r2],%[m4]\n" + "ipm %[cc]\n" + : [r1] "=3Dr" (r1) + , [cc] "=3Dr" (cc) + : [m3] "i" (5) /* round toward 0 */ + , [r2] "f" (r2) + , [m4] "i" (8) /* bit 0 is set, but must be ignored; XxC is not se= t */ + : "cc"); + cc >>=3D 28; + + assert(r1 =3D=3D 0); + assert(cc =3D=3D 3); + assert(fetestexcept(FE_ALL_EXCEPT) =3D=3D (FE_INVALID | FE_INEXACT)); + + return EXIT_SUCCESS; +} diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.tar= get index 19fbbc6e53..71bf39b78d 100644 --- a/tests/tcg/s390x/Makefile.target +++ b/tests/tcg/s390x/Makefile.target @@ -39,12 +39,17 @@ TESTS+=3Dmxdb TESTS+=3Depsw TESTS+=3Dlarl TESTS+=3Dmdeb +TESTS+=3Dcgebra +TESTS+=3Dclgebr =20 cdsg: CFLAGS+=3D-pthread cdsg: LDFLAGS+=3D-pthread =20 rxsbg: CFLAGS+=3D-O2 =20 +cgebra: LDFLAGS+=3D-lm +clgebr: LDFLAGS+=3D-lm + include $(S390X_SRC)/pgm-specification.mak $(PGM_SPECIFICATION_TESTS): pgm-specification-user.o $(PGM_SPECIFICATION_TESTS): LDFLAGS+=3Dpgm-specification-user.o --=20 2.39.3 From nobody Sun May 19 02:12:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1690217718; cv=none; d=zohomail.com; s=zohoarc; b=BY/NzkjsYLhZ5YbZb+QLtiNsfkkgKpaiP5kHUr58qshiLW19XGx+0isPk2db08Vn/yTdyr7qikCB+gE/wlxrWMv1u8+WyIgWEUMLwfimpfQ/lIEUlQA7dyvTT8qWwGfi/XnQuHCrvoUM8Yj1v7MiURhxl/W8XJ2XfmPO7nD4pbY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690217718; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nFJNxFMoP1z0Pyr8y71Psk7wgz0h6JymgTyC9s0CgXs=; b=gMhiCTu4hnzC09ioNMbi3WO6aYVKdrmBG20g1tR5woPXomqpAVGOwEObePoanMz0J0GJ4sV7ar5HzuFtRvTdK9MNwOoqCL2YWjrDebXvHDocRU5XGsOull+sS2sk9ZoCLPLkY45OMQ2ucEStVA500L4WkGG1A159f5sjwN0WPOM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16902177179890.7461125060889344; Mon, 24 Jul 2023 09:55:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNyp9-0001Ki-1y; Mon, 24 Jul 2023 12:54:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyoy-0001G2-GY for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyow-0006vL-T5 for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:08 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-169-nOXxmH_XPS2jPX0-8IbyXg-1; Mon, 24 Jul 2023 12:54:04 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 50B8F8030AC; Mon, 24 Jul 2023 16:54:04 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 781B7492CAC; Mon, 24 Jul 2023 16:54:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690217646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nFJNxFMoP1z0Pyr8y71Psk7wgz0h6JymgTyC9s0CgXs=; b=YhC8/9/gByy38UAGxoOwWDaFitnwr4rrhEIzgBlDq0FVg7rn5yqXL2htsKpq6lIFFdZSCm hg9qk6wIIMI7/s6w0uOaojuuY67f8qHSMNPS/cx0R7QdYWzPkNlplP8Uo1uz/eTcZxQUiK EezYMi+W+8gEBUsVJzht+rBA3RhhtEw= X-MC-Unique: nOXxmH_XPS2jPX0-8IbyXg-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich Subject: [PULL 09/16] tests/tcg/s390x: Test CLM Date: Mon, 24 Jul 2023 18:53:42 +0200 Message-Id: <20230724165349.55714-10-thuth@redhat.com> In-Reply-To: <20230724165349.55714-1-thuth@redhat.com> References: <20230724165349.55714-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1690217718309100005 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Add a small test to prevent regressions. Tested-by: Thomas Huth Signed-off-by: Ilya Leoshkevich Message-Id: <20230724082032.66864-11-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/clm.S | 29 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 tests/tcg/s390x/clm.S diff --git a/tests/tcg/s390x/Makefile.softmmu-target b/tests/tcg/s390x/Make= file.softmmu-target index e813e318db..062d8e368a 100644 --- a/tests/tcg/s390x/Makefile.softmmu-target +++ b/tests/tcg/s390x/Makefile.softmmu-target @@ -17,6 +17,7 @@ LDFLAGS=3D-nostdlib -static ASM_TESTS =3D = \ bal = \ cksm = \ + clm = \ exrl-ssm-early = \ sam = \ lpsw = \ diff --git a/tests/tcg/s390x/clm.S b/tests/tcg/s390x/clm.S new file mode 100644 index 0000000000..17156a81f2 --- /dev/null +++ b/tests/tcg/s390x/clm.S @@ -0,0 +1,29 @@ + .org 0x8e +program_interruption_code: + .org 0x1d0 /* program new PSW */ + .quad 0,pgm + .org 0x200 /* lowcore padding */ + .globl _start +_start: + lgrl %r0,op1 + clm %r0,6,op2 + jle failure + lgrl %r1,bad_addr + clm %r0,0,0(%r1) +failure: + lpswe failure_psw +pgm: + chhsi program_interruption_code,5 /* addressing exception? */ + jne failure + lpswe success_psw + .align 8 +op1: + .quad 0x1234567887654321 +op2: + .quad 0x3456789abcdef012 +bad_addr: + .quad 0xffffffff00000000 +success_psw: + .quad 0x2000000000000,0xfff /* see is_special_wait_psw() */ +failure_psw: + .quad 0x2000000000000,0 /* disabled wait */ --=20 2.39.3 From nobody Sun May 19 02:12:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1690217703; cv=none; d=zohomail.com; s=zohoarc; b=IHlhL82oMJRj5kxmPvYkuk26HtgDOSRBMpj+7jfjakM7HfKUiOigK+Dx4D4FiqRCRzaY8fUuAOhH0ye4d8EAonffjcRqGhShhlv6IP5tx3cTnyxX0I8nrTIeSSmob6l7GmeExhpMuXxKj9jQG5C/VsU1euqO8KlM/OXXUxFQkFY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690217703; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=V1FPmqMhfqcrnIQOop+duFFFielJgMHsobOJxQfZPCY=; b=kBMZZPldlg3CPXlkikj25pD2CwuNMzdPtZhwLRl/+TQ0qctVo6nDZzER2qDBRqErg/G+Reu09rEosXCvQ6W0AFNTbVjuCspjjEuP3onPd+WZ9ttKceEcVuFK9A5+jZcydh03hD+QGQ+65apR7rjGtEXDZeVFhIieuWfjdCRboXY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1690217703494252.57985415441829; Mon, 24 Jul 2023 09:55:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNyp9-0001Lc-L2; Mon, 24 Jul 2023 12:54:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyp2-0001HG-6G for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyoy-0006vw-TU for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:10 -0400 Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-688-l-D2fkk8N4G7TYTQOdIc_A-1; Mon, 24 Jul 2023 12:54:05 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 851161C0E0C4; Mon, 24 Jul 2023 16:54:05 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id C32F2492CAC; Mon, 24 Jul 2023 16:54:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690217648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V1FPmqMhfqcrnIQOop+duFFFielJgMHsobOJxQfZPCY=; b=C4uHGok9dfTdNXIwUzCDHvblPYRrigWtsat6245o2b1twUV5n/Hm0uIhj6Nl5GRX8HVgkU 2x4OVd2QR9Fjnb6//5RivnwohDKWBZetvvvilYTF2iTAKdjKBbVFCbh/YT8ATK4QK1gSO3 SWyMWknuAFTzxa4nwEDApE187Lb2Mmw= X-MC-Unique: l-D2fkk8N4G7TYTQOdIc_A-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich Subject: [PULL 10/16] tests/tcg/s390x: Test ICM Date: Mon, 24 Jul 2023 18:53:43 +0200 Message-Id: <20230724165349.55714-11-thuth@redhat.com> In-Reply-To: <20230724165349.55714-1-thuth@redhat.com> References: <20230724165349.55714-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1690217705512100005 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Add a small test to prevent regressions. Tested-by: Thomas Huth Signed-off-by: Ilya Leoshkevich Message-Id: <20230724082032.66864-12-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/icm.S | 32 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 tests/tcg/s390x/icm.S diff --git a/tests/tcg/s390x/Makefile.softmmu-target b/tests/tcg/s390x/Make= file.softmmu-target index 062d8e368a..58684d7da7 100644 --- a/tests/tcg/s390x/Makefile.softmmu-target +++ b/tests/tcg/s390x/Makefile.softmmu-target @@ -19,6 +19,7 @@ ASM_TESTS =3D = \ cksm = \ clm = \ exrl-ssm-early = \ + icm = \ sam = \ lpsw = \ lpswe-early = \ diff --git a/tests/tcg/s390x/icm.S b/tests/tcg/s390x/icm.S new file mode 100644 index 0000000000..d24d1f52fb --- /dev/null +++ b/tests/tcg/s390x/icm.S @@ -0,0 +1,32 @@ + .org 0x8e +program_interruption_code: + .org 0x1d0 /* program new PSW */ + .quad 0,pgm + .org 0x200 /* lowcore padding */ + .globl _start +_start: + lgrl %r0,op1 + icm %r0,10,op2 + cg %r0,exp + jne failure + lgrl %r1,bad_addr + icm %r0,0,0(%r1) +failure: + lpswe failure_psw +pgm: + chhsi program_interruption_code,5 /* addressing exception? */ + jne failure + lpswe success_psw + .align 8 +op1: + .quad 0x1234567887654321 +op2: + .quad 0x0011223344556677 +exp: + .quad 0x1234567800651121 +bad_addr: + .quad 0xffffffff00000000 +success_psw: + .quad 0x2000000000000,0xfff /* see is_special_wait_psw() */ +failure_psw: + .quad 0x2000000000000,0 /* disabled wait */ --=20 2.39.3 From nobody Sun May 19 02:12:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1690217807; cv=none; d=zohomail.com; s=zohoarc; b=l5aS8uw748xf6ywYJLNeyo8+9kTmqNvYY66RQ0bHn7YoRaNVyAbaXzgB5iQEJi4jIrJ7HSlK0yE3J2CVsHt7/V7CtfnVJiMY4OpSkaGOe0h9XkqmBafzcXT2VS1rIh1inzAuTlBbj5XmotxN3jG3u1Un/jeXrW/8D5lNQMOms8Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690217807; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zvEkjxFawxSMsxHLnuRRdzlHwbPPlU/4PabyCVxDysY=; b=JRtqe9klzJuftY70zaMw7QVompHbPBAGM+AHaElHU3Fi6PpEBiYAUQKAzAW1h3EOKjj4TBxaJZpQbh+Kr25bq60QcwbyIGZzxz+CMk8lUPG1R+ITSq704drMiZcrMEsUAu2OMBI9CaPjmdUkddt5jy6f/kvTRY0g5jzk3QWCsw0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169021780715614.704326209047395; Mon, 24 Jul 2023 09:56:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNyp6-0001J0-HT; Mon, 24 Jul 2023 12:54:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyp2-0001HH-6G for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyoz-0006w3-U5 for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:11 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-503-c-wL0NRTOLW1uggDTJto_Q-1; Mon, 24 Jul 2023 12:54:07 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9881985A58A; Mon, 24 Jul 2023 16:54:06 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id CD3AC492CAC; Mon, 24 Jul 2023 16:54:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690217649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zvEkjxFawxSMsxHLnuRRdzlHwbPPlU/4PabyCVxDysY=; b=WoFjejIR8ov9fp1/iqlTL54VUlgrf3GrzGjyxYXwIzhaSTOxXKcFDdv2mV3vuOv8jbAXw+ Ver1M/l6lCzoENDFwga75z1sRMihKRWyKAyz70sE59VVkWNeoS8T8XGQVoi3XAIQCBSfFz dcGwCwwaASKzKzezT5rW4o6yIQiogHE= X-MC-Unique: c-wL0NRTOLW1uggDTJto_Q-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich Subject: [PULL 11/16] tests/tcg/s390x: Test MC Date: Mon, 24 Jul 2023 18:53:44 +0200 Message-Id: <20230724165349.55714-12-thuth@redhat.com> In-Reply-To: <20230724165349.55714-1-thuth@redhat.com> References: <20230724165349.55714-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1690217809275100003 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Add a small test to prevent regressions. Tested-by: Thomas Huth Signed-off-by: Ilya Leoshkevich Message-Id: <20230724082032.66864-13-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/mc.S | 56 +++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 tests/tcg/s390x/mc.S diff --git a/tests/tcg/s390x/Makefile.softmmu-target b/tests/tcg/s390x/Make= file.softmmu-target index 58684d7da7..145e0bfde1 100644 --- a/tests/tcg/s390x/Makefile.softmmu-target +++ b/tests/tcg/s390x/Makefile.softmmu-target @@ -24,6 +24,7 @@ ASM_TESTS =3D = \ lpsw = \ lpswe-early = \ lra = \ + mc = \ ssm-early = \ stosm-early = \ unaligned-lowcore diff --git a/tests/tcg/s390x/mc.S b/tests/tcg/s390x/mc.S new file mode 100644 index 0000000000..e7466bb4b5 --- /dev/null +++ b/tests/tcg/s390x/mc.S @@ -0,0 +1,56 @@ + .org 0x8d +ilc: + .org 0x8e +program_interruption_code: + .org 0x94 +monitor_class: + .org 0xb0 +monitor_code: + .org 0x150 +program_old_psw: + .org 0x1d0 /* program new PSW */ + .quad 0x180000000,pgm /* 64-bit mode */ + .org 0x200 /* lowcore padding */ + .globl _start +_start: + stctg %c8,%c8,c8 /* enable only monitor class 1= */ + mvhhi c8+6,0x4000 + lctlg %c8,%c8,c8 +mc_nop: + mc 123,0 +mc_monitor_event: + mc 321,1 + j failure +mc_specification: + mc 333,16 + j failure +pgm: + lgrl %r0,program_old_psw+8 /* ilc adjustment */ + llgc %r1,ilc + sgr %r0,%r1 + larl %r1,mc_monitor_event /* dispatch based on old PSW */ + cgrje %r0,%r1,pgm_monitor_event + larl %r1,mc_specification + cgrje %r0,%r1,pgm_specification + j failure +pgm_monitor_event: + chhsi program_interruption_code,0x40 /* monitor event? */ + jne failure + chhsi monitor_class,1 /* class from mc_monitor_event= ? */ + jne failure + cghsi monitor_code,321 /* code from mc_monitor_event?= */ + jne failure + j mc_specification /* next test */ +pgm_specification: + chhsi program_interruption_code,6 /* specification exception? */ + jne failure + lpswe success_psw +failure: + lpswe failure_psw + .align 8 +c8: + .quad 0 +success_psw: + .quad 0x2000000000000,0xfff /* see is_special_wait_psw() */ +failure_psw: + .quad 0x2000000000000,0 /* disabled wait */ --=20 2.39.3 From nobody Sun May 19 02:12:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1690217762; cv=none; d=zohomail.com; s=zohoarc; b=Vyo92pZRHc66CrSK+nzYWNut7zvLukUqUQMgl7HtUI0uFw+HA40ChxHPo/tM7FyfyYAJRv43mEAK4+hGFJbHnVCJHNiUy2vEYcmnYBOOfzbKXMUJv3KHg/bjfuTdJevVCpS9zHrz2sTj4BGFj+yLhO/0W+AqZNKAlQ4bbiBTV1E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690217762; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=z0ivgEtnxs0YGV0qRka4zNEb2i4d8MpMhmA/3c8rDJg=; b=GJKbBo94KNc+en4RngPWgH6Pbq9OLUw5/rYoPpea77ajWLc8bMcEYwV9nfx+hyl5McMMcaVHPMtb2TjagWcUXA3gAQt5APfSAZ4X86ncwLYNWs7O6zOomU6WbVr5rFm8odrwxWa2dxRguJz+tsS0yH6t/qqlltLj2MNKJnUfAGQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1690217762127967.4860816001295; Mon, 24 Jul 2023 09:56:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNyp5-0001Ik-LC; Mon, 24 Jul 2023 12:54:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyp4-0001HW-IY for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyp3-0006wi-33 for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:14 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-533-nSpf1lUGO-Gcdn59vnA6eA-1; Mon, 24 Jul 2023 12:54:08 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A7FA8185A793; Mon, 24 Jul 2023 16:54:07 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id DEC2E492CAC; Mon, 24 Jul 2023 16:54:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690217652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z0ivgEtnxs0YGV0qRka4zNEb2i4d8MpMhmA/3c8rDJg=; b=PVLgpCQ28356S7iHJIYjM4F+2MXr5PE8X0vsK8rEbW+EN5Q8eTXel7XLkhon/FKjktXIN5 gzK8CjOIKoj7E3u2lmAdDQGQ3lh+hrheZ3o995OmAmbE+QwHjhzlULaeYXYWtSzo9jSVEj +aM9TzvQKQ+Qc7fCSbFLtvGHGN5aWV4= X-MC-Unique: nSpf1lUGO-Gcdn59vnA6eA-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich Subject: [PULL 12/16] tests/tcg/s390x: Test STPQ Date: Mon, 24 Jul 2023 18:53:45 +0200 Message-Id: <20230724165349.55714-13-thuth@redhat.com> In-Reply-To: <20230724165349.55714-1-thuth@redhat.com> References: <20230724165349.55714-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1690217762735100013 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Add a small test to prevent regressions. Tested-by: Thomas Huth Signed-off-by: Ilya Leoshkevich Message-Id: <20230724082032.66864-14-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/stpq.S | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 tests/tcg/s390x/stpq.S diff --git a/tests/tcg/s390x/Makefile.softmmu-target b/tests/tcg/s390x/Make= file.softmmu-target index 145e0bfde1..76345b6e64 100644 --- a/tests/tcg/s390x/Makefile.softmmu-target +++ b/tests/tcg/s390x/Makefile.softmmu-target @@ -27,6 +27,7 @@ ASM_TESTS =3D = \ mc = \ ssm-early = \ stosm-early = \ + stpq = \ unaligned-lowcore =20 include $(S390X_SRC)/pgm-specification.mak diff --git a/tests/tcg/s390x/stpq.S b/tests/tcg/s390x/stpq.S new file mode 100644 index 0000000000..687a52eafa --- /dev/null +++ b/tests/tcg/s390x/stpq.S @@ -0,0 +1,20 @@ + .org 0x200 /* lowcore padding */ + .globl _start +_start: + lgrl %r0,value + lgrl %r1,value+8 + stpq %r0,stored_value + clc stored_value(16),value + jne failure + lpswe success_psw +failure: + lpswe failure_psw + .align 16 +value: + .quad 0x1234567887654321, 0x8765432112345678 +stored_value: + .quad 0, 0 +success_psw: + .quad 0x2000000000000,0xfff /* see is_special_wait_psw() */ +failure_psw: + .quad 0x2000000000000,0 /* disabled wait */ --=20 2.39.3 From nobody Sun May 19 02:12:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1690217756; cv=none; d=zohomail.com; s=zohoarc; b=X4NDVjnN90d58Sql1/z3wlnoUPpF8ytSIUMqBcbPBvXutyMIDixgOOWGOB8WTYQqucdeaqc6daSso6FtO3B/Rh0MIBhCjUrvsonGPdsTxGaxbLfa8SDt7q1YM83j18/tFUxgGLRzZNbRD3A8k832JhLaUzqBrhbboG2Q8kpFz5s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690217756; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UPZAqp99usLpVFtgppm/Pe3CTt20xx/6W024G0Ze3fE=; b=PVw1JM6kAX7UC/D3GwqmC3QOm/BN7Pmvsuizd0fRv2WcSoJlydJ/Bu4Vyla7ie2b0CFfHEni0u3rC/g/23Vq6slmaMQwz8I5HAh/sVHxecggr2Fguut54m+WZyKQ0dEY1ax1xBxhWB5XjN91sd/VoZ1nzopx73WpQHU3yB52k60= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1690217756659668.127105080991; Mon, 24 Jul 2023 09:55:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNyp8-0001KT-FI; Mon, 24 Jul 2023 12:54:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyp7-0001K7-9q for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyp5-0006x5-Tl for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:17 -0400 Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-583-xbeCtrV1PVeuTOBUlDTciQ-1; Mon, 24 Jul 2023 12:54:12 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B0E463C13507; Mon, 24 Jul 2023 16:54:08 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 00761492CAC; Mon, 24 Jul 2023 16:54:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690217655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UPZAqp99usLpVFtgppm/Pe3CTt20xx/6W024G0Ze3fE=; b=af0a7amjr6lOiKV0louF6qO1R5dtV0pqYKRTXoZ/+mu9MiJWnKdar7V2r7F5HuWBCD8bgl x7UUZM5eEce/6vJHgYMbq46yeuXEJQHOV/LGeYBR+5E+Ih6tVxafIUWGz5K5gVHsiYFn8Q FbtBDFlrx9EOUgyer3jQUYfNRoNqUKs= X-MC-Unique: xbeCtrV1PVeuTOBUlDTciQ-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Ilya Leoshkevich Subject: [PULL 13/16] tests/tcg/s390x: Test VCKSM Date: Mon, 24 Jul 2023 18:53:46 +0200 Message-Id: <20230724165349.55714-14-thuth@redhat.com> In-Reply-To: <20230724165349.55714-1-thuth@redhat.com> References: <20230724165349.55714-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1690217758676100007 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Add a small test to prevent regressions. Tested-by: Thomas Huth Signed-off-by: Ilya Leoshkevich Message-Id: <20230724082032.66864-15-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/tcg/s390x/vx.h | 2 ++ tests/tcg/s390x/vcksm.c | 31 +++++++++++++++++++++++++++++++ tests/tcg/s390x/Makefile.target | 1 + 3 files changed, 34 insertions(+) create mode 100644 tests/tcg/s390x/vcksm.c diff --git a/tests/tcg/s390x/vx.h b/tests/tcg/s390x/vx.h index 02e7fd518a..00701dbe35 100644 --- a/tests/tcg/s390x/vx.h +++ b/tests/tcg/s390x/vx.h @@ -1,6 +1,8 @@ #ifndef QEMU_TESTS_S390X_VX_H #define QEMU_TESTS_S390X_VX_H =20 +#include + typedef union S390Vector { uint64_t d[2]; /* doubleword */ uint32_t w[4]; /* word */ diff --git a/tests/tcg/s390x/vcksm.c b/tests/tcg/s390x/vcksm.c new file mode 100644 index 0000000000..452daaae6c --- /dev/null +++ b/tests/tcg/s390x/vcksm.c @@ -0,0 +1,31 @@ +/* + * Test the VCKSM instruction. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include +#include +#include +#include "vx.h" + +int main(void) +{ + S390Vector v1; + S390Vector v2 =3D { + .d[0] =3D 0xb2261c8140edce49ULL, + .d[1] =3D 0x387bf5a433af39d1ULL, + }; + S390Vector v3 =3D { + .d[0] =3D 0x73b03d2c7f9e654eULL, + .d[1] =3D 0x23d74e51fb479877ULL, + }; + S390Vector exp =3D {.d[0] =3D 0xdedd7f8eULL, .d[1] =3D 0ULL}; + + asm volatile("vcksm %[v1],%[v2],%[v3]" + : [v1] "=3Dv" (v1.v) + : [v2] "v" (v2.v) + , [v3] "v" (v3.v)); + assert(memcmp(&v1, &exp, sizeof(v1)) =3D=3D 0); + + return EXIT_SUCCESS; +} diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.tar= get index 71bf39b78d..1fc9809907 100644 --- a/tests/tcg/s390x/Makefile.target +++ b/tests/tcg/s390x/Makefile.target @@ -58,6 +58,7 @@ TESTS +=3D $(PGM_SPECIFICATION_TESTS) Z13_TESTS=3Dvistr Z13_TESTS+=3Dlcbb Z13_TESTS+=3Dlocfhr +Z13_TESTS+=3Dvcksm $(Z13_TESTS): CFLAGS+=3D-march=3Dz13 -O2 TESTS+=3D$(Z13_TESTS) =20 --=20 2.39.3 From nobody Sun May 19 02:12:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1690217715; cv=none; d=zohomail.com; s=zohoarc; b=mSIhqZS4sRnjKa/LcxdHTsqNFnShO7tjP4aE2IsGnG/j3PfELn1URAxHCTDz9DvHXT7rPqctDYfV8PuOFZYN33/dpxAYmFjzAD8cToeVqWktB4k7QXtJodQQf9jMHXtfPW8K/OhKl08Sh4HIqSZ1sTFAE8T8SoR5Tw5m2w6b/g0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690217715; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iPOxlP9jVVZgRq1ag3lsE4EewRndCV9jE1VIxSImnvE=; b=aBHjGwJf1uLd6p8vwgdCQURTlXBsp6E97h/6kkvK4e/AGIPkuXpWryZym7mc8GrUvZGpPGX3qcgmj38OyxiyOieKNIVQ1D3wMxtFyfUFrUE0dl44xsRInsgpwnwlwxlFJPN+l+w8CTKNa+2pYVmCyfYY2qu/8xfoQVTf9VsiOkc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1690217715253158.38049710865914; Mon, 24 Jul 2023 09:55:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNypD-0001NX-Qg; Mon, 24 Jul 2023 12:54:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNypB-0001N3-VR for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNypA-0006y0-KD for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:21 -0400 Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-350-IKz5f-jTMXyeOz5PYbT9pA-1; Mon, 24 Jul 2023 12:54:17 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BD35B280BCA5; Mon, 24 Jul 2023 16:54:09 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 07E7C492CAC; Mon, 24 Jul 2023 16:54:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690217660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iPOxlP9jVVZgRq1ag3lsE4EewRndCV9jE1VIxSImnvE=; b=jMqs3zdWIBPKTBJBqJlge1QT8QpY6cwa9M+vnoATYC34fU9u9Nk1Y/1GatYoka1CybVOiy rWkahL2u85m8Rq0YIYMXf7dbRU3Ur6gN6VgBkUx08vkXtxCkPrqkZQeLNJ9BYcJe1Uc+FE GE3BVoDhdsZQd0wIoaGKBM/uCGv/nfA= X-MC-Unique: IKz5f-jTMXyeOz5PYbT9pA-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Juan Quintela Subject: [PULL 14/16] tests/avocado/migration: Remove the malfunctioning s390x tests Date: Mon, 24 Jul 2023 18:53:47 +0200 Message-Id: <20230724165349.55714-15-thuth@redhat.com> In-Reply-To: <20230724165349.55714-1-thuth@redhat.com> References: <20230724165349.55714-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1690217716264100001 Content-Type: text/plain; charset="utf-8" The tests from tests/avocado/migration.py do not work at all on s390x - the bios shuts down immediately when it cannot find a boot disk, so there is nothing left to migrate here. For doing a proper migration test, we would need a proper payload, but we already do such tests in the migration *qtest*, so it is unnecessary to redo such a test here, thus let's simply remove this test. Message-Id: <20230721164346.10112-1-thuth@redhat.com> Reviewed-by: Juan Quintela Signed-off-by: Thomas Huth --- tests/avocado/migration.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/tests/avocado/migration.py b/tests/avocado/migration.py index 8b2ec0e3c4..fdc1d234fb 100644 --- a/tests/avocado/migration.py +++ b/tests/avocado/migration.py @@ -134,21 +134,3 @@ def test_migration_with_unix(self): =20 def test_migration_with_exec(self): self.migration_with_exec() - - -@skipUnless('s390x' in os.uname()[4], "host !=3D target") -class S390X(MigrationTest): - """ - :avocado: tags=3Darch:s390x - :avocado: tags=3Dmachine:s390-ccw-virtio - :avocado: tags=3Dcpu:qemu - """ - - def test_migration_with_tcp_localhost(self): - self.migration_with_tcp_localhost() - - def test_migration_with_unix(self): - self.migration_with_unix() - - def test_migration_with_exec(self): - self.migration_with_exec() --=20 2.39.3 From nobody Sun May 19 02:12:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1690217746; cv=none; d=zohomail.com; s=zohoarc; b=BynUQ5b6fsStu2MmSkPyXlcITSIpRrDioU5/fu0U/sZfj93V59nx30QWOovsJSPDT6qFd/2tF4vYRrqFFpS/KUMSE8EigQAMijL+lYKX9KaA7EaszgvSbArrKadKF8Nag+mjcu1pa7YXFQwU90vtWzJafKIfonY3MNiIED55IhM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690217746; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YiWtFAUzA2SuCKiDe2sa0GXcXSqiDxu6vVONDFunCJE=; b=Vq3YP+3bVVdingy8Rq1ZLjUtjjHrnnnX8ZOPj75Kp2wf3eOXtpE/2i0NhGqdCN1bCmmFL8ZjpDTd6vPnA6OXAjBzq4ixbvs2Ge1HaOXk0LgglTotIBYIxU+f0Kfwo1VR2iEfuYpfjPU1ONOpMLV5L82vy2YyWqyqFptISDLuk/o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1690217746617240.77336068478292; Mon, 24 Jul 2023 09:55:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNypG-0001O6-BK; Mon, 24 Jul 2023 12:54:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNypE-0001Nl-QJ for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNypD-0006yS-AJ for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:24 -0400 Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-581-d9K8TNP_OomqOCqcVZWbcg-1; Mon, 24 Jul 2023 12:54:15 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 305B3280BC54; Mon, 24 Jul 2023 16:54:12 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C7EA492CAC; Mon, 24 Jul 2023 16:54:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690217662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YiWtFAUzA2SuCKiDe2sa0GXcXSqiDxu6vVONDFunCJE=; b=FWluOWDvyGinbwvOCm3oncXXASh6/Kgq82uwuzLRE4TVj0IRGU7NcHxfHeMzb7aqmVxu1c U97IYSvAoP0Y/WzzPa7fkpFMSJh610kHesfAjsMsVo8Kvz4mEIn34P34pou3VJWio0jU90 xkfNRyt2OQ5KMoAscyT2/dWnByMSd4I= X-MC-Unique: d9K8TNP_OomqOCqcVZWbcg-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-stable@nongnu.org, Song Gao Subject: [PULL 15/16] target/loongarch: Fix the CSRRD CPUID instruction on big endian hosts Date: Mon, 24 Jul 2023 18:53:48 +0200 Message-Id: <20230724165349.55714-16-thuth@redhat.com> In-Reply-To: <20230724165349.55714-1-thuth@redhat.com> References: <20230724165349.55714-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1690217748629100003 Content-Type: text/plain; charset="utf-8" The test in tests/avocado/machine_loongarch.py is currently failing on big endian hosts like s390x. By comparing the traces between running the QEMU_EFI.fd bios on a s390x and on a x86 host, it's quickly obvious that the CSRRD instruction for the CPUID is behaving differently. And indeed: The code currently does a long read (i.e. 64 bit) from the address that points to the CPUState->cpu_index field (with tcg_gen_ld_tl() in the trans_csrrd() function). But this cpu_index field is only an "int" (i.e. 32 bit). While this dirty pointer magic works on little endian hosts, it of course fails on big endian hosts. Fix it by using a proper helper function instead. Cc: qemu-stable@nongnu.org Message-Id: <20230720175307.854460-1-thuth@redhat.com> Reviewed-by: Song Gao Signed-off-by: Thomas Huth --- target/loongarch/cpu.h | 1 + target/loongarch/helper.h | 1 + target/loongarch/csr_helper.c | 9 +++++++++ target/loongarch/insn_trans/trans_privileged.c.inc | 8 +------- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index ed04027af1..fa371ca8ba 100644 --- a/target/loongarch/cpu.h +++ b/target/loongarch/cpu.h @@ -342,6 +342,7 @@ typedef struct CPUArchState { uint64_t CSR_DBG; uint64_t CSR_DERA; uint64_t CSR_DSAVE; + uint64_t CSR_CPUID; =20 #ifndef CONFIG_USER_ONLY LoongArchTLB tlb[LOONGARCH_TLB_MAX]; diff --git a/target/loongarch/helper.h b/target/loongarch/helper.h index b9de77d926..ffb1e0b0bf 100644 --- a/target/loongarch/helper.h +++ b/target/loongarch/helper.h @@ -98,6 +98,7 @@ DEF_HELPER_1(rdtime_d, i64, env) #ifndef CONFIG_USER_ONLY /* CSRs helper */ DEF_HELPER_1(csrrd_pgd, i64, env) +DEF_HELPER_1(csrrd_cpuid, i64, env) DEF_HELPER_1(csrrd_tval, i64, env) DEF_HELPER_2(csrwr_estat, i64, env, tl) DEF_HELPER_2(csrwr_asid, i64, env, tl) diff --git a/target/loongarch/csr_helper.c b/target/loongarch/csr_helper.c index 6526367946..55341551a5 100644 --- a/target/loongarch/csr_helper.c +++ b/target/loongarch/csr_helper.c @@ -35,6 +35,15 @@ target_ulong helper_csrrd_pgd(CPULoongArchState *env) return v; } =20 +target_ulong helper_csrrd_cpuid(CPULoongArchState *env) +{ + LoongArchCPU *lac =3D env_archcpu(env); + + env->CSR_CPUID =3D CPU(lac)->cpu_index; + + return env->CSR_CPUID; +} + target_ulong helper_csrrd_tval(CPULoongArchState *env) { LoongArchCPU *cpu =3D env_archcpu(env); diff --git a/target/loongarch/insn_trans/trans_privileged.c.inc b/target/lo= ongarch/insn_trans/trans_privileged.c.inc index 02bca7ca23..9c9de090f0 100644 --- a/target/loongarch/insn_trans/trans_privileged.c.inc +++ b/target/loongarch/insn_trans/trans_privileged.c.inc @@ -99,13 +99,7 @@ static const CSRInfo csr_info[] =3D { CSR_OFF(PWCH), CSR_OFF(STLBPS), CSR_OFF(RVACFG), - [LOONGARCH_CSR_CPUID] =3D { - .offset =3D (int)offsetof(CPUState, cpu_index) - - (int)offsetof(LoongArchCPU, env), - .flags =3D CSRFL_READONLY, - .readfn =3D NULL, - .writefn =3D NULL - }, + CSR_OFF_FUNCS(CPUID, CSRFL_READONLY, gen_helper_csrrd_cpuid, NULL), CSR_OFF_FLAGS(PRCFG1, CSRFL_READONLY), CSR_OFF_FLAGS(PRCFG2, CSRFL_READONLY), CSR_OFF_FLAGS(PRCFG3, CSRFL_READONLY), --=20 2.39.3 From nobody Sun May 19 02:12:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1690217707; cv=none; d=zohomail.com; s=zohoarc; b=KyXulT6MKI9ztWcaVWzTeGEsZSfb4egSWEHzk3XPHkvRRImp4wzQWHQ5KgBdfIwE4yQBkUGrt+TWB4ADoArMyKlF0eIwf6TIlU3SCyvvEozxXG74MeQ0Mgo5d72oCqfoL9VoAY6k9nkENBH4mSfxrD+qPspBTeNqQ/op8/RUkn8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690217707; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GyDnabCQzl6gPHWrtz83iEReskzaxBX9DyQ1sJhD//8=; b=Xk80IgQbZXoHHikPlneFajifdWNJgT1mkT9+6HN9CJqJQ4O8t4dBkzmr9W5ginkATPGXmP0TZtzDvueIqWceqHTRIpQ3tx6XbIMeH9GvJHRLRDpxorFQHqAC6QvODAqJ57XqHSwHDShf5Vbdbglfrl/ShjQ9QHxXflAjkHCn30s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1690217707053772.9483083684963; Mon, 24 Jul 2023 09:55:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNypC-0001N7-5Q; Mon, 24 Jul 2023 12:54:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNypA-0001MR-W8 for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNyp9-0006xm-Ed for qemu-devel@nongnu.org; Mon, 24 Jul 2023 12:54:20 -0400 Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-371-Zg5cChXnNUy1zhauy-mwdQ-1; Mon, 24 Jul 2023 12:54:15 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BA7903C1395A; Mon, 24 Jul 2023 16:54:13 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id C174C48FB01; Mon, 24 Jul 2023 16:54:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690217658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GyDnabCQzl6gPHWrtz83iEReskzaxBX9DyQ1sJhD//8=; b=IA4GK91huV/aT/OgEbviSDfd3YH3uCrwyZEV/DqLOX4bwTFZSTUoDEMqnpXIEXIbbiw5bi ETsSrvdpBF5jE0Hd4wFQaPywrz678iO3Od61fY5EIxYxtkjc7kSd30IJ9lFiZb9WdAuQZP tcmcCZZ9djEu4de5fySNAOvaKz/4WdY= X-MC-Unique: Zg5cChXnNUy1zhauy-mwdQ-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 16/16] tests/avocado/machine_s390_ccw_virtio: Skip the flaky virtio-gpu test by default Date: Mon, 24 Jul 2023 18:53:49 +0200 Message-Id: <20230724165349.55714-17-thuth@redhat.com> In-Reply-To: <20230724165349.55714-1-thuth@redhat.com> References: <20230724165349.55714-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1690217708297100009 The virtio-gpu test is known to be flaky - that's why we also did not enable the test_s390x_fedora in the gitlab CI. However, a flaky test can also be annoying when testing locally, so let's rather skip this subtest by default and start running the test_s390x_fedora test in the gitlab CI again (since the other things that are tested here are quite valuable). Message-Id: <20230724084851.24251-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: C=C3=A9dric Le Goater Signed-off-by: Thomas Huth --- tests/avocado/machine_s390_ccw_virtio.py | 51 +++++++++++++----------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/tests/avocado/machine_s390_ccw_virtio.py b/tests/avocado/machi= ne_s390_ccw_virtio.py index 78152f2ad1..e7a2a20ba6 100644 --- a/tests/avocado/machine_s390_ccw_virtio.py +++ b/tests/avocado/machine_s390_ccw_virtio.py @@ -159,7 +159,6 @@ def test_s390x_devices(self): 'MemTotal: 115640 kB') =20 =20 - @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab') def test_s390x_fedora(self): =20 """ @@ -229,31 +228,35 @@ def test_s390x_fedora(self): # writing to the framebuffer. Since the PPM is uncompressed, we th= en # can simply read the written "magic bytes" back from the PPM file= to # check whether the framebuffer is working as expected. - self.log.info("Test screendump of virtio-gpu device") - exec_command_and_wait_for_pattern(self, + # Unfortunately, this test is flaky, so we don't run it by default + if os.getenv('QEMU_TEST_FLAKY_TESTS'): + self.log.info("Test screendump of virtio-gpu device") + exec_command_and_wait_for_pattern(self, 'while ! (dmesg | grep gpudrmfb) ; do sleep 1 ; do= ne', 'virtio_gpudrmfb frame buffer device') - exec_command_and_wait_for_pattern(self, - 'echo -e "\e[?25l" > /dev/tty0', ':/#') - exec_command_and_wait_for_pattern(self, 'for ((i=3D0;i<250;i++)); = do ' - 'echo " The qu ick fo x j ump s o ver a laz y d og" >> fox= .txt;' - 'done', - ':/#') - exec_command_and_wait_for_pattern(self, - 'dd if=3Dfox.txt of=3D/dev/fb0 bs=3D1000 oflag=3Dsync,nocache = ; rm fox.txt', - '12+0 records out') - with tempfile.NamedTemporaryFile(suffix=3D'.ppm', - prefix=3D'qemu-scrdump-') as ppmf= ile: - self.vm.command('screendump', filename=3Dppmfile.name) - ppmfile.seek(0) - line =3D ppmfile.readline() - self.assertEqual(line, b"P6\n") - line =3D ppmfile.readline() - self.assertEqual(line, b"1280 800\n") - line =3D ppmfile.readline() - self.assertEqual(line, b"255\n") - line =3D ppmfile.readline(256) - self.assertEqual(line, b"The quick fox jumps over a lazy dog\n= ") + exec_command_and_wait_for_pattern(self, + 'echo -e "\e[?25l" > /dev/tty0', ':/#') + exec_command_and_wait_for_pattern(self, 'for ((i=3D0;i<250;i++= )); do ' + 'echo " The qu ick fo x j ump s o ver a laz y d og" >>= fox.txt;' + 'done', + ':/#') + exec_command_and_wait_for_pattern(self, + 'dd if=3Dfox.txt of=3D/dev/fb0 bs=3D1000 oflag=3Dsync,noca= che ; rm fox.txt', + '12+0 records out') + with tempfile.NamedTemporaryFile(suffix=3D'.ppm', + prefix=3D'qemu-scrdump-') as = ppmfile: + self.vm.command('screendump', filename=3Dppmfile.name) + ppmfile.seek(0) + line =3D ppmfile.readline() + self.assertEqual(line, b"P6\n") + line =3D ppmfile.readline() + self.assertEqual(line, b"1280 800\n") + line =3D ppmfile.readline() + self.assertEqual(line, b"255\n") + line =3D ppmfile.readline(256) + self.assertEqual(line, b"The quick fox jumps over a lazy d= og\n") + else: + self.log.info("Skipped flaky screendump of virtio-gpu device t= est") =20 # Hot-plug a virtio-crypto device and see whether it gets accepted self.log.info("Test hot-plug virtio-crypto device") --=20 2.39.3