From nobody Sun Feb 8 00:03:39 2026 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=1661880385; cv=none; d=zohomail.com; s=zohoarc; b=IL9RUdCIYfavxAdonOfs9WSuOC1WFnETTRGDRMkKrrBPfIJR/G3wBRMrHIp8FTuEhR/np4he6pilA5GTyBvyqgX9JaSdvElzsI4tfbQmcSZsZBxyde/fiO94rePv/aVzVPLAcW1VqCtcO3WDSiuP6tfgSs46zNFvLMtqxqKnMkg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661880385; 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=QlIADtL1/ylJTvF48iJIfhWrxv0+BgSLXfMGZ5gP6Ug=; b=Lho0FSzgg29HA2sr1HAMyD6AB+jJ/2MDxrffJmuGiqfia4xyP6AvReNXQ02uUx0JTNsXDJD0CQSzaTf3DXsJ1dRjowR1Z6omLbXXTywth0tyBqm7iOH28uHi/+ptumUGJE2I+8eNdjE249mNOmiD8IlWR/61QZP0uwfRwqbn2SA= 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 1661880385194399.06751481502886; Tue, 30 Aug 2022 10:26:25 -0700 (PDT) Received: from localhost ([::1]:46468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oT50J-0001Z0-IL for importer@patchew.org; Tue, 30 Aug 2022 13:26:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT4uA-0006Oe-FM for qemu-devel@nongnu.org; Tue, 30 Aug 2022 13:20:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:47641) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT4u6-0005hn-LH for qemu-devel@nongnu.org; Tue, 30 Aug 2022 13:20:00 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-251-vsoIj3UMMLibnyBcg_S-rQ-1; Tue, 30 Aug 2022 13:19:53 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 034D785A589; Tue, 30 Aug 2022 17:19:53 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id 86C071121314; Tue, 30 Aug 2022 17:19:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661879996; 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=QlIADtL1/ylJTvF48iJIfhWrxv0+BgSLXfMGZ5gP6Ug=; b=SrK6nj7cRlqAdeUbU9AcDtbHJ6LWG2i7Lw8TLwa0jj01kg+ov+EaaggK9sKhgNxNwcQ6jT V0FOtk+T2UtS/qx5yLnO13CXywa7v9zl7FmIuNcX27VXSKP2HOLtjK06cB9QFZRbzbh76i IAczRzIrskoktFe+JnpHgCUViSftWX0= X-MC-Unique: vsoIj3UMMLibnyBcg_S-rQ-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson , Peter Maydell Cc: qemu-s390x@nongnu.org Subject: [PULL 1/6] hw: Add compat machines for 7.2 Date: Tue, 30 Aug 2022 19:19:42 +0200 Message-Id: <20220830171947.71464-2-thuth@redhat.com> In-Reply-To: <20220830171947.71464-1-thuth@redhat.com> References: <20220830171947.71464-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1661880386777100003 Content-Type: text/plain; charset="utf-8" From: Cornelia Huck Add 7.2 machine types for arm/i440fx/m68k/q35/s390x/spapr. Signed-off-by: Cornelia Huck Reviewed-by: Daniel Henrique Barboza Reviewed-by: Michael S. Tsirkin Message-Id: <20220727121755.395894-1-cohuck@redhat.com> [thuth: fixed conflict with pcmc->legacy_no_rng_seed] 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 | 14 +++++++++++++- hw/i386/pc_q35.c | 13 ++++++++++++- hw/m68k/virt.c | 9 ++++++++- hw/ppc/spapr.c | 15 +++++++++++++-- hw/s390x/s390-virtio-ccw.c | 14 +++++++++++++- 10 files changed, 79 insertions(+), 7 deletions(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index 7b416c9787..311ed17e18 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -379,6 +379,9 @@ struct MachineState { } \ type_init(machine_initfn##_register_types) =20 +extern GlobalProperty hw_compat_7_1[]; +extern const size_t hw_compat_7_1_len; + extern GlobalProperty hw_compat_7_0[]; extern const size_t hw_compat_7_0_len; =20 diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 8435733bd6..c95333514e 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -200,6 +200,9 @@ void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid, /* sgx.c */ void pc_machine_init_sgx_epc(PCMachineState *pcms); =20 +extern GlobalProperty pc_compat_7_1[]; +extern const size_t pc_compat_7_1_len; + extern GlobalProperty pc_compat_7_0[]; extern const size_t pc_compat_7_0_len; =20 diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 9633f822f3..1a6480fd2a 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -3094,10 +3094,17 @@ static void machvirt_machine_init(void) } type_init(machvirt_machine_init); =20 +static void virt_machine_7_2_options(MachineClass *mc) +{ +} +DEFINE_VIRT_MACHINE_AS_LATEST(7, 2) + static void virt_machine_7_1_options(MachineClass *mc) { + virt_machine_7_2_options(mc); + compat_props_add(mc->compat_props, hw_compat_7_1, hw_compat_7_1_len); } -DEFINE_VIRT_MACHINE_AS_LATEST(7, 1) +DEFINE_VIRT_MACHINE(7, 1) =20 static void virt_machine_7_0_options(MachineClass *mc) { diff --git a/hw/core/machine.c b/hw/core/machine.c index a673302cce..aa520e74a8 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -40,6 +40,9 @@ #include "hw/virtio/virtio-pci.h" #include "qom/object_interfaces.h" =20 +GlobalProperty hw_compat_7_1[] =3D {}; +const size_t hw_compat_7_1_len =3D G_N_ELEMENTS(hw_compat_7_1); + GlobalProperty hw_compat_7_0[] =3D { { "arm-gicv3-common", "force-8-bit-prio", "on" }, { "nvme-ns", "eui64-default", "on"}, diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 7280c02ce3..566accf7e6 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -107,6 +107,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_7_1[] =3D {}; +const size_t pc_compat_7_1_len =3D G_N_ELEMENTS(pc_compat_7_1); + GlobalProperty pc_compat_7_0[] =3D {}; const size_t pc_compat_7_0_len =3D G_N_ELEMENTS(pc_compat_7_0); =20 diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 20962c34e7..8043a250ad 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -432,7 +432,7 @@ static void pc_i440fx_machine_options(MachineClass *m) machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE); } =20 -static void pc_i440fx_7_1_machine_options(MachineClass *m) +static void pc_i440fx_7_2_machine_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); pc_i440fx_machine_options(m); @@ -442,6 +442,18 @@ static void pc_i440fx_7_1_machine_options(MachineClass= *m) pcmc->legacy_no_rng_seed =3D true; } =20 +DEFINE_I440FX_MACHINE(v7_2, "pc-i440fx-7.2", NULL, + pc_i440fx_7_2_machine_options); + +static void pc_i440fx_7_1_machine_options(MachineClass *m) +{ + pc_i440fx_7_2_machine_options(m); + m->alias =3D NULL; + m->is_default =3D false; + compat_props_add(m->compat_props, hw_compat_7_1, hw_compat_7_1_len); + compat_props_add(m->compat_props, pc_compat_7_1, pc_compat_7_1_len); +} + DEFINE_I440FX_MACHINE(v7_1, "pc-i440fx-7.1", NULL, pc_i440fx_7_1_machine_options); =20 diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 2e5dae9a89..53eda50e81 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -370,7 +370,7 @@ static void pc_q35_machine_options(MachineClass *m) m->max_cpus =3D 288; } =20 -static void pc_q35_7_1_machine_options(MachineClass *m) +static void pc_q35_7_2_machine_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); pc_q35_machine_options(m); @@ -379,6 +379,17 @@ static void pc_q35_7_1_machine_options(MachineClass *m) pcmc->legacy_no_rng_seed =3D true; } =20 +DEFINE_Q35_MACHINE(v7_2, "pc-q35-7.2", NULL, + pc_q35_7_2_machine_options); + +static void pc_q35_7_1_machine_options(MachineClass *m) +{ + pc_q35_7_2_machine_options(m); + m->alias =3D NULL; + compat_props_add(m->compat_props, hw_compat_7_1, hw_compat_7_1_len); + compat_props_add(m->compat_props, pc_compat_7_1, pc_compat_7_1_len); +} + DEFINE_Q35_MACHINE(v7_1, "pc-q35-7.1", NULL, pc_q35_7_1_machine_options); =20 diff --git a/hw/m68k/virt.c b/hw/m68k/virt.c index 0aa383fa6b..3122c8ef2c 100644 --- a/hw/m68k/virt.c +++ b/hw/m68k/virt.c @@ -322,10 +322,17 @@ type_init(virt_machine_register_types) } \ type_init(machvirt_machine_##major##_##minor##_init); =20 +static void virt_machine_7_2_options(MachineClass *mc) +{ +} +DEFINE_VIRT_MACHINE(7, 2, true) + static void virt_machine_7_1_options(MachineClass *mc) { + virt_machine_7_2_options(mc); + compat_props_add(mc->compat_props, hw_compat_7_1, hw_compat_7_1_len); } -DEFINE_VIRT_MACHINE(7, 1, true) +DEFINE_VIRT_MACHINE(7, 1, false) =20 static void virt_machine_7_0_options(MachineClass *mc) { diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index bc9ba6e6dc..fb790b61e4 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4730,15 +4730,26 @@ static void spapr_machine_latest_class_options(Mach= ineClass *mc) } \ type_init(spapr_machine_register_##suffix) =20 +/* + * pseries-7.2 + */ +static void spapr_machine_7_2_class_options(MachineClass *mc) +{ + /* Defaults for the latest behaviour inherited from the base class */ +} + +DEFINE_SPAPR_MACHINE(7_2, "7.2", true); + /* * pseries-7.1 */ static void spapr_machine_7_1_class_options(MachineClass *mc) { - /* Defaults for the latest behaviour inherited from the base class */ + spapr_machine_7_2_class_options(mc); + compat_props_add(mc->compat_props, hw_compat_7_1, hw_compat_7_1_len); } =20 -DEFINE_SPAPR_MACHINE(7_1, "7.1", true); +DEFINE_SPAPR_MACHINE(7_1, "7.1", false); =20 /* * pseries-7.0 diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index cc3097bfee..bf1b36d824 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -792,14 +792,26 @@ bool css_migration_enabled(void) } = \ type_init(ccw_machine_register_##suffix) =20 +static void ccw_machine_7_2_instance_options(MachineState *machine) +{ +} + +static void ccw_machine_7_2_class_options(MachineClass *mc) +{ +} +DEFINE_CCW_MACHINE(7_2, "7.2", true); + static void ccw_machine_7_1_instance_options(MachineState *machine) { + ccw_machine_7_2_instance_options(machine); } =20 static void ccw_machine_7_1_class_options(MachineClass *mc) { + ccw_machine_7_2_class_options(mc); + compat_props_add(mc->compat_props, hw_compat_7_1, hw_compat_7_1_len); } -DEFINE_CCW_MACHINE(7_1, "7.1", true); +DEFINE_CCW_MACHINE(7_1, "7.1", false); =20 static void ccw_machine_7_0_instance_options(MachineState *machine) { --=20 2.31.1 From nobody Sun Feb 8 00:03:39 2026 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=1661882061; cv=none; d=zohomail.com; s=zohoarc; b=YZ12L7tmOnQ1Z0NlZewRPr4ZZHOw6E0gMbccBuea3CyCLUj3vWJcw8vJkZYl6qL6/UO63yamZ+RIROoF21lKe8V0JpiFHEk0zKcScXsCbNCJeJg7XbnetT7NtxcvN15WSsCIMAPLJUueQ0yxCdsKZLt6Y6WXO2dEg7BomNclKKQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661882061; 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=DMppPlGTIdS9SRAKUhai0VSJ9OsNB1b3noyyc4GaZZs=; b=Mbr9l+Sjw4qgSuysIEzu5rimRlkukpvhL6P4pP+UAiiKdR0pVP8feZWHJM4LCMjnGLPhjOqD6gs68ygriBt+vpbfAUGWqbQ9rA+fQNqx0rnRLTFK2KLKuFkn3O5EV9zqghpm0A1++C4wS0mOYDkp8gjqhuotJghreDmhzRaAZu4= 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 1661882061266658.1433115905978; Tue, 30 Aug 2022 10:54:21 -0700 (PDT) Received: from localhost ([::1]:40536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oT5RM-00057i-1y for importer@patchew.org; Tue, 30 Aug 2022 13:54:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40264) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT4uN-0006Rh-A6 for qemu-devel@nongnu.org; Tue, 30 Aug 2022 13:20:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:40804) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT4u9-0005iu-JA for qemu-devel@nongnu.org; Tue, 30 Aug 2022 13:20:15 -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-367-7DTSjoSvM5WNyYtq2tbyYQ-1; Tue, 30 Aug 2022 13:19:55 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 86D6080A0C2; Tue, 30 Aug 2022 17:19:54 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D13D1121314; Tue, 30 Aug 2022 17:19:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661880000; 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=DMppPlGTIdS9SRAKUhai0VSJ9OsNB1b3noyyc4GaZZs=; b=FKOQSU67cIPh9MAWNe/FpF6ZuGGfyYIkvH3EsnnJGmYrrDOWqkft+jfJJR6oKXZp/sMQoU F1FRHpe2AzroWqYfAHmamThZW5kpnN3GB/TZNCcBMw8FaMBk36AHq+Rg91r8jDCqfnx6ve W1VzAQUCpe/R2rHgZdii+osTZRLoilE= X-MC-Unique: 7DTSjoSvM5WNyYtq2tbyYQ-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson , Peter Maydell Cc: qemu-s390x@nongnu.org Subject: [PULL 2/6] s390x/cpumodel: add stfl197 processor-activity-instrumentation extension 1 Date: Tue, 30 Aug 2022 19:19:43 +0200 Message-Id: <20220830171947.71464-3-thuth@redhat.com> In-Reply-To: <20220830171947.71464-1-thuth@redhat.com> References: <20220830171947.71464-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1661882062083100001 Content-Type: text/plain; charset="utf-8" From: Christian Borntraeger Add stfle 197 (processor-activity-instrumentation extension 1) to the gen16 default model and fence it off for 7.1 and older. Signed-off-by: Christian Borntraeger Reviewed-by: David Hildenbrand Message-Id: <20220727135120.12784-1-borntraeger@linux.ibm.com> Acked-by: Cornelia Huck Signed-off-by: Thomas Huth --- target/s390x/cpu_features_def.h.inc | 1 + hw/s390x/s390-virtio-ccw.c | 1 + target/s390x/gen-features.c | 2 ++ 3 files changed, 4 insertions(+) diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_feature= s_def.h.inc index 3603e5fb12..e3cfe63735 100644 --- a/target/s390x/cpu_features_def.h.inc +++ b/target/s390x/cpu_features_def.h.inc @@ -114,6 +114,7 @@ DEF_FEAT(VECTOR_PACKED_DECIMAL_ENH2, "vxpdeh2", STFL, 1= 92, "Vector-Packed-Decima DEF_FEAT(BEAR_ENH, "beareh", STFL, 193, "BEAR-enhancement facility") DEF_FEAT(RDP, "rdp", STFL, 194, "Reset-DAT-protection facility") DEF_FEAT(PAI, "pai", STFL, 196, "Processor-Activity-Instrumentation facili= ty") +DEF_FEAT(PAIE, "paie", STFL, 197, "Processor-Activity-Instrumentation exte= nsion-1") =20 /* Features exposed via SCLP SCCB Byte 80 - 98 (bit numbers relative to b= yte-80) */ DEF_FEAT(SIE_GSLS, "gsls", SCLP_CONF_CHAR, 40, "SIE: Guest-storage-limit-s= uppression facility") diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index bf1b36d824..9a2467c889 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -804,6 +804,7 @@ DEFINE_CCW_MACHINE(7_2, "7.2", true); static void ccw_machine_7_1_instance_options(MachineState *machine) { ccw_machine_7_2_instance_options(machine); + s390_cpudef_featoff_greater(16, 1, S390_FEAT_PAIE); } =20 static void ccw_machine_7_1_class_options(MachineClass *mc) diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c index ad140184b9..1558c52626 100644 --- a/target/s390x/gen-features.c +++ b/target/s390x/gen-features.c @@ -575,6 +575,7 @@ static uint16_t full_GEN16_GA1[] =3D { S390_FEAT_BEAR_ENH, S390_FEAT_RDP, S390_FEAT_PAI, + S390_FEAT_PAIE, }; =20 =20 @@ -669,6 +670,7 @@ static uint16_t default_GEN16_GA1[] =3D { S390_FEAT_BEAR_ENH, S390_FEAT_RDP, S390_FEAT_PAI, + S390_FEAT_PAIE, }; =20 /* QEMU (CPU model) features */ --=20 2.31.1 From nobody Sun Feb 8 00:03:39 2026 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=1661880728; cv=none; d=zohomail.com; s=zohoarc; b=Yk3/66zj5VprbdFnHAl2mO3UF9GIC1QArAImLLHfh91tyoOIJs+zMjlMVLknjr0AS1ToHqF2m3Ef7BbBtlyEZJSlvlIZn/7km/YTqSF6SqXzpIEidd91VZa48ft4u9DjTCjMyNvLgxo13IxpM09p4S8Kd1PCMd4laz4bGwLeNZw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661880728; 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=QWT2hJHkg+Svuv6fDzYJqfPZvRwRiMFQOkWMQKMmPYQ=; b=g78UpjNgYu1U1Ogesr5A3eaY9w2Jvvfl29ZjmYeDPVqpfzBGYsJa7uAk1M0n4z///eXMPO4ChBKSpZwjZ+qh7wT8gapllZFIugkE6aGiYlkh5tnz0m4hDWXWKVF4/ENfA6AokbxRM5eEidt1VRu1OQFdaMh0dNoVLRd1cUUnjs8= 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 1661880728024253.73091901771443; Tue, 30 Aug 2022 10:32:08 -0700 (PDT) Received: from localhost ([::1]:35726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oT55p-0006aV-CD for importer@patchew.org; Tue, 30 Aug 2022 13:32:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT4u9-0006O7-OL for qemu-devel@nongnu.org; Tue, 30 Aug 2022 13:20:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:24699) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT4u6-0005hz-HJ for qemu-devel@nongnu.org; Tue, 30 Aug 2022 13:20:00 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [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-641-Q36PoTSMOCWY_VXxJ8SUcA-1; Tue, 30 Aug 2022 13:19:56 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 127BB29DD990; Tue, 30 Aug 2022 17:19:56 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id D13BF1121314; Tue, 30 Aug 2022 17:19:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661879997; 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=QWT2hJHkg+Svuv6fDzYJqfPZvRwRiMFQOkWMQKMmPYQ=; b=LtZCd61s19/nPDKTU9A3/UZMiRbWDzW+b0M87+LzXbP/4sRqAJHIBpF6rSm6t+Ijbzh44+ bgvbnjGJtHH+wkXAK3mwSIiQ5L7PMpxsKwNE4JuvbdxDQfSDHtVEuTL4v7MjMV0DskI+SD 5rGf/MP+RlensfUHiQaOXm5wryp6v94= X-MC-Unique: Q36PoTSMOCWY_VXxJ8SUcA-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson , Peter Maydell Cc: qemu-s390x@nongnu.org Subject: [PULL 3/6] target/s390x: Fix CLFIT and CLGIT immediate size Date: Tue, 30 Aug 2022 19:19:44 +0200 Message-Id: <20220830171947.71464-4-thuth@redhat.com> In-Reply-To: <20220830171947.71464-1-thuth@redhat.com> References: <20220830171947.71464-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1661880728606100001 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich I2 is 16 bits, not 32. Found by running valgrind's none/tests/s390x/traps. Fixes: 1c2687518235 ("target-s390: Implement COMPARE AND TRAP") Signed-off-by: Ilya Leoshkevich Message-Id: <20220817161529.597414-1-iii@linux.ibm.com> Reviewed-by: David Hildenbrand Signed-off-by: Thomas Huth --- target/s390x/tcg/insn-data.def | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/s390x/tcg/insn-data.def b/target/s390x/tcg/insn-data.def index 5e448bb2c4..6d2cfe5fa2 100644 --- a/target/s390x/tcg/insn-data.def +++ b/target/s390x/tcg/insn-data.def @@ -290,8 +290,8 @@ D(0xb961, CLGRT, RRF_c, GIE, r1_o, r2_o, 0, 0, ct, 0, 1) D(0xeb23, CLT, RSY_b, MIE, r1_32u, m2_32u, 0, 0, ct, 0, 1) D(0xeb2b, CLGT, RSY_b, MIE, r1_o, m2_64, 0, 0, ct, 0, 1) - D(0xec73, CLFIT, RIE_a, GIE, r1_32u, i2_32u, 0, 0, ct, 0, 1) - D(0xec71, CLGIT, RIE_a, GIE, r1_o, i2_32u, 0, 0, ct, 0, 1) + D(0xec73, CLFIT, RIE_a, GIE, r1_32u, i2_16u, 0, 0, ct, 0, 1) + D(0xec71, CLGIT, RIE_a, GIE, r1_o, i2_16u, 0, 0, ct, 0, 1) =20 /* CONVERT TO DECIMAL */ C(0x4e00, CVD, RX_a, Z, r1_o, a2, 0, 0, cvd, 0) --=20 2.31.1 From nobody Sun Feb 8 00:03:39 2026 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=1661881978; cv=none; d=zohomail.com; s=zohoarc; b=n4LccwkYOSGawwPTqa6Mj1sIdDEUcvdKrURiM01S95Z2Kxa5/1GIVWwyTHHCrayvzWwrMbx7XB9XrlfIcVJRUUtOmgLiPqRgiWUM/sSLyeFr3ENx15v4n9CA4bHNkkPFlVRDCYPqZM4DB9hHwaVP4ueDLc7ANATD+Jn48o+gaRU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661881978; 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=m8h79wOHIduyozIw5k3sBr2NCR28mUsun9GVxHQ/fUo=; b=ILiELKzpfRLBetlGeqj/aGKeFBbLGMPydChYokzAqYW9b0qlOVgkCvgoRnwPHsxPDsyEGRPcZw3sEWq5opWuzRQjsVR6Riy2lyubOspU2e6CqCNbZLQ0TjnF6es5q2q24JDz7IeXq2ylck3FXs+35FkxF/tVIqsxlQm3msbqMz4= 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 1661881978143993.9888245148948; Tue, 30 Aug 2022 10:52:58 -0700 (PDT) Received: from localhost ([::1]:34876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oT5Q0-0002VG-K7 for importer@patchew.org; Tue, 30 Aug 2022 13:52:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT4uC-0006Pi-S7 for qemu-devel@nongnu.org; Tue, 30 Aug 2022 13:20:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:31466) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT4uB-0005jM-5k for qemu-devel@nongnu.org; Tue, 30 Aug 2022 13:20: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-103-38HAFJEEPoabkS8XcKq8EQ-1; Tue, 30 Aug 2022 13:19:58 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A4C38803916; Tue, 30 Aug 2022 17:19:57 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id 70A411121314; Tue, 30 Aug 2022 17:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661880001; 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=m8h79wOHIduyozIw5k3sBr2NCR28mUsun9GVxHQ/fUo=; b=MGNKcFdrOEpxaAUpRU572t2fYL8QeK3pMGphfzgDfz46PguwAg0Gbty/D2xgXQ1POuPNua 3PiGjwo/eM3O4lUoy9Pg9QF3ia0j+t4Ln05WKPWQFiQrJ7A6tZlZnFX57cYtkk6F8X70RH Kg5UlAEodZdY3wEhPmiKVekVOYucHeU= X-MC-Unique: 38HAFJEEPoabkS8XcKq8EQ-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson , Peter Maydell Cc: qemu-s390x@nongnu.org Subject: [PULL 4/6] backends/hostmem: Fix support of memory-backend-memfd in qemu_maxrampagesize() Date: Tue, 30 Aug 2022 19:19:45 +0200 Message-Id: <20220830171947.71464-5-thuth@redhat.com> In-Reply-To: <20220830171947.71464-1-thuth@redhat.com> References: <20220830171947.71464-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1661881979420100001 Content-Type: text/plain; charset="utf-8" It is currently not possible yet to use "memory-backend-memfd" on s390x with hugepages enabled. This problem is caused by qemu_maxrampagesize() not taking memory-backend-memfd objects into account yet, so the code in s390_memory_init() fails to enable the huge page support there via s390_set_max_pagesize(). Fix it by generalizing the code, so that it looks at qemu_ram_pagesize(memdev->mr.ram_block) instead of re-trying to get the information from the filesystem. Suggested-by: David Hildenbrand Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=3D2116496 Message-Id: <20220810125720.3849835-2-thuth@redhat.com> Reviewed-by: David Hildenbrand Reviewed-by: Claudio Imbrenda Signed-off-by: Thomas Huth --- backends/hostmem.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/backends/hostmem.c b/backends/hostmem.c index 624bb7ecd3..4428e06738 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -306,22 +306,12 @@ bool host_memory_backend_is_mapped(HostMemoryBackend = *backend) return backend->is_mapped; } =20 -#ifdef __linux__ size_t host_memory_backend_pagesize(HostMemoryBackend *memdev) { - Object *obj =3D OBJECT(memdev); - char *path =3D object_property_get_str(obj, "mem-path", NULL); - size_t pagesize =3D qemu_mempath_getpagesize(path); - - g_free(path); + size_t pagesize =3D qemu_ram_pagesize(memdev->mr.ram_block); + g_assert(pagesize >=3D qemu_real_host_page_size()); return pagesize; } -#else -size_t host_memory_backend_pagesize(HostMemoryBackend *memdev) -{ - return qemu_real_host_page_size(); -} -#endif =20 static void host_memory_backend_memory_complete(UserCreatable *uc, Error **errp) --=20 2.31.1 From nobody Sun Feb 8 00:03:39 2026 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=1661881685; cv=none; d=zohomail.com; s=zohoarc; b=HgDZITrVzUKtGzrTv7f11YnytKrPPboeBStp8ugc0t+H0utf118Gi+lVt8RmOx8ChzK2UH1JYKQdiJE0HzYyCqkXAXpok3ZU8nWG2nNAicdG0yfm4l+73muGw3G4H06QgoSa4e2MpRmX+nJobbor+e70VbyhdPFBaMcAQ0dbI0o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661881685; 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=BItsyTMEsiA4TfG65uIPJGnDqTcblD2HJTtqcAX3ric=; b=mUCDje98JW1hpfza7EET7lGbC16jAdsLfuxvBlmoZ9d4z6Ot2tD1Pen4JIRZbjd0+OXnIgu0+a4noLWx95lCwrpdjQyJzz2s/VXb777BhHCU1EWe0poH1S8MX3ZcbwuSJcgzrnErEekafPUOXq9pft0reMMRCOMKC1bp51DxCJc= 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 1661881685303475.2149023400724; Tue, 30 Aug 2022 10:48:05 -0700 (PDT) Received: from localhost ([::1]:40496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oT5LH-0007ML-Or for importer@patchew.org; Tue, 30 Aug 2022 13:48:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT4uB-0006PI-J5 for qemu-devel@nongnu.org; Tue, 30 Aug 2022 13:20:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:22147) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT4u9-0005iz-UW for qemu-devel@nongnu.org; Tue, 30 Aug 2022 13:20:03 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [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-110-WZ10aHX_Mayp5UJnFak9xw-1; Tue, 30 Aug 2022 13:19:59 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3DC8C1C05EB4; Tue, 30 Aug 2022 17:19:59 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id F22F21121314; Tue, 30 Aug 2022 17:19:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661880000; 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=BItsyTMEsiA4TfG65uIPJGnDqTcblD2HJTtqcAX3ric=; b=ZhJXpL/B2IRxFlf/IgUTY6Fq2erM5yF6zvDu5s6MffKKCo8eMZMyFcJTrwSrtCNuRc1Bn9 E9CU2hTRNA3J2uaAvW9xTR+NEVULC0tlWCj6NkhAMX8hMYS0Py1OSRMtbm77kFoIFMhmsN pbCfyxQEzz3bpUnbf3Nc/H6lGq2Ex5w= X-MC-Unique: WZ10aHX_Mayp5UJnFak9xw-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson , Peter Maydell Cc: qemu-s390x@nongnu.org Subject: [PULL 5/6] softmmu/physmem: Remove the ifdef __linux__ around the pagesize functions Date: Tue, 30 Aug 2022 19:19:46 +0200 Message-Id: <20220830171947.71464-6-thuth@redhat.com> In-Reply-To: <20220830171947.71464-1-thuth@redhat.com> References: <20220830171947.71464-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1661881685859100001 Content-Type: text/plain; charset="utf-8" Now that host_memory_backend_pagesize() is not depending on the hugetlb memory path handling anymore, we can also remove the #ifdef and the TOCTTOU comment from the calling functions - the code should now work equally well on all host architectures. Message-Id: <20220810125720.3849835-3-thuth@redhat.com> Reviewed-by: Claudio Imbrenda Acked-by: David Hildenbrand Signed-off-by: Thomas Huth --- softmmu/physmem.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/softmmu/physmem.c b/softmmu/physmem.c index dc3c3e5f2e..50231bab30 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -1331,13 +1331,6 @@ GString *ram_block_format(void) return buf; } =20 -#ifdef __linux__ -/* - * FIXME TOCTTOU: this iterates over memory backends' mem-path, which - * may or may not name the same files / on the same filesystem now as - * when we actually open and map them. Iterate over the file - * descriptors instead, and use qemu_fd_getpagesize(). - */ static int find_min_backend_pagesize(Object *obj, void *opaque) { long *hpsize_min =3D opaque; @@ -1391,16 +1384,6 @@ long qemu_maxrampagesize(void) object_child_foreach(memdev_root, find_max_backend_pagesize, &pagesize= ); return pagesize; } -#else -long qemu_minrampagesize(void) -{ - return qemu_real_host_page_size(); -} -long qemu_maxrampagesize(void) -{ - return qemu_real_host_page_size(); -} -#endif =20 #ifdef CONFIG_POSIX static int64_t get_file_size(int fd) --=20 2.31.1 From nobody Sun Feb 8 00:03:39 2026 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=1661880385; cv=none; d=zohomail.com; s=zohoarc; b=eD/DeeBOvPjmKhz+MdAc2ugVCQx1yBNTHDpa3vIl5ODzwGq2XDb/SCucSJ3Z8pOpTgrmtIQVjZP+CrIYdK6IeoBJxXdE8BKLnjaxL2avGSnOukGd9otKMPiC3VsZOiCgfndR+EqKrVfJEaGK3FBbk7ucYjLt3XHYng+WAoQBMYQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661880385; 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=QRJLjfV3bDE0kdD2RZ3saNQ53b+vWbLbBXtOhjtgAPE=; b=QIGEneXcdh5F3EHVrK9hWmTJxRlwgJ1W3wM3sDLXWL0iBDjrYEXll6GyExoEas6cEPXTE9sdH0TwnYmDwLrKFQ0g16BoEnbpChrR/BwXC4C9p+5+tFedOShZMewTBsOV6natMkpHDt6OanX8gbbKSjgke/9G0qiHT5WCkriq1n0= 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 1661880385624599.8999763362085; Tue, 30 Aug 2022 10:26:25 -0700 (PDT) Received: from localhost ([::1]:41694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oT50K-0001i9-9i for importer@patchew.org; Tue, 30 Aug 2022 13:26:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT4uG-0006R1-Cd for qemu-devel@nongnu.org; Tue, 30 Aug 2022 13:20:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:30997) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT4uD-0005vX-8B for qemu-devel@nongnu.org; Tue, 30 Aug 2022 13:20:06 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-489-9xRBlqEvPv-JmOy9z4PtPA-1; Tue, 30 Aug 2022 13:20:01 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DABB1801231; Tue, 30 Aug 2022 17:20:00 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9C8FB1121314; Tue, 30 Aug 2022 17:19:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661880004; 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=QRJLjfV3bDE0kdD2RZ3saNQ53b+vWbLbBXtOhjtgAPE=; b=BKWK1vtamL9Dz4Uzby4tfNpWORTW9BYka6BuwvFhFXF+wSHPP8DjFpKSIm+vEIYD6kuJCA fQHVGF+wRemqNJlp2y7IHfSGij/Fy6PXpc53o228PxdrYqt8Y8k64eZWCPXC8El02wngOe 9ZWg/LaowmVedfvb2nPceEanpNzJrso= X-MC-Unique: 9xRBlqEvPv-JmOy9z4PtPA-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson , Peter Maydell Cc: qemu-s390x@nongnu.org Subject: [PULL 6/6] util/mmap-alloc: Remove qemu_mempath_getpagesize() Date: Tue, 30 Aug 2022 19:19:47 +0200 Message-Id: <20220830171947.71464-7-thuth@redhat.com> In-Reply-To: <20220830171947.71464-1-thuth@redhat.com> References: <20220830171947.71464-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1661880386720100001 Content-Type: text/plain; charset="utf-8" The last user of this function has just been removed, so we can drop this function now, too. Message-Id: <20220810125720.3849835-4-thuth@redhat.com> Reviewed-by: David Hildenbrand Reviewed-by: Claudio Imbrenda Signed-off-by: Thomas Huth --- include/qemu/mmap-alloc.h | 2 -- util/mmap-alloc.c | 31 ------------------------------- 2 files changed, 33 deletions(-) diff --git a/include/qemu/mmap-alloc.h b/include/qemu/mmap-alloc.h index 5076695cc8..2825e231a7 100644 --- a/include/qemu/mmap-alloc.h +++ b/include/qemu/mmap-alloc.h @@ -4,8 +4,6 @@ =20 size_t qemu_fd_getpagesize(int fd); =20 -size_t qemu_mempath_getpagesize(const char *mem_path); - /** * qemu_ram_mmap: mmap anonymous memory, the specified file or device. * diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c index 5b90cb68ea..5ed7d29183 100644 --- a/util/mmap-alloc.c +++ b/util/mmap-alloc.c @@ -53,37 +53,6 @@ size_t qemu_fd_getpagesize(int fd) return qemu_real_host_page_size(); } =20 -size_t qemu_mempath_getpagesize(const char *mem_path) -{ -#ifdef CONFIG_LINUX - struct statfs fs; - int ret; - - if (mem_path) { - do { - ret =3D statfs(mem_path, &fs); - } while (ret !=3D 0 && errno =3D=3D EINTR); - - if (ret !=3D 0) { - fprintf(stderr, "Couldn't statfs() memory path: %s\n", - strerror(errno)); - exit(1); - } - - if (fs.f_type =3D=3D HUGETLBFS_MAGIC) { - /* It's hugepage, return the huge page size */ - return fs.f_bsize; - } - } -#ifdef __sparc__ - /* SPARC Linux needs greater alignment than the pagesize */ - return QEMU_VMALLOC_ALIGN; -#endif -#endif - - return qemu_real_host_page_size(); -} - #define OVERCOMMIT_MEMORY_PATH "/proc/sys/vm/overcommit_memory" static bool map_noreserve_effective(int fd, uint32_t qemu_map_flags) { --=20 2.31.1