qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Bharata B Rao <bharata@linux.vnet.ibm.com>, david@gibson.dropbear.id.au
Cc: agraf@suse.de, aik@ozlabs.ru, mdroth@linux.vnet.ibm.com,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	tyreld@linux.vnet.ibm.com, imammedo@redhat.com,
	nfont@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH v6 2/6] spapr: Add LMB DR connectors
Date: Mon, 6 Jul 2015 17:49:48 +0200	[thread overview]
Message-ID: <20150706174948.5dc3b8a8@thh440s> (raw)
In-Reply-To: <1435567472-20338-3-git-send-email-bharata@linux.vnet.ibm.com>

On Mon, 29 Jun 2015 14:14:28 +0530
Bharata B Rao <bharata@linux.vnet.ibm.com> wrote:

> Enable memory hotplug for pseries 2.4 and add LMB DR connectors.
> With memory hotplug, enforce RAM size, NUMA node memory size and maxmem
> to be a multiple of SPAPR_MEMORY_BLOCK_SIZE (256M) since that's the
> granularity in which LMBs are represented and hot-added.
> 
> LMB DR connectors will be used by the memory hotplug code.
> 
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
>                [spapr_drc_reset implementation]
> ---
>  hw/ppc/spapr.c         | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  include/hw/ppc/spapr.h |  1 +
>  2 files changed, 89 insertions(+)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 241ecad..bee868c 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
...
> +/*
> + * If RAM size, maxmem size and individual node mem sizes aren't aligned
> + * to SPAPR_MEMORY_BLOCK_SIZE(256MB), then refuse to start the guest
> + * since we can't support such unaligned sizes with DRCONF_MEMORY.
> + */
> +static void spapr_validate_node_memory(MachineState *machine)
> +{
> +    int i;
> +
> +    if (machine->maxram_size % SPAPR_MEMORY_BLOCK_SIZE ||
> +        machine->ram_size % SPAPR_MEMORY_BLOCK_SIZE) {
> +        error_report("Can't support memory configuration where RAM size "
> +                     "0x" RAM_ADDR_FMT " or maxmem size "
> +                     "0x" RAM_ADDR_FMT " isn't aligned to %lld MB",
> +                     machine->ram_size, machine->maxram_size,
> +                     SPAPR_MEMORY_BLOCK_SIZE/M_BYTE);
> +        exit(EXIT_FAILURE);
> +    }
> +
> +    for (i = 0; i < nb_numa_nodes; i++) {
> +        if (numa_info[i].node_mem &&
> +            numa_info[i].node_mem % SPAPR_MEMORY_BLOCK_SIZE) {
> +            error_report("Can't support memory configuration where memory "
> +                         "size %lx of node %d isn't aligned to %lld MB",
> +                         numa_info[i].node_mem, i,
> +                         SPAPR_MEMORY_BLOCK_SIZE/M_BYTE);

FYI, this causes a compiler warning when compiling for a 32-bit host:

hw/ppc/spapr.c: In function 'spapr_validate_node_memory':
hw/ppc/spapr.c:1638:26: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'uint64_t' [-Wformat=]

I think you have to use PRIx64 or something similar here.

 Thomas

  parent reply	other threads:[~2015-07-06 15:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-29  8:44 [Qemu-devel] [PATCH v6 0/6] Memory hotplug for PowerPC sPAPR guests Bharata B Rao
2015-06-29  8:44 ` [Qemu-devel] [PATCH v6 1/6] spapr: Initialize hotplug memory address space Bharata B Rao
2015-06-29  8:44 ` [Qemu-devel] [PATCH v6 2/6] spapr: Add LMB DR connectors Bharata B Rao
2015-06-29 16:36   ` Thomas Huth
2015-06-30  3:19   ` David Gibson
2015-07-06 15:49   ` Thomas Huth [this message]
2015-07-07  1:35     ` David Gibson
2015-06-29  8:44 ` [Qemu-devel] [PATCH v6 3/6] spapr: Support ibm, dynamic-reconfiguration-memory Bharata B Rao
2015-06-29  8:44 ` [Qemu-devel] [PATCH v6 4/6] spapr: Make hash table size a factor of maxram_size Bharata B Rao
2015-06-29  8:44 ` [Qemu-devel] [PATCH v6 5/6] spapr: Memory hotplug support Bharata B Rao
2015-06-30  3:25   ` David Gibson
2015-06-29  8:44 ` [Qemu-devel] [PATCH v6 6/6] spapr: Don't allow memory hotplug to memory less nodes Bharata B Rao
2015-06-30  3:26 ` [Qemu-devel] [PATCH v6 0/6] Memory hotplug for PowerPC sPAPR guests David Gibson
2015-06-30  3:43   ` Bharata B Rao

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=20150706174948.5dc3b8a8@thh440s \
    --to=thuth@redhat.com \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=imammedo@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=nfont@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=tyreld@linux.vnet.ibm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).