From: David Gibson <david@gibson.dropbear.id.au>
To: Bharata B Rao <bharata@linux.vnet.ibm.com>
Cc: nfonteno@us.ibm.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [FIX PATCH] spapr: Fix ibm,lrdr-capacity
Date: Wed, 6 Apr 2016 15:19:06 +1000 [thread overview]
Message-ID: <20160406051906.GZ16485@voom.fritz.box> (raw)
In-Reply-To: <1459919166-21640-1-git-send-email-bharata@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1989 bytes --]
On Wed, Apr 06, 2016 at 10:36:06AM +0530, Bharata B Rao wrote:
> ibm,lrdr-capacity has a field to describe the maximum address in bytes
> and therefore, the most memory that can be allocated to this guest. We
> are using maxmem for this field, but instead should use the actual RAM
> address corresponding to the end of hotplug region.
>
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> ---
> Applies on ppc-for-2.6 branch of David Gibson's tree.
Thanks, applied to ppc-for-2.6.
>
> hw/ppc/spapr_rtas.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
> index 2db2292..f073258 100644
> --- a/hw/ppc/spapr_rtas.c
> +++ b/hw/ppc/spapr_rtas.c
> @@ -684,6 +684,9 @@ int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr,
> int i;
> uint32_t lrdr_capacity[5];
> MachineState *machine = MACHINE(qdev_get_machine());
> + sPAPRMachineState *spapr = SPAPR_MACHINE(machine);
> + uint64_t max_hotplug_addr = spapr->hotplug_memory.base +
> + memory_region_size(&spapr->hotplug_memory.mr);
>
> ret = fdt_add_mem_rsv(fdt, rtas_addr, rtas_size);
> if (ret < 0) {
> @@ -733,8 +736,8 @@ int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr,
>
> }
>
> - lrdr_capacity[0] = cpu_to_be32(((uint64_t)machine->maxram_size) >> 32);
> - lrdr_capacity[1] = cpu_to_be32(machine->maxram_size & 0xffffffff);
> + lrdr_capacity[0] = cpu_to_be32(max_hotplug_addr >> 32);
> + lrdr_capacity[1] = cpu_to_be32(max_hotplug_addr & 0xffffffff);
> lrdr_capacity[2] = 0;
> lrdr_capacity[3] = cpu_to_be32(SPAPR_MEMORY_BLOCK_SIZE);
> lrdr_capacity[4] = cpu_to_be32(max_cpus/smp_threads);
--
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: 819 bytes --]
prev parent reply other threads:[~2016-04-06 6:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-06 5:06 [Qemu-devel] [FIX PATCH] spapr: Fix ibm,lrdr-capacity Bharata B Rao
2016-04-06 5:19 ` David Gibson [this message]
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=20160406051906.GZ16485@voom.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=bharata@linux.vnet.ibm.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=nfonteno@us.ibm.com \
--cc=qemu-devel@nongnu.org \
/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).