From nobody Thu May 2 22:58:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1591087339; cv=none; d=zohomail.com; s=zohoarc; b=ZKVuhyv12s/uKUKWRKwFMR/VPhtFDzB44sW0XlWA3jovfFnI/TzKV3PmqRLyy+K+92H0NHo0qXJExaQo2v0ycCzmYZNSrNWWJLDFK32F3VysEJgTNPoUq83Q4Pv24ScKDBhigJF6t9YPNO6fWbyPw1JwqFWQJx4pcnxKTEw2Mag= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591087339; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=SMFT0w1mQkR6AC+ONrb6rhHVNWELDdmXiwzp9aIXd64=; b=iqg6sU/wgXr77h7IQJ7rgTtVbsOEc2Fu4He3YEOAid68lv1TupGs3Y/XNHm4alkALKGrVUbASQkbxIWkQViMP+ditJRQUhKqzphBErngCDdl1JCH6muJrp9khJkS5rLWJPBh3MirDc8wSMTvfkFWcQViPBHyMc8oNfh30KlgoRY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1591087339206802.4225481908593; Tue, 2 Jun 2020 01:42:19 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-486-LYPgNYn3OGeRnG9oWGa1pg-1; Tue, 02 Jun 2020 04:42:13 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 76E1F1030980; Tue, 2 Jun 2020 08:42:07 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6E0062DE81; Tue, 2 Jun 2020 08:42:06 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 25EB41809543; Tue, 2 Jun 2020 08:42:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0528g1Kg016712 for ; Tue, 2 Jun 2020 04:42:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 04C3A5C221; Tue, 2 Jun 2020 08:42:01 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 54D075C1C5; Tue, 2 Jun 2020 08:41:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591087336; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:content-type:content-type:list-id: list-help:list-unsubscribe:list-subscribe:list-post; bh=SMFT0w1mQkR6AC+ONrb6rhHVNWELDdmXiwzp9aIXd64=; b=AdbJfYEnOXzQExYPwwguBRIas03jxaRvslRW+fTVQJBdkKyiL2xhNEy7gyALe6PzaS659D DO5wPUe/tZEqX5Dez6+N1wkSIwJSjReZAKU68X9sr1Q+uipIDs73Oq2gNYpTViXlakMljG nZuOM65mgCjJlVXeetrEzfJGO4nuc7M= X-MC-Unique: LYPgNYn3OGeRnG9oWGa1pg-1 From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH] numa: forbid '-numa node, mem' for 5.1 and newer machine types Date: Tue, 2 Jun 2020 04:41:51 -0400 Message-Id: <20200602084151.480567-1-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: peter.maydell@linaro.org, ehabkost@redhat.com, mst@redhat.com, libvir-list@redhat.com, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, marcel.apfelbaum@gmail.com, pbonzini@redhat.com, david@gibson.dropbear.id.au, rth@twiddle.net X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Deprecation period is run out and it's a time to flip the switch introduced by cd5ff8333a. Disable legacy option for new machine types (since 5.1) and amend documentation. '-numa node,memdev' shall be used instead of disabled option with new machine types. Signed-off-by: Igor Mammedov Reviewed-by: Michal Privoznik --- - rebased on top of current master - move compat mode from 4.2 to 5.0 CC: peter.maydell@linaro.org CC: ehabkost@redhat.com CC: marcel.apfelbaum@gmail.com CC: mst@redhat.com CC: pbonzini@redhat.com CC: rth@twiddle.net CC: david@gibson.dropbear.id.au CC: libvir-list@redhat.com CC: qemu-arm@nongnu.org CC: qemu-ppc@nongnu.org --- docs/system/deprecated.rst | 17 ----------------- hw/arm/virt.c | 2 +- hw/core/numa.c | 6 ++++++ hw/i386/pc.c | 1 - hw/i386/pc_piix.c | 1 + hw/i386/pc_q35.c | 1 + hw/ppc/spapr.c | 2 +- qemu-options.hx | 9 +++++---- 8 files changed, 15 insertions(+), 24 deletions(-) diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst index f0061f94aa..57edc075c2 100644 --- a/docs/system/deprecated.rst +++ b/docs/system/deprecated.rst @@ -101,23 +101,6 @@ error in the future. The ``-realtime mlock=3Don|off`` argument has been replaced by the ``-overcommit mem-lock=3Don|off`` argument. =20 -``-numa node,mem=3D``\ *size* (since 4.1) -''''''''''''''''''''''''''''''''''''''' - -The parameter ``mem`` of ``-numa node`` is used to assign a part of -guest RAM to a NUMA node. But when using it, it's impossible to manage spe= cified -RAM chunk on the host side (like bind it to a host node, setting bind poli= cy, ...), -so guest end-ups with the fake NUMA configuration with suboptiomal perform= ance. -However since 2014 there is an alternative way to assign RAM to a NUMA node -using parameter ``memdev``, which does the same as ``mem`` and adds -means to actualy manage node RAM on the host side. Use parameter ``memdev`` -with *memory-backend-ram* backend as an replacement for parameter ``mem`` -to achieve the same fake NUMA effect or a properly configured -*memory-backend-file* backend to actually benefit from NUMA configuration. -In future new machine versions will not accept the option but it will still -work with old machine types. User can check QAPI schema to see if the lega= cy -option is supported by looking at MachineInfo::numa-mem-supported property. - ``-numa`` node (without memory specified) (since 4.1) ''''''''''''''''''''''''''''''''''''''''''''''''''''' =20 diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 37462a6f78..063d4703f7 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2262,7 +2262,6 @@ static void virt_machine_class_init(ObjectClass *oc, = void *data) hc->pre_plug =3D virt_machine_device_pre_plug_cb; hc->plug =3D virt_machine_device_plug_cb; hc->unplug_request =3D virt_machine_device_unplug_request_cb; - mc->numa_mem_supported =3D true; mc->nvdimm_supported =3D true; mc->auto_enable_numa_with_memhp =3D true; mc->default_ram_id =3D "mach-virt.ram"; @@ -2375,6 +2374,7 @@ DEFINE_VIRT_MACHINE_AS_LATEST(5, 1) static void virt_machine_5_0_options(MachineClass *mc) { virt_machine_5_1_options(mc); + mc->numa_mem_supported =3D true; } DEFINE_VIRT_MACHINE(5, 0) =20 diff --git a/hw/core/numa.c b/hw/core/numa.c index 316bc50d75..05be412e59 100644 --- a/hw/core/numa.c +++ b/hw/core/numa.c @@ -117,6 +117,12 @@ static void parse_numa_node(MachineState *ms, NumaNode= Options *node, } =20 if (node->has_mem) { + if (!mc->numa_mem_supported) { + error_setg(errp, "Parameter -numa node,mem is not supported by= this" + " machine type. Use -numa node,memdev instead"); + return; + } + numa_info[nodenr].node_mem =3D node->mem; if (!qtest_enabled()) { warn_report("Parameter -numa node,mem is deprecated," diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 2128f3d6fe..a86136069c 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1960,7 +1960,6 @@ static void pc_machine_class_init(ObjectClass *oc, vo= id *data) hc->unplug =3D pc_machine_device_unplug_cb; mc->default_cpu_type =3D TARGET_DEFAULT_CPU_TYPE; mc->nvdimm_supported =3D true; - mc->numa_mem_supported =3D true; mc->default_ram_id =3D "pc.ram"; =20 object_class_property_add(oc, PC_MACHINE_DEVMEM_REGION_SIZE, "int", diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index f66e1d73ce..8955436efa 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -438,6 +438,7 @@ static void pc_i440fx_5_0_machine_options(MachineClass = *m) pc_i440fx_5_1_machine_options(m); m->alias =3D NULL; m->is_default =3D false; + m->numa_mem_supported =3D true; compat_props_add(m->compat_props, hw_compat_5_0, hw_compat_5_0_len); compat_props_add(m->compat_props, pc_compat_5_0, pc_compat_5_0_len); } diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 4ba8ac8774..af6b32adb7 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -366,6 +366,7 @@ static void pc_q35_5_0_machine_options(MachineClass *m) { pc_q35_5_1_machine_options(m); m->alias =3D NULL; + m->numa_mem_supported =3D true; compat_props_add(m->compat_props, hw_compat_5_0, hw_compat_5_0_len); compat_props_add(m->compat_props, pc_compat_5_0, pc_compat_5_0_len); } diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 3b1a5ed865..210d61d1b3 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4511,7 +4511,6 @@ static void spapr_machine_class_init(ObjectClass *oc,= void *data) * in which LMBs are represented and hot-added */ mc->numa_mem_align_shift =3D 28; - mc->numa_mem_supported =3D true; mc->auto_enable_numa =3D true; =20 smc->default_caps.caps[SPAPR_CAP_HTM] =3D SPAPR_CAP_OFF; @@ -4599,6 +4598,7 @@ static void spapr_machine_5_0_class_options(MachineCl= ass *mc) { spapr_machine_5_1_class_options(mc); compat_props_add(mc->compat_props, hw_compat_5_0, hw_compat_5_0_len); + mc->numa_mem_supported =3D true; } =20 DEFINE_SPAPR_MACHINE(5_0, "5.0", false); diff --git a/qemu-options.hx b/qemu-options.hx index 93bde2bbc8..196f468786 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -239,10 +239,11 @@ SRST -numa node,nodeid=3D0 -numa node,nodeid=3D1 \ -numa cpu,node-id=3D0,socket-id=3D0 -numa cpu,node-id=3D1,socket-i= d=3D1 =20 - '\ ``mem``\ ' assigns a given RAM amount to a node. '\ ``memdev``\ ' - assigns RAM from a given memory backend device to a node. If - '\ ``mem``\ ' and '\ ``memdev``\ ' are omitted in all nodes, RAM is - split equally between them. + Legacy '\ ``mem``\ ' assigns a given RAM amount to a node (not support= ed + for 5.1 and newer machine types). '\ ``memdev``\ ' assigns RAM from + a given memory backend device to a node. If '\ ``mem``\ ' and + '\ ``memdev``\ ' are omitted in all nodes, RAM is split equally betwee= n them. + =20 '\ ``mem``\ ' and '\ ``memdev``\ ' are mutually exclusive. Furthermore, if one node uses '\ ``memdev``\ ', all of them have to --=20 2.18.4