From nobody Thu May 9 00:25:58 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642584138940354.4355058735456; Wed, 19 Jan 2022 01:22:18 -0800 (PST) Received: from localhost ([::1]:51618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nA7AX-0003hj-W7 for importer@patchew.org; Wed, 19 Jan 2022 04:22:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6OL-0006U0-3q for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:32:30 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:22781) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6OI-0004ep-Ji for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:32:28 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-462-7XYSfhprON-F1hq8Dlf68Q-1; Wed, 19 Jan 2022 03:32:24 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 972031966320; Wed, 19 Jan 2022 08:32:23 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 347E64F858; Wed, 19 Jan 2022 08:32:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642581146; 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=IspAsj8viqjov9r9Wz0WvaHsOhWwgCENretjvZS6kzE=; b=PC1UWyBG+i2EHKVqXeBJankDJpvKhZRgERhSJoWgzu48lreElogM7EfOBEgMju4UouUxVl 61vOH9trekLt+bNJW2xslkxwezJNt8iWcLJlqhBPOHNaaKoNsPGCVRj4YQFjFVd8bum7Ny UpEDBtM7NNy50aDZ39kZYLyAUkTVL94= X-MC-Unique: 7XYSfhprON-F1hq8Dlf68Q-1 From: Thomas Huth To: qemu-devel@nongnu.org Subject: [PULL 01/10] s390x/css: fix PMCW invalid mask Date: Wed, 19 Jan 2022 09:32:06 +0100 Message-Id: <20220119083215.120911-2-thuth@redhat.com> In-Reply-To: <20220119083215.120911-1-thuth@redhat.com> References: <20220119083215.120911-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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+importer=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: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Peter Maydell , Nico Boehr , Janosch Frank , Pierre Morel , Cornelia Huck , Halil Pasic Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642584140980100001 Content-Type: text/plain; charset="utf-8" From: Nico Boehr Previously, we required bits 5, 6 and 7 to be zero (0x07 =3D=3D 0b111). But, as per the principles of operation, bit 5 is ignored in MSCH and bits 0, 1, 6 and 7 need to be zero. As both PMCW_FLAGS_MASK_INVALID and ioinst_schib_valid() are only used by ioinst_handle_msch(), adjust the mask accordingly. Fixes: db1c8f53bfb1 ("s390: Channel I/O basic definitions.") Signed-off-by: Nico Boehr Reviewed-by: Pierre Morel Reviewed-by: Halil Pasic Reviewed-by: Janosch Frank Reviewed-by: Cornelia Huck Message-Id: <20211216131657.1057978-1-nrb@linux.ibm.com> Signed-off-by: Thomas Huth --- include/hw/s390x/ioinst.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/s390x/ioinst.h b/include/hw/s390x/ioinst.h index 3771fff9d4..ea8d0f2444 100644 --- a/include/hw/s390x/ioinst.h +++ b/include/hw/s390x/ioinst.h @@ -107,7 +107,7 @@ QEMU_BUILD_BUG_MSG(sizeof(PMCW) !=3D 28, "size of PMCW = is wrong"); #define PMCW_FLAGS_MASK_MP 0x0004 #define PMCW_FLAGS_MASK_TF 0x0002 #define PMCW_FLAGS_MASK_DNV 0x0001 -#define PMCW_FLAGS_MASK_INVALID 0x0700 +#define PMCW_FLAGS_MASK_INVALID 0xc300 =20 #define PMCW_CHARS_MASK_ST 0x00e00000 #define PMCW_CHARS_MASK_MBFC 0x00000004 --=20 2.27.0 From nobody Thu May 9 00:25:58 2024 Delivered-To: importer@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+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1642583082; cv=none; d=zohomail.com; s=zohoarc; b=OSLdYHQbDHuF7P/8MwnJj5GBZMGQt4MjPqbe8A1MpLcp7vHvF8gLPVKFtYryictR4KIJT0FHMxtz8VVSNjSt5BBbhrJTTjStdrIAtDZjyQGFti8BKiTqV0wlq37SfZKb7hlNUPRAdcg0TQQZUWarAhrUJTcukWHG7n5pDQl5Oy0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642583082; 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=tFXqggZx/xuv5c3DaoRRrLfkTJau5fKaTGPITCFuVFo=; b=eXp+y/Eq4o+RD3eatCUE9/sdG8/Sp1HJ6NfzuG3k1A8Ea1ND1hcCcDXTLlmdZ/u6chvnHxbYhd+/HsBJu23EoQ0c58UVVKj3gFPph4UOICL+AQDEcJkbIx7ImcS0DIPaodSLPGSCmW1dJpLBvmjLRm5+h4QbUXVWblrFFvG06Bc= 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+importer=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 1642583082463817.4576337163531; Wed, 19 Jan 2022 01:04:42 -0800 (PST) Received: from localhost ([::1]:49902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nA6tV-0008Pv-FH for importer@patchew.org; Wed, 19 Jan 2022 04:04:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6OV-0006Yt-8Y for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:32:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:38456) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6OT-0004fS-LO for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:32:38 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-515-7ofgOBdaO3ujivE5mNFWYw-1; Wed, 19 Jan 2022 03:32:36 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DEE1C1124C41; Wed, 19 Jan 2022 08:32:34 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3512E4F858; Wed, 19 Jan 2022 08:32:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642581157; 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=tFXqggZx/xuv5c3DaoRRrLfkTJau5fKaTGPITCFuVFo=; b=EVBTx+zUOutWaBv8LCdKctelGsbg+987CTWEHvgSlMF0KVPy/jluj0iYRPQ8hDnsgiYN7n GYLT3evCFGd9a1dF2aVYk8ggkpIT1LuRXfwiQqLqJ30cD/8Zqj9bKCZxY2dYk2JzXEJAXc hgr87LSTzFPBL3DlXkSSJhz9uAJpWPw= X-MC-Unique: 7ofgOBdaO3ujivE5mNFWYw-1 From: Thomas Huth To: qemu-devel@nongnu.org Subject: [PULL 02/10] target/s390x: Fix SLDA sign bit index Date: Wed, 19 Jan 2022 09:32:07 +0100 Message-Id: <20220119083215.120911-3-thuth@redhat.com> In-Reply-To: <20220119083215.120911-1-thuth@redhat.com> References: <20220119083215.120911-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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+importer=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: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Peter Maydell , Ilya Leoshkevich , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1642583083258100001 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich SLDA operates on 64-bit values, so its sign bit index should be 63, not 31. Fixes: a79ba3398a0a ("target-s390: Convert SHIFT DOUBLE") Reported-by: David Hildenbrand Signed-off-by: Ilya Leoshkevich Reviewed-by: David Hildenbrand Message-Id: <20220112165016.226996-2-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- target/s390x/tcg/insn-data.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/tcg/insn-data.def b/target/s390x/tcg/insn-data.def index f0af458aee..90c753068c 100644 --- a/target/s390x/tcg/insn-data.def +++ b/target/s390x/tcg/insn-data.def @@ -800,7 +800,7 @@ C(0xebde, SRLK, RSY_a, DO, r3_32u, sh32, new, r1_32, srl, 0) C(0xeb0c, SRLG, RSY_a, Z, r3_o, sh64, r1, 0, srl, 0) /* SHIFT LEFT DOUBLE */ - D(0x8f00, SLDA, RS_a, Z, r1_D32, sh64, new, r1_D32, sla, 0, 31) + D(0x8f00, SLDA, RS_a, Z, r1_D32, sh64, new, r1_D32, sla, 0, 63) /* SHIFT LEFT DOUBLE LOGICAL */ C(0x8d00, SLDL, RS_a, Z, r1_D32, sh64, new, r1_D32, sll, 0) /* SHIFT RIGHT DOUBLE */ --=20 2.27.0 From nobody Thu May 9 00:25:58 2024 Delivered-To: importer@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+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1642584362; cv=none; d=zohomail.com; s=zohoarc; b=bT/jpG2kbJrp/Rm4d7yAIgPSH6UUzTRv5Zua8C8UvAAAxg5eDY0U5eOU5uvtEQHaJY7hoRB8cU34pjzkof2jfkue68BkYyFg9cat7okI4SbIRg5quoMMoG4azCWpluzmR+yXty5LaYyjBazsUxCwQRuMEHA/cVIMcZN0jw0tMgU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642584362; 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=I2H9o+dkLFgh+Hfd6dSYyQ2xHGDnDxdycc3HkGkOGLY=; b=a//POKNPP4eKNXw/CB1s5x/Ax1+OYFboNGTKHzuGOF0yqyC6EULRMl22eDToegnOITOlkJQPYDTVzRSlmb+6Oi7A4EXs8/5bVOhMhfLed/h3v67lygWdGBnTapiJtJpVCR0z3N/L3BndE0vuzNRqpENrB7ZJ4+nT2fY+/H7TkQA= 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+importer=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 1642584362404749.5526527444104; Wed, 19 Jan 2022 01:26:02 -0800 (PST) Received: from localhost ([::1]:58634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nA7E9-0008SV-8F for importer@patchew.org; Wed, 19 Jan 2022 04:26:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6Oa-0006aS-M7 for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:32:46 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:44620) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6OX-0004fr-Nu for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:32:42 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-393-zGIsMf-WPyKXonSiAsx8Hw-1; Wed, 19 Jan 2022 03:32:38 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0BE671966328; Wed, 19 Jan 2022 08:32:37 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 73CBB4F858; Wed, 19 Jan 2022 08:32:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642581161; 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=I2H9o+dkLFgh+Hfd6dSYyQ2xHGDnDxdycc3HkGkOGLY=; b=fn3boZx0VmhX8v3lmLZ3KpEBdZ04d+gGymJ4+nkl8AKWNQCCZJR6mxiT2Eau1lM9tOdSkX 1bDycnD2b4pOVTB4QZb/cXiZrfWXkw2y40TxVDfkGyXMVtuh8Ts+U4qeTa7nhUE6lzO5P/ H8NdCHRVkQZMQsNDz4XPDo4QTXZNLQ0= X-MC-Unique: zGIsMf-WPyKXonSiAsx8Hw-1 From: Thomas Huth To: qemu-devel@nongnu.org Subject: [PULL 03/10] target/s390x: Fix SRDA CC calculation Date: Wed, 19 Jan 2022 09:32:08 +0100 Message-Id: <20220119083215.120911-4-thuth@redhat.com> In-Reply-To: <20220119083215.120911-1-thuth@redhat.com> References: <20220119083215.120911-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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+importer=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: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Peter Maydell , Ilya Leoshkevich , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1642584363865100001 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich SRDA uses r1_D32 for binding the first operand and s64 for setting CC. cout_s64() relies on o->out being the shift result, however, wout_r1_D32() clobbers it. Fix by using a temporary. Fixes: a79ba3398a0a ("target-s390: Convert SHIFT DOUBLE") Signed-off-by: Ilya Leoshkevich Reviewed-by: David Hildenbrand Message-Id: <20220112165016.226996-3-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- target/s390x/tcg/translate.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index f180853e7a..766b4c87b2 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -5420,9 +5420,11 @@ static void wout_r1_P32(DisasContext *s, DisasOps *o) static void wout_r1_D32(DisasContext *s, DisasOps *o) { int r1 =3D get_field(s, r1); + TCGv_i64 t =3D tcg_temp_new_i64(); store_reg32_i64(r1 + 1, o->out); - tcg_gen_shri_i64(o->out, o->out, 32); - store_reg32_i64(r1, o->out); + tcg_gen_shri_i64(t, o->out, 32); + store_reg32_i64(r1, t); + tcg_temp_free_i64(t); } #define SPEC_wout_r1_D32 SPEC_r1_even =20 --=20 2.27.0 From nobody Thu May 9 00:25:58 2024 Delivered-To: importer@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+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1642583351; cv=none; d=zohomail.com; s=zohoarc; b=Yjqj0E3P0aTLLisgj4RuN7sdl9lij5KzN/axoLmwJUBea6nuE55W85gOejdxIsHdZzw7TMt+HWmPtrRBKEbs0+lkwA9rS+ERHNbMgOPl2QxG5dsfEJNgI4SyJ1dNBF4wm4ajBzIFOD1kCXraad4TPxl2jvuXYUE37oKnfkBgz6o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642583351; 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=OvehWVLmC++f9bbWPzzm0emi9QcDfLuNMal5OtHVNw8=; b=HT6zksHTUSlQligc4zjcFu/81S6BBNhYP4W2Ue+n5wY4bIm169TRFtec/pTyIZ4zBv4ScqVepYA9xJL4lAELqvUQcswlhr0F8rViBZ+bkEOWmwEPGfliHzr+DSe/BarGFuqhCBXEE+xcHDr+CB6Is/7aRAuFKEXKl7oLTKTMIzs= 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+importer=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 164258335114991.51176939187906; Wed, 19 Jan 2022 01:09:11 -0800 (PST) Received: from localhost ([::1]:58646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nA6xq-0005zM-66 for importer@patchew.org; Wed, 19 Jan 2022 04:09:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6Oa-0006aU-Vq for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:32:46 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:44789) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6OX-0004fw-Ve for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:32:43 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-673-aWb7AkeINc6hFn3-Tzhdvw-1; Wed, 19 Jan 2022 03:32:40 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EF764839A42; Wed, 19 Jan 2022 08:32:38 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8277E4F858; Wed, 19 Jan 2022 08:32:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642581161; 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=OvehWVLmC++f9bbWPzzm0emi9QcDfLuNMal5OtHVNw8=; b=c5U2qNFFHAjCckQRMst3Y6TsoyndyDaLBnHWIzqqn/RI/CH12erOM6D3ss+/pXInAbsVT5 4B6jD4hOxlGG6Tleps9uYOK5C+QH1U8uRv2LFa8pDDr+D8hGoAgiMO38I2uIXzZOMk3Y4m cXx725ENSJORMLowsZ1a4U9qfFsOS7A= X-MC-Unique: aWb7AkeINc6hFn3-Tzhdvw-1 From: Thomas Huth To: qemu-devel@nongnu.org Subject: [PULL 04/10] target/s390x: Fix cc_calc_sla_64() missing overflows Date: Wed, 19 Jan 2022 09:32:09 +0100 Message-Id: <20220119083215.120911-5-thuth@redhat.com> In-Reply-To: <20220119083215.120911-1-thuth@redhat.com> References: <20220119083215.120911-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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+importer=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: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Peter Maydell , Ilya Leoshkevich , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1642583352156100001 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich An overflow occurs for SLAG when at least one shifted bit is not equal to sign bit. Therefore, we need to check that `shift + 1` bits are neither all 0s nor all 1s. The current code checks only `shift` bits, missing some overflows. Fixes: cbe24bfa91d2 ("target-s390: Convert SHIFT, ROTATE SINGLE") Co-developed-by: David Hildenbrand Signed-off-by: Ilya Leoshkevich Reviewed-by: David Hildenbrand Message-Id: <20220112165016.226996-4-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- target/s390x/tcg/cc_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/tcg/cc_helper.c b/target/s390x/tcg/cc_helper.c index c2c96c3a3c..c9b7b0e8c6 100644 --- a/target/s390x/tcg/cc_helper.c +++ b/target/s390x/tcg/cc_helper.c @@ -297,7 +297,7 @@ static uint32_t cc_calc_sla_32(uint32_t src, int shift) =20 static uint32_t cc_calc_sla_64(uint64_t src, int shift) { - uint64_t mask =3D ((1ULL << shift) - 1ULL) << (64 - shift); + uint64_t mask =3D -1ULL << (63 - shift); uint64_t sign =3D 1ULL << 63; uint64_t match; int64_t r; --=20 2.27.0 From nobody Thu May 9 00:25:58 2024 Delivered-To: importer@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+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1642582185; cv=none; d=zohomail.com; s=zohoarc; b=d3I+kXTZXhRD2rqq9z1rZkKkhpHdBjD3MJja+9ZdlqljL69+cxXesqkwHLO2ma78dRKdJfJkj5nE9XrFS03KTVVXJzBq2hF0pe0GxXzGNTcGId/A3l6Ic8Y67B1ibu5JEhU5m9UO9CIkX2nsKdvhGog1STV9yvNUfw9srmpvoAQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642582185; 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=/715XU7qWgZJxG9QrxPeM2NDksn9LlnidWCxFUs7jFo=; b=Sh9/AgkhpY2JpqBsHNY786Cj8jLbNFEUhJ+onC4ydpp+u5U/eIptFZr7RMlA24ADCyyYc5dAT+tveda3UWjXwigdQFjRdqNbdwwAsef6vAG/JWs//SCrdo26HLyn46X2QmAJuqzwcddN8uYDqgdyOPgGITHli8ytCPO9KcdIgM4= 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+importer=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 1642582185588795.0235788852511; Wed, 19 Jan 2022 00:49:45 -0800 (PST) Received: from localhost ([::1]:33612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nA6f2-0004k8-9m for importer@patchew.org; Wed, 19 Jan 2022 03:49:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6Of-0006bi-8X for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:32:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:25330) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6Oc-0004gR-AK for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:32:48 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-344-p5JWrHIxN468abWK9ut8fg-1; Wed, 19 Jan 2022 03:32:42 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5452610151E0; Wed, 19 Jan 2022 08:32:41 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 912684F858; Wed, 19 Jan 2022 08:32:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642581165; 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=/715XU7qWgZJxG9QrxPeM2NDksn9LlnidWCxFUs7jFo=; b=AiBEUc54FmEaLAFe0ds7+8GkLPXvaHtdh/Md0z5w4+FQ+aqlWOPs5CwKR7csB9USxIVRTk S8vTkDeks2W8E8NzW94zUfRda1k2SY9lImyGf1tlCMUzXgZsiSBGRMKHUX8hPBquHayAbn FJytZn+HreMVn5jm8DhfuMbxa/oBUFc= X-MC-Unique: p5JWrHIxN468abWK9ut8fg-1 From: Thomas Huth To: qemu-devel@nongnu.org Subject: [PULL 05/10] target/s390x: Fix shifting 32-bit values for more than 31 bits Date: Wed, 19 Jan 2022 09:32:10 +0100 Message-Id: <20220119083215.120911-6-thuth@redhat.com> In-Reply-To: <20220119083215.120911-1-thuth@redhat.com> References: <20220119083215.120911-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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+importer=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: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Peter Maydell , Ilya Leoshkevich , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1642582186172100003 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich According to PoP, both 32- and 64-bit shifts use lowest 6 address bits. The current code special-cases 32-bit shifts to use only 5 bits, which is not correct. For example, shifting by 32 bits currently preserves the initial value, however, it's supposed zero it out instead. Fix by merging sh32 and sh64 and adapting CC calculation to shift values greater than 31. Fixes: cbe24bfa91d2 ("target-s390: Convert SHIFT, ROTATE SINGLE") Signed-off-by: Ilya Leoshkevich Reviewed-by: David Hildenbrand Message-Id: <20220112165016.226996-5-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- target/s390x/cpu-dump.c | 3 +-- target/s390x/s390x-internal.h | 3 +-- target/s390x/tcg/cc_helper.c | 36 +++----------------------- target/s390x/tcg/insn-data.def | 36 +++++++++++++------------- target/s390x/tcg/translate.c | 47 ++++++++++++++++------------------ 5 files changed, 45 insertions(+), 80 deletions(-) diff --git a/target/s390x/cpu-dump.c b/target/s390x/cpu-dump.c index 0f5c062994..ffa9e94d84 100644 --- a/target/s390x/cpu-dump.c +++ b/target/s390x/cpu-dump.c @@ -121,8 +121,7 @@ const char *cc_name(enum cc_op cc_op) [CC_OP_NZ_F64] =3D "CC_OP_NZ_F64", [CC_OP_NZ_F128] =3D "CC_OP_NZ_F128", [CC_OP_ICM] =3D "CC_OP_ICM", - [CC_OP_SLA_32] =3D "CC_OP_SLA_32", - [CC_OP_SLA_64] =3D "CC_OP_SLA_64", + [CC_OP_SLA] =3D "CC_OP_SLA", [CC_OP_FLOGR] =3D "CC_OP_FLOGR", [CC_OP_LCBB] =3D "CC_OP_LCBB", [CC_OP_VC] =3D "CC_OP_VC", diff --git a/target/s390x/s390x-internal.h b/target/s390x/s390x-internal.h index 1a178aed41..6fc8cad2d5 100644 --- a/target/s390x/s390x-internal.h +++ b/target/s390x/s390x-internal.h @@ -193,8 +193,7 @@ enum cc_op { CC_OP_NZ_F128, /* FP dst !=3D 0 (128bit) */ =20 CC_OP_ICM, /* insert characters under mask */ - CC_OP_SLA_32, /* Calculate shift left signed (32bit) */ - CC_OP_SLA_64, /* Calculate shift left signed (64bit) */ + CC_OP_SLA, /* Calculate shift left signed */ CC_OP_FLOGR, /* find leftmost one */ CC_OP_LCBB, /* load count to block boundary */ CC_OP_VC, /* vector compare result */ diff --git a/target/s390x/tcg/cc_helper.c b/target/s390x/tcg/cc_helper.c index c9b7b0e8c6..8d04097f78 100644 --- a/target/s390x/tcg/cc_helper.c +++ b/target/s390x/tcg/cc_helper.c @@ -268,34 +268,7 @@ static uint32_t cc_calc_icm(uint64_t mask, uint64_t va= l) } } =20 -static uint32_t cc_calc_sla_32(uint32_t src, int shift) -{ - uint32_t mask =3D ((1U << shift) - 1U) << (32 - shift); - uint32_t sign =3D 1U << 31; - uint32_t match; - int32_t r; - - /* Check if the sign bit stays the same. */ - if (src & sign) { - match =3D mask; - } else { - match =3D 0; - } - if ((src & mask) !=3D match) { - /* Overflow. */ - return 3; - } - - r =3D ((src << shift) & ~sign) | (src & sign); - if (r =3D=3D 0) { - return 0; - } else if (r < 0) { - return 1; - } - return 2; -} - -static uint32_t cc_calc_sla_64(uint64_t src, int shift) +static uint32_t cc_calc_sla(uint64_t src, int shift) { uint64_t mask =3D -1ULL << (63 - shift); uint64_t sign =3D 1ULL << 63; @@ -459,11 +432,8 @@ static uint32_t do_calc_cc(CPUS390XState *env, uint32_= t cc_op, case CC_OP_ICM: r =3D cc_calc_icm(src, dst); break; - case CC_OP_SLA_32: - r =3D cc_calc_sla_32(src, dst); - break; - case CC_OP_SLA_64: - r =3D cc_calc_sla_64(src, dst); + case CC_OP_SLA: + r =3D cc_calc_sla(src, dst); break; case CC_OP_FLOGR: r =3D cc_calc_flogr(dst); diff --git a/target/s390x/tcg/insn-data.def b/target/s390x/tcg/insn-data.def index 90c753068c..1c3e115712 100644 --- a/target/s390x/tcg/insn-data.def +++ b/target/s390x/tcg/insn-data.def @@ -747,8 +747,8 @@ C(0xb9e1, POPCNT, RRE, PC, 0, r2_o, r1, 0, popcnt, nz64) =20 /* ROTATE LEFT SINGLE LOGICAL */ - C(0xeb1d, RLL, RSY_a, Z, r3_o, sh32, new, r1_32, rll32, 0) - C(0xeb1c, RLLG, RSY_a, Z, r3_o, sh64, r1, 0, rll64, 0) + C(0xeb1d, RLL, RSY_a, Z, r3_o, sh, new, r1_32, rll32, 0) + C(0xeb1c, RLLG, RSY_a, Z, r3_o, sh, r1, 0, rll64, 0) =20 /* ROTATE THEN INSERT SELECTED BITS */ C(0xec55, RISBG, RIE_f, GIE, 0, r2, r1, 0, risbg, s64) @@ -784,29 +784,29 @@ C(0x0400, SPM, RR_a, Z, r1, 0, 0, 0, spm, 0) =20 /* SHIFT LEFT SINGLE */ - D(0x8b00, SLA, RS_a, Z, r1, sh32, new, r1_32, sla, 0, 31) - D(0xebdd, SLAK, RSY_a, DO, r3, sh32, new, r1_32, sla, 0, 31) - D(0xeb0b, SLAG, RSY_a, Z, r3, sh64, r1, 0, sla, 0, 63) + D(0x8b00, SLA, RS_a, Z, r1, sh, new, r1_32, sla, 0, 31) + D(0xebdd, SLAK, RSY_a, DO, r3, sh, new, r1_32, sla, 0, 31) + D(0xeb0b, SLAG, RSY_a, Z, r3, sh, r1, 0, sla, 0, 63) /* SHIFT LEFT SINGLE LOGICAL */ - C(0x8900, SLL, RS_a, Z, r1_o, sh32, new, r1_32, sll, 0) - C(0xebdf, SLLK, RSY_a, DO, r3_o, sh32, new, r1_32, sll, 0) - C(0xeb0d, SLLG, RSY_a, Z, r3_o, sh64, r1, 0, sll, 0) + C(0x8900, SLL, RS_a, Z, r1_o, sh, new, r1_32, sll, 0) + C(0xebdf, SLLK, RSY_a, DO, r3_o, sh, new, r1_32, sll, 0) + C(0xeb0d, SLLG, RSY_a, Z, r3_o, sh, r1, 0, sll, 0) /* SHIFT RIGHT SINGLE */ - C(0x8a00, SRA, RS_a, Z, r1_32s, sh32, new, r1_32, sra, s32) - C(0xebdc, SRAK, RSY_a, DO, r3_32s, sh32, new, r1_32, sra, s32) - C(0xeb0a, SRAG, RSY_a, Z, r3_o, sh64, r1, 0, sra, s64) + C(0x8a00, SRA, RS_a, Z, r1_32s, sh, new, r1_32, sra, s32) + C(0xebdc, SRAK, RSY_a, DO, r3_32s, sh, new, r1_32, sra, s32) + C(0xeb0a, SRAG, RSY_a, Z, r3_o, sh, r1, 0, sra, s64) /* SHIFT RIGHT SINGLE LOGICAL */ - C(0x8800, SRL, RS_a, Z, r1_32u, sh32, new, r1_32, srl, 0) - C(0xebde, SRLK, RSY_a, DO, r3_32u, sh32, new, r1_32, srl, 0) - C(0xeb0c, SRLG, RSY_a, Z, r3_o, sh64, r1, 0, srl, 0) + C(0x8800, SRL, RS_a, Z, r1_32u, sh, new, r1_32, srl, 0) + C(0xebde, SRLK, RSY_a, DO, r3_32u, sh, new, r1_32, srl, 0) + C(0xeb0c, SRLG, RSY_a, Z, r3_o, sh, r1, 0, srl, 0) /* SHIFT LEFT DOUBLE */ - D(0x8f00, SLDA, RS_a, Z, r1_D32, sh64, new, r1_D32, sla, 0, 63) + D(0x8f00, SLDA, RS_a, Z, r1_D32, sh, new, r1_D32, sla, 0, 63) /* SHIFT LEFT DOUBLE LOGICAL */ - C(0x8d00, SLDL, RS_a, Z, r1_D32, sh64, new, r1_D32, sll, 0) + C(0x8d00, SLDL, RS_a, Z, r1_D32, sh, new, r1_D32, sll, 0) /* SHIFT RIGHT DOUBLE */ - C(0x8e00, SRDA, RS_a, Z, r1_D32, sh64, new, r1_D32, sra, s64) + C(0x8e00, SRDA, RS_a, Z, r1_D32, sh, new, r1_D32, sra, s64) /* SHIFT RIGHT DOUBLE LOGICAL */ - C(0x8c00, SRDL, RS_a, Z, r1_D32, sh64, new, r1_D32, srl, 0) + C(0x8c00, SRDL, RS_a, Z, r1_D32, sh, new, r1_D32, srl, 0) =20 /* SQUARE ROOT */ F(0xb314, SQEBR, RRE, Z, 0, e2, new, e1, sqeb, 0, IF_BFP) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 766b4c87b2..46dea73357 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -636,8 +636,7 @@ static void gen_op_calc_cc(DisasContext *s) case CC_OP_LTUGTU_64: case CC_OP_TM_32: case CC_OP_TM_64: - case CC_OP_SLA_32: - case CC_OP_SLA_64: + case CC_OP_SLA: case CC_OP_SUBU: case CC_OP_NZ_F128: case CC_OP_VC: @@ -1178,19 +1177,6 @@ struct DisasInsn { /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ /* Miscellaneous helpers, used by several operations. */ =20 -static void help_l2_shift(DisasContext *s, DisasOps *o, int mask) -{ - int b2 =3D get_field(s, b2); - int d2 =3D get_field(s, d2); - - if (b2 =3D=3D 0) { - o->in2 =3D tcg_const_i64(d2 & mask); - } else { - o->in2 =3D get_address(s, 0, b2, d2); - tcg_gen_andi_i64(o->in2, o->in2, mask); - } -} - static DisasJumpType help_goto_direct(DisasContext *s, uint64_t dest) { if (dest =3D=3D s->pc_tmp) { @@ -4113,9 +4099,18 @@ static DisasJumpType op_soc(DisasContext *s, DisasOp= s *o) =20 static DisasJumpType op_sla(DisasContext *s, DisasOps *o) { + TCGv_i64 t; uint64_t sign =3D 1ull << s->insn->data; - enum cc_op cco =3D s->insn->data =3D=3D 31 ? CC_OP_SLA_32 : CC_OP_SLA_= 64; - gen_op_update2_cc_i64(s, cco, o->in1, o->in2); + if (s->insn->data =3D=3D 31) { + t =3D tcg_temp_new_i64(); + tcg_gen_shli_i64(t, o->in1, 32); + } else { + t =3D o->in1; + } + gen_op_update2_cc_i64(s, CC_OP_SLA, t, o->in2); + if (s->insn->data =3D=3D 31) { + tcg_temp_free_i64(t); + } tcg_gen_shl_i64(o->out, o->in1, o->in2); /* The arithmetic left shift is curious in that it does not affect the sign bit. Copy that over from the source unchanged. */ @@ -5924,17 +5919,19 @@ static void in2_ri2(DisasContext *s, DisasOps *o) } #define SPEC_in2_ri2 0 =20 -static void in2_sh32(DisasContext *s, DisasOps *o) +static void in2_sh(DisasContext *s, DisasOps *o) { - help_l2_shift(s, o, 31); -} -#define SPEC_in2_sh32 0 + int b2 =3D get_field(s, b2); + int d2 =3D get_field(s, d2); =20 -static void in2_sh64(DisasContext *s, DisasOps *o) -{ - help_l2_shift(s, o, 63); + if (b2 =3D=3D 0) { + o->in2 =3D tcg_const_i64(d2 & 0x3f); + } else { + o->in2 =3D get_address(s, 0, b2, d2); + tcg_gen_andi_i64(o->in2, o->in2, 0x3f); + } } -#define SPEC_in2_sh64 0 +#define SPEC_in2_sh 0 =20 static void in2_m2_8u(DisasContext *s, DisasOps *o) { --=20 2.27.0 From nobody Thu May 9 00:25:58 2024 Delivered-To: importer@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+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1642582821; cv=none; d=zohomail.com; s=zohoarc; b=CcPyVGADqR6LhiqzH2SNFgybliToty269dDxdd+8CIlvEVfpL9cd3hEetmVo1fp26Obyv1JztDajDV9WBnMeivk/9h+dPonjeimcVsTDVTDS3Rtgrua4yBXu58zZ7I4F6Pp8PzPm6C3omuLMgnWETDTkdBe4jUZ1Wx5C4DEJFtA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642582821; 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=wlru8De4VPQQW0NKdALwOKAs/qP6Gneuw6GtYDuHDDY=; b=nif8wD5YJS5wYK8u3l+JVZ+CODDjlPHJ5tmpngtTtyM3qU4qkTeStAdiP31uw4tTdKNflKkAgsct97RGlH+RocWuX6nVWuDco8UvmXWt4t3FDA4vjg9J4TNLI0DVGoFE8RXGUKgj0WRpldvK4q1pT+gPdCyiu3LiY6UYZFuSFPM= 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+importer=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 1642582821027240.68737759564806; Wed, 19 Jan 2022 01:00:21 -0800 (PST) Received: from localhost ([::1]:44408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nA6pH-0004cC-Ej for importer@patchew.org; Wed, 19 Jan 2022 04:00:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6Oe-0006bp-Ka for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:32:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:27512) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6Oc-0004gV-II for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:32:48 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-119-XjNfdH01OOaXIJdD87aqhA-1; Wed, 19 Jan 2022 03:32:44 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 98AB61966321; Wed, 19 Jan 2022 08:32:43 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id D2F8A4F858; Wed, 19 Jan 2022 08:32:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642581166; 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=wlru8De4VPQQW0NKdALwOKAs/qP6Gneuw6GtYDuHDDY=; b=P8EYyOKlcCowhksyBKdLSagVQA16Sn1WXMdBLNKb1hFGydvbLU5xMC90xhjVSWIjXvKFl3 afYRkVtKCt+suysQWpT+nrnruRBhJziUrTQqOZl6NeTXaFKZTZCbLWLiadLD9SUyudSWDw v1lI9uinA3WrlxOntXT11ctjXuKOro4= X-MC-Unique: XjNfdH01OOaXIJdD87aqhA-1 From: Thomas Huth To: qemu-devel@nongnu.org Subject: [PULL 06/10] tests/tcg/s390x: Test shift instructions Date: Wed, 19 Jan 2022 09:32:11 +0100 Message-Id: <20220119083215.120911-7-thuth@redhat.com> In-Reply-To: <20220119083215.120911-1-thuth@redhat.com> References: <20220119083215.120911-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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+importer=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: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Peter Maydell , Ilya Leoshkevich , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1642582822909100001 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Add a test for each shift instruction in order to to prevent regressions. Signed-off-by: Ilya Leoshkevich Acked-by: David Hildenbrand Message-Id: <20220112165016.226996-6-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/shift.c | 270 ++++++++++++++++++++++++++++++++ 2 files changed, 271 insertions(+) create mode 100644 tests/tcg/s390x/shift.c diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.tar= get index cc64dd32d2..1a7238b4eb 100644 --- a/tests/tcg/s390x/Makefile.target +++ b/tests/tcg/s390x/Makefile.target @@ -9,6 +9,7 @@ TESTS+=3Dexrl-trtr TESTS+=3Dpack TESTS+=3Dmvo TESTS+=3Dmvc +TESTS+=3Dshift TESTS+=3Dtrap TESTS+=3Dsignals-s390x =20 diff --git a/tests/tcg/s390x/shift.c b/tests/tcg/s390x/shift.c new file mode 100644 index 0000000000..29594fec5c --- /dev/null +++ b/tests/tcg/s390x/shift.c @@ -0,0 +1,270 @@ +#include +#include +#include + +#define DEFINE_SHIFT_SINGLE_COMMON(_name, _insn_str) \ + static uint64_t _name(uint64_t op1, uint64_t op2, uint64_t *cc) \ + { \ + asm(" sll %[cc],28\n" \ + " spm %[cc]\n" \ + " " _insn_str "\n" \ + " ipm %[cc]\n" \ + " srl %[cc],28" \ + : [op1] "+&r" (op1), \ + [cc] "+&r" (*cc) \ + : [op2] "r" (op2) \ + : "cc"); \ + return op1; \ + } +#define DEFINE_SHIFT_SINGLE_2(_insn, _offset) \ + DEFINE_SHIFT_SINGLE_COMMON(_insn ## _ ## _offset, \ + #_insn " %[op1]," #_offset "(%[op2])") +#define DEFINE_SHIFT_SINGLE_3(_insn, _offset) \ + DEFINE_SHIFT_SINGLE_COMMON(_insn ## _ ## _offset, \ + #_insn " %[op1],%[op1]," #_offset "(%[op2])= ") +#define DEFINE_SHIFT_DOUBLE(_insn, _offset) \ + static uint64_t _insn ## _ ## _offset(uint64_t op1, uint64_t op2, \ + uint64_t *cc) \ + { \ + uint32_t op1h =3D op1 >> 32; \ + uint32_t op1l =3D op1 & 0xffffffff; \ + register uint32_t r2 asm("2") =3D op1h; \ + register uint32_t r3 asm("3") =3D op1l; \ + \ + asm(" sll %[cc],28\n" \ + " spm %[cc]\n" \ + " " #_insn " %[r2]," #_offset "(%[op2])\n" \ + " ipm %[cc]\n" \ + " srl %[cc],28" \ + : [r2] "+&r" (r2), \ + [r3] "+&r" (r3), \ + [cc] "+&r" (*cc) \ + : [op2] "r" (op2) \ + : "cc"); \ + op1h =3D r2; \ + op1l =3D r3; \ + return (((uint64_t)op1h) << 32) | op1l; \ + } + +DEFINE_SHIFT_SINGLE_3(rll, 0x4cf3b); +DEFINE_SHIFT_SINGLE_3(rllg, 0x697c9); +DEFINE_SHIFT_SINGLE_2(sla, 0x4b0); +DEFINE_SHIFT_SINGLE_2(sla, 0xd54); +DEFINE_SHIFT_SINGLE_3(slak, 0x2832c); +DEFINE_SHIFT_SINGLE_3(slag, 0x66cc4); +DEFINE_SHIFT_SINGLE_3(slag, 0xd54); +DEFINE_SHIFT_SINGLE_2(sll, 0xd04); +DEFINE_SHIFT_SINGLE_3(sllk, 0x2699f); +DEFINE_SHIFT_SINGLE_3(sllg, 0x59df9); +DEFINE_SHIFT_SINGLE_2(sra, 0x67e); +DEFINE_SHIFT_SINGLE_3(srak, 0x60943); +DEFINE_SHIFT_SINGLE_3(srag, 0x6b048); +DEFINE_SHIFT_SINGLE_2(srl, 0x035); +DEFINE_SHIFT_SINGLE_3(srlk, 0x43dfc); +DEFINE_SHIFT_SINGLE_3(srlg, 0x27227); +DEFINE_SHIFT_DOUBLE(slda, 0x38b); +DEFINE_SHIFT_DOUBLE(sldl, 0x031); +DEFINE_SHIFT_DOUBLE(srda, 0x36f); +DEFINE_SHIFT_DOUBLE(srdl, 0x99a); + +struct shift_test { + const char *name; + uint64_t (*insn)(uint64_t, uint64_t, uint64_t *); + uint64_t op1; + uint64_t op2; + uint64_t exp_result; + uint64_t exp_cc; +}; + +static const struct shift_test tests[] =3D { + { + .name =3D "rll", + .insn =3D rll_0x4cf3b, + .op1 =3D 0xecbd589a45c248f5ull, + .op2 =3D 0x62e5508ccb4c99fdull, + .exp_result =3D 0xecbd589af545c248ull, + .exp_cc =3D 0, + }, + { + .name =3D "rllg", + .insn =3D rllg_0x697c9, + .op1 =3D 0xaa2d54c1b729f7f4ull, + .op2 =3D 0x5ffcf7465f5cd71full, + .exp_result =3D 0x29f7f4aa2d54c1b7ull, + .exp_cc =3D 0, + }, + { + .name =3D "sla-1", + .insn =3D sla_0x4b0, + .op1 =3D 0x8bf21fb67cca0e96ull, + .op2 =3D 0x3ddf2f53347d3030ull, + .exp_result =3D 0x8bf21fb600000000ull, + .exp_cc =3D 3, + }, + { + .name =3D "sla-2", + .insn =3D sla_0xd54, + .op1 =3D 0xe4faaed5def0e926ull, + .op2 =3D 0x18d586fab239cbeeull, + .exp_result =3D 0xe4faaed5fbc3a498ull, + .exp_cc =3D 3, + }, + { + .name =3D "slak", + .insn =3D slak_0x2832c, + .op1 =3D 0x7300bf78707f09f9ull, + .op2 =3D 0x4d193b85bb5cb39bull, + .exp_result =3D 0x7300bf783f84fc80ull, + .exp_cc =3D 3, + }, + { + .name =3D "slag-1", + .insn =3D slag_0x66cc4, + .op1 =3D 0xe805966de1a77762ull, + .op2 =3D 0x0e92953f6aa91c6bull, + .exp_result =3D 0xbbb1000000000000ull, + .exp_cc =3D 3, + }, + { + .name =3D "slag-2", + .insn =3D slag_0xd54, + .op1 =3D 0xdef0e92600000000ull, + .op2 =3D 0x18d586fab239cbeeull, + .exp_result =3D 0xfbc3a49800000000ull, + .exp_cc =3D 3, + }, + { + .name =3D "sll", + .insn =3D sll_0xd04, + .op1 =3D 0xb90281a3105939dfull, + .op2 =3D 0xb5e4df7e082e4c5eull, + .exp_result =3D 0xb90281a300000000ull, + .exp_cc =3D 0, + }, + { + .name =3D "sllk", + .insn =3D sllk_0x2699f, + .op1 =3D 0x777c6cf116f99557ull, + .op2 =3D 0xe0556cf112e5a458ull, + .exp_result =3D 0x777c6cf100000000ull, + .exp_cc =3D 0, + }, + { + .name =3D "sllg", + .insn =3D sllg_0x59df9, + .op1 =3D 0xcdf86cbfbc0f3557ull, + .op2 =3D 0x325a45acf99c6d3dull, + .exp_result =3D 0x55c0000000000000ull, + .exp_cc =3D 0, + }, + { + .name =3D "sra", + .insn =3D sra_0x67e, + .op1 =3D 0xb878f048d5354183ull, + .op2 =3D 0x9e27d13195931f79ull, + .exp_result =3D 0xb878f048ffffffffull, + .exp_cc =3D 1, + }, + { + .name =3D "srak", + .insn =3D srak_0x60943, + .op1 =3D 0xb6ceb5a429cedb35ull, + .op2 =3D 0x352354900ae34d7aull, + .exp_result =3D 0xb6ceb5a400000000ull, + .exp_cc =3D 0, + }, + { + .name =3D "srag", + .insn =3D srag_0x6b048, + .op1 =3D 0xd54dd4468676c63bull, + .op2 =3D 0x84d026db7b4dca28ull, + .exp_result =3D 0xffffffffffffd54dull, + .exp_cc =3D 1, + }, + { + .name =3D "srl", + .insn =3D srl_0x035, + .op1 =3D 0x09be503ef826815full, + .op2 =3D 0xbba8d1a0e542d5c1ull, + .exp_result =3D 0x9be503e00000000ull, + .exp_cc =3D 0, + }, + { + .name =3D "srlk", + .insn =3D srlk_0x43dfc, + .op1 =3D 0x540d6c8de71aee2aull, + .op2 =3D 0x0000000000000000ull, + .exp_result =3D 0x540d6c8d00000000ull, + .exp_cc =3D 0, + }, + { + .name =3D "srlg", + .insn =3D srlg_0x27227, + .op1 =3D 0x26f7123c1c447a34ull, + .op2 =3D 0x0000000000000000ull, + .exp_result =3D 0x00000000004dee24ull, + .exp_cc =3D 0, + }, + { + .name =3D "slda", + .insn =3D slda_0x38b, + .op1 =3D 0x7988f722dd5bbe7cull, + .op2 =3D 0x9aed3f95b4d78cc2ull, + .exp_result =3D 0x1ee45bab77cf8000ull, + .exp_cc =3D 3, + }, + { + .name =3D "sldl", + .insn =3D sldl_0x031, + .op1 =3D 0xaae2918dce2b049aull, + .op2 =3D 0x0000000000000000ull, + .exp_result =3D 0x0934000000000000ull, + .exp_cc =3D 0, + }, + { + .name =3D "srda", + .insn =3D srda_0x36f, + .op1 =3D 0x0cd4ed9228a50978ull, + .op2 =3D 0x72b046f0848b8cc9ull, + .exp_result =3D 0x000000000000000cull, + .exp_cc =3D 2, + }, + { + .name =3D "srdl", + .insn =3D srdl_0x99a, + .op1 =3D 0x1018611c41689a1dull, + .op2 =3D 0x2907e150c50ba319ull, + .exp_result =3D 0x0000000000000203ull, + .exp_cc =3D 0, + }, +}; + +int main(void) +{ + int ret =3D 0; + size_t i; + + for (i =3D 0; i < sizeof(tests) / sizeof(tests[0]); i++) { + uint64_t result; + uint64_t cc =3D 0; + + result =3D tests[i].insn(tests[i].op1, tests[i].op2, &cc); + if (result !=3D tests[i].exp_result) { + fprintf(stderr, + "bad %s result:\n" + "actual =3D 0x%" PRIx64 "\n" + "expected =3D 0x%" PRIx64 "\n", + tests[i].name, result, tests[i].exp_result); + ret =3D 1; + } + if (cc !=3D tests[i].exp_cc) { + fprintf(stderr, + "bad %s cc:\n" + "actual =3D %" PRIu64 "\n" + "expected =3D %" PRIu64 "\n", + tests[i].name, cc, tests[i].exp_cc); + ret =3D 1; + } + } + return ret; +} --=20 2.27.0 From nobody Thu May 9 00:25:58 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642583556868642.2447074854372; Wed, 19 Jan 2022 01:12:36 -0800 (PST) Received: from localhost ([::1]:38132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nA719-0002oN-Kt for importer@patchew.org; Wed, 19 Jan 2022 04:12:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6P9-0006qm-R2 for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:33:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:22669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6P7-0006Ho-T0 for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:33:19 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-346-sWgllIRTOySzpvM0VYHP9A-1; Wed, 19 Jan 2022 03:33:12 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BBCF41966324; Wed, 19 Jan 2022 08:33:10 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 347014F85F; Wed, 19 Jan 2022 08:32:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642581197; 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=g5nylxmugxBBVbAlG4CHf8UnyZlRsHhcSQwZV3YafFg=; b=iNzlf6jhki2hv19Cvsrxxp9BSHyuZlS61ZF8RsHXuRGGEv0zRGKvjjaw0Wy4clnAD24o8S hNXTf+CmiFvGPzbz+SFAACFT+AWLwJELY3Lh+l+rUAtjI2yy9+so9CQdCpg9tlXHbyPfkx lu3fEJWu2US/swYSErogYVwocM0HRSI= X-MC-Unique: sWgllIRTOySzpvM0VYHP9A-1 From: Thomas Huth To: qemu-devel@nongnu.org Subject: [PULL 07/10] MAINTAINERS: split out s390x sections Date: Wed, 19 Jan 2022 09:32:12 +0100 Message-Id: <20220119083215.120911-8-thuth@redhat.com> In-Reply-To: <20220119083215.120911-1-thuth@redhat.com> References: <20220119083215.120911-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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+importer=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: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Peter Maydell , Eric Farman , David Hildenbrand , Cornelia Huck , Halil Pasic , Christian Borntraeger , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642583558264100001 From: Cornelia Huck Split out some more specialized devices etc., so that we can build smarter lists of people to be put on cc: in the future. Signed-off-by: Cornelia Huck Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: David Hildenbrand Acked-by: Christian Borntraeger Acked-by: Thomas Huth Acked-by: Halil Pasic Acked-by: Eric Farman Message-Id: <20211222105548.356852-1-cohuck@redhat.com> Signed-off-by: Thomas Huth --- MAINTAINERS | 85 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 74 insertions(+), 11 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 2fd74c4642..793d6edd2d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -297,7 +297,6 @@ M: David Hildenbrand S: Maintained F: target/s390x/ F: target/s390x/tcg -F: target/s390x/cpu_models_*.[ch] F: hw/s390x/ F: disas/s390.c F: tests/tcg/s390x/ @@ -396,16 +395,10 @@ M: Halil Pasic M: Christian Borntraeger S: Supported F: target/s390x/kvm/ -F: target/s390x/ioinst.[ch] F: target/s390x/machine.c F: target/s390x/sigp.c -F: target/s390x/cpu_features*.[ch] -F: target/s390x/cpu_models.[ch] F: hw/s390x/pv.c F: include/hw/s390x/pv.h -F: hw/intc/s390_flic.c -F: hw/intc/s390_flic_kvm.c -F: include/hw/s390x/s390_flic.h F: gdb-xml/s390*.xml T: git https://github.com/borntraeger/qemu.git s390-next L: qemu-s390x@nongnu.org @@ -1533,12 +1526,8 @@ S390 Virtio-ccw M: Halil Pasic M: Christian Borntraeger S: Supported -F: hw/char/sclp*.[hc] -F: hw/char/terminal3270.c F: hw/s390x/ F: include/hw/s390x/ -F: hw/watchdog/wdt_diag288.c -F: include/hw/watchdog/wdt_diag288.h F: configs/devices/s390x-softmmu/default.mak F: tests/avocado/machine_s390_ccw_virtio.py T: git https://github.com/borntraeger/qemu.git s390-next @@ -1563,6 +1552,37 @@ F: hw/s390x/s390-pci* F: include/hw/s390x/s390-pci* L: qemu-s390x@nongnu.org =20 +S390 channel subsystem +M: Halil Pasic +M: Christian Borntraeger +S: Supported +F: hw/s390x/ccw-device.[ch] +F: hw/s390x/css.c +F: hw/s390x/css-bridge.c +F: include/hw/s390x/css.h +F: include/hw/s390x/css-bridge.h +F: include/hw/s390x/ioinst.h +F: target/s390x/ioinst.c +L: qemu-s390x@nongnu.org + +S390 CPU models +M: David Hildenbrand +S: Maintained +F: target/s390x/cpu_features*.[ch] +F: target/s390x/cpu_models.[ch] +L: qemu-s390x@nongnu.org + +S390 SCLP-backed devices +M: Halil Pasic +M: Christian Borntraeger +S: Supported +F: include/hw/s390x/event-facility.h +F: include/hw/s390x/sclp.h +F: hw/char/sclp*.[hc] +F: hw/s390x/event-facility.c +F: hw/s390x/sclp*.c +L: qemu-s390x@nongnu.org + X86 Machines ------------ PC @@ -1970,6 +1990,7 @@ M: Halil Pasic S: Supported F: hw/s390x/virtio-ccw*.[hc] F: hw/s390x/vhost-vsock-ccw.c +F: hw/s390x/vhost-user-fs-ccw.c T: git https://gitlab.com/cohuck/qemu.git s390-next T: git https://github.com/borntraeger/qemu.git s390-next L: qemu-s390x@nongnu.org @@ -2308,6 +2329,48 @@ F: hw/timer/mips_gictimer.c F: include/hw/intc/mips_gic.h F: include/hw/timer/mips_gictimer.h =20 +S390 3270 device +M: Halil Pasic +M: Christian Borntraeger +S: Odd fixes +F: include/hw/s390x/3270-ccw.h +F: hw/char/terminal3270.c +F: hw/s390x/3270-ccw.c +L: qemu-s390x@nongnu.org + +S390 diag 288 watchdog +M: Halil Pasic +M: Christian Borntraeger +S: Supported +F: hw/watchdog/wdt_diag288.c +F: include/hw/watchdog/wdt_diag288.h +L: qemu-s390x@nongnu.org + +S390 storage key device +M: Halil Pasic +M: Christian Borntraeger +S: Supported +F: hw/s390x/storage-keys.h +F: hw/390x/s390-skeys*.c +L: qemu-s390x@nongnu.org + +S390 storage attribute device +M: Halil Pasic +M: Christian Borntraeger +S: Supported +F: hw/s390x/storage-attributes.h +F: hw/s390/s390-stattrib*.c +L: qemu-s390x@nongnu.org + +S390 floating interrupt controller +M: Halil Pasic +M: Christian Borntraeger +M: David Hildenbrand +S: Supported +F: hw/intc/s390_flic*.c +F: include/hw/s390x/s390_flic.h +L: qemu-s390x@nongnu.org + Subsystems ---------- Overall Audio backends --=20 2.27.0 From nobody Thu May 9 00:25:58 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642583940172982.3802126361392; Wed, 19 Jan 2022 01:19:00 -0800 (PST) Received: from localhost ([::1]:45314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nA77K-0007mE-AS for importer@patchew.org; Wed, 19 Jan 2022 04:18:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6PC-0006rJ-P1 for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:33:25 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:56066) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6PA-0006M6-2w for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:33:21 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-411-LsNEhxy1NqqBjg6Yps9ANA-1; Wed, 19 Jan 2022 03:33:14 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BD1C11966323; Wed, 19 Jan 2022 08:33:12 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2339C4F858; Wed, 19 Jan 2022 08:33:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642581199; 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=cx9bq+4n5tPdK36ksYIUnTcdkcQ7lt3JScVomUqMMY8=; b=g8SEU5GJD7LJGOLLyFdwR3r4CoXJ1nETTzG2H+RwpOfc1ab/eNLQIKfaHifT4M3zuIRglv RMdHfj50vBjvMAw4vZYuiNG6eAtKzKMpMbVe8YVKNeOyfXsoaxUwgCn/KDwn5SMUsICSdE DrWRGtGZJAZgqD8GxKm9Bllnw6VQdJo= X-MC-Unique: LsNEhxy1NqqBjg6Yps9ANA-1 From: Thomas Huth To: qemu-devel@nongnu.org Subject: [PULL 08/10] MAINTAINERS: Add myself to s390 I/O areas Date: Wed, 19 Jan 2022 09:32:13 +0100 Message-Id: <20220119083215.120911-9-thuth@redhat.com> In-Reply-To: <20220119083215.120911-1-thuth@redhat.com> References: <20220119083215.120911-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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+importer=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: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Halil Pasic , Peter Maydell , Eric Farman , Christian Borntraeger Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642583942520100001 Content-Type: text/plain; charset="utf-8" From: Eric Farman After the recent restructuring, I'd like to volunteer to help in some of the s390 I/O areas. Built on "[PATCH RFC v2] MAINTAINERS: split out s390x sections" Signed-off-by: Eric Farman Acked-by: Christian Borntraeger Acked-by: Halil Pasic Message-Id: <20220112164044.2210508-1-farman@linux.ibm.com> Signed-off-by: Thomas Huth --- MAINTAINERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 793d6edd2d..893a556710 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1525,6 +1525,7 @@ S390 Machines S390 Virtio-ccw M: Halil Pasic M: Christian Borntraeger +M: Eric Farman S: Supported F: hw/s390x/ F: include/hw/s390x/ @@ -1555,6 +1556,7 @@ L: qemu-s390x@nongnu.org S390 channel subsystem M: Halil Pasic M: Christian Borntraeger +M: Eric Farman S: Supported F: hw/s390x/ccw-device.[ch] F: hw/s390x/css.c @@ -1987,6 +1989,7 @@ T: git https://github.com/stefanha/qemu.git block virtio-ccw M: Cornelia Huck M: Halil Pasic +M: Eric Farman S: Supported F: hw/s390x/virtio-ccw*.[hc] F: hw/s390x/vhost-vsock-ccw.c --=20 2.27.0 From nobody Thu May 9 00:25:58 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642584152323514.7200635266495; Wed, 19 Jan 2022 01:22:32 -0800 (PST) Received: from localhost ([::1]:52512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nA7Al-0004JM-Be for importer@patchew.org; Wed, 19 Jan 2022 04:22:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6Px-0006wC-56 for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:34:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:28314) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6PZ-00073N-Q1 for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:33:47 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-77-WeiieBCjPyKYyyDurA5-DQ-1; Wed, 19 Jan 2022 03:33:42 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0599C1F2DA; Wed, 19 Jan 2022 08:33:41 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 286C84F858; Wed, 19 Jan 2022 08:33:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642581225; 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=F2bbzNpojd/qoHnFGenWLoFCTAmJUAIIwchPZ9W0zLk=; b=FrxAvpw3+txDvfLGFxe8FyyfFd1hyg2qBs/HkrriNrS+wM8+G26nRnDNrF8qyoFnWbrfVy CQmqeuIWQcrLgmE91IZ7hbTl/mK17rIzNg2QMQav5Lnv57P/kTgKG3FKUNfISRidgPRTxI W4A1lMDssdSVCM21mOXnUOuX+C08i4g= X-MC-Unique: WeiieBCjPyKYyyDurA5-DQ-1 From: Thomas Huth To: qemu-devel@nongnu.org Subject: [PULL 09/10] s390x/ipl: support extended kernel command line size Date: Wed, 19 Jan 2022 09:32:14 +0100 Message-Id: <20220119083215.120911-10-thuth@redhat.com> In-Reply-To: <20220119083215.120911-1-thuth@redhat.com> References: <20220119083215.120911-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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+importer=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: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Peter Maydell , Viktor Mihajlovski , Marc Hartmayer , Christian Borntraeger , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642584152921100003 Content-Type: text/plain; charset="utf-8" From: Marc Hartmayer In the past s390 used a fixed command line length of 896 bytes. This has ch= anged with the Linux commit 5ecb2da660ab ("s390: support command lines longer tha= n 896 bytes"). There is now a parm area indicating the maximum command line size.= This parm area has always been initialized to zero, so with older kernels this f= ield would read zero and we must then assume that only 896 bytes are available. Signed-off-by: Marc Hartmayer Reviewed-by: David Hildenbrand Reviewed-by: Christian Borntraeger Acked-by: Viktor Mihajlovski Message-Id: <20211122112909.18138-1-mhartmay@linux.ibm.com> [thuth: Cosmetic fixes, and use PRIu64 instead of %lu] Signed-off-by: Thomas Huth --- hw/s390x/ipl.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 7ddca0127f..eb7fc4c4ae 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -37,8 +37,9 @@ =20 #define KERN_IMAGE_START 0x010000UL #define LINUX_MAGIC_ADDR 0x010008UL +#define KERN_PARM_AREA_SIZE_ADDR 0x010430UL #define KERN_PARM_AREA 0x010480UL -#define KERN_PARM_AREA_SIZE 0x000380UL +#define LEGACY_KERN_PARM_AREA_SIZE 0x000380UL #define INITRD_START 0x800000UL #define INITRD_PARM_START 0x010408UL #define PARMFILE_START 0x001000UL @@ -110,6 +111,21 @@ static uint64_t bios_translate_addr(void *opaque, uint= 64_t srcaddr) return srcaddr + dstaddr; } =20 +static uint64_t get_max_kernel_cmdline_size(void) +{ + uint64_t *size_ptr =3D rom_ptr(KERN_PARM_AREA_SIZE_ADDR, sizeof(*size_= ptr)); + + if (size_ptr) { + uint64_t size; + + size =3D be64_to_cpu(*size_ptr); + if (size) { + return size; + } + } + return LEGACY_KERN_PARM_AREA_SIZE; +} + static void s390_ipl_realize(DeviceState *dev, Error **errp) { MachineState *ms =3D MACHINE(qdev_get_machine()); @@ -197,10 +213,13 @@ static void s390_ipl_realize(DeviceState *dev, Error = **errp) ipl->start_addr =3D KERN_IMAGE_START; /* Overwrite parameters in the kernel image, which are "rom" */ if (parm_area) { - if (cmdline_size > KERN_PARM_AREA_SIZE) { + uint64_t max_cmdline_size =3D get_max_kernel_cmdline_size(= ); + + if (cmdline_size > max_cmdline_size) { error_setg(errp, - "kernel command line exceeds maximum size: = %zu > %lu", - cmdline_size, KERN_PARM_AREA_SIZE); + "kernel command line exceeds maximum size:" + " %zu > %" PRIu64, + cmdline_size, max_cmdline_size); return; } =20 --=20 2.27.0 From nobody Thu May 9 00:25:58 2024 Delivered-To: importer@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+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1642583243; cv=none; d=zohomail.com; s=zohoarc; b=DZ0CzCUhQ/+mtdbe59Oql6BKM29EKpUcRK2K1EOdYQrt22nDn0ps9WEd4T7DI4hyrJsIiObKkFLZe9MikL7eWDZP8vMYbTlG0oToZE8oGruAQndwJrjfiAd4vcVuIZ9sfzIL+avSiZPVFdiaOVVhdyS3WEW/A3PAxAGI8LKC58I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642583243; 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=xy18YLpmzj0O4ArsnVfqMOMHNAj3Xk0C0yXAuzsUOv4=; b=GpeARdELxglB9w5+7LkbGp+dxeHmmn/nYZon8STzzWv3CJuqjMhSIOjLOUrFPVrLqkNwIi6HWGd46lH/IrYeLD/U0oW3IGmsuqcg2dwS9QXu4bRO3R75JQpGtFZb8MnTbjgHbNSi09wSCwE2rvKnmClHdSrv6+KHZlRQ++pbrig= 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+importer=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 1642583243891288.73772914900394; Wed, 19 Jan 2022 01:07:23 -0800 (PST) Received: from localhost ([::1]:53430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nA6w5-0002T6-G1 for importer@patchew.org; Wed, 19 Jan 2022 04:07:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6Qj-000812-KQ for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:34:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:52327) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6Qi-00079P-2M for qemu-devel@nongnu.org; Wed, 19 Jan 2022 03:34:57 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-230-9R6m81HaNbSLa9_OumR_dQ-1; Wed, 19 Jan 2022 03:34:14 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 491511083F65; Wed, 19 Jan 2022 08:34:13 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A2CE4F873; Wed, 19 Jan 2022 08:33:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642581295; 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=xy18YLpmzj0O4ArsnVfqMOMHNAj3Xk0C0yXAuzsUOv4=; b=TapN07092pg5LwK4Pvr7Y9uwTaWB1VLG5R1e4iFRKB52Uqb14MNn8zXqhwRkK7ZyiwKZJs qv9O8yuKeUhDweU00F5LWL0lJdqiG7ZNugaLQx/EE/u5oODxYMbhYvO5VNtvZ+j7ILYtkC uJfwJjVdVftF8Usj9vXKw2suuBK/AKM= X-MC-Unique: 9R6m81HaNbSLa9_OumR_dQ-1 From: Thomas Huth To: qemu-devel@nongnu.org Subject: [PULL 10/10] s390x: sigp: Reorder the SIGP STOP code Date: Wed, 19 Jan 2022 09:32:15 +0100 Message-Id: <20220119083215.120911-11-thuth@redhat.com> In-Reply-To: <20220119083215.120911-1-thuth@redhat.com> References: <20220119083215.120911-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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+importer=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: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Peter Maydell , Eric Farman , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1642583245215100001 Content-Type: text/plain; charset="utf-8" From: Eric Farman Let's wait to mark the VCPU STOPPED until the possible STORE STATUS operation is completed, so that we know the CPU is fully stopped and done doing anything. (When we also clear the possible sigp_order field for STOP orders.) Suggested-by: David Hildenbrand Signed-off-by: Eric Farman Message-Id: <20211213210919.856693-2-farman@linux.ibm.com> Reviewed-by: David Hildenbrand Signed-off-by: Thomas Huth --- target/s390x/sigp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c index 51c727834c..9dd977349a 100644 --- a/target/s390x/sigp.c +++ b/target/s390x/sigp.c @@ -139,7 +139,7 @@ static void sigp_stop_and_store_status(CPUState *cs, ru= n_on_cpu_data arg) case S390_CPU_STATE_OPERATING: cpu->env.sigp_order =3D SIGP_STOP_STORE_STATUS; cpu_inject_stop(cpu); - /* store will be performed in do_stop_interrup() */ + /* store will be performed in do_stop_interrupt() */ break; case S390_CPU_STATE_STOPPED: /* already stopped, just store the status */ @@ -479,13 +479,17 @@ void do_stop_interrupt(CPUS390XState *env) { S390CPU *cpu =3D env_archcpu(env); =20 - if (s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu) =3D=3D 0) { - qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); - } + /* + * Complete the STOP operation before exposing the CPU as + * STOPPED to the system. + */ if (cpu->env.sigp_order =3D=3D SIGP_STOP_STORE_STATUS) { s390_store_status(cpu, S390_STORE_STATUS_DEF_ADDR, true); } env->sigp_order =3D 0; + if (s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu) =3D=3D 0) { + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + } env->pending_int &=3D ~INTERRUPT_STOP; } =20 --=20 2.27.0