From nobody Wed Oct 29 22:59:57 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525713247665295.4919537299281; Mon, 7 May 2018 10:14:07 -0700 (PDT) Received: from localhost ([::1]:47292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fFjiA-0006Ei-RQ for importer@patchew.org; Mon, 07 May 2018 13:14:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fFjYR-0006hI-7g for qemu-devel@nongnu.org; Mon, 07 May 2018 13:04:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fFjYP-0007wS-0d for qemu-devel@nongnu.org; Mon, 07 May 2018 13:04:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60930) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fFjYO-0007vr-Pc for qemu-devel@nongnu.org; Mon, 07 May 2018 13:04:00 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0A9384E02E; Mon, 7 May 2018 17:04:00 +0000 (UTC) Received: from localhost (ovpn-116-33.gru2.redhat.com [10.97.116.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 340D01057FA5; Mon, 7 May 2018 17:03:54 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 7 May 2018 14:03:12 -0300 Message-Id: <20180507170315.11497-10-ehabkost@redhat.com> In-Reply-To: <20180507170315.11497-1-ehabkost@redhat.com> References: <20180507170315.11497-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 07 May 2018 17:04:00 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 09/12] pc: rename "hotplug memory" terminology to "device 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: David Hildenbrand 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" From: David Hildenbrand Let's make it clear that we are dealing with device memory. That it can be used for memory hotplug is just a special case. Signed-off-by: David Hildenbrand Message-Id: <20180423165126.15441-10-david@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Eduardo Habkost --- include/hw/i386/pc.h | 2 +- hw/i386/acpi-build.c | 2 +- hw/i386/pc.c | 25 ++++++++++++------------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 07b596ee76..2e834e6ded 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -71,7 +71,7 @@ struct PCMachineState { }; =20 #define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device" -#define PC_MACHINE_MEMHP_REGION_SIZE "hotplug-memory-region-size" +#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/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index b1eddeb204..9bc6d97ea1 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2313,7 +2313,7 @@ build_srat(GArray *table_data, BIOSLinker *linker, Ma= chineState *machine) const CPUArchIdList *apic_ids =3D mc->possible_cpu_arch_ids(machine); PCMachineState *pcms =3D PC_MACHINE(machine); ram_addr_t hotplugabble_address_space_size =3D - object_property_get_int(OBJECT(pcms), PC_MACHINE_MEMHP_REGION_SIZE, + object_property_get_int(OBJECT(pcms), PC_MACHINE_DEVMEM_REGION_SIZ= E, NULL); =20 srat_start =3D table_data->len; diff --git a/hw/i386/pc.c b/hw/i386/pc.c index e94e63dc6c..868893d0a1 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1374,11 +1374,10 @@ void pc_memory_init(PCMachineState *pcms, /* always allocate the device memory information */ machine->device_memory =3D g_malloc0(sizeof(*machine->device_memory)); =20 - /* initialize hotplug memory address space */ + /* initialize device memory address space */ if (pcmc->has_reserved_memory && (machine->ram_size < machine->maxram_size)) { - ram_addr_t hotplug_mem_size =3D - machine->maxram_size - machine->ram_size; + ram_addr_t device_mem_size =3D machine->maxram_size - machine->ram= _size; =20 if (machine->ram_slots > ACPI_MAX_RAM_SLOTS) { error_report("unsupported amount of memory slots: %"PRIu64, @@ -1397,19 +1396,19 @@ void pc_memory_init(PCMachineState *pcms, ROUND_UP(0x100000000ULL + pcms->above_4g_mem_size, 1ULL << 30); =20 if (pcmc->enforce_aligned_dimm) { - /* size hotplug region assuming 1G page max alignment per slot= */ - hotplug_mem_size +=3D (1ULL << 30) * machine->ram_slots; + /* size device region assuming 1G page max alignment per slot = */ + device_mem_size +=3D (1ULL << 30) * machine->ram_slots; } =20 - if ((machine->device_memory->base + hotplug_mem_size) < - hotplug_mem_size) { + if ((machine->device_memory->base + device_mem_size) < + device_mem_size) { error_report("unsupported amount of maximum memory: " RAM_ADDR= _FMT, machine->maxram_size); exit(EXIT_FAILURE); } =20 memory_region_init(&machine->device_memory->mr, OBJECT(pcms), - "hotplug-memory", hotplug_mem_size); + "device-memory", device_mem_size); memory_region_add_subregion(system_memory, machine->device_memory-= >base, &machine->device_memory->mr); } @@ -2064,9 +2063,9 @@ static HotplugHandler *pc_get_hotpug_handler(MachineS= tate *machine, } =20 static void -pc_machine_get_hotplug_memory_region_size(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +pc_machine_get_device_memory_region_size(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { MachineState *ms =3D MACHINE(obj); int64_t value =3D memory_region_size(&ms->device_memory->mr); @@ -2373,8 +2372,8 @@ 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_MEMHP_REGION_SIZE, "int", - pc_machine_get_hotplug_memory_region_size, NULL, + object_class_property_add(oc, PC_MACHINE_DEVMEM_REGION_SIZE, "int", + pc_machine_get_device_memory_region_size, NULL, NULL, NULL, &error_abort); =20 object_class_property_add(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "size", --=20 2.14.3