From nobody Sun Feb 8 20:34:16 2026 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 1524503002872756.1055340573793; Mon, 23 Apr 2018 10:03:22 -0700 (PDT) Received: from localhost ([::1]:54595 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fAes6-0007v8-3b for importer@patchew.org; Mon, 23 Apr 2018 13:03:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fAehS-0007vU-6R for qemu-devel@nongnu.org; Mon, 23 Apr 2018 12:52:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fAehR-00009z-1F for qemu-devel@nongnu.org; Mon, 23 Apr 2018 12:52:22 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:48156 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 1fAehQ-00009J-S0; Mon, 23 Apr 2018 12:52:20 -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 55C24406E974; Mon, 23 Apr 2018 16:52:20 +0000 (UTC) Received: from t460s.redhat.com (unknown [10.36.118.87]) by smtp.corp.redhat.com (Postfix) with ESMTP id 486CE7C53; Mon, 23 Apr 2018 16:52:11 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Mon, 23 Apr 2018 18:51:24 +0200 Message-Id: <20180423165126.15441-10-david@redhat.com> In-Reply-To: <20180423165126.15441-1-david@redhat.com> References: <20180423165126.15441-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]); Mon, 23 Apr 2018 16:52:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 23 Apr 2018 16:52:20 +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 v4 09/11] 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: Pankaj Gupta , Eduardo Habkost , "Michael S . Tsirkin" , David Hildenbrand , Markus Armbruster , Alexander Graf , qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Marcel Apfelbaum , 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 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 --- hw/i386/acpi-build.c | 2 +- hw/i386/pc.c | 25 ++++++++++++------------- include/hw/i386/pc.h | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 70b37e6df4..123430fbff 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 4b2ede9029..afbdf48fbb 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_malloc(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", 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" --=20 2.14.3