From nobody Tue May 7 15:51:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529071640834957.9709880183009; Fri, 15 Jun 2018 07:07:20 -0700 (PDT) Received: from localhost ([::1]:47016 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpNd-00028J-Vw for importer@patchew.org; Fri, 15 Jun 2018 10:07:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpLY-0000qG-1d for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTpLW-0003Qz-Ii for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:00 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:45128 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTpLW-0003Qp-Er; Fri, 15 Jun 2018 10:04:58 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 019488A3DD; Fri, 15 Jun 2018 14:04:58 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-18.ams2.redhat.com [10.36.117.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 22AA950328; Fri, 15 Jun 2018 14:04:56 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 15 Jun 2018 16:04:36 +0200 Message-Id: <20180615140448.32234-2-david@redhat.com> In-Reply-To: <20180615140448.32234-1-david@redhat.com> References: <20180615140448.32234-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 15 Jun 2018 14:04:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 15 Jun 2018 14:04:58 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 01/13] pc-dimm: remove leftover "struct pc_dimms_capacity" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S . Tsirkin" , Xiao Guangrong , David Hildenbrand , Alexander Graf , qemu-ppc@nongnu.org, Paolo Bonzini , Igor Mammedov , David Gibson , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Not needed anymore, let's drop it. Reviewed-by: David Gibson Reviewed-by: Igor Mammedov Signed-off-by: David Hildenbrand --- hw/mem/pc-dimm.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 12da89d562..62b34a992e 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -27,11 +27,6 @@ #include "sysemu/numa.h" #include "trace.h" =20 -typedef struct pc_dimms_capacity { - uint64_t size; - Error **errp; -} pc_dimms_capacity; - void pc_dimm_memory_plug(DeviceState *dev, MachineState *machine, uint64_t align, Error **errp) { --=20 2.17.1 From nobody Tue May 7 15:51:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529071816197973.0291205520157; Fri, 15 Jun 2018 07:10:16 -0700 (PDT) Received: from localhost ([::1]:47030 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpQd-0004ee-CJ for importer@patchew.org; Fri, 15 Jun 2018 10:10:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpLa-0000rQ-2k for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTpLY-0003TB-Oj for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:02 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49462 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTpLY-0003SV-JL; Fri, 15 Jun 2018 10:05:00 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1D72081663F2; Fri, 15 Jun 2018 14:05:00 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-18.ams2.redhat.com [10.36.117.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D1CE6352E; Fri, 15 Jun 2018 14:04:58 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 15 Jun 2018 16:04:37 +0200 Message-Id: <20180615140448.32234-3-david@redhat.com> In-Reply-To: <20180615140448.32234-1-david@redhat.com> References: <20180615140448.32234-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 15 Jun 2018 14:05:00 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 15 Jun 2018 14:05:00 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 02/13] pc: rename pc_dimm_(plug|unplug|...)* into pc_memory_(plug|unplug|...)* X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S . Tsirkin" , Xiao Guangrong , David Hildenbrand , Alexander Graf , qemu-ppc@nongnu.org, Paolo Bonzini , Igor Mammedov , David Gibson , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Use a similar naming scheme as spapr. This way, we can go ahead and rename e.g. pc_dimm_memory_plug to pc_dimm_plug, which avoids confusion. Reviewed-by: Igor Mammedov Signed-off-by: David Hildenbrand Reviewed-by: David Gibson --- hw/i386/pc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 622e49d6bc..f9250ffae7 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1674,8 +1674,8 @@ void ioapic_init_gsi(GSIState *gsi_state, const char = *parent_name) } } =20 -static void pc_dimm_plug(HotplugHandler *hotplug_dev, - DeviceState *dev, Error **errp) +static void pc_memory_plug(HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { HotplugHandlerClass *hhc; Error *local_err =3D NULL; @@ -1728,8 +1728,8 @@ out: error_propagate(errp, local_err); } =20 -static void pc_dimm_unplug_request(HotplugHandler *hotplug_dev, - DeviceState *dev, Error **errp) +static void pc_memory_unplug_request(HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { HotplugHandlerClass *hhc; Error *local_err =3D NULL; @@ -1759,8 +1759,8 @@ out: error_propagate(errp, local_err); } =20 -static void pc_dimm_unplug(HotplugHandler *hotplug_dev, - DeviceState *dev, Error **errp) +static void pc_memory_unplug(HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { PCMachineState *pcms =3D PC_MACHINE(hotplug_dev); HotplugHandlerClass *hhc; @@ -2015,7 +2015,7 @@ static void pc_machine_device_plug_cb(HotplugHandler = *hotplug_dev, DeviceState *dev, Error **errp) { if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { - pc_dimm_plug(hotplug_dev, dev, errp); + pc_memory_plug(hotplug_dev, dev, errp); } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { pc_cpu_plug(hotplug_dev, dev, errp); } @@ -2025,7 +2025,7 @@ static void pc_machine_device_unplug_request_cb(Hotpl= ugHandler *hotplug_dev, DeviceState *dev, Error **= errp) { if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { - pc_dimm_unplug_request(hotplug_dev, dev, errp); + pc_memory_unplug_request(hotplug_dev, dev, errp); } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { pc_cpu_unplug_request_cb(hotplug_dev, dev, errp); } else { @@ -2038,7 +2038,7 @@ static void pc_machine_device_unplug_cb(HotplugHandle= r *hotplug_dev, DeviceState *dev, Error **errp) { if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { - pc_dimm_unplug(hotplug_dev, dev, errp); + pc_memory_unplug(hotplug_dev, dev, errp); } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { pc_cpu_unplug_cb(hotplug_dev, dev, errp); } else { --=20 2.17.1 From nobody Tue May 7 15:51:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529071658090768.0535220439934; Fri, 15 Jun 2018 07:07:38 -0700 (PDT) Received: from localhost ([::1]:47018 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpO5-0002Us-7j for importer@patchew.org; Fri, 15 Jun 2018 10:07:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpLf-0000tn-Q3 for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTpLb-0003XL-Ae for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:07 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53952 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTpLb-0003Wg-5A; Fri, 15 Jun 2018 10:05:03 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B2706401EF03; Fri, 15 Jun 2018 14:05:02 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-18.ams2.redhat.com [10.36.117.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5860263A6F; Fri, 15 Jun 2018 14:05:00 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 15 Jun 2018 16:04:38 +0200 Message-Id: <20180615140448.32234-4-david@redhat.com> In-Reply-To: <20180615140448.32234-1-david@redhat.com> References: <20180615140448.32234-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 15 Jun 2018 14:05:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 15 Jun 2018 14:05:02 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 03/13] pc-dimm: rename pc_dimm_memory_* to pc_dimm_* X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S . Tsirkin" , Xiao Guangrong , David Hildenbrand , Alexander Graf , qemu-ppc@nongnu.org, Paolo Bonzini , Igor Mammedov , David Gibson , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Let's rename it to make it look more consistent. Reviewed-by: Igor Mammedov Signed-off-by: David Hildenbrand Acked-by: David Gibson Reviewed-by: David Gibson --- hw/i386/pc.c | 4 ++-- hw/mem/pc-dimm.c | 6 +++--- hw/ppc/spapr.c | 6 +++--- include/hw/mem/pc-dimm.h | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index f9250ffae7..f23133facc 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1713,7 +1713,7 @@ static void pc_memory_plug(HotplugHandler *hotplug_de= v, goto out; } =20 - pc_dimm_memory_plug(dev, MACHINE(pcms), align, &local_err); + pc_dimm_plug(dev, MACHINE(pcms), align, &local_err); if (local_err) { goto out; } @@ -1773,7 +1773,7 @@ static void pc_memory_unplug(HotplugHandler *hotplug_= dev, goto out; } =20 - pc_dimm_memory_unplug(dev, MACHINE(pcms)); + pc_dimm_unplug(dev, MACHINE(pcms)); object_unparent(OBJECT(dev)); =20 out: diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 62b34a992e..9e0c83e415 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -27,8 +27,8 @@ #include "sysemu/numa.h" #include "trace.h" =20 -void pc_dimm_memory_plug(DeviceState *dev, MachineState *machine, - uint64_t align, Error **errp) +void pc_dimm_plug(DeviceState *dev, MachineState *machine, uint64_t align, + Error **errp) { int slot; PCDIMMDevice *dimm =3D PC_DIMM(dev); @@ -84,7 +84,7 @@ out: error_propagate(errp, local_err); } =20 -void pc_dimm_memory_unplug(DeviceState *dev, MachineState *machine) +void pc_dimm_unplug(DeviceState *dev, MachineState *machine) { PCDIMMDevice *dimm =3D PC_DIMM(dev); PCDIMMDeviceClass *ddc =3D PC_DIMM_GET_CLASS(dimm); diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index f59999daac..3e5320020f 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3153,7 +3153,7 @@ static void spapr_memory_plug(HotplugHandler *hotplug= _dev, DeviceState *dev, align =3D memory_region_get_alignment(mr); size =3D memory_region_size(mr); =20 - pc_dimm_memory_plug(dev, MACHINE(ms), align, &local_err); + pc_dimm_plug(dev, MACHINE(ms), align, &local_err); if (local_err) { goto out; } @@ -3176,7 +3176,7 @@ static void spapr_memory_plug(HotplugHandler *hotplug= _dev, DeviceState *dev, return; =20 out_unplug: - pc_dimm_memory_unplug(dev, MACHINE(ms)); + pc_dimm_unplug(dev, MACHINE(ms)); out: error_propagate(errp, local_err); } @@ -3328,7 +3328,7 @@ static void spapr_memory_unplug(HotplugHandler *hotpl= ug_dev, DeviceState *dev) sPAPRMachineState *spapr =3D SPAPR_MACHINE(hotplug_dev); sPAPRDIMMState *ds =3D spapr_pending_dimm_unplugs_find(spapr, PC_DIMM(= dev)); =20 - pc_dimm_memory_unplug(dev, MACHINE(hotplug_dev)); + pc_dimm_unplug(dev, MACHINE(hotplug_dev)); object_unparent(OBJECT(dev)); spapr_pending_dimm_unplugs_remove(spapr, ds); } diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h index 627c8601d9..860343d64f 100644 --- a/include/hw/mem/pc-dimm.h +++ b/include/hw/mem/pc-dimm.h @@ -78,7 +78,7 @@ typedef struct PCDIMMDeviceClass { =20 int pc_dimm_get_free_slot(const int *hint, int max_slots, Error **errp); =20 -void pc_dimm_memory_plug(DeviceState *dev, MachineState *machine, - uint64_t align, Error **errp); -void pc_dimm_memory_unplug(DeviceState *dev, MachineState *machine); +void pc_dimm_plug(DeviceState *dev, MachineState *machine, uint64_t align, + Error **errp); +void pc_dimm_unplug(DeviceState *dev, MachineState *machine); #endif --=20 2.17.1 From nobody Tue May 7 15:51:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529071684510113.5426270511158; Fri, 15 Jun 2018 07:08:04 -0700 (PDT) Received: from localhost ([::1]:47019 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpOV-0002qc-OF for importer@patchew.org; Fri, 15 Jun 2018 10:08:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpLk-00011Z-Om for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTpLf-0003c0-6h for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:12 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49478 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTpLf-0003bs-1a; Fri, 15 Jun 2018 10:05:07 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9087081663F2; Fri, 15 Jun 2018 14:05:06 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-18.ams2.redhat.com [10.36.117.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id EE71E63A6F; Fri, 15 Jun 2018 14:05:02 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 15 Jun 2018 16:04:39 +0200 Message-Id: <20180615140448.32234-5-david@redhat.com> In-Reply-To: <20180615140448.32234-1-david@redhat.com> References: <20180615140448.32234-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 15 Jun 2018 14:05:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 15 Jun 2018 14:05:06 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 04/13] pc-dimm: remove pc_dimm_get_free_slot() from header X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S . Tsirkin" , Xiao Guangrong , David Hildenbrand , Alexander Graf , qemu-ppc@nongnu.org, Paolo Bonzini , Igor Mammedov , David Gibson , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Not used outside of pc-dimm.c and there shouldn't be other users. If other devices (e.g. memory devices) ever have to also use slots, then we will have to factor this out. Reviewed-by: Igor Mammedov Signed-off-by: David Hildenbrand Reviewed-by: David Gibson --- hw/mem/pc-dimm.c | 4 +++- include/hw/mem/pc-dimm.h | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 9e0c83e415..7387963cf1 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -27,6 +27,8 @@ #include "sysemu/numa.h" #include "trace.h" =20 +static int pc_dimm_get_free_slot(const int *hint, int max_slots, Error **e= rrp); + void pc_dimm_plug(DeviceState *dev, MachineState *machine, uint64_t align, Error **errp) { @@ -111,7 +113,7 @@ static int pc_dimm_slot2bitmap(Object *obj, void *opaqu= e) return 0; } =20 -int pc_dimm_get_free_slot(const int *hint, int max_slots, Error **errp) +static int pc_dimm_get_free_slot(const int *hint, int max_slots, Error **e= rrp) { unsigned long *bitmap; int slot =3D 0; diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h index 860343d64f..cf71247630 100644 --- a/include/hw/mem/pc-dimm.h +++ b/include/hw/mem/pc-dimm.h @@ -76,8 +76,6 @@ typedef struct PCDIMMDeviceClass { MemoryRegion *(*get_vmstate_memory_region)(PCDIMMDevice *dimm); } PCDIMMDeviceClass; =20 -int pc_dimm_get_free_slot(const int *hint, int max_slots, Error **errp); - void pc_dimm_plug(DeviceState *dev, MachineState *machine, uint64_t align, Error **errp); void pc_dimm_unplug(DeviceState *dev, MachineState *machine); --=20 2.17.1 From nobody Tue May 7 15:51:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529071868992752.225960444733; Fri, 15 Jun 2018 07:11:08 -0700 (PDT) Received: from localhost ([::1]:47041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpRU-0005Q3-4x for importer@patchew.org; Fri, 15 Jun 2018 10:11:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpLi-0000wf-Dk for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTpLh-0003cw-BB for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:10 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49490 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTpLh-0003ck-5G; Fri, 15 Jun 2018 10:05:09 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B00B1818A6A9; Fri, 15 Jun 2018 14:05:08 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-18.ams2.redhat.com [10.36.117.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB26D63A72; Fri, 15 Jun 2018 14:05:06 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 15 Jun 2018 16:04:40 +0200 Message-Id: <20180615140448.32234-6-david@redhat.com> In-Reply-To: <20180615140448.32234-1-david@redhat.com> References: <20180615140448.32234-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 15 Jun 2018 14:05:08 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 15 Jun 2018 14:05:08 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 05/13] pc: factor out pc specific dimm checks into pc_memory_pre_plug() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S . Tsirkin" , Xiao Guangrong , David Hildenbrand , Alexander Graf , qemu-ppc@nongnu.org, Paolo Bonzini , Igor Mammedov , David Gibson , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We can perform these checks before the device is actually realized. Reviewed-by: David Gibson Reviewed-by: Igor Mammedov Signed-off-by: David Hildenbrand --- hw/i386/pc.c | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index f23133facc..2db032a6df 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1674,6 +1674,29 @@ void ioapic_init_gsi(GSIState *gsi_state, const char= *parent_name) } } =20 +static void pc_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *d= ev, + Error **errp) +{ + const PCMachineState *pcms =3D PC_MACHINE(hotplug_dev); + const bool is_nvdimm =3D object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM); + + /* + * When -no-acpi is used with Q35 machine type, no ACPI is built, + * but pcms->acpi_dev is still created. Check !acpi_enabled in + * addition to cover this case. + */ + if (!pcms->acpi_dev || !acpi_enabled) { + error_setg(errp, + "memory hotplug is not enabled: missing acpi device or = acpi disabled"); + return; + } + + if (is_nvdimm && !pcms->acpi_nvdimm_state.is_enabled) { + error_setg(errp, "nvdimm is not enabled: missing 'nvdimm' in '-M'"= ); + return; + } +} + static void pc_memory_plug(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { @@ -1696,23 +1719,6 @@ static void pc_memory_plug(HotplugHandler *hotplug_d= ev, align =3D memory_region_get_alignment(mr); } =20 - /* - * When -no-acpi is used with Q35 machine type, no ACPI is built, - * but pcms->acpi_dev is still created. Check !acpi_enabled in - * addition to cover this case. - */ - if (!pcms->acpi_dev || !acpi_enabled) { - error_setg(&local_err, - "memory hotplug is not enabled: missing acpi device or = acpi disabled"); - goto out; - } - - if (is_nvdimm && !pcms->acpi_nvdimm_state.is_enabled) { - error_setg(&local_err, - "nvdimm is not enabled: missing 'nvdimm' in '-M'"); - goto out; - } - pc_dimm_plug(dev, MACHINE(pcms), align, &local_err); if (local_err) { goto out; @@ -2006,7 +2012,9 @@ static void pc_cpu_pre_plug(HotplugHandler *hotplug_d= ev, static void pc_machine_device_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { - if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { + if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { + pc_memory_pre_plug(hotplug_dev, dev, errp); + } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { pc_cpu_pre_plug(hotplug_dev, dev, errp); } } --=20 2.17.1 From nobody Tue May 7 15:51:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529071824717879.8220544072124; Fri, 15 Jun 2018 07:10:24 -0700 (PDT) Received: from localhost ([::1]:47032 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpQl-0004oh-JK for importer@patchew.org; Fri, 15 Jun 2018 10:10:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpLo-00016d-TF for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTpLn-0003iy-Li for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:16 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40518 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTpLn-0003ir-GN; Fri, 15 Jun 2018 10:05:15 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0F3C4406F619; Fri, 15 Jun 2018 14:05:15 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-18.ams2.redhat.com [10.36.117.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED3A863A5B; Fri, 15 Jun 2018 14:05:08 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 15 Jun 2018 16:04:41 +0200 Message-Id: <20180615140448.32234-7-david@redhat.com> In-Reply-To: <20180615140448.32234-1-david@redhat.com> References: <20180615140448.32234-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 15 Jun 2018 14:05:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 15 Jun 2018 14:05:15 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 06/13] nvdimm: no need to overwrite get_vmstate_memory_region() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S . Tsirkin" , Xiao Guangrong , David Hildenbrand , Alexander Graf , qemu-ppc@nongnu.org, Paolo Bonzini , Igor Mammedov , David Gibson , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Our parent class (PC_DIMM) provides exactly the same function. Reviewed-by: David Gibson Reviewed-by: Igor Mammedov Signed-off-by: David Hildenbrand --- hw/mem/nvdimm.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index 4087aca25e..f974accbdd 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -166,11 +166,6 @@ static void nvdimm_write_label_data(NVDIMMDevice *nvdi= mm, const void *buf, memory_region_set_dirty(mr, backend_offset, size); } =20 -static MemoryRegion *nvdimm_get_vmstate_memory_region(PCDIMMDevice *dimm) -{ - return host_memory_backend_get_memory(dimm->hostmem, &error_abort); -} - static void nvdimm_class_init(ObjectClass *oc, void *data) { PCDIMMDeviceClass *ddc =3D PC_DIMM_CLASS(oc); @@ -178,7 +173,6 @@ static void nvdimm_class_init(ObjectClass *oc, void *da= ta) =20 ddc->realize =3D nvdimm_realize; ddc->get_memory_region =3D nvdimm_get_memory_region; - ddc->get_vmstate_memory_region =3D nvdimm_get_vmstate_memory_region; =20 nvc->read_label_data =3D nvdimm_read_label_data; nvc->write_label_data =3D nvdimm_write_label_data; --=20 2.17.1 From nobody Tue May 7 15:51:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529072012101571.6431127710963; Fri, 15 Jun 2018 07:13:32 -0700 (PDT) Received: from localhost ([::1]:47053 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpTk-0007QH-3p for importer@patchew.org; Fri, 15 Jun 2018 10:13:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpLs-00019v-C5 for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTpLp-0003jf-Rf for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:20 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55108 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTpLp-0003jW-Kw; Fri, 15 Jun 2018 10:05:17 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2C083C12B7; Fri, 15 Jun 2018 14:05:17 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-18.ams2.redhat.com [10.36.117.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 49AE163A51; Fri, 15 Jun 2018 14:05:15 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 15 Jun 2018 16:04:42 +0200 Message-Id: <20180615140448.32234-8-david@redhat.com> In-Reply-To: <20180615140448.32234-1-david@redhat.com> References: <20180615140448.32234-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 15 Jun 2018 14:05:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 15 Jun 2018 14:05:17 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 07/13] hostmem: drop error variable from host_memory_backend_get_memory() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S . Tsirkin" , Xiao Guangrong , David Hildenbrand , Alexander Graf , qemu-ppc@nongnu.org, Paolo Bonzini , Igor Mammedov , David Gibson , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Unused, so let's remove it. Reviewed-by: David Gibson Reviewed-by: Igor Mammedov Signed-off-by: David Hildenbrand --- backends/hostmem.c | 3 +-- hw/mem/nvdimm.c | 4 ++-- hw/mem/pc-dimm.c | 4 ++-- hw/misc/ivshmem.c | 3 +-- include/sysemu/hostmem.h | 3 +-- numa.c | 3 +-- 6 files changed, 8 insertions(+), 12 deletions(-) diff --git a/backends/hostmem.c b/backends/hostmem.c index 3627e61584..4908946cd3 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -247,8 +247,7 @@ bool host_memory_backend_mr_inited(HostMemoryBackend *b= ackend) return memory_region_size(&backend->mr) !=3D 0; } =20 -MemoryRegion * -host_memory_backend_get_memory(HostMemoryBackend *backend, Error **errp) +MemoryRegion *host_memory_backend_get_memory(HostMemoryBackend *backend) { return host_memory_backend_mr_inited(backend) ? &backend->mr : NULL; } diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index f974accbdd..df9716231f 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -105,7 +105,7 @@ static MemoryRegion *nvdimm_get_memory_region(PCDIMMDev= ice *dimm, Error **errp) =20 static void nvdimm_realize(PCDIMMDevice *dimm, Error **errp) { - MemoryRegion *mr =3D host_memory_backend_get_memory(dimm->hostmem, err= p); + MemoryRegion *mr =3D host_memory_backend_get_memory(dimm->hostmem); NVDIMMDevice *nvdimm =3D NVDIMM(dimm); uint64_t align, pmem_size, size =3D memory_region_size(mr); =20 @@ -161,7 +161,7 @@ static void nvdimm_write_label_data(NVDIMMDevice *nvdim= m, const void *buf, =20 memcpy(nvdimm->label_data + offset, buf, size); =20 - mr =3D host_memory_backend_get_memory(dimm->hostmem, &error_abort); + mr =3D host_memory_backend_get_memory(dimm->hostmem); backend_offset =3D memory_region_size(mr) - nvdimm->label_size + offse= t; memory_region_set_dirty(mr, backend_offset, size); } diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 7387963cf1..73f0eee4c7 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -226,12 +226,12 @@ static MemoryRegion *pc_dimm_get_memory_region(PCDIMM= Device *dimm, Error **errp) return NULL; } =20 - return host_memory_backend_get_memory(dimm->hostmem, errp); + return host_memory_backend_get_memory(dimm->hostmem); } =20 static MemoryRegion *pc_dimm_get_vmstate_memory_region(PCDIMMDevice *dimm) { - return host_memory_backend_get_memory(dimm->hostmem, &error_abort); + return host_memory_backend_get_memory(dimm->hostmem); } =20 static uint64_t pc_dimm_md_get_addr(const MemoryDeviceState *md) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 16f03701b7..ee01c5e66b 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -909,8 +909,7 @@ static void ivshmem_common_realize(PCIDevice *dev, Erro= r **errp) if (s->hostmem !=3D NULL) { IVSHMEM_DPRINTF("using hostmem\n"); =20 - s->ivshmem_bar2 =3D host_memory_backend_get_memory(s->hostmem, - &error_abort); + s->ivshmem_bar2 =3D host_memory_backend_get_memory(s->hostmem); } else { Chardev *chr =3D qemu_chr_fe_get_driver(&s->server_chr); assert(chr); diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h index 5beb0ef8ab..6e6bd2c1cb 100644 --- a/include/sysemu/hostmem.h +++ b/include/sysemu/hostmem.h @@ -62,8 +62,7 @@ struct HostMemoryBackend { }; =20 bool host_memory_backend_mr_inited(HostMemoryBackend *backend); -MemoryRegion *host_memory_backend_get_memory(HostMemoryBackend *backend, - Error **errp); +MemoryRegion *host_memory_backend_get_memory(HostMemoryBackend *backend); =20 void host_memory_backend_set_mapped(HostMemoryBackend *backend, bool mappe= d); bool host_memory_backend_is_mapped(HostMemoryBackend *backend); diff --git a/numa.c b/numa.c index 33572bfa74..94f758c757 100644 --- a/numa.c +++ b/numa.c @@ -523,8 +523,7 @@ void memory_region_allocate_system_memory(MemoryRegion = *mr, Object *owner, if (!backend) { continue; } - MemoryRegion *seg =3D host_memory_backend_get_memory(backend, - &error_fatal); + MemoryRegion *seg =3D host_memory_backend_get_memory(backend); =20 if (memory_region_is_mapped(seg)) { char *path =3D object_get_canonical_path_component(OBJECT(back= end)); --=20 2.17.1 From nobody Tue May 7 15:51:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529072173413829.8710032100486; Fri, 15 Jun 2018 07:16:13 -0700 (PDT) Received: from localhost ([::1]:47076 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpWO-0001Yi-MO for importer@patchew.org; Fri, 15 Jun 2018 10:16:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpLt-0001Ap-3G for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTpLr-0003k8-TM for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:20 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53966 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTpLr-0003jz-NR; Fri, 15 Jun 2018 10:05:19 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4825B401EF2E; Fri, 15 Jun 2018 14:05:19 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-18.ams2.redhat.com [10.36.117.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65B8A63A5B; Fri, 15 Jun 2018 14:05:17 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 15 Jun 2018 16:04:43 +0200 Message-Id: <20180615140448.32234-9-david@redhat.com> In-Reply-To: <20180615140448.32234-1-david@redhat.com> References: <20180615140448.32234-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 15 Jun 2018 14:05:19 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 15 Jun 2018 14:05:19 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 08/13] pc-dimm: merge get_(vmstate_)memory_region() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S . Tsirkin" , Xiao Guangrong , David Hildenbrand , Alexander Graf , qemu-ppc@nongnu.org, Paolo Bonzini , Igor Mammedov , David Gibson , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Importantly, get_vmstate_memory_region() should also fail with a proper error if called before the device is realized. For a PCDIMM, both functions are to return the same thing, so share the implementation. All current users are called after the device has been realized, so we can expect the calls to succeed. Signed-off-by: David Hildenbrand Reviewed-by: David Gibson Reviewed-by: Igor Mammedov --- hw/mem/pc-dimm.c | 13 +++++-------- include/hw/mem/pc-dimm.h | 3 ++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 73f0eee4c7..4ff39b59ef 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -35,7 +35,8 @@ void pc_dimm_plug(DeviceState *dev, MachineState *machine= , uint64_t align, int slot; PCDIMMDevice *dimm =3D PC_DIMM(dev); PCDIMMDeviceClass *ddc =3D PC_DIMM_GET_CLASS(dimm); - MemoryRegion *vmstate_mr =3D ddc->get_vmstate_memory_region(dimm); + MemoryRegion *vmstate_mr =3D ddc->get_vmstate_memory_region(dimm, + &error_abort= ); Error *local_err =3D NULL; MemoryRegion *mr; uint64_t addr; @@ -90,7 +91,8 @@ void pc_dimm_unplug(DeviceState *dev, MachineState *machi= ne) { PCDIMMDevice *dimm =3D PC_DIMM(dev); PCDIMMDeviceClass *ddc =3D PC_DIMM_GET_CLASS(dimm); - MemoryRegion *vmstate_mr =3D ddc->get_vmstate_memory_region(dimm); + MemoryRegion *vmstate_mr =3D ddc->get_vmstate_memory_region(dimm, + &error_abort= ); MemoryRegion *mr =3D ddc->get_memory_region(dimm, &error_abort); =20 memory_device_unplug_region(machine, mr); @@ -229,11 +231,6 @@ static MemoryRegion *pc_dimm_get_memory_region(PCDIMMD= evice *dimm, Error **errp) return host_memory_backend_get_memory(dimm->hostmem); } =20 -static MemoryRegion *pc_dimm_get_vmstate_memory_region(PCDIMMDevice *dimm) -{ - return host_memory_backend_get_memory(dimm->hostmem); -} - static uint64_t pc_dimm_md_get_addr(const MemoryDeviceState *md) { const PCDIMMDevice *dimm =3D PC_DIMM(md); @@ -298,7 +295,7 @@ static void pc_dimm_class_init(ObjectClass *oc, void *d= ata) dc->desc =3D "DIMM memory module"; =20 ddc->get_memory_region =3D pc_dimm_get_memory_region; - ddc->get_vmstate_memory_region =3D pc_dimm_get_vmstate_memory_region; + ddc->get_vmstate_memory_region =3D pc_dimm_get_memory_region; =20 mdc->get_addr =3D pc_dimm_md_get_addr; /* for a dimm plugged_size =3D=3D region_size */ diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h index cf71247630..5679a80465 100644 --- a/include/hw/mem/pc-dimm.h +++ b/include/hw/mem/pc-dimm.h @@ -73,7 +73,8 @@ typedef struct PCDIMMDeviceClass { /* public */ void (*realize)(PCDIMMDevice *dimm, Error **errp); MemoryRegion *(*get_memory_region)(PCDIMMDevice *dimm, Error **errp); - MemoryRegion *(*get_vmstate_memory_region)(PCDIMMDevice *dimm); + MemoryRegion *(*get_vmstate_memory_region)(PCDIMMDevice *dimm, + Error **errp); } PCDIMMDeviceClass; =20 void pc_dimm_plug(DeviceState *dev, MachineState *machine, uint64_t align, --=20 2.17.1 From nobody Tue May 7 15:51:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529071953524924.5892072996; Fri, 15 Jun 2018 07:12:33 -0700 (PDT) Received: from localhost ([::1]:47049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpSi-0006Xn-Ls for importer@patchew.org; Fri, 15 Jun 2018 10:12:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpLy-0001Gi-K5 for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTpLu-0003l9-Fm for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:26 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41704 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTpLt-0003ki-UL; Fri, 15 Jun 2018 10:05:22 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 660CD402312B; Fri, 15 Jun 2018 14:05:21 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-18.ams2.redhat.com [10.36.117.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8375C63A6F; Fri, 15 Jun 2018 14:05:19 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 15 Jun 2018 16:04:44 +0200 Message-Id: <20180615140448.32234-10-david@redhat.com> In-Reply-To: <20180615140448.32234-1-david@redhat.com> References: <20180615140448.32234-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 15 Jun 2018 14:05:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 15 Jun 2018 14:05:21 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 09/13] nvdimm: convert "unarmed" into a static property X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S . Tsirkin" , Xiao Guangrong , David Hildenbrand , Alexander Graf , qemu-ppc@nongnu.org, Paolo Bonzini , Igor Mammedov , David Gibson , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We don't allow to modify it after realization. So we can simply turn it into a static property. Signed-off-by: David Hildenbrand Reviewed-by: David Gibson --- hw/mem/nvdimm.c | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index df9716231f..7260c9c6b1 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -64,36 +64,11 @@ out: error_propagate(errp, local_err); } =20 -static bool nvdimm_get_unarmed(Object *obj, Error **errp) -{ - NVDIMMDevice *nvdimm =3D NVDIMM(obj); - - return nvdimm->unarmed; -} - -static void nvdimm_set_unarmed(Object *obj, bool value, Error **errp) -{ - NVDIMMDevice *nvdimm =3D NVDIMM(obj); - Error *local_err =3D NULL; - - if (memory_region_size(&nvdimm->nvdimm_mr)) { - error_setg(&local_err, "cannot change property value"); - goto out; - } - - nvdimm->unarmed =3D value; - - out: - error_propagate(errp, local_err); -} - static void nvdimm_init(Object *obj) { object_property_add(obj, NVDIMM_LABEL_SIZE_PROP, "int", nvdimm_get_label_size, nvdimm_set_label_size, NULL, NULL, NULL); - object_property_add_bool(obj, NVDIMM_UNARMED_PROP, - nvdimm_get_unarmed, nvdimm_set_unarmed, NULL); } =20 static MemoryRegion *nvdimm_get_memory_region(PCDIMMDevice *dimm, Error **= errp) @@ -166,13 +141,20 @@ static void nvdimm_write_label_data(NVDIMMDevice *nvd= imm, const void *buf, memory_region_set_dirty(mr, backend_offset, size); } =20 +static Property nvdimm_properties[] =3D { + DEFINE_PROP_BOOL(NVDIMM_UNARMED_PROP, NVDIMMDevice, unarmed, false), + DEFINE_PROP_END_OF_LIST(), +}; + static void nvdimm_class_init(ObjectClass *oc, void *data) { PCDIMMDeviceClass *ddc =3D PC_DIMM_CLASS(oc); NVDIMMClass *nvc =3D NVDIMM_CLASS(oc); + DeviceClass *dc =3D DEVICE_CLASS(oc); =20 ddc->realize =3D nvdimm_realize; ddc->get_memory_region =3D nvdimm_get_memory_region; + dc->props =3D nvdimm_properties; =20 nvc->read_label_data =3D nvdimm_read_label_data; nvc->write_label_data =3D nvdimm_write_label_data; --=20 2.17.1 From nobody Tue May 7 15:51:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529072361469900.4098058584069; Fri, 15 Jun 2018 07:19:21 -0700 (PDT) Received: from localhost ([::1]:47088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpZH-0003hz-5D for importer@patchew.org; Fri, 15 Jun 2018 10:19:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpLx-0001FW-BQ for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTpLw-0003m2-5O for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:25 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:45162 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTpLv-0003lr-W4; Fri, 15 Jun 2018 10:05:24 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8442E8AA15; Fri, 15 Jun 2018 14:05:23 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-18.ams2.redhat.com [10.36.117.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id A28DE6352E; Fri, 15 Jun 2018 14:05:21 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 15 Jun 2018 16:04:45 +0200 Message-Id: <20180615140448.32234-11-david@redhat.com> In-Reply-To: <20180615140448.32234-1-david@redhat.com> References: <20180615140448.32234-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 15 Jun 2018 14:05:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 15 Jun 2018 14:05:23 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 10/13] nvdimm: convert nvdimm_mr into a pointer X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S . Tsirkin" , Xiao Guangrong , David Hildenbrand , Alexander Graf , qemu-ppc@nongnu.org, Paolo Bonzini , Igor Mammedov , David Gibson , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This way we can easily check if the region has already been inititalized without having to rely on the size of an uninitialized region being 0. Signed-off-by: David Hildenbrand Reviewed-by: David Gibson Reviewed-by: Igor Mammedov --- hw/mem/nvdimm.c | 9 +++++---- include/hw/mem/nvdimm.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index 7260c9c6b1..db7d8c3050 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -43,7 +43,7 @@ static void nvdimm_set_label_size(Object *obj, Visitor *v= , const char *name, Error *local_err =3D NULL; uint64_t value; =20 - if (memory_region_size(&nvdimm->nvdimm_mr)) { + if (nvdimm->nvdimm_mr) { error_setg(&local_err, "cannot change property value"); goto out; } @@ -75,7 +75,7 @@ static MemoryRegion *nvdimm_get_memory_region(PCDIMMDevic= e *dimm, Error **errp) { NVDIMMDevice *nvdimm =3D NVDIMM(dimm); =20 - return &nvdimm->nvdimm_mr; + return nvdimm->nvdimm_mr; } =20 static void nvdimm_realize(PCDIMMDevice *dimm, Error **errp) @@ -102,9 +102,10 @@ static void nvdimm_realize(PCDIMMDevice *dimm, Error *= *errp) return; } =20 - memory_region_init_alias(&nvdimm->nvdimm_mr, OBJECT(dimm), + nvdimm->nvdimm_mr =3D g_new(MemoryRegion, 1); + memory_region_init_alias(nvdimm->nvdimm_mr, OBJECT(dimm), "nvdimm-memory", mr, 0, pmem_size); - nvdimm->nvdimm_mr.align =3D align; + nvdimm->nvdimm_mr->align =3D align; } =20 /* diff --git a/include/hw/mem/nvdimm.h b/include/hw/mem/nvdimm.h index 9340631cfc..c5c9b3c7f8 100644 --- a/include/hw/mem/nvdimm.h +++ b/include/hw/mem/nvdimm.h @@ -74,7 +74,7 @@ struct NVDIMMDevice { * it's the PMEM region in NVDIMM device, which is presented to * guest via ACPI NFIT and _FIT method if NVDIMM hotplug is supported. */ - MemoryRegion nvdimm_mr; + MemoryRegion *nvdimm_mr; =20 /* * The 'on' value results in the unarmed flag set in ACPI NFIT, --=20 2.17.1 From nobody Tue May 7 15:51:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529072037723824.1220112862028; Fri, 15 Jun 2018 07:13:57 -0700 (PDT) Received: from localhost ([::1]:47057 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpUC-0007qv-T4 for importer@patchew.org; Fri, 15 Jun 2018 10:13:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpM1-0001Ja-Gb for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTpLy-0003mi-8k for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:29 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49504 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTpLy-0003mZ-3y; Fri, 15 Jun 2018 10:05:26 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A67FC818A6AF; Fri, 15 Jun 2018 14:05:25 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-18.ams2.redhat.com [10.36.117.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id C0AA06352E; Fri, 15 Jun 2018 14:05:23 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 15 Jun 2018 16:04:46 +0200 Message-Id: <20180615140448.32234-12-david@redhat.com> In-Reply-To: <20180615140448.32234-1-david@redhat.com> References: <20180615140448.32234-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 15 Jun 2018 14:05:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 15 Jun 2018 14:05:25 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 11/13] nvdimm: allow setting the label-size to 0 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S . Tsirkin" , Xiao Guangrong , David Hildenbrand , Alexander Graf , qemu-ppc@nongnu.org, Paolo Bonzini , Igor Mammedov , David Gibson , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" It is inititally 0, so setting it to 0 should be allowed, too. Signed-off-by: David Hildenbrand --- hw/mem/nvdimm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index db7d8c3050..df7646488b 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -52,9 +52,9 @@ static void nvdimm_set_label_size(Object *obj, Visitor *v= , const char *name, if (local_err) { goto out; } - if (value < MIN_NAMESPACE_LABEL_SIZE) { + if (value && value < MIN_NAMESPACE_LABEL_SIZE) { error_setg(&local_err, "Property '%s.%s' (0x%" PRIx64 ") is requir= ed" - " at least 0x%lx", object_get_typename(obj), + " either 0 or at least 0x%lx", object_get_typename(obj), name, value, MIN_NAMESPACE_LABEL_SIZE); goto out; } --=20 2.17.1 From nobody Tue May 7 15:51:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 152907203445081.92616905051136; Fri, 15 Jun 2018 07:13:54 -0700 (PDT) Received: from localhost ([::1]:47056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpU9-0007nT-JY for importer@patchew.org; Fri, 15 Jun 2018 10:13:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpM3-0001K3-8W for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTpM0-0003nF-H0 for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:31 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53974 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTpM0-0003n7-8R; Fri, 15 Jun 2018 10:05:28 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C6EA5406C78F; Fri, 15 Jun 2018 14:05:27 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-18.ams2.redhat.com [10.36.117.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id E2D3763A4F; Fri, 15 Jun 2018 14:05:25 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 15 Jun 2018 16:04:47 +0200 Message-Id: <20180615140448.32234-13-david@redhat.com> In-Reply-To: <20180615140448.32234-1-david@redhat.com> References: <20180615140448.32234-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 15 Jun 2018 14:05:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 15 Jun 2018 14:05:27 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 12/13] nvdimm: make get_memory_region() perform checks and initialization X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S . Tsirkin" , Xiao Guangrong , David Hildenbrand , Alexander Graf , qemu-ppc@nongnu.org, Paolo Bonzini , Igor Mammedov , David Gibson , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We might get a call to get_memory_region() before the device has been realized. We should return a consistent value, as the return value will e.g. later on be used in the pre_plug handler. To avoid duplicating too much code, factor the initialization and checks out into a helper function. Signed-off-by: David Hildenbrand Reviewed-by: Igor Mammedov --- hw/mem/nvdimm.c | 46 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index df7646488b..deba5719bc 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -71,20 +71,24 @@ static void nvdimm_init(Object *obj) NULL, NULL); } =20 -static MemoryRegion *nvdimm_get_memory_region(PCDIMMDevice *dimm, Error **= errp) +static void nvdimm_prepare_memory_region(NVDIMMDevice *nvdimm, Error **err= p) { - NVDIMMDevice *nvdimm =3D NVDIMM(dimm); + PCDIMMDevice *dimm =3D PC_DIMM(nvdimm); + uint64_t align, pmem_size, size; + MemoryRegion *mr; =20 - return nvdimm->nvdimm_mr; -} + if (nvdimm->nvdimm_mr) { + return; + } =20 -static void nvdimm_realize(PCDIMMDevice *dimm, Error **errp) -{ - MemoryRegion *mr =3D host_memory_backend_get_memory(dimm->hostmem); - NVDIMMDevice *nvdimm =3D NVDIMM(dimm); - uint64_t align, pmem_size, size =3D memory_region_size(mr); + if (!dimm->hostmem) { + error_setg(errp, "'" PC_DIMM_MEMDEV_PROP "' property must be set"); + return; + } =20 + mr =3D host_memory_backend_get_memory(dimm->hostmem); align =3D memory_region_get_alignment(mr); + size =3D memory_region_size(mr); =20 pmem_size =3D size - nvdimm->label_size; nvdimm->label_data =3D memory_region_get_ram_ptr(mr) + pmem_size; @@ -108,6 +112,30 @@ static void nvdimm_realize(PCDIMMDevice *dimm, Error *= *errp) nvdimm->nvdimm_mr->align =3D align; } =20 +static MemoryRegion *nvdimm_get_memory_region(PCDIMMDevice *dimm, Error **= errp) +{ + NVDIMMDevice *nvdimm =3D NVDIMM(dimm); + Error *local_err =3D NULL; + + if (!nvdimm->nvdimm_mr) { + nvdimm_prepare_memory_region(nvdimm, &local_err); + if (local_err) { + error_propagate(errp, local_err); + return NULL; + } + } + return nvdimm->nvdimm_mr; +} + +static void nvdimm_realize(PCDIMMDevice *dimm, Error **errp) +{ + NVDIMMDevice *nvdimm =3D NVDIMM(dimm); + + if (!nvdimm->nvdimm_mr) { + nvdimm_prepare_memory_region(nvdimm, errp); + } +} + /* * the caller should check the input parameters before calling * label read/write functions. --=20 2.17.1 From nobody Tue May 7 15:51:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529072193403454.8578238762593; Fri, 15 Jun 2018 07:16:33 -0700 (PDT) Received: from localhost ([::1]:47077 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpWi-0001wy-M0 for importer@patchew.org; Fri, 15 Jun 2018 10:16:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTpMD-0001Sf-5J for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTpM7-0003s1-02 for qemu-devel@nongnu.org; Fri, 15 Jun 2018 10:05:41 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40528 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTpM6-0003ro-Qu; Fri, 15 Jun 2018 10:05:34 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 62D6740704B0; Fri, 15 Jun 2018 14:05:34 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-18.ams2.redhat.com [10.36.117.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0F0CE6352E; Fri, 15 Jun 2018 14:05:27 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 15 Jun 2018 16:04:48 +0200 Message-Id: <20180615140448.32234-14-david@redhat.com> In-Reply-To: <20180615140448.32234-1-david@redhat.com> References: <20180615140448.32234-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 15 Jun 2018 14:05:34 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 15 Jun 2018 14:05:34 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 13/13] pc-dimm: get_memory_region() will not fail after realize X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S . Tsirkin" , Xiao Guangrong , David Hildenbrand , Alexander Graf , qemu-ppc@nongnu.org, Paolo Bonzini , Igor Mammedov , David Gibson , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Let's try to reduce error handling a bit. In the plug/unplug case, the device was realized and therefore we can assume that getting access to the memory region will not fail. For get_vmstate_memory_region() this is already handled that way. Document both cases. Reviewed-by: Igor Mammedov Signed-off-by: David Hildenbrand Acked-by: David Gibson Reviewed-by: David Gibson --- hw/i386/pc.c | 7 +------ hw/mem/pc-dimm.c | 7 +------ hw/ppc/spapr.c | 12 ++---------- include/hw/mem/pc-dimm.h | 6 ++++-- 4 files changed, 8 insertions(+), 24 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 2db032a6df..f310040351 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1706,15 +1706,10 @@ static void pc_memory_plug(HotplugHandler *hotplug_= dev, PCMachineClass *pcmc =3D PC_MACHINE_GET_CLASS(pcms); PCDIMMDevice *dimm =3D PC_DIMM(dev); PCDIMMDeviceClass *ddc =3D PC_DIMM_GET_CLASS(dimm); - MemoryRegion *mr; + MemoryRegion *mr =3D ddc->get_memory_region(dimm, &error_abort); uint64_t align =3D TARGET_PAGE_SIZE; bool is_nvdimm =3D object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM); =20 - mr =3D ddc->get_memory_region(dimm, &local_err); - if (local_err) { - goto out; - } - if (memory_region_get_alignment(mr) && pcmc->enforce_aligned_dimm) { align =3D memory_region_get_alignment(mr); } diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 4ff39b59ef..65843bc52a 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -37,15 +37,10 @@ void pc_dimm_plug(DeviceState *dev, MachineState *machi= ne, uint64_t align, PCDIMMDeviceClass *ddc =3D PC_DIMM_GET_CLASS(dimm); MemoryRegion *vmstate_mr =3D ddc->get_vmstate_memory_region(dimm, &error_abort= ); + MemoryRegion *mr =3D ddc->get_memory_region(dimm, &error_abort); Error *local_err =3D NULL; - MemoryRegion *mr; uint64_t addr; =20 - mr =3D ddc->get_memory_region(dimm, &local_err); - if (local_err) { - goto out; - } - addr =3D object_property_get_uint(OBJECT(dimm), PC_DIMM_ADDR_PROP, &local_err); if (local_err) { diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 3e5320020f..6934abc21e 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3142,14 +3142,10 @@ static void spapr_memory_plug(HotplugHandler *hotpl= ug_dev, DeviceState *dev, sPAPRMachineState *ms =3D SPAPR_MACHINE(hotplug_dev); PCDIMMDevice *dimm =3D PC_DIMM(dev); PCDIMMDeviceClass *ddc =3D PC_DIMM_GET_CLASS(dimm); - MemoryRegion *mr; + MemoryRegion *mr =3D ddc->get_memory_region(dimm, &error_abort); uint64_t align, size, addr; uint32_t node; =20 - mr =3D ddc->get_memory_region(dimm, &local_err); - if (local_err) { - goto out; - } align =3D memory_region_get_alignment(mr); size =3D memory_region_size(mr); =20 @@ -3340,16 +3336,12 @@ static void spapr_memory_unplug_request(HotplugHand= ler *hotplug_dev, Error *local_err =3D NULL; PCDIMMDevice *dimm =3D PC_DIMM(dev); PCDIMMDeviceClass *ddc =3D PC_DIMM_GET_CLASS(dimm); - MemoryRegion *mr; + MemoryRegion *mr =3D ddc->get_memory_region(dimm, &error_abort); uint32_t nr_lmbs; uint64_t size, addr_start, addr; int i; sPAPRDRConnector *drc; =20 - mr =3D ddc->get_memory_region(dimm, &local_err); - if (local_err) { - goto out; - } size =3D memory_region_size(mr); nr_lmbs =3D size / SPAPR_MEMORY_BLOCK_SIZE; =20 diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h index 5679a80465..26ebb7d5e9 100644 --- a/include/hw/mem/pc-dimm.h +++ b/include/hw/mem/pc-dimm.h @@ -62,9 +62,11 @@ typedef struct PCDIMMDevice { * @realize: called after common dimm is realized so that the dimm based * devices get the chance to do specified operations. * @get_memory_region: returns #MemoryRegion associated with @dimm which - * is directly mapped into the physical address space of guest. + * is directly mapped into the physical address space of guest. Will not + * fail after the device was realized. * @get_vmstate_memory_region: returns #MemoryRegion which indicates the - * memory of @dimm should be kept during live migration. + * memory of @dimm should be kept during live migration. Will not fail + * after the device was realized. */ typedef struct PCDIMMDeviceClass { /* private */ --=20 2.17.1