All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: David Hildenbrand <david@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-s390x@nongnu.org,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>,
	Marcel Apfelbaum <marcel@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <rth@twiddle.net>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-ppc@nongnu.org, Pankaj Gupta <pagupta@redhat.com>,
	Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH v4 10/11] spapr: rename "hotplug memory" terminology to "device memory"
Date: Tue, 24 Apr 2018 09:29:30 +1000	[thread overview]
Message-ID: <20180423232930.GJ19804@umbus.fritz.box> (raw)
In-Reply-To: <20180423165126.15441-11-david@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 6244 bytes --]

On Mon, Apr 23, 2018 at 06:51:25PM +0200, David Hildenbrand wrote:
> 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 <david@redhat.com>

Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  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(sPAPRMachineState *spapr, void *fdt)
>      int ret, i, offset;
>      uint64_t lmb_size = SPAPR_MEMORY_BLOCK_SIZE;
>      uint32_t prop_lmb_size[] = {0, cpu_to_be32(lmb_size)};
> -    uint32_t hotplug_lmb_start = machine->device_memory->base / lmb_size;
> +    uint32_t device_lmb_start = machine->device_memory->base / lmb_size;
>      uint32_t nr_lmbs = (machine->device_memory->base +
>                         memory_region_size(&machine->device_memory->mr)) /
>                         lmb_size;
> @@ -690,7 +690,7 @@ static int spapr_populate_drconf_memory(sPAPRMachineState *spapr, void *fdt)
>      MemoryDeviceInfoList *dimms = NULL;
>  
>      /*
> -     * 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 == machine->maxram_size) {
>          return 0;
> @@ -722,7 +722,7 @@ static int spapr_populate_drconf_memory(sPAPRMachineState *spapr, void *fdt)
>          goto out;
>      }
>  
> -    if (hotplug_lmb_start) {
> +    if (device_lmb_start) {
>          dimms = qmp_memory_device_list();
>      }
>  
> @@ -733,7 +733,7 @@ static int spapr_populate_drconf_memory(sPAPRMachineState *spapr, void *fdt)
>          uint64_t addr = i * lmb_size;
>          uint32_t *dynamic_memory = cur_index;
>  
> -        if (i >= hotplug_lmb_start) {
> +        if (i >= device_lmb_start) {
>              sPAPRDRConnector *drc;
>  
>              drc = spapr_drc_by_id(TYPE_SPAPR_DRC_LMB, i);
> @@ -752,7 +752,7 @@ static int spapr_populate_drconf_memory(sPAPRMachineState *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] = cpu_to_be32(addr >> 32);
> @@ -903,11 +903,11 @@ static void spapr_dt_rtas(sPAPRMachineState *spapr, void *fdt)
>      GString *hypertas = g_string_sized_new(256);
>      GString *qemu_hypertas = g_string_sized_new(256);
>      uint32_t refpoints[] = { cpu_to_be32(0x4), cpu_to_be32(0x4) };
> -    uint64_t max_hotplug_addr = MACHINE(spapr)->device_memory->base +
> +    uint64_t max_device_addr = MACHINE(spapr)->device_memory->base +
>          memory_region_size(&MACHINE(spapr)->device_memory->mr);
>      uint32_t lrdr_capacity[] = {
> -        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)
>  
>      /* initialize device memory address space */
>      if (machine->ram_size < machine->maxram_size) {
> -        ram_addr_t hotplug_mem_size = machine->maxram_size - machine->ram_size;
> +        ram_addr_t device_mem_size = 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 other
> @@ -2551,9 +2551,9 @@ static void spapr_machine_init(MachineState *machine)
>          }
>  
>          machine->device_memory->base = 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 *spapr, uint32_t index,
>      hwaddr phb0_base, phb_base;
>      int i;
>  
> -    /* 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 = 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
>  
> -/* 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)
>  
>  /*
>   * Number of 32 bit words in each LMB list entry in ibm,dynamic-memory

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-04-23 23:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-23 16:51 [Qemu-devel] [PATCH v4 00/11] pc-dimm: factor out MemoryDevice David Hildenbrand
2018-04-23 16:51 ` [Qemu-devel] [PATCH v4 01/11] pc-dimm: factor out MemoryDevice interface David Hildenbrand
2018-04-23 16:51 ` [Qemu-devel] [PATCH v4 02/11] machine: make MemoryHotplugState accessible via the machine David Hildenbrand
2018-05-04 19:26   ` Eduardo Habkost
2018-05-05  5:34     ` Marcel Apfelbaum
2018-05-07  8:42     ` [Qemu-devel] [qemu-s390x] " David Hildenbrand
2018-05-10 16:57     ` [Qemu-devel] " Paolo Bonzini
2018-05-10 17:52       ` Eduardo Habkost
2018-05-14  6:31         ` Markus Armbruster
2018-04-23 16:51 ` [Qemu-devel] [PATCH v4 03/11] pc-dimm: no need to pass the memory region David Hildenbrand
2018-04-23 16:51 ` [Qemu-devel] [PATCH v4 04/11] pc-dimm: pass in the machine and to the MemoryHotplugState David Hildenbrand
2018-04-23 16:51 ` [Qemu-devel] [PATCH v4 05/11] pc-dimm: factor out address search into MemoryDevice code David Hildenbrand
2018-04-23 16:51 ` [Qemu-devel] [PATCH v4 06/11] pc-dimm: factor out capacity and slot checks into MemoryDevice David Hildenbrand
2018-04-23 16:51 ` [Qemu-devel] [PATCH v4 07/11] pc-dimm: move actual plug/unplug of a memory region to MemoryDevice David Hildenbrand
2018-04-23 16:51 ` [Qemu-devel] [PATCH v4 08/11] machine: rename MemoryHotplugState to DeviceMemoryState David Hildenbrand
2018-04-23 16:51 ` [Qemu-devel] [PATCH v4 09/11] pc: rename "hotplug memory" terminology to "device memory" David Hildenbrand
2018-04-23 16:51 ` [Qemu-devel] [PATCH v4 10/11] spapr: " David Hildenbrand
2018-04-23 23:29   ` David Gibson [this message]
2018-04-23 16:51 ` [Qemu-devel] [PATCH v4 11/11] vl: allow 'maxmem' without 'slot' David Hildenbrand
2018-04-23 17:40 ` [Qemu-devel] [PATCH v4 00/11] pc-dimm: factor out MemoryDevice Michael S. Tsirkin
2018-04-23 20:47   ` Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180423232930.GJ19804@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=armbru@redhat.com \
    --cc=david@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=marcel@redhat.com \
    --cc=mst@redhat.com \
    --cc=pagupta@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.