From nobody Thu Nov 28 10:43:06 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=1692791255; cv=none; d=zohomail.com; s=zohoarc; b=e8Fphnl9NCdmcjLrnjoga85vyeTomKOaMstB9f7g+ml2hPoga9+T3FNCMwBgo1e1Eb05Gjliw0QYuBrDLp/pu8DHfqh+znDYr2viyjpHi6hHygT628/yBwJyy6/2E73W0XuH1vaIa0WFeuXxWTlAyoghBkhgU5SlbSod9723s8g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692791255; 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=J3Nck2u3A4F4LecG/luR7cDRcfzib6aECdxmdEZ2d5Q=; b=c9fVYMN/FE6zIkT/4jQYrgNiAXp5mXxtnNEHsWITdH5HAvermPOCz88x0SJM5fKDTOiEpfN9HPhSdLMatLPi5z1XmUu+vi5Uz0iKnTc9+qxA7gf+k7NyAxvsScXYx4+4HuRzzhyd402nc0ezvKPTkXfrhah8gkwUPUi5Gc51cRk= 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 1692791255141559.629929112599; Wed, 23 Aug 2023 04:47:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYmJL-0001VU-PF; Wed, 23 Aug 2023 07:46:07 -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 1qYmJF-0001Tf-R0 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46:04 -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 1qYmJ7-0001OG-T7 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:45:58 -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-481-re_27quVOTOW5FOAAqvJlw-1; Wed, 23 Aug 2023 07:45:49 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2C671853061; Wed, 23 Aug 2023 11:45:49 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id B63C0C15BAE; Wed, 23 Aug 2023 11:45:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692791152; 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=J3Nck2u3A4F4LecG/luR7cDRcfzib6aECdxmdEZ2d5Q=; b=R4HBIYtYjzWnwRiKwiFtsN0HjRaR0xRtl/5T1niX/JSoOXwYih4UhCXe4+IJd6SthEY+f4 P+3DoeQc6ug7olsIjB1RxMoE5TJsP6gE3SmJkgoF56MBxQe9pQOcfNGeYQ8hob6FdfMuqx mIhvwqWp9xYL7YxLzzxG/tyD38s2JmU= X-MC-Unique: re_27quVOTOW5FOAAqvJlw-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , Cornelia Huck , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Laurent Vivier , "Michael S . Tsirkin" Subject: [PULL 01/12] hw: Add compat machines for 8.2 Date: Wed, 23 Aug 2023 13:45:33 +0200 Message-Id: <20230823114544.216520-2-thuth@redhat.com> In-Reply-To: <20230823114544.216520-1-thuth@redhat.com> References: <20230823114544.216520-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.8 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: -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 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1692791255787100001 From: Cornelia Huck Add 8.2 machine types for arm/i440fx/m68k/q35/s390x/spapr. Signed-off-by: Cornelia Huck Message-Id: <20230718142235.135319-1-cohuck@redhat.com> Reviewed-by: Thomas Huth Reviewed-by: C=C3=A9dric Le Goater Acked-by: Laurent Vivier Acked-by: Michael S. Tsirkin Signed-off-by: Thomas Huth --- include/hw/boards.h | 3 +++ include/hw/i386/pc.h | 3 +++ hw/arm/virt.c | 9 ++++++++- hw/core/machine.c | 3 +++ hw/i386/pc.c | 3 +++ hw/i386/pc_piix.c | 16 +++++++++++++--- hw/i386/pc_q35.c | 14 ++++++++++++-- hw/m68k/virt.c | 9 ++++++++- hw/ppc/spapr.c | 15 +++++++++++++-- hw/s390x/s390-virtio-ccw.c | 14 +++++++++++++- 10 files changed, 79 insertions(+), 10 deletions(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index ed83360198..3b541ffd24 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -390,6 +390,9 @@ struct MachineState { } \ type_init(machine_initfn##_register_types) =20 +extern GlobalProperty hw_compat_8_1[]; +extern const size_t hw_compat_8_1_len; + extern GlobalProperty hw_compat_8_0[]; extern const size_t hw_compat_8_0_len; =20 diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index d54e8b1101..0fabece236 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -200,6 +200,9 @@ void pc_madt_cpu_entry(int uid, const CPUArchIdList *ap= ic_ids, /* sgx.c */ void pc_machine_init_sgx_epc(PCMachineState *pcms); =20 +extern GlobalProperty pc_compat_8_1[]; +extern const size_t pc_compat_8_1_len; + extern GlobalProperty pc_compat_8_0[]; extern const size_t pc_compat_8_0_len; =20 diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 7d9dbc2663..2a560271b5 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -3170,10 +3170,17 @@ static void machvirt_machine_init(void) } type_init(machvirt_machine_init); =20 +static void virt_machine_8_2_options(MachineClass *mc) +{ +} +DEFINE_VIRT_MACHINE_AS_LATEST(8, 2) + static void virt_machine_8_1_options(MachineClass *mc) { + virt_machine_8_2_options(mc); + compat_props_add(mc->compat_props, hw_compat_8_1, hw_compat_8_1_len); } -DEFINE_VIRT_MACHINE_AS_LATEST(8, 1) +DEFINE_VIRT_MACHINE(8, 1) =20 static void virt_machine_8_0_options(MachineClass *mc) { diff --git a/hw/core/machine.c b/hw/core/machine.c index f0d35c6401..da699cf4e1 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -39,6 +39,9 @@ #include "hw/virtio/virtio.h" #include "hw/virtio/virtio-pci.h" =20 +GlobalProperty hw_compat_8_1[] =3D {}; +const size_t hw_compat_8_1_len =3D G_N_ELEMENTS(hw_compat_8_1); + GlobalProperty hw_compat_8_0[] =3D { { "migration", "multifd-flush-after-each-section", "on"}, { TYPE_PCI_DEVICE, "x-pcie-ari-nextfn-1", "on" }, diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 3109d5e0e0..54838c0c41 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -114,6 +114,9 @@ { "qemu64-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, }= ,\ { "athlon-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, }, =20 +GlobalProperty pc_compat_8_1[] =3D {}; +const size_t pc_compat_8_1_len =3D G_N_ELEMENTS(pc_compat_8_1); + GlobalProperty pc_compat_8_0[] =3D { { "virtio-mem", "unplugged-inaccessible", "auto" }, }; diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index ac72e8f5be..ce1ac95274 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -504,13 +504,25 @@ static void pc_i440fx_machine_options(MachineClass *m) machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE); } =20 -static void pc_i440fx_8_1_machine_options(MachineClass *m) +static void pc_i440fx_8_2_machine_options(MachineClass *m) { pc_i440fx_machine_options(m); m->alias =3D "pc"; m->is_default =3D true; } =20 +DEFINE_I440FX_MACHINE(v8_2, "pc-i440fx-8.2", NULL, + pc_i440fx_8_2_machine_options); + +static void pc_i440fx_8_1_machine_options(MachineClass *m) +{ + pc_i440fx_8_2_machine_options(m); + m->alias =3D NULL; + m->is_default =3D false; + compat_props_add(m->compat_props, hw_compat_8_1, hw_compat_8_1_len); + compat_props_add(m->compat_props, pc_compat_8_1, pc_compat_8_1_len); +} + DEFINE_I440FX_MACHINE(v8_1, "pc-i440fx-8.1", NULL, pc_i440fx_8_1_machine_options); =20 @@ -519,8 +531,6 @@ static void pc_i440fx_8_0_machine_options(MachineClass = *m) PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); =20 pc_i440fx_8_1_machine_options(m); - m->alias =3D NULL; - m->is_default =3D false; compat_props_add(m->compat_props, hw_compat_8_0, hw_compat_8_0_len); compat_props_add(m->compat_props, pc_compat_8_0, pc_compat_8_0_len); =20 diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index dc27a9e223..37c4814bed 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -379,12 +379,23 @@ static void pc_q35_machine_options(MachineClass *m) machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE); } =20 -static void pc_q35_8_1_machine_options(MachineClass *m) +static void pc_q35_8_2_machine_options(MachineClass *m) { pc_q35_machine_options(m); m->alias =3D "q35"; } =20 +DEFINE_Q35_MACHINE(v8_2, "pc-q35-8.2", NULL, + pc_q35_8_2_machine_options); + +static void pc_q35_8_1_machine_options(MachineClass *m) +{ + pc_q35_8_2_machine_options(m); + m->alias =3D NULL; + compat_props_add(m->compat_props, hw_compat_8_1, hw_compat_8_1_len); + compat_props_add(m->compat_props, pc_compat_8_1, pc_compat_8_1_len); +} + DEFINE_Q35_MACHINE(v8_1, "pc-q35-8.1", NULL, pc_q35_8_1_machine_options); =20 @@ -393,7 +404,6 @@ static void pc_q35_8_0_machine_options(MachineClass *m) PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); =20 pc_q35_8_1_machine_options(m); - m->alias =3D NULL; compat_props_add(m->compat_props, hw_compat_8_0, hw_compat_8_0_len); compat_props_add(m->compat_props, pc_compat_8_0, pc_compat_8_0_len); =20 diff --git a/hw/m68k/virt.c b/hw/m68k/virt.c index de91726cf9..2dd3c99894 100644 --- a/hw/m68k/virt.c +++ b/hw/m68k/virt.c @@ -347,10 +347,17 @@ type_init(virt_machine_register_types) } \ type_init(machvirt_machine_##major##_##minor##_init); =20 +static void virt_machine_8_2_options(MachineClass *mc) +{ +} +DEFINE_VIRT_MACHINE(8, 2, true) + static void virt_machine_8_1_options(MachineClass *mc) { + virt_machine_8_2_options(mc); + compat_props_add(mc->compat_props, hw_compat_8_1, hw_compat_8_1_len); } -DEFINE_VIRT_MACHINE(8, 1, true) +DEFINE_VIRT_MACHINE(8, 1, false) =20 static void virt_machine_8_0_options(MachineClass *mc) { diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 1c8b8d57a7..622fea8256 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4752,15 +4752,26 @@ static void spapr_machine_latest_class_options(Mach= ineClass *mc) } \ type_init(spapr_machine_register_##suffix) =20 +/* + * pseries-8.2 + */ +static void spapr_machine_8_2_class_options(MachineClass *mc) +{ + /* Defaults for the latest behaviour inherited from the base class */ +} + +DEFINE_SPAPR_MACHINE(8_2, "8.2", true); + /* * pseries-8.1 */ static void spapr_machine_8_1_class_options(MachineClass *mc) { - /* Defaults for the latest behaviour inherited from the base class */ + spapr_machine_8_2_class_options(mc); + compat_props_add(mc->compat_props, hw_compat_8_1, hw_compat_8_1_len); } =20 -DEFINE_SPAPR_MACHINE(8_1, "8.1", true); +DEFINE_SPAPR_MACHINE(8_1, "8.1", false); =20 /* * pseries-8.0 diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 4516d73ff5..c52a1fcf67 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -828,14 +828,26 @@ bool css_migration_enabled(void) } = \ type_init(ccw_machine_register_##suffix) =20 +static void ccw_machine_8_2_instance_options(MachineState *machine) +{ +} + +static void ccw_machine_8_2_class_options(MachineClass *mc) +{ +} +DEFINE_CCW_MACHINE(8_2, "8.2", true); + static void ccw_machine_8_1_instance_options(MachineState *machine) { + ccw_machine_8_2_instance_options(machine); } =20 static void ccw_machine_8_1_class_options(MachineClass *mc) { + ccw_machine_8_2_class_options(mc); + compat_props_add(mc->compat_props, hw_compat_8_1, hw_compat_8_1_len); } -DEFINE_CCW_MACHINE(8_1, "8.1", true); +DEFINE_CCW_MACHINE(8_1, "8.1", false); =20 static void ccw_machine_8_0_instance_options(MachineState *machine) { --=20 2.39.3 From nobody Thu Nov 28 10:43:06 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=1692791339; cv=none; d=zohomail.com; s=zohoarc; b=m7YgbWtp5XVejnnI3aU3nO03LvligKHtpF1raJe7JdXtFi8czwcW3buwTUmSY7Y17l5GRg4ISWKO+x+74uRTC/TzAlls1nF40XXzKrU35LO9EgSaHsiHqBuNEfkT7vnSjKqSGlXjpxBJLmvC2YYxLE93PbH+u/HROP6CqUpY2kY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692791339; 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=xYJlui688L5hS3PaC/CBbdriErtm8Ikgw7xUEycY5nA=; b=STOgBeyepkhmQMgSWB7jip/QVroDGdt9Pf7c4CkH963heBUpIh95hK5mAz78wIDjywkzCGRcb5B/LB1gSbwrLJ0d4L+fwPgh7WPgNIG8oJZARrzSdZD9uqqFLPRAeNdjMOX9AiiQakxof/Tq04A4QHYasBtzwqcdzF5/7sZio2c= 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 1692791339185950.7637036055457; Wed, 23 Aug 2023 04:48:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYmJi-0001Zi-SH; Wed, 23 Aug 2023 07:46:30 -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 1qYmJF-0001Tj-RR for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46:04 -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 1qYmJ7-0001OC-M0 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:45:55 -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-113-Ohrz0P24PqyoUWjiDzrM-g-1; Wed, 23 Aug 2023 07:45:50 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7ED69858EED; Wed, 23 Aug 2023 11:45:50 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B6D9C15BAE; Wed, 23 Aug 2023 11:45:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692791152; 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=xYJlui688L5hS3PaC/CBbdriErtm8Ikgw7xUEycY5nA=; b=TZhK8Bzo35tAxH/gnrFSRk9k7ofxUN5ytz7+4Q334xXonsawZvyDmFMzJ2Bxi7IiS3+U07 U27xE1mRfPjCOUbuNCRhyEz3tnUwMGAwAelkTaLKtRBKuC6IKNwWLvmO7ML33Zz0TiXu+Y 1UMpbVgJ14ScC2JKnVuuzaQIajzgsBo= X-MC-Unique: Ohrz0P24PqyoUWjiDzrM-g-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Matthew Rosato Subject: [PULL 02/12] s390x: Convert DPRINTF to trace events Date: Wed, 23 Aug 2023 13:45:34 +0200 Message-Id: <20230823114544.216520-3-thuth@redhat.com> In-Reply-To: <20230823114544.216520-1-thuth@redhat.com> References: <20230823114544.216520-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.8 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: -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 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1692791339985100001 From: C=C3=A9dric Le Goater Output message are slightly modified to ease selection with wildcards and to report extra parameters. Signed-off-by: C=C3=A9dric Le Goater Message-Id: <20230804080415.56852-1-clg@redhat.com> Reviewed-by: Thomas Huth Reviewed-by: Matthew Rosato Signed-off-by: Thomas Huth --- hw/s390x/s390-pci-bus.c | 25 ++++++------------ hw/s390x/s390-pci-inst.c | 48 ++++++++++++++--------------------- target/s390x/kvm/kvm.c | 33 ++++++++---------------- hw/s390x/trace-events | 17 +++++++++++++ target/s390x/kvm/trace-events | 7 +++++ 5 files changed, 62 insertions(+), 68 deletions(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 02751f3597..2ca36f9f3b 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -27,16 +27,7 @@ #include "sysemu/reset.h" #include "sysemu/runstate.h" =20 -#ifndef DEBUG_S390PCI_BUS -#define DEBUG_S390PCI_BUS 0 -#endif - -#define DPRINTF(fmt, ...) \ - do { \ - if (DEBUG_S390PCI_BUS) { \ - fprintf(stderr, "S390pci-bus: " fmt, ## __VA_ARGS__); \ - } \ - } while (0) +#include "trace.h" =20 S390pciState *s390_get_phb(void) { @@ -132,7 +123,7 @@ void s390_pci_sclp_configure(SCCB *sccb) uint16_t rc; =20 if (!pbdev) { - DPRINTF("sclp config no dev found\n"); + trace_s390_pci_sclp_nodev("configure", be32_to_cpu(psccb->aid)); rc =3D SCLP_RC_ADAPTER_ID_NOT_RECOGNIZED; goto out; } @@ -199,7 +190,7 @@ void s390_pci_sclp_deconfigure(SCCB *sccb) uint16_t rc; =20 if (!pbdev) { - DPRINTF("sclp deconfig no dev found\n"); + trace_s390_pci_sclp_nodev("deconfigure", be32_to_cpu(psccb->aid)); rc =3D SCLP_RC_ADAPTER_ID_NOT_RECOGNIZED; goto out; } @@ -573,7 +564,7 @@ static IOMMUTLBEntry s390_translate_iommu(IOMMUMemoryRe= gion *mr, hwaddr addr, return ret; } =20 - DPRINTF("iommu trans addr 0x%" PRIx64 "\n", addr); + trace_s390_pci_iommu_xlate(addr); =20 if (addr < iommu->pba || addr > iommu->pal) { error =3D ERR_EVENT_OORANGE; @@ -692,8 +683,8 @@ static void s390_msi_ctrl_write(void *opaque, hwaddr ad= dr, uint64_t data, uint32_t sum_bit; =20 assert(pbdev); - DPRINTF("write_msix data 0x%" PRIx64 " idx %d vec 0x%x\n", data, - pbdev->idx, vec); + + trace_s390_pci_msi_ctrl_write(data, pbdev->idx, vec); =20 if (pbdev->state !=3D ZPCI_FS_ENABLED) { return; @@ -843,7 +834,7 @@ static void s390_pcihost_realize(DeviceState *dev, Erro= r **errp) PCIHostState *phb =3D PCI_HOST_BRIDGE(dev); S390pciState *s =3D S390_PCI_HOST_BRIDGE(dev); =20 - DPRINTF("host_init\n"); + trace_s390_pcihost("realize"); =20 b =3D pci_register_root_bus(dev, NULL, s390_pci_set_irq, s390_pci_map_= irq, NULL, get_system_memory(), get_system_io(), = 0, @@ -1120,7 +1111,7 @@ static void s390_pcihost_plug(HotplugHandler *hotplug= _dev, DeviceState *dev, return; } } else { - DPRINTF("zPCI interpretation facilities missing.\n"); + trace_s390_pcihost("zPCI interpretation missing"); pbdev->interp =3D false; pbdev->forwarding_assist =3D false; } diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index 8f84ac6251..30149546c0 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -23,16 +23,7 @@ #include "hw/s390x/s390-pci-vfio.h" #include "hw/s390x/tod.h" =20 -#ifndef DEBUG_S390PCI_INST -#define DEBUG_S390PCI_INST 0 -#endif - -#define DPRINTF(fmt, ...) \ - do { \ - if (DEBUG_S390PCI_INST) { \ - fprintf(stderr, "s390pci-inst: " fmt, ## __VA_ARGS__); \ - } \ - } while (0) +#include "trace.h" =20 static inline void inc_dma_avail(S390PCIIOMMU *iommu) { @@ -133,8 +124,7 @@ static int list_pci(ClpReqRspListPci *rrb, uint8_t *cc) =20 g_l2 +=3D sizeof(ClpFhListEntry); /* Add endian check for DPRINTF? */ - DPRINTF("g_l2 %d vendor id 0x%x device id 0x%x fid 0x%x fh 0x%x\n", - g_l2, + trace_s390_pci_list_entry(g_l2, lduw_p(&rrb->response.fh_list[i].vendor_id), lduw_p(&rrb->response.fh_list[i].device_id), ldl_p(&rrb->response.fh_list[i].fid), @@ -153,7 +143,7 @@ static int list_pci(ClpReqRspListPci *rrb, uint8_t *cc) stw_p(&rrb->response.hdr.rsp, CLP_RC_OK); out: if (rc) { - DPRINTF("list pci failed rc 0x%x\n", rc); + trace_s390_pci_list(rc); stw_p(&rrb->response.hdr.rsp, res_code); } return rc; @@ -280,7 +270,7 @@ int clp_service_call(S390CPU *cpu, uint8_t r2, uintptr_= t ra) stw_p(&ressetpci->hdr.rsp, CLP_RC_OK); break; default: - DPRINTF("unknown set pci command\n"); + trace_s390_pci_unknown("set-pci", reqsetpci->oc); stw_p(&ressetpci->hdr.rsp, CLP_RC_SETPCIFN_FHOP); break; } @@ -292,7 +282,7 @@ int clp_service_call(S390CPU *cpu, uint8_t r2, uintptr_= t ra) =20 pbdev =3D s390_pci_find_dev_by_fh(s, ldl_p(&reqquery->fh)); if (!pbdev) { - DPRINTF("query pci no pci dev\n"); + trace_s390_pci_nodev("query", ldl_p(&reqquery->fh)); stw_p(&resquery->hdr.rsp, CLP_RC_SETPCIFN_FH); goto out; } @@ -317,7 +307,7 @@ int clp_service_call(S390CPU *cpu, uint8_t r2, uintptr_= t ra) stl_p(&resquery->bar[i], data); resquery->bar_size[i] =3D pbdev->pdev->io_regions[i].size ? ctz64(pbdev->pdev->io_regions[i].size)= : 0; - DPRINTF("bar %d addr 0x%x size 0x%" PRIx64 "barsize 0x%x\n", i, + trace_s390_pci_bar(i, ldl_p(&resquery->bar[i]), pbdev->pdev->io_regions[i].size, resquery->bar_size[i]); @@ -351,7 +341,7 @@ int clp_service_call(S390CPU *cpu, uint8_t r2, uintptr_= t ra) break; } default: - DPRINTF("unknown clp command\n"); + trace_s390_pci_unknown("clp", lduw_p(&reqh->cmd)); stw_p(&resh->rsp, CLP_RC_CMD); break; } @@ -459,7 +449,7 @@ int pcilg_service_call(S390CPU *cpu, uint8_t r1, uint8_= t r2, uintptr_t ra) =20 pbdev =3D s390_pci_find_dev_by_fh(s390_get_phb(), fh); if (!pbdev) { - DPRINTF("pcilg no pci dev\n"); + trace_s390_pci_nodev("pcilg", fh); setcc(cpu, ZPCI_PCI_LS_INVAL_HANDLE); return 0; } @@ -500,7 +490,7 @@ int pcilg_service_call(S390CPU *cpu, uint8_t r1, uint8_= t r2, uintptr_t ra) } break; default: - DPRINTF("pcilg invalid space\n"); + trace_s390_pci_invalid("pcilg", fh); setcc(cpu, ZPCI_PCI_LS_ERR); s390_set_status_code(env, r2, ZPCI_PCI_ST_INVAL_AS); return 0; @@ -559,7 +549,7 @@ int pcistg_service_call(S390CPU *cpu, uint8_t r1, uint8= _t r2, uintptr_t ra) =20 pbdev =3D s390_pci_find_dev_by_fh(s390_get_phb(), fh); if (!pbdev) { - DPRINTF("pcistg no pci dev\n"); + trace_s390_pci_nodev("pcistg", fh); setcc(cpu, ZPCI_PCI_LS_INVAL_HANDLE); return 0; } @@ -608,7 +598,7 @@ int pcistg_service_call(S390CPU *cpu, uint8_t r1, uint8= _t r2, uintptr_t ra) data, len); break; default: - DPRINTF("pcistg invalid space\n"); + trace_s390_pci_invalid("pcistg", fh); setcc(cpu, ZPCI_PCI_LS_ERR); s390_set_status_code(env, r2, ZPCI_PCI_ST_INVAL_AS); return 0; @@ -729,7 +719,7 @@ int rpcit_service_call(S390CPU *cpu, uint8_t r1, uint8_= t r2, uintptr_t ra) =20 pbdev =3D s390_pci_find_dev_by_fh(s390_get_phb(), fh); if (!pbdev) { - DPRINTF("rpcit no pci dev\n"); + trace_s390_pci_nodev("rpcit", fh); setcc(cpu, ZPCI_PCI_LS_INVAL_HANDLE); return 0; } @@ -863,7 +853,7 @@ int pcistb_service_call(S390CPU *cpu, uint8_t r1, uint8= _t r3, uint64_t gaddr, =20 pbdev =3D s390_pci_find_dev_by_fh(s390_get_phb(), fh); if (!pbdev) { - DPRINTF("pcistb no pci dev fh 0x%x\n", fh); + trace_s390_pci_nodev("pcistb", fh); setcc(cpu, ZPCI_PCI_LS_INVAL_HANDLE); return 0; } @@ -879,7 +869,7 @@ int pcistb_service_call(S390CPU *cpu, uint8_t r1, uint8= _t r3, uint64_t gaddr, } =20 if (pcias > ZPCI_IO_BAR_MAX) { - DPRINTF("pcistb invalid space\n"); + trace_s390_pci_invalid("pcistb", fh); setcc(cpu, ZPCI_PCI_LS_ERR); s390_set_status_code(env, r1, ZPCI_PCI_ST_INVAL_AS); return 0; @@ -971,7 +961,7 @@ static int reg_irqs(CPUS390XState *env, S390PCIBusDevic= e *pbdev, ZpciFib fib) pbdev->noi =3D FIB_DATA_NOI(ldl_p(&fib.data)); pbdev->sum =3D FIB_DATA_SUM(ldl_p(&fib.data)); =20 - DPRINTF("reg_irqs adapter id %d\n", pbdev->routes.adapter.adapter_id); + trace_s390_pci_irqs("register", pbdev->routes.adapter.adapter_id); return 0; out: release_indicator(&pbdev->routes.adapter, pbdev->summary_ind); @@ -996,7 +986,7 @@ int pci_dereg_irqs(S390PCIBusDevice *pbdev) pbdev->noi =3D 0; pbdev->sum =3D 0; =20 - DPRINTF("dereg_irqs adapter id %d\n", pbdev->routes.adapter.adapter_id= ); + trace_s390_pci_irqs("unregister", pbdev->routes.adapter.adapter_id); return 0; } =20 @@ -1139,7 +1129,7 @@ static int mpcifc_reg_int_interp(S390PCIBusDevice *pb= dev, ZpciFib *fib) =20 rc =3D s390_pci_kvm_aif_enable(pbdev, fib, pbdev->forwarding_assist); if (rc) { - DPRINTF("Failed to enable interrupt forwarding\n"); + trace_s390_pci_kvm_aif("enable"); return rc; } =20 @@ -1152,7 +1142,7 @@ static int mpcifc_dereg_int_interp(S390PCIBusDevice *= pbdev, ZpciFib *fib) =20 rc =3D s390_pci_kvm_aif_disable(pbdev); if (rc) { - DPRINTF("Failed to disable interrupt forwarding\n"); + trace_s390_pci_kvm_aif("disable"); return rc; } =20 @@ -1185,7 +1175,7 @@ int mpcifc_service_call(S390CPU *cpu, uint8_t r1, uin= t64_t fiba, uint8_t ar, =20 pbdev =3D s390_pci_find_dev_by_fh(s390_get_phb(), fh); if (!pbdev) { - DPRINTF("mpcifc no pci dev fh 0x%x\n", fh); + trace_s390_pci_nodev("mpcifc", fh); setcc(cpu, ZPCI_PCI_LS_INVAL_HANDLE); return 0; } diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c index a9e5880349..c47a4a2c13 100644 --- a/target/s390x/kvm/kvm.c +++ b/target/s390x/kvm/kvm.c @@ -52,16 +52,6 @@ #include "hw/s390x/s390-virtio-hcall.h" #include "target/s390x/kvm/pv.h" =20 -#ifndef DEBUG_KVM -#define DEBUG_KVM 0 -#endif - -#define DPRINTF(fmt, ...) do { \ - if (DEBUG_KVM) { \ - fprintf(stderr, fmt, ## __VA_ARGS__); \ - } \ -} while (0) - #define kvm_vm_check_mem_attr(s, attr) \ kvm_vm_check_attr(s, KVM_S390_VM_MEM_CTRL, attr) =20 @@ -912,11 +902,11 @@ static void determine_sw_breakpoint_instr(void) if (kvm_vm_enable_cap(kvm_state, KVM_CAP_S390_USER_INSTR0, 0)) { sw_bp_inst =3D diag_501; sw_bp_ilen =3D sizeof(diag_501); - DPRINTF("KVM: will use 4-byte sw breakpoints.\n"); + trace_kvm_sw_breakpoint(4); } else { sw_bp_inst =3D instr_0x0000; sw_bp_ilen =3D sizeof(instr_0x0000); - DPRINTF("KVM: will use 2-byte sw breakpoints.\n"); + trace_kvm_sw_breakpoint(2); } } =20 @@ -1307,7 +1297,7 @@ static int handle_b2(S390CPU *cpu, struct kvm_run *ru= n, uint8_t ipa1) break; default: rc =3D -1; - DPRINTF("KVM: unhandled PRIV: 0xb2%x\n", ipa1); + trace_kvm_insn_unhandled_priv(ipa1); break; } =20 @@ -1487,7 +1477,7 @@ static int handle_b9(S390CPU *cpu, struct kvm_run *ru= n, uint8_t ipa1) break; default: r =3D -1; - DPRINTF("KVM: unhandled PRIV: 0xb9%x\n", ipa1); + trace_kvm_insn_unhandled_priv(ipa1); break; } =20 @@ -1511,7 +1501,7 @@ static int handle_eb(S390CPU *cpu, struct kvm_run *ru= n, uint8_t ipbl) break; default: r =3D -1; - DPRINTF("KVM: unhandled PRIV: 0xeb%x\n", ipbl); + trace_kvm_insn_unhandled_priv(ipbl); break; } =20 @@ -1531,7 +1521,7 @@ static int handle_e3(S390CPU *cpu, struct kvm_run *ru= n, uint8_t ipbl) break; default: r =3D -1; - DPRINTF("KVM: unhandled PRIV: 0xe3%x\n", ipbl); + trace_kvm_insn_unhandled_priv(ipbl); break; } =20 @@ -1654,7 +1644,7 @@ static int handle_diag(S390CPU *cpu, struct kvm_run *= run, uint32_t ipb) r =3D handle_sw_breakpoint(cpu, run); break; default: - DPRINTF("KVM: unknown DIAG: 0x%x\n", func_code); + trace_kvm_insn_diag(func_code); kvm_s390_program_interrupt(cpu, PGM_SPECIFICATION); break; } @@ -1684,8 +1674,7 @@ static int handle_instruction(S390CPU *cpu, struct kv= m_run *run) uint8_t ipa1 =3D run->s390_sieic.ipa & 0x00ff; int r =3D -1; =20 - DPRINTF("handle_instruction 0x%x 0x%x\n", - run->s390_sieic.ipa, run->s390_sieic.ipb); + trace_kvm_insn(run->s390_sieic.ipa, run->s390_sieic.ipb); switch (ipa0) { case IPA0_B2: r =3D handle_b2(cpu, run, ipa1); @@ -1765,7 +1754,7 @@ static int handle_intercept(S390CPU *cpu) int icpt_code =3D run->s390_sieic.icptcode; int r =3D 0; =20 - DPRINTF("intercept: 0x%x (at 0x%lx)\n", icpt_code, (long)run->psw_addr= ); + trace_kvm_intercept(icpt_code, (long)run->psw_addr); switch (icpt_code) { case ICPT_INSTRUCTION: case ICPT_PV_INSTR: @@ -2150,13 +2139,13 @@ int kvm_arch_fixup_msi_route(struct kvm_irq_routing= _entry *route, uint32_t vec =3D data & ZPCI_MSI_VEC_MASK; =20 if (!dev) { - DPRINTF("add_msi_route no pci device\n"); + trace_kvm_msi_route_fixup("no pci device"); return -ENODEV; } =20 pbdev =3D s390_pci_find_dev_by_target(s390_get_phb(), DEVICE(dev)->id); if (!pbdev) { - DPRINTF("add_msi_route no zpci device\n"); + trace_kvm_msi_route_fixup("no zpci device"); return -ENODEV; } =20 diff --git a/hw/s390x/trace-events b/hw/s390x/trace-events index 8b9213eab9..34da5ea323 100644 --- a/hw/s390x/trace-events +++ b/hw/s390x/trace-events @@ -19,3 +19,20 @@ virtio_ccw_set_ind(uint64_t ind_loc, uint8_t ind_old, ui= nt8_t ind_new) "VIRTIO-C s390_pci_clp_cap(const char *id, uint32_t cap) "PCI: %s: missing expected = CLP capability %u" s390_pci_clp_cap_size(const char *id, uint32_t size, uint32_t cap) "PCI: %= s: bad size (%u) for CLP capability %u" s390_pci_clp_dev_info(const char *id) "PCI: %s: cannot read vfio device in= fo" + +# s390-pci-bus.c +s390_pci_sclp_nodev(const char *str, uint32_t aid) "%s no dev found aid 0x= %x" +s390_pci_iommu_xlate(uint64_t addr) "iommu trans addr 0x%" PRIx64 +s390_pci_msi_ctrl_write(uint64_t data, uint32_t idx, uint32_t vec) "write_= msix data 0x%" PRIx64 " idx %d vec 0x%x" +s390_pcihost(const char *msg) "%s" + +# s390-pci-inst.c +s390_pci_irqs(const char *str, uint32_t id) "%s irqs for adapter id %d" +s390_pci_kvm_aif(const char *str) "Failed to %s interrupt forwarding" + +s390_pci_list_entry(uint32_t g_l2, uint32_t vid, uint32_t did, uint32_t fi= d, uint32_t fh) "g_l2 %d vendor id 0x%x device id 0x%x fid 0x%x fh 0x%x" +s390_pci_list(uint32_t rc) "failed rc 0x%x" +s390_pci_unknown(const char *msg, uint32_t cmd) "%s unknown command 0x%x" +s390_pci_bar(uint32_t bar, uint32_t addr, uint64_t size, uint32_t barsize)= "bar %d addr 0x%x size 0x%" PRIx64 "barsize 0x%x" +s390_pci_nodev(const char *cmd, uint32_t fh) "%s no pci dev fh 0x%x" +s390_pci_invalid(const char *cmd, uint32_t fh) "%s invalid space fh 0x%x" diff --git a/target/s390x/kvm/trace-events b/target/s390x/kvm/trace-events index 5289f5f675..818f1a37a1 100644 --- a/target/s390x/kvm/trace-events +++ b/target/s390x/kvm/trace-events @@ -5,3 +5,10 @@ kvm_enable_cmma(int rc) "CMMA: enabling with result code %= d" kvm_clear_cmma(int rc) "CMMA: clearing with result code %d" kvm_failed_cpu_state_set(int cpu_index, uint8_t state, const char *msg) "W= arning: Unable to set cpu %d state %" PRIu8 " to KVM: %s" kvm_assign_subch_ioeventfd(int fd, uint32_t addr, bool assign, int datamat= ch) "fd: %d sch: @0x%x assign: %d vq: %d" + +kvm_sw_breakpoint(uint32_t n) "KVM: will use %d-byte sw breakpoints" +kvm_insn_unhandled_priv(uint32_t x) "KVM: unhandled PRIV: 0x%x" +kvm_insn_diag(uint32_t x) "KVM: unknown DIAG: 0x%x" +kvm_insn(uint32_t ipa, uint32_t ipb) "handle_instruction 0x%x 0x%x" +kvm_intercept(uint32_t icpt_code, uint64_t psw_addr) "intercept: 0x%x (at = 0x%"PRIx64"lx)" +kvm_msi_route_fixup(const char* msg) "%s" --=20 2.39.3 From nobody Thu Nov 28 10:43:06 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=1692791315; cv=none; d=zohomail.com; s=zohoarc; b=FQAKjwCELmDfEba7d84096jdtI6i2jPjLxwazvueNvXPGjy2ZVDo3M1B8qVWO9Q/4rRWNamj+qgDkXcjLFv4GH8tk+D+BEQa3r535T7fw/T83XLCSrSAd5DhU24ztzuOLrIQbkO/KUI5ABN2wCiB7KHk3LgSYuSGNx84emqHCJU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692791315; 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=aIP0quCoL+X1Pi1Luss8tVsOjW5zlKuDAWiV48K05l0=; b=Ce5IPHVb6sUCCE98jBDtlC4lfyMmEQzFBoDdhzyqa7Ah9e4ZhspxY+rLNE1IY5HAkmVDO+LeIYPcljeEf8AiuSaLMIQ3Aq7w+AYPfdJskTnNZ+gphpTLJ+C1uxB9rhUVnTl0bHX1lMrMWBmp09Kcw/c1o5/H9R/Qwplba6+NgJQ= 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 1692791315069798.5828880677212; Wed, 23 Aug 2023 04:48:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYmJX-0001YZ-Lh; Wed, 23 Aug 2023 07:46:21 -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 1qYmJF-0001Th-R7 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46:05 -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 1qYmJA-0001Pd-3L for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46:01 -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-499-YWukU_toOD6i2x7NPHmB2Q-1; Wed, 23 Aug 2023 07:45:52 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CB1DC8D40A4; Wed, 23 Aug 2023 11:45:51 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4B04C15BAE; Wed, 23 Aug 2023 11:45:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692791155; 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=aIP0quCoL+X1Pi1Luss8tVsOjW5zlKuDAWiV48K05l0=; b=M4oWunA0LizEelvx5eyFgBf8/6793CBMgvb/Rixc75eXNPlMZ0Y9ijvVPaaO9RGlsdsQr4 CWvmOwaUYnWjzMMsI48loEuUHBtkL5ap11kVa58She6ASDrkSBjBN6NPimi5nFwu3hTSZI SJRgVnuO3z5pfDEunr4tmDXiFNw0kz8= X-MC-Unique: YWukU_toOD6i2x7NPHmB2Q-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , Ilya Leoshkevich , qemu-stable@nongnu.org, David Hildenbrand Subject: [PULL 03/12] target/s390x: Check reserved bits of VFMIN/VFMAX's M5 Date: Wed, 23 Aug 2023 13:45:35 +0200 Message-Id: <20230823114544.216520-4-thuth@redhat.com> In-Reply-To: <20230823114544.216520-1-thuth@redhat.com> References: <20230823114544.216520-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: -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 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1692791315832100001 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich VFMIN and VFMAX should raise a specification exceptions when bits 1-3 of M5 are set. Cc: qemu-stable@nongnu.org Fixes: da4807527f3b ("s390x/tcg: Implement VECTOR FP (MAXIMUM|MINIMUM)") Signed-off-by: Ilya Leoshkevich Message-Id: <20230804234621.252522-1-iii@linux.ibm.com> Reviewed-by: David Hildenbrand 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 f8df121d3d..b5d07d5ec5 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 >=3D 13) { + if (m6 =3D=3D 5 || m6 =3D=3D 6 || m6 =3D=3D 7 || m6 >=3D 13 || (m5 & 7= )) { gen_program_exception(s, PGM_SPECIFICATION); return DISAS_NORETURN; } --=20 2.39.3 From nobody Thu Nov 28 10:43:06 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=1692791504; cv=none; d=zohomail.com; s=zohoarc; b=AE6sysN1O03kS3hg8fs57LLd4wOmuVohzpaUh/K26P1hVfyHrQrcQ5sMrnJ4XIJRNCod616LslQ7sD8foFL4pqXyIjkMMppbAqw9lb0bq/09J2dslUqXcWTb8a2wHrsFe2DXc8ZFrGDOD43tXV0ED+sfXV8nPdoB1TzNJ89FMJU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692791504; 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=sXnGa8WXrrK20Y0dTFhEeYD/7VY/YJAHG0l7e6CcfZ8=; b=j/8U2xuyoM58/LHnEJkBo71DPXI+pa6nzfNpXYvb35UcqXlSvBExGOBu1LKEP1OXq+8u24ToIOOlIAA1cJwm26ZlfiIEl0NuU69oljqLMMO7JlNsQKhKoE946Dptx31/ZIMDUi/qw9D7KT8rhNNFvT5ODhP5Wou0hl7Ny3vc6O4= 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 1692791504818989.7545360271433; Wed, 23 Aug 2023 04:51:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYmJM-0001W9-GM; Wed, 23 Aug 2023 07:46:08 -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 1qYmJH-0001Tm-Pg for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46: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 1qYmJC-0001Pf-Dy for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46:02 -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-572-h7PAfSEPMP2id0bcQoTZ3w-1; Wed, 23 Aug 2023 07:45:53 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2D016101A52E; Wed, 23 Aug 2023 11:45:53 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17D9EC15BAE; Wed, 23 Aug 2023 11:45:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692791155; 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=sXnGa8WXrrK20Y0dTFhEeYD/7VY/YJAHG0l7e6CcfZ8=; b=EDFDP13ViFgMQuOg7BvSoQkfthDbOsm1EuScBolnImAR21REjqiw0NvU2Ucn7JRPqBCBiC 0b7gH7MF+m+4bHfyYN6g0Mzq+/vyr6LHuf9YGm0u42RXVsBaPN/GA+zhtzbxLq5v/YJ5J0 MvIcqoWYxb2TFXqDRHRadpgSvLxuHCI= X-MC-Unique: h7PAfSEPMP2id0bcQoTZ3w-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , Ilya Leoshkevich , qemu-stable@nongnu.org, David Hildenbrand Subject: [PULL 04/12] target/s390x: Fix VSTL with a large length Date: Wed, 23 Aug 2023 13:45:36 +0200 Message-Id: <20230823114544.216520-5-thuth@redhat.com> In-Reply-To: <20230823114544.216520-1-thuth@redhat.com> References: <20230823114544.216520-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: -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 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1692791506970100007 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich The length is always truncated to 16 bytes. Do not probe more than that. Cc: qemu-stable@nongnu.org Fixes: 0e0a5b49ad58 ("s390x/tcg: Implement VECTOR STORE WITH LENGTH") Signed-off-by: Ilya Leoshkevich Message-Id: <20230804235624.263260-1-iii@linux.ibm.com> Reviewed-by: David Hildenbrand Signed-off-by: Thomas Huth --- target/s390x/tcg/vec_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/tcg/vec_helper.c b/target/s390x/tcg/vec_helper.c index 48d86722b2..dafc4c3582 100644 --- a/target/s390x/tcg/vec_helper.c +++ b/target/s390x/tcg/vec_helper.c @@ -193,7 +193,7 @@ void HELPER(vstl)(CPUS390XState *env, const void *v1, u= int64_t addr, uint64_t bytes) { /* Probe write access before actually modifying memory */ - probe_write_access(env, addr, bytes, GETPC()); + probe_write_access(env, addr, MIN(bytes, 16), GETPC()); =20 if (likely(bytes >=3D 16)) { cpu_stq_data_ra(env, addr, s390_vec_read_element64(v1, 0), GETPC()= ); --=20 2.39.3 From nobody Thu Nov 28 10:43:06 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=1692791211; cv=none; d=zohomail.com; s=zohoarc; b=F2hQyGYbXxNfVPGd48fdD/lEuN5U5ZvftQUzyzIiNoyNJkeX9Q5FH+6u4Os1hep4iZxXoss5AIRAgNAJgmAw9j5glsEuc+YN7M6hngrazy0nZgmzz/4rhpBuggcjs1fuc7S0tvyWVaeLOpy2SduH2/BWYuFHc+X16GuU29mXb24= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692791211; 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=JztBJHrVZPoEyd5VVRxoKMhYvt0vf53/BnHzwP12uxE=; b=lQwbWj3FDceTjR8H4NLUiijtA1ywEcEO8ItU5EMGEf2riU0S8IF9pL7S0SNOUQcriRmeu9noJyE/AARwKQ7ny3GdV5my5JOZEu3t5MVysFLNMdhKHC7Sp9Zy5bP89Xm8AsS4rG4xXbmTphXx/d/P2lLHjhLKSG/cGi2xgm4CA8E= 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 1692791211123435.8019419403497; Wed, 23 Aug 2023 04:46:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYmJN-0001Wh-1M; Wed, 23 Aug 2023 07:46:09 -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 1qYmJJ-0001UM-VM for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46:06 -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 1qYmJF-0001RL-IR for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46:04 -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-401-DsGcyLNFP1mruuuEMkQ7Ww-1; Wed, 23 Aug 2023 07:45:54 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5E4E6185A7A5; Wed, 23 Aug 2023 11:45:54 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F75EC15BAE; Wed, 23 Aug 2023 11:45:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692791157; 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=JztBJHrVZPoEyd5VVRxoKMhYvt0vf53/BnHzwP12uxE=; b=PVOJ4XA73Jzo5Gcpo7V5KZ5fUoQxLFHm5B0TyuUvKaOZGC/A1MPdhqAxNEtKkUl7y5YUcn zqsCzoHEKIHcBN/0Aob5lXVT68dlXqZaaTP3KRxHhsZqzQreHvTIT/SlUey8IQi7GFgXoX BPn9AcekfDdT91mqL2GnppGa2OuZcRA= X-MC-Unique: DsGcyLNFP1mruuuEMkQ7Ww-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , Ilya Leoshkevich Subject: [PULL 05/12] tests/tcg/s390x: Test VSTL Date: Wed, 23 Aug 2023 13:45:37 +0200 Message-Id: <20230823114544.216520-6-thuth@redhat.com> In-Reply-To: <20230823114544.216520-1-thuth@redhat.com> References: <20230823114544.216520-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: -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 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1692791213083100003 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich Message-Id: <20230804235624.263260-2-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/tcg/s390x/vstl.c | 37 +++++++++++++++++++++++++++++++++ tests/tcg/s390x/Makefile.target | 1 + 2 files changed, 38 insertions(+) create mode 100644 tests/tcg/s390x/vstl.c diff --git a/tests/tcg/s390x/vstl.c b/tests/tcg/s390x/vstl.c new file mode 100644 index 0000000000..bece952c7e --- /dev/null +++ b/tests/tcg/s390x/vstl.c @@ -0,0 +1,37 @@ +/* + * Test the VSTL instruction. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include +#include +#include "vx.h" + +static inline void vstl(S390Vector *v1, void *db2, size_t r3) +{ + asm("vstl %[v1],%[r3],%[db2]" + : [db2] "=3DQ" (*(char *)db2) + : [v1] "v" (v1->v), [r3] "r" (r3) + : "memory"); +} + +int main(void) +{ + uint64_t buf[3] =3D {0x1122334455667788ULL, 0x99aabbccddeeffULL, + 0x5a5a5a5a5a5a5a5aULL}; + S390Vector v =3D {.d[0] =3D 0x1234567887654321ULL, + .d[1] =3D 0x9abcdef00fedcba9ULL}; + + vstl(&v, buf, 0); + assert(buf[0] =3D=3D 0x1222334455667788ULL); + + vstl(&v, buf, 1); + assert(buf[0] =3D=3D 0x1234334455667788ULL); + + vstl(&v, buf, -1); + assert(buf[0] =3D=3D 0x1234567887654321ULL); + assert(buf[1] =3D=3D 0x9abcdef00fedcba9ULL); + assert(buf[2] =3D=3D 0x5a5a5a5a5a5a5a5aULL); + + return EXIT_SUCCESS; +} diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.tar= get index 1fc9809907..e280c8c280 100644 --- a/tests/tcg/s390x/Makefile.target +++ b/tests/tcg/s390x/Makefile.target @@ -59,6 +59,7 @@ Z13_TESTS=3Dvistr Z13_TESTS+=3Dlcbb Z13_TESTS+=3Dlocfhr Z13_TESTS+=3Dvcksm +Z13_TESTS+=3Dvstl $(Z13_TESTS): CFLAGS+=3D-march=3Dz13 -O2 TESTS+=3D$(Z13_TESTS) =20 --=20 2.39.3 From nobody Thu Nov 28 10:43:06 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=1692791503; cv=none; d=zohomail.com; s=zohoarc; b=Ell/QEm1yqXHrvYuJv+/ufWViehzq6zOmASzwiPfGSWRRPKsqKvKytHYk9kzrKUZckFAUUab44aBTIeSdi0QUz9JRmOYh4WsRrF0kxyFdGYoIYc4BON82G1wylnx7AJc20JNEgMyOz8jMootL9JSuLXp36tKApHQshjzXhaPP7Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692791503; 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=Wnhh4a3kG3JL9XAwRzomI8TrtI7tvty0j3sbL7SKKWo=; b=eq77Em00s8DJtK3N4LzIFUnKaCuRoTBHKaXIvRyW+qtpGKQdxIhiAWbOFWED+fOzCbq+SgCpnQOMZnU3KOIFp9sEeOo85DuSkMuXGRfTU/II3Eq0kL5t9C3YfK5bBNwHo8R6lJx3kgw2b6v43Wzsb6X/cOITASedaEUXLhKIdCQ= 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 1692791503303715.6962290141838; Wed, 23 Aug 2023 04:51:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYmJO-0001XY-FL; Wed, 23 Aug 2023 07:46:10 -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 1qYmJJ-0001UW-Vl for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46:06 -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 1qYmJF-0001S7-IC for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46:03 -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-1--9Dk0TaJM2SJdM3z023C6Q-1; Wed, 23 Aug 2023 07:45:56 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E66D68D40A4; Wed, 23 Aug 2023 11:45:55 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id A2861C15BB8; Wed, 23 Aug 2023 11:45:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692791159; 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=Wnhh4a3kG3JL9XAwRzomI8TrtI7tvty0j3sbL7SKKWo=; b=DnchnfF/7P6P/NNSBo9LA99KJFvVjeYdNEZRythGB7zQDD+mROkDZWuTl7gS7KzRdB6p8W BsyDkxxthoDrYWbLjIaXLCbaTfG+CI9QUn1GDKbaDNMDNCb6MJJHVJc/wmN7vHGX90I3Cl 0creS6Hhq5AJLoqi7o7HmNsS1GhE/pc= X-MC-Unique: -9Dk0TaJM2SJdM3z023C6Q-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , Ilya Leoshkevich , qemu-stable@nongnu.org, David Hildenbrand Subject: [PULL 06/12] target/s390x: Use a 16-bit immediate in VREP Date: Wed, 23 Aug 2023 13:45:38 +0200 Message-Id: <20230823114544.216520-7-thuth@redhat.com> In-Reply-To: <20230823114544.216520-1-thuth@redhat.com> References: <20230823114544.216520-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: -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 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1692791505436100003 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Unlike most other instructions that contain an immediate element index, VREP's one is 16-bit, and not 4-bit. The code uses only 8 bits, so using, e.g., 0x101 does not lead to a specification exception. Fix by checking all 16 bits. Cc: qemu-stable@nongnu.org Fixes: 28d08731b1d8 ("s390x/tcg: Implement VECTOR REPLICATE") Signed-off-by: Ilya Leoshkevich Message-Id: <20230807163459.849766-1-iii@linux.ibm.com> Reviewed-by: David Hildenbrand Signed-off-by: Thomas Huth --- target/s390x/tcg/translate_vx.c.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/s390x/tcg/translate_vx.c.inc b/target/s390x/tcg/transla= te_vx.c.inc index b5d07d5ec5..ec94d39df0 100644 --- a/target/s390x/tcg/translate_vx.c.inc +++ b/target/s390x/tcg/translate_vx.c.inc @@ -57,7 +57,7 @@ #define FPF_LONG 3 #define FPF_EXT 4 =20 -static inline bool valid_vec_element(uint8_t enr, MemOp es) +static inline bool valid_vec_element(uint16_t enr, MemOp es) { return !(enr & ~(NUM_VEC_ELEMENTS(es) - 1)); } @@ -964,7 +964,7 @@ static DisasJumpType op_vpdi(DisasContext *s, DisasOps = *o) =20 static DisasJumpType op_vrep(DisasContext *s, DisasOps *o) { - const uint8_t enr =3D get_field(s, i2); + const uint16_t enr =3D get_field(s, i2); const uint8_t es =3D get_field(s, m4); =20 if (es > ES_64 || !valid_vec_element(enr, es)) { --=20 2.39.3 From nobody Thu Nov 28 10:43:06 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=1692791276; cv=none; d=zohomail.com; s=zohoarc; b=ftGCKbwGB5myWJARLGzkR9IoXf3hIHgTWRDD/7wDrfugMXN4GdSmsI9IOhGR6zaUWebylQdq60s/AczLW5wj6u31EnV3CDn9ZnVjeR3L3G4SJFTdWaHFIZDW8z2lT6HUpWR2LRiA+NNNc1XgB7vZ3Ommch/kXQ6s6Gd1vbHviSQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692791276; 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=qOFBWFRg4NE622W93HZhBOXECakhIqIfisekBTHA2Ck=; b=NG6LC//9p8MW2TFzXsmelvBTgsjgrnGz7jT7PnLxymnhJxjW9PFEMtOxmymQK565TGHk9gt/NBusZZrHOBQ6dnJVz3m1f+SO7f2IoIovSOIoI6PQXs0pVqTe24suK1kJdC7MScqvlyPwUpKRtRhFuFv0jHT9QdBcQGFkTqrXRAU= 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 1692791276368264.1016486469813; Wed, 23 Aug 2023 04:47:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYmJk-0001Zn-23; Wed, 23 Aug 2023 07:46:32 -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 1qYmJK-0001Uy-I2 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46:06 -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 1qYmJG-0001TA-B3 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46:06 -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-557-o3a2_J2RPMK60pxeSrqo0g-1; Wed, 23 Aug 2023 07:45:58 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7D1183C11A04; Wed, 23 Aug 2023 11:45:57 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7E01CC15BB8; Wed, 23 Aug 2023 11:45:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692791161; 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=qOFBWFRg4NE622W93HZhBOXECakhIqIfisekBTHA2Ck=; b=J7nYV3a1METEcOf1K+A9KA0+t+0zj4v1Odo14Gn1aVYTsJT0UOKUBYLQtpmIei2l7h06Bm 9B+844abpz/BsVsKW/I/JvvOQJfCcsxmhWpmGFwQUy0MD3WbeJhzj/be0O0/eSB0Hj4Vr1 xGNIifYG2XSiPkHDbWNZPuUsj+8ArC4= X-MC-Unique: o3a2_J2RPMK60pxeSrqo0g-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , Ilya Leoshkevich Subject: [PULL 07/12] tests/tcg/s390x: Test VREP Date: Wed, 23 Aug 2023 13:45:39 +0200 Message-Id: <20230823114544.216520-8-thuth@redhat.com> In-Reply-To: <20230823114544.216520-1-thuth@redhat.com> References: <20230823114544.216520-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: -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 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1692791278062100007 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich Message-Id: <20230807163459.849766-2-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/tcg/s390x/vrep.c | 81 +++++++++++++++++++++++++++++++++ tests/tcg/s390x/Makefile.target | 1 + 2 files changed, 82 insertions(+) create mode 100644 tests/tcg/s390x/vrep.c diff --git a/tests/tcg/s390x/vrep.c b/tests/tcg/s390x/vrep.c new file mode 100644 index 0000000000..d5a3bd8eb2 --- /dev/null +++ b/tests/tcg/s390x/vrep.c @@ -0,0 +1,81 @@ +/* + * Test the VREP instruction. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include +#include +#include +#include +#include +#include +#include +#include "vx.h" + +static void handle_sigill(int sig, siginfo_t *info, void *ucontext) +{ + mcontext_t *mcontext =3D &((ucontext_t *)ucontext)->uc_mcontext; + char *insn =3D (char *)info->si_addr; + + if (insn[0] !=3D 0xe7 || insn[5] !=3D 0x4d) { + _exit(EXIT_FAILURE); + } + + mcontext->gregs[2] =3D SIGILL; +} + +static inline __attribute__((__always_inline__)) unsigned long +vrep(S390Vector *v1, const S390Vector *v3, const uint16_t i2, const uint8_= t m4) +{ + register unsigned long sig asm("r2") =3D -1; + + asm("vrep %[v1],%[v3],%[i2],%[m4]\n" + : [v1] "=3Dv" (v1->v) + , [sig] "+r" (sig) + : [v3] "v" (v3->v) + , [i2] "i" (i2) + , [m4] "i" (m4)); + + return sig; +} + +int main(int argc, char *argv[]) +{ + S390Vector v3 =3D {.d[0] =3D 1, .d[1] =3D 2}; + struct sigaction act; + S390Vector v1; + int err; + + memset(&act, 0, sizeof(act)); + act.sa_sigaction =3D handle_sigill; + act.sa_flags =3D SA_SIGINFO; + err =3D sigaction(SIGILL, &act, NULL); + assert(err =3D=3D 0); + + assert(vrep(&v1, &v3, 7, 0) =3D=3D -1); + assert(v1.d[0] =3D=3D 0x0101010101010101ULL); + assert(v1.d[1] =3D=3D 0x0101010101010101ULL); + + assert(vrep(&v1, &v3, 7, 1) =3D=3D -1); + assert(v1.d[0] =3D=3D 0x0002000200020002ULL); + assert(v1.d[1] =3D=3D 0x0002000200020002ULL); + + assert(vrep(&v1, &v3, 1, 2) =3D=3D -1); + assert(v1.d[0] =3D=3D 0x0000000100000001ULL); + assert(v1.d[1] =3D=3D 0x0000000100000001ULL); + + assert(vrep(&v1, &v3, 1, 3) =3D=3D -1); + assert(v1.d[0] =3D=3D 2); + assert(v1.d[1] =3D=3D 2); + + assert(vrep(&v1, &v3, 0x10, 0) =3D=3D SIGILL); + assert(vrep(&v1, &v3, 0x101, 0) =3D=3D SIGILL); + assert(vrep(&v1, &v3, 0x8, 1) =3D=3D SIGILL); + assert(vrep(&v1, &v3, 0x108, 1) =3D=3D SIGILL); + assert(vrep(&v1, &v3, 0x4, 2) =3D=3D SIGILL); + assert(vrep(&v1, &v3, 0x104, 2) =3D=3D SIGILL); + assert(vrep(&v1, &v3, 0x2, 3) =3D=3D SIGILL); + assert(vrep(&v1, &v3, 0x102, 3) =3D=3D SIGILL); + + return EXIT_SUCCESS; +} diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.tar= get index e280c8c280..a6062b5c07 100644 --- a/tests/tcg/s390x/Makefile.target +++ b/tests/tcg/s390x/Makefile.target @@ -60,6 +60,7 @@ Z13_TESTS+=3Dlcbb Z13_TESTS+=3Dlocfhr Z13_TESTS+=3Dvcksm Z13_TESTS+=3Dvstl +Z13_TESTS+=3Dvrep $(Z13_TESTS): CFLAGS+=3D-march=3Dz13 -O2 TESTS+=3D$(Z13_TESTS) =20 --=20 2.39.3 From nobody Thu Nov 28 10:43:06 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=1692791443; cv=none; d=zohomail.com; s=zohoarc; b=j7UCau/pPiA3Q01eB5wEcM1Mr0nCTDvWjaO0aOU6C4Myk6P4sSz204oq+cAfjq/MvM3XU0aTT9mWZaitalx3pLIBybnV1U7487lxXPR7MWrUDCl6uN5LQkkfU2VWmouZKx7+feZJJ4gWAO4K3XND3G2tXFS+12HDPuWCtxOFZhA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692791443; 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=WXanHHW5Z+bhFHzfaTCZfhOu9IpzK9EWaYjdv7W35XM=; b=m17XG+FYesy2NKdlPw3M4XYphE/YsrGTG29JdK43h1xPTsl9TpqJvjWTAM3Pk7ns8ZFSYT45jg6Gdi5g6FmHMnA3AnJDU/J6qE3+mFbCBOeU/pxj7q7I1Bh8mVdNgUkEt9RD6etro8LlgtRWIYOFckqBH5LHk4gg4rNkLO3Q7AU= 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 1692791443781524.1418981980377; Wed, 23 Aug 2023 04:50:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYmJd-0001Ya-NR; Wed, 23 Aug 2023 07:46: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 1qYmJJ-0001UX-WB for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46:06 -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 1qYmJF-0001SZ-J2 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46:04 -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-221-b9FdElcWNdyE1KcPwbgFiQ-1; Wed, 23 Aug 2023 07:45:58 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A3A1C101A53C; Wed, 23 Aug 2023 11:45:58 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id BDD42C15BAE; Wed, 23 Aug 2023 11:45:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692791160; 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=WXanHHW5Z+bhFHzfaTCZfhOu9IpzK9EWaYjdv7W35XM=; b=eGSi06Nb6PvShRD//Gu040nN0BK5tEOrvuiWHbsEG9QqHZp/lmMfwRebXUdbZ33jm17MtI /jcfyQlVrJ8P1LCr7/HwJPvDoK8XlkNGqkcsZFDRoaFRKRtmGbNOD3OsJrHAsrItE7p6Dg EF7v11AWgi/5zUBCXC3SYezHAZ/54lA= X-MC-Unique: b9FdElcWNdyE1KcPwbgFiQ-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , Halil Pasic , Cornelia Huck Subject: [PULL 08/12] hw/s390x/s390-virtio-ccw: Remove superfluous code to set the NIC model Date: Wed, 23 Aug 2023 13:45:40 +0200 Message-Id: <20230823114544.216520-9-thuth@redhat.com> In-Reply-To: <20230823114544.216520-1-thuth@redhat.com> References: <20230823114544.216520-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: -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 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1692791445268100001 Content-Type: text/plain; charset="utf-8" The check for nd->model being NULL was originally required, but in commit e11f463295d95aba ("s390x/virtio: use qemu_check_nic_model()") the corresponding code had been replaced by a call to the function qemu_check_nic_model() - and this in turn calls qemu_find_nic_model() which contains the same check for nd->model being NULL again. So we can remove this from the calling site now. Message-Id: <20230804073525.11857-1-thuth@redhat.com> Reviewed-by: Halil Pasic Reviewed-by: Cornelia Huck Signed-off-by: Thomas Huth --- hw/s390x/s390-virtio-ccw.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index c52a1fcf67..bfcf64d007 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -222,10 +222,6 @@ static void s390_create_virtio_net(BusState *bus, cons= t char *name) NICInfo *nd =3D &nd_table[i]; DeviceState *dev; =20 - if (!nd->model) { - nd->model =3D g_strdup("virtio"); - } - qemu_check_nic_model(nd, "virtio"); =20 dev =3D qdev_new(name); --=20 2.39.3 From nobody Thu Nov 28 10:43:06 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=1692791513; cv=none; d=zohomail.com; s=zohoarc; b=Y+urqnjUueDpPdGc0MndH5KLDu0zry/8HE2pOxS2LWmo9nTNfPgvBMRmJqZRfTE0h3Dqcrp2FOzvQYe/MU+Ms2FBDZ1dxHSTzId6DuKBi3K4CxTGR54lzmClT7g91BGtHUm/RzouTTFUnO3PLjnWG011GB+L3xvhYgoJkqcevWg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692791513; 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=wjR5bu7zj9PvPOnk1lPS9Xpd0n5telhvG0HDeL5s1OM=; b=HXYcJC1ihZVMXzPqzgEiaLq3oqOXoAw/8aoxPjdWTEtPyALvxkd6wC3oxZRMEJwlbTpPcPTfp4XwcXc2FvONEBj6oqZS85sUBEHrLnlCdwKMsxdYwsL/3jGkD9xVzIZpD4lkiR3OS3JxQIuoAI3Dr/gp+ZaSXKm00QgUCbQZ9VA= 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 1692791513290657.8856908774155; Wed, 23 Aug 2023 04:51:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYmJN-0001Wq-5x; Wed, 23 Aug 2023 07:46:09 -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 1qYmJK-0001V9-Mh for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46:06 -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 1qYmJH-0001U2-4P for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46:06 -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-22-Mt-rwB2pNrmIhe5jRuP1XA-1; Wed, 23 Aug 2023 07:46:00 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 272DF380670D for ; Wed, 23 Aug 2023 11:46:00 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 447B5C15E7F; Wed, 23 Aug 2023 11:45:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692791162; 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=wjR5bu7zj9PvPOnk1lPS9Xpd0n5telhvG0HDeL5s1OM=; b=SZM4VvJB8hltSht+cWMUWGmG77auqtk6rqbz10mIVYIyt6H6WJn5SMJBJsvvzxuPbA46ed IebnZuyJWF6lMojmX1Ec6jOrgIzZ47KlbsgpdFDIUDGcCBN6n1ObDzXkFrgOWeNXznOchH n0mmvgh/a3WhkFp6jTinj3W4nnFopF4= X-MC-Unique: Mt-rwB2pNrmIhe5jRuP1XA-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 09/12] include/hw/virtio/virtio-gpu: Fix virtio-gpu with blob on big endian hosts Date: Wed, 23 Aug 2023 13:45:41 +0200 Message-Id: <20230823114544.216520-10-thuth@redhat.com> In-Reply-To: <20230823114544.216520-1-thuth@redhat.com> References: <20230823114544.216520-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.8 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: -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 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1692791514265100003 Using "-device virtio-gpu,blob=3Dtrue" currently does not work on big endian hosts (like s390x). The guest kernel prints an error message like: [drm:virtio_gpu_dequeue_ctrl_func [virtio_gpu]] *ERROR* response 0x1200 (c= ommand 0x10c) and the display stays black. When running QEMU with "-d guest_errors", it shows an error message like this: virtio_gpu_create_mapping_iov: nr_entries is too big (83886080 > 16384) which indicates that this value has not been properly byte-swapped. And indeed, the virtio_gpu_create_blob_bswap() function (that should swap the fields in the related structure) fails to swap some of the entries. After correctly swapping all missing values here, too, the virtio-gpu device is now also working with blob=3Dtrue on s390x hosts. Fixes: e0933d91b1 ("virtio-gpu: Add virtio_gpu_resource_create_blob") Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=3D2230469 Message-Id: <20230815122007.928049-1-thuth@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Thomas Huth --- include/hw/virtio/virtio-gpu-bswap.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/hw/virtio/virtio-gpu-bswap.h b/include/hw/virtio/virti= o-gpu-bswap.h index 9124108485..637a0585d0 100644 --- a/include/hw/virtio/virtio-gpu-bswap.h +++ b/include/hw/virtio/virtio-gpu-bswap.h @@ -63,7 +63,10 @@ virtio_gpu_create_blob_bswap(struct virtio_gpu_resource_= create_blob *cblob) { virtio_gpu_ctrl_hdr_bswap(&cblob->hdr); le32_to_cpus(&cblob->resource_id); + le32_to_cpus(&cblob->blob_mem); le32_to_cpus(&cblob->blob_flags); + le32_to_cpus(&cblob->nr_entries); + le64_to_cpus(&cblob->blob_id); le64_to_cpus(&cblob->size); } =20 --=20 2.39.3 From nobody Thu Nov 28 10:43:06 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=1692791245; cv=none; d=zohomail.com; s=zohoarc; b=Dum6ZTE71LvM6PjDScTmpD9obrkZmQ+AEzmmGBcSiSZ5kFcz3BVHYCeZk8A1ZK3E/w6ny6A78WtaMtehIrqVCQsV0wUp1uoBx+pqxKiZcBMUbn9c7qXdVxdvxed41nB4LOosPFblCDgYYY+K3Q41zKA6469dKiLTBsiRe2NEmjU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692791245; 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=ZeaG7bPnJl+2IaD51LCxf8RW+vTNt4sa0NwiRsCp53w=; b=c6S3NI9rhjcyuuBTiljDrfz68gc3esjnmKfeOJunpnLo3Kj9twFDYMI3B4J+tFhzszKZOM9iA/C8VUabwLsUjfuQwqKY5S6KiTtvI+E760KaMbzi085JF/AcvqS8VqIIqF70VmeblhhhcATIkmYk34i8suqjUWdNSIUH31LzYhk= 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 1692791245505487.63413106526366; Wed, 23 Aug 2023 04:47:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYmJO-0001Xi-Mn; Wed, 23 Aug 2023 07:46:10 -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 1qYmJL-0001Vb-MW for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46:07 -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 1qYmJK-0001V8-6t for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46:07 -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-137-6TUCWl_gNXWAXGU4OmYhIA-1; Wed, 23 Aug 2023 07:46:02 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A3A4A1C068E9; Wed, 23 Aug 2023 11:46:01 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74C84C15BAE; Wed, 23 Aug 2023 11:46:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692791165; 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=ZeaG7bPnJl+2IaD51LCxf8RW+vTNt4sa0NwiRsCp53w=; b=dPRyXtH1HJrv+GJ3ThT/KXRSFUhKYagcmlgL8OFxEHesuwOorekAIVsZPhvAlPEi3f1SXO vgpIbvb11GnP2xhmxEojGC+ViTbCa+nT8Euni8LbVxNKSvyI0fg/xbG3Cf3t+J6mqhA9te +aH+YBHFpGNt3KVK3EeebHZbbIE+95c= X-MC-Unique: 6TUCWl_gNXWAXGU4OmYhIA-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , Ilya Leoshkevich , David Hildenbrand , Claudio Fontana , Richard Henderson Subject: [PULL 10/12] linux-user/elfload: Enable vxe2 on s390x Date: Wed, 23 Aug 2023 13:45:42 +0200 Message-Id: <20230823114544.216520-11-thuth@redhat.com> In-Reply-To: <20230823114544.216520-1-thuth@redhat.com> References: <20230823114544.216520-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: -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 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1692791245968100002 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich The vxe2 hwcap is not set for programs running in linux-user, but is set by a Linux kernel running in softmmu. Add it to the former. Signed-off-by: Ilya Leoshkevich Message-Id: <20230804233748.218935-2-iii@linux.ibm.com> Reviewed-by: David Hildenbrand Reviewed-by: Claudio Fontana Reviewed-by: Richard Henderson Signed-off-by: Thomas Huth --- linux-user/elfload.c | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index ac03beb01b..92b981c445 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1614,6 +1614,7 @@ uint32_t get_elf_hwcap(void) } GET_FEATURE(S390_FEAT_VECTOR, HWCAP_S390_VXRS); GET_FEATURE(S390_FEAT_VECTOR_ENH, HWCAP_S390_VXRS_EXT); + GET_FEATURE(S390_FEAT_VECTOR_ENH2, HWCAP_S390_VXRS_EXT2); =20 return hwcap; } --=20 2.39.3 From nobody Thu Nov 28 10:43:06 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=1692791392; cv=none; d=zohomail.com; s=zohoarc; b=GvXzG5AwCHgkBPBOY/ZmAx5UO2nMPyGJtEtood1J+CqFVq//+5C0m5yX3OU26Gcm9QQfRMyOiykdOEcoP/AGCiu0R3f2xClOU6LhXTvXNrEzJar9yFUFwuC+swtU/LNll7n0CEb1L7a4wqIfg1SjE+Cy3+Cf0wY4byp3z9eL6SA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692791392; 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=CyV1ROp1edt5ej0qkoEODn89anDkzeeYo0FXYSVmjQo=; b=Bf+Zuz4nFPkSXh/k+QMl8Hr5Vfv/U8PyytiWmp3Insnk3PXKPeY7T03IcURbDCfeZjC21EY/RsIhRgbGbEPhAltGH2BtYPVa4cujLYFs0q9Jdf7QyHRVmV9gNKcY5G/COtUE2cTs9q7xFe+FLsRRSWLHS1pgpqNjrLyvAVVXsZU= 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 1692791392321813.5614104311081; Wed, 23 Aug 2023 04:49:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYmJl-0001a6-5Q; Wed, 23 Aug 2023 07:46:33 -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 1qYmJO-0001Xa-Gi for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46: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 1qYmJL-0001Vt-94 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46: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-413-6YeW00rGOserFY4OF5G7ig-1; Wed, 23 Aug 2023 07:46:03 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1F626800CAE; Wed, 23 Aug 2023 11:46:03 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id E788BC15BAE; Wed, 23 Aug 2023 11:46:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692791166; 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=CyV1ROp1edt5ej0qkoEODn89anDkzeeYo0FXYSVmjQo=; b=g0D3SOpzzppr6tSYiNuJ8s1dlwif1n04lKimn/lmmjAwWPI3UfpFggX5nWOjkret65kgQ7 d/XxQYa4U2sYfZpFQJjcmNtVcAIg/lS9fKh3yWvhIkr7TtxDn38C5B/jEfDTtip/XaInTW IPhmiZL2C+MgAJvk0Ynsy2SDRkkx5aw= X-MC-Unique: 6YeW00rGOserFY4OF5G7ig-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , Ilya Leoshkevich , qemu-stable@nongnu.org, Claudio Fontana , David Hildenbrand Subject: [PULL 11/12] target/s390x: Fix the "ignored match" case in VSTRS Date: Wed, 23 Aug 2023 13:45:43 +0200 Message-Id: <20230823114544.216520-12-thuth@redhat.com> In-Reply-To: <20230823114544.216520-1-thuth@redhat.com> References: <20230823114544.216520-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: -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 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1692791394329100001 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Currently the emulation of VSTRS recognizes partial matches in presence of \0 in the haystack, which, according to PoP, is not correct: If the ZS flag is one and a zero byte was detected in the second operand, then there can not be a partial match ... Add a check for this. While at it, fold a number of explicitly handled special cases into the generic logic. Cc: qemu-stable@nongnu.org Reported-by: Claudio Fontana Closes: https://lists.gnu.org/archive/html/qemu-devel/2023-08/msg00633.html Fixes: 1d706f314191 ("target/s390x: vxeh2: vector string search") Signed-off-by: Ilya Leoshkevich Message-Id: <20230804233748.218935-3-iii@linux.ibm.com> Tested-by: Claudio Fontana Acked-by: David Hildenbrand Signed-off-by: Thomas Huth --- target/s390x/tcg/vec_string_helper.c | 54 +++++++++------------------- 1 file changed, 17 insertions(+), 37 deletions(-) diff --git a/target/s390x/tcg/vec_string_helper.c b/target/s390x/tcg/vec_st= ring_helper.c index 9b85becdfb..a19f429768 100644 --- a/target/s390x/tcg/vec_string_helper.c +++ b/target/s390x/tcg/vec_string_helper.c @@ -474,9 +474,9 @@ DEF_VSTRC_CC_RT_HELPER(32) static int vstrs(S390Vector *v1, const S390Vector *v2, const S390Vector *v= 3, const S390Vector *v4, uint8_t es, bool zs) { - int substr_elen, substr_0, str_elen, i, j, k, cc; + int substr_elen, i, j, k, cc; int nelem =3D 16 >> es; - bool eos =3D false; + int str_leftmost_0; =20 substr_elen =3D s390_vec_read_element8(v4, 7) >> es; =20 @@ -498,47 +498,20 @@ static int vstrs(S390Vector *v1, const S390Vector *v2= , const S390Vector *v3, } =20 /* If ZS, look for eos in the searched string. */ + str_leftmost_0 =3D nelem; if (zs) { for (k =3D 0; k < nelem; k++) { if (s390_vec_read_element(v2, k, es) =3D=3D 0) { - eos =3D true; + str_leftmost_0 =3D k; break; } } - str_elen =3D k; - } else { - str_elen =3D nelem; } =20 - substr_0 =3D s390_vec_read_element(v3, 0, es); - - for (k =3D 0; ; k++) { - for (; k < str_elen; k++) { - if (s390_vec_read_element(v2, k, es) =3D=3D substr_0) { - break; - } - } - - /* If we reached the end of the string, no match. */ - if (k =3D=3D str_elen) { - cc =3D eos; /* no match (with or without zero char) */ - goto done; - } - - /* If the substring is only one char, match. */ - if (substr_elen =3D=3D 1) { - cc =3D 2; /* full match */ - goto done; - } - - /* If the match begins at the last char, we have a partial match. = */ - if (k =3D=3D str_elen - 1) { - cc =3D 3; /* partial match */ - goto done; - } - + cc =3D str_leftmost_0 =3D=3D nelem ? 0 : 1; /* No match. */ + for (k =3D 0; k < nelem; k++) { i =3D MIN(nelem, k + substr_elen); - for (j =3D k + 1; j < i; j++) { + for (j =3D k; j < i; j++) { uint32_t e2 =3D s390_vec_read_element(v2, j, es); uint32_t e3 =3D s390_vec_read_element(v3, j - k, es); if (e2 !=3D e3) { @@ -546,9 +519,16 @@ static int vstrs(S390Vector *v1, const S390Vector *v2,= const S390Vector *v3, } } if (j =3D=3D i) { - /* Matched up until "end". */ - cc =3D i - k =3D=3D substr_elen ? 2 : 3; /* full or partial ma= tch */ - goto done; + /* All elements matched. */ + if (k > str_leftmost_0) { + cc =3D 1; /* Ignored match. */ + k =3D nelem; + } else if (i - k =3D=3D substr_elen) { + cc =3D 2; /* Full match. */ + } else { + cc =3D 3; /* Partial match. */ + } + break; } } =20 --=20 2.39.3 From nobody Thu Nov 28 10:43:06 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=1692791274; cv=none; d=zohomail.com; s=zohoarc; b=eb9NlHgwfs+AVxnhFZ40Eg8VJj3pDXqXjxWgFI/SoIfh000h+9g9cPr9B1bleFlKGFHvDHW91CK5kYS3nmB9sddRK7ULN+RmKB9slt9Z6l8yhRcQoEJAB01jzkVYfK8hnRsXL//ZbRcMlF2uFq4lhvc3VLHeC2qd4Vby3wBrva0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692791274; 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=ZKzgd+PwDSw1IXSdBOzJq70FmczDucXQ+0ZBaWhhhDk=; b=Lwgw90gWv1bfEuIEKeyWRTbcKgo3KU/IejbSr5QWTUYCBfgkwBGfGUiKXEvVKG+QhcPVMftpPPWS82+IwOpXJUNY3nC3YFpxnJs4f46ZRxOy+aq9a6qUOvvMEYbTn37/DuLDnk/y/btJhlvriS2ZI9Y7XZyArvvSLwLRhZdopKk= 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 1692791274105790.398668945813; Wed, 23 Aug 2023 04:47:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYmJi-0001Zj-TE; Wed, 23 Aug 2023 07:46:30 -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 1qYmJM-0001WB-GB for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46:08 -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 1qYmJK-0001Vc-S4 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 07:46: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-475-5ZiGSViMOQWpIIGrqFLK-w-1; Wed, 23 Aug 2023 07:46:04 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2936B857A84; Wed, 23 Aug 2023 11:46:04 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B4C7C15BAE; Wed, 23 Aug 2023 11:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692791166; 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=ZKzgd+PwDSw1IXSdBOzJq70FmczDucXQ+0ZBaWhhhDk=; b=GNW8Q9bnLJw6tmbM8cjdZRpAaQkOTLbMyZH5KBV1d43UqmGQCKTBLEQoidQE9tICAtVKci ljg7ZKMhY8eEDFKvX4/1na9fk3NY5kO3lYpiY1UiVQeq7je3QPOKTkF+V2QOrpq8+JLtjx lX1CtTbfIxgiIOLjSCssUbC5IOE8xkQ= X-MC-Unique: 5ZiGSViMOQWpIIGrqFLK-w-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , Ilya Leoshkevich Subject: [PULL 12/12] tests/tcg/s390x: Test VSTRS Date: Wed, 23 Aug 2023 13:45:44 +0200 Message-Id: <20230823114544.216520-13-thuth@redhat.com> In-Reply-To: <20230823114544.216520-1-thuth@redhat.com> References: <20230823114544.216520-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: -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 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1692791275572100001 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich Message-Id: <20230804233748.218935-4-iii@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/tcg/s390x/vxeh2_vstrs.c | 88 +++++++++++++++++++++++++++++++++ tests/tcg/s390x/Makefile.target | 1 + 2 files changed, 89 insertions(+) create mode 100644 tests/tcg/s390x/vxeh2_vstrs.c diff --git a/tests/tcg/s390x/vxeh2_vstrs.c b/tests/tcg/s390x/vxeh2_vstrs.c new file mode 100644 index 0000000000..313ec1d728 --- /dev/null +++ b/tests/tcg/s390x/vxeh2_vstrs.c @@ -0,0 +1,88 @@ +/* + * Test the VSTRS instruction. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include +#include +#include +#include +#include "vx.h" + +static inline __attribute__((__always_inline__)) int +vstrs(S390Vector *v1, const S390Vector *v2, const S390Vector *v3, + const S390Vector *v4, const uint8_t m5, const uint8_t m6) +{ + int cc; + + asm("vstrs %[v1],%[v2],%[v3],%[v4],%[m5],%[m6]\n" + "ipm %[cc]" + : [v1] "=3Dv" (v1->v) + , [cc] "=3Dr" (cc) + : [v2] "v" (v2->v) + , [v3] "v" (v3->v) + , [v4] "v" (v4->v) + , [m5] "i" (m5) + , [m6] "i" (m6) + : "cc"); + + return (cc >> 28) & 3; +} + +static void test_ignored_match(void) +{ + S390Vector v1; + S390Vector v2 =3D {.d[0] =3D 0x222000205e410000ULL, .d[1] =3D 0}; + S390Vector v3 =3D {.d[0] =3D 0x205e410000000000ULL, .d[1] =3D 0}; + S390Vector v4 =3D {.d[0] =3D 3, .d[1] =3D 0}; + + assert(vstrs(&v1, &v2, &v3, &v4, 0, 2) =3D=3D 1); + assert(v1.d[0] =3D=3D 16); + assert(v1.d[1] =3D=3D 0); +} + +static void test_empty_needle(void) +{ + S390Vector v1; + S390Vector v2 =3D {.d[0] =3D 0x5300000000000000ULL, .d[1] =3D 0}; + S390Vector v3 =3D {.d[0] =3D 0, .d[1] =3D 0}; + S390Vector v4 =3D {.d[0] =3D 0, .d[1] =3D 0}; + + assert(vstrs(&v1, &v2, &v3, &v4, 0, 0) =3D=3D 2); + assert(v1.d[0] =3D=3D 0); + assert(v1.d[1] =3D=3D 0); +} + +static void test_max_length(void) +{ + S390Vector v1; + S390Vector v2 =3D {.d[0] =3D 0x1122334455667700ULL, .d[1] =3D 0}; + S390Vector v3 =3D {.d[0] =3D 0, .d[1] =3D 0}; + S390Vector v4 =3D {.d[0] =3D 16, .d[1] =3D 0}; + + assert(vstrs(&v1, &v2, &v3, &v4, 0, 0) =3D=3D 3); + assert(v1.d[0] =3D=3D 7); + assert(v1.d[1] =3D=3D 0); +} + +static void test_no_match(void) +{ + S390Vector v1; + S390Vector v2 =3D {.d[0] =3D 0xffffff000fffff00ULL, .d[1] =3D 0x82b}; + S390Vector v3 =3D {.d[0] =3D 0xfffffffeffffffffULL, + .d[1] =3D 0xffffffff00000000ULL}; + S390Vector v4 =3D {.d[0] =3D 11, .d[1] =3D 0}; + + assert(vstrs(&v1, &v2, &v3, &v4, 0, 2) =3D=3D 1); + assert(v1.d[0] =3D=3D 16); + assert(v1.d[1] =3D=3D 0); +} + +int main(void) +{ + test_ignored_match(); + test_empty_needle(); + test_max_length(); + test_no_match(); + return EXIT_SUCCESS; +} diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.tar= get index a6062b5c07..9c0e70c6ca 100644 --- a/tests/tcg/s390x/Makefile.target +++ b/tests/tcg/s390x/Makefile.target @@ -75,6 +75,7 @@ ifneq ($(CROSS_CC_HAS_Z15),) Z15_TESTS=3Dvxeh2_vs Z15_TESTS+=3Dvxeh2_vcvt Z15_TESTS+=3Dvxeh2_vlstr +Z15_TESTS+=3Dvxeh2_vstrs $(Z15_TESTS): CFLAGS+=3D-march=3Dz15 -O2 TESTS+=3D$(Z15_TESTS) endif --=20 2.39.3