From nobody Sun Feb 8 22:34:47 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 1524502857815691.0130020018453; Mon, 23 Apr 2018 10:00:57 -0700 (PDT) Received: from localhost ([::1]:54566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fAepb-0006EQ-I5 for importer@patchew.org; Mon, 23 Apr 2018 13:00:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fAehU-0007vr-DL for qemu-devel@nongnu.org; Mon, 23 Apr 2018 12:52:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fAehT-0000Bh-CL for qemu-devel@nongnu.org; Mon, 23 Apr 2018 12:52:24 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59182 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 1fAehT-0000BU-72; Mon, 23 Apr 2018 12:52:23 -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 B224B81A88C8; Mon, 23 Apr 2018 16:52:22 +0000 (UTC) Received: from t460s.redhat.com (unknown [10.36.118.87]) by smtp.corp.redhat.com (Postfix) with ESMTP id 920877C53; Mon, 23 Apr 2018 16:52:20 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Mon, 23 Apr 2018 18:51:25 +0200 Message-Id: <20180423165126.15441-11-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.8]); Mon, 23 Apr 2018 16:52:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Mon, 23 Apr 2018 16:52:22 +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 10/11] spapr: 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 at relevant places 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 Acked-by: David Gibson --- hw/ppc/spapr.c | 28 ++++++++++++++-------------- include/hw/ppc/spapr.h | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 8ecb716f72..a32b88e41d 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -681,7 +681,7 @@ static int spapr_populate_drconf_memory(sPAPRMachineSta= te *spapr, void *fdt) int ret, i, offset; uint64_t lmb_size =3D SPAPR_MEMORY_BLOCK_SIZE; uint32_t prop_lmb_size[] =3D {0, cpu_to_be32(lmb_size)}; - uint32_t hotplug_lmb_start =3D machine->device_memory->base / lmb_size; + uint32_t device_lmb_start =3D machine->device_memory->base / lmb_size; uint32_t nr_lmbs =3D (machine->device_memory->base + memory_region_size(&machine->device_memory->mr)) / lmb_size; @@ -690,7 +690,7 @@ static int spapr_populate_drconf_memory(sPAPRMachineSta= te *spapr, void *fdt) MemoryDeviceInfoList *dimms =3D NULL; =20 /* - * Don't create the node if there is no hotpluggable memory + * Don't create the node if there is no device memory */ if (machine->ram_size =3D=3D machine->maxram_size) { return 0; @@ -722,7 +722,7 @@ static int spapr_populate_drconf_memory(sPAPRMachineSta= te *spapr, void *fdt) goto out; } =20 - if (hotplug_lmb_start) { + if (device_lmb_start) { dimms =3D qmp_memory_device_list(); } =20 @@ -733,7 +733,7 @@ static int spapr_populate_drconf_memory(sPAPRMachineSta= te *spapr, void *fdt) uint64_t addr =3D i * lmb_size; uint32_t *dynamic_memory =3D cur_index; =20 - if (i >=3D hotplug_lmb_start) { + if (i >=3D device_lmb_start) { sPAPRDRConnector *drc; =20 drc =3D spapr_drc_by_id(TYPE_SPAPR_DRC_LMB, i); @@ -752,7 +752,7 @@ static int spapr_populate_drconf_memory(sPAPRMachineSta= te *spapr, void *fdt) } else { /* * LMB information for RMA, boot time RAM and gap b/n RAM and - * hotplug memory region -- all these are marked as reserved + * device memory region -- all these are marked as reserved * and as having no valid DRC. */ dynamic_memory[0] =3D cpu_to_be32(addr >> 32); @@ -903,11 +903,11 @@ static void spapr_dt_rtas(sPAPRMachineState *spapr, v= oid *fdt) GString *hypertas =3D g_string_sized_new(256); GString *qemu_hypertas =3D g_string_sized_new(256); uint32_t refpoints[] =3D { cpu_to_be32(0x4), cpu_to_be32(0x4) }; - uint64_t max_hotplug_addr =3D MACHINE(spapr)->device_memory->base + + uint64_t max_device_addr =3D MACHINE(spapr)->device_memory->base + memory_region_size(&MACHINE(spapr)->device_memory->mr); uint32_t lrdr_capacity[] =3D { - cpu_to_be32(max_hotplug_addr >> 32), - cpu_to_be32(max_hotplug_addr & 0xffffffff), + cpu_to_be32(max_device_addr >> 32), + cpu_to_be32(max_device_addr & 0xffffffff), 0, cpu_to_be32(SPAPR_MEMORY_BLOCK_SIZE), cpu_to_be32(max_cpus / smp_threads), }; @@ -2531,7 +2531,7 @@ static void spapr_machine_init(MachineState *machine) =20 /* initialize device memory address space */ if (machine->ram_size < machine->maxram_size) { - ram_addr_t hotplug_mem_size =3D machine->maxram_size - machine->ra= m_size; + ram_addr_t device_mem_size =3D machine->maxram_size - machine->ram= _size; /* * Limit the number of hotpluggable memory slots to half the number * slots that KVM supports, leaving the other half for PCI and oth= er @@ -2551,9 +2551,9 @@ static void spapr_machine_init(MachineState *machine) } =20 machine->device_memory->base =3D ROUND_UP(machine->ram_size, - SPAPR_HOTPLUG_MEM_ALIGN); + SPAPR_DEVICE_MEM_ALIGN); memory_region_init(&machine->device_memory->mr, OBJECT(spapr), - "hotplug-memory", hotplug_mem_size); + "device-memory", device_mem_size); memory_region_add_subregion(sysmem, machine->device_memory->base, &machine->device_memory->mr); } @@ -4154,11 +4154,11 @@ static void phb_placement_2_7(sPAPRMachineState *sp= apr, uint32_t index, hwaddr phb0_base, phb_base; int i; =20 - /* Do we have hotpluggable memory? */ + /* Do we have device memory? */ if (MACHINE(spapr)->maxram_size > ram_top) { /* Can't just use maxram_size, because there may be an - * alignment gap between normal and hotpluggable memory - * regions */ + * alignment gap between normal and device memory regions + */ ram_top =3D MACHINE(spapr)->device_memory->base + memory_region_size(&MACHINE(spapr)->device_memory->mr); } diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 56ff02d32a..3388750fc7 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -747,8 +747,8 @@ int spapr_rng_populate_dt(void *fdt); */ #define SPAPR_MAX_RAM_SLOTS 32 =20 -/* 1GB alignment for hotplug memory region */ -#define SPAPR_HOTPLUG_MEM_ALIGN (1ULL << 30) +/* 1GB alignment for device memory region */ +#define SPAPR_DEVICE_MEM_ALIGN (1ULL << 30) =20 /* * Number of 32 bit words in each LMB list entry in ibm,dynamic-memory --=20 2.14.3