All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Thomas Huth <thuth@redhat.com>
Cc: qemu-devel@nongnu.org, imammedo@redhat.com, aik@ozlabs.ru,
	agraf@suse.de, mdroth@linux.vnet.ibm.com, qemu-ppc@nongnu.org,
	tyreld@linux.vnet.ibm.com,
	Bharata B Rao <bharata@linux.vnet.ibm.com>,
	nfont@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH v6 2/6] spapr: Add LMB DR connectors
Date: Tue, 7 Jul 2015 11:35:39 +1000	[thread overview]
Message-ID: <20150707013539.GI17857@voom.redhat.com> (raw)
In-Reply-To: <20150706174948.5dc3b8a8@thh440s>

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

On Mon, Jul 06, 2015 at 05:49:48PM +0200, Thomas Huth wrote:
> 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.

I've added a patch to correct this to spapr-next.

-- 
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: Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-07-07  2:29 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
2015-07-07  1:35     ` David Gibson [this message]
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=20150707013539.GI17857@voom.redhat.com \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=bharata@linux.vnet.ibm.com \
    --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=thuth@redhat.com \
    --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 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.