From nobody Thu Nov 6 12:10:25 2025 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=linux.intel.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1540832991298302.86217592693265; Mon, 29 Oct 2018 10:09:51 -0700 (PDT) Received: from localhost ([::1]:47204 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHB30-0006YI-6D for importer@patchew.org; Mon, 29 Oct 2018 13:09:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHAxA-0002CK-CJ for qemu-devel@nongnu.org; Mon, 29 Oct 2018 13:03:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHAx7-0004m4-8Q for qemu-devel@nongnu.org; Mon, 29 Oct 2018 13:03:48 -0400 Received: from mga06.intel.com ([134.134.136.31]:16083) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gHAx6-0004bA-TJ for qemu-devel@nongnu.org; Mon, 29 Oct 2018 13:03:45 -0400 Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Oct 2018 10:03:29 -0700 Received: from mjadwisz-mobl.ger.corp.intel.com (HELO localhost.localdomain) ([10.252.7.64]) by fmsmga006.fm.intel.com with ESMTP; 29 Oct 2018 10:03:27 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,441,1534834800"; d="scan'208";a="276598977" From: Samuel Ortiz To: qemu-devel@nongnu.org Date: Mon, 29 Oct 2018 18:01:52 +0100 Message-Id: <20181029170159.3801-13-sameo@linux.intel.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181029170159.3801-1-sameo@linux.intel.com> References: <20181029170159.3801-1-sameo@linux.intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.31 Subject: [Qemu-devel] [PATCH v3 12/19] hw: i386: Make the hotpluggable memory size property more generic 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" , Paolo Bonzini , Igor Mammedov , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This property is currently defined under i386/pc while it only describes a region size that's eventually fetched from the AML ACPI code. We can make it more generic and shareable across machine types by moving it to memory-device.h instead. Signed-off-by: Samuel Ortiz --- hw/i386/acpi-build.c | 2 +- hw/i386/pc.c | 3 ++- include/hw/i386/pc.h | 1 - include/hw/mem/memory-device.h | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 414a6c4c4e..dfc02a8a85 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1630,7 +1630,7 @@ build_srat(GArray *table_data, BIOSLinker *linker, MachineClass *mc =3D MACHINE_GET_CLASS(machine); const CPUArchIdList *apic_ids =3D mc->possible_cpu_arch_ids(machine); ram_addr_t hotplugabble_address_space_size =3D - object_property_get_int(OBJECT(machine), PC_MACHINE_DEVMEM_REGION_= SIZE, + object_property_get_int(OBJECT(machine), MEMORY_DEVICE_REGION_SIZE, NULL); =20 srat_start =3D table_data->len; diff --git a/hw/i386/pc.c b/hw/i386/pc.c index bd4a77b856..1dcbbd5139 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -67,6 +67,7 @@ #include "hw/boards.h" #include "acpi-build.h" #include "hw/mem/pc-dimm.h" +#include "hw/mem/memory-device.h" #include "qapi/error.h" #include "qapi/qapi-visit-common.h" #include "qapi/visitor.h" @@ -2442,7 +2443,7 @@ static void pc_machine_class_init(ObjectClass *oc, vo= id *data) nc->nmi_monitor_handler =3D x86_nmi; mc->default_cpu_type =3D TARGET_DEFAULT_CPU_TYPE; =20 - object_class_property_add(oc, PC_MACHINE_DEVMEM_REGION_SIZE, "int", + object_class_property_add(oc, MEMORY_DEVICE_REGION_SIZE, "int", pc_machine_get_device_memory_region_size, NULL, NULL, NULL, &error_abort); =20 diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index da0bd39741..7d177cd207 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -62,7 +62,6 @@ struct PCMachineState { }; =20 #define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device" -#define PC_MACHINE_DEVMEM_REGION_SIZE "device-memory-region-size" #define PC_MACHINE_MAX_RAM_BELOW_4G "max-ram-below-4g" #define PC_MACHINE_VMPORT "vmport" #define PC_MACHINE_SMM "smm" diff --git a/include/hw/mem/memory-device.h b/include/hw/mem/memory-device.h index e904e194d5..d9a4fc7c3e 100644 --- a/include/hw/mem/memory-device.h +++ b/include/hw/mem/memory-device.h @@ -97,6 +97,8 @@ typedef struct MemoryDeviceClass { MemoryDeviceInfo *info); } MemoryDeviceClass; =20 +#define MEMORY_DEVICE_REGION_SIZE "memory-device-region-size" + MemoryDeviceInfoList *qmp_memory_device_list(void); uint64_t get_plugged_memory_size(void); void memory_device_pre_plug(MemoryDeviceState *md, MachineState *ms, --=20 2.17.2