* [Qemu-devel] [PATCH] spapr: Don't create ibm, dynamic-reconfiguration-memory w/o DR LMBs
@ 2016-01-19 4:39 Bharata B Rao
2016-01-19 5:00 ` David Gibson
0 siblings, 1 reply; 4+ messages in thread
From: Bharata B Rao @ 2016-01-19 4:39 UTC (permalink / raw)
To: qemu-devel; +Cc: Bharata B Rao, qemu-ppc, david
If guest doesn't have any dynamically reconfigurable (DR) logical memory
blocks (LMB), then we shouldn't create ibm,dynamic-reconfiguration-memory
device tree node.
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
---
This applies against ppc-for-2.6 branch of David Gibson's tree.
hw/ppc/spapr.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 50e5a26..86e5023 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -763,6 +763,13 @@ static int spapr_populate_drconf_memory(sPAPRMachineState *spapr, void *fdt)
int nr_nodes = nb_numa_nodes ? nb_numa_nodes : 1;
/*
+ * Don't create the node if there are no DR LMBs.
+ */
+ if (!nr_lmbs) {
+ return 0;
+ }
+
+ /*
* Allocate enough buffer size to fit in ibm,dynamic-memory
* or ibm,associativity-lookup-arrays
*/
@@ -868,7 +875,7 @@ int spapr_h_cas_compose_response(sPAPRMachineState *spapr,
_FDT((spapr_fixup_cpu_dt(fdt, spapr)));
}
- /* Generate memory nodes or ibm,dynamic-reconfiguration-memory node */
+ /* Generate ibm,dynamic-reconfiguration-memory node if required */
if (memory_update && smc->dr_lmb_enabled) {
_FDT((spapr_populate_drconf_memory(spapr, fdt)));
}
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] spapr: Don't create ibm, dynamic-reconfiguration-memory w/o DR LMBs
2016-01-19 4:39 [Qemu-devel] [PATCH] spapr: Don't create ibm, dynamic-reconfiguration-memory w/o DR LMBs Bharata B Rao
@ 2016-01-19 5:00 ` David Gibson
2016-01-20 5:30 ` Bharata B Rao
0 siblings, 1 reply; 4+ messages in thread
From: David Gibson @ 2016-01-19 5:00 UTC (permalink / raw)
To: Bharata B Rao; +Cc: qemu-ppc, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1701 bytes --]
On Tue, Jan 19, 2016 at 10:09:21AM +0530, Bharata B Rao wrote:
> If guest doesn't have any dynamically reconfigurable (DR) logical memory
> blocks (LMB), then we shouldn't create ibm,dynamic-reconfiguration-memory
> device tree node.
>
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> ---
> This applies against ppc-for-2.6 branch of David Gibson's tree.
Applied to ppc-for-2.6, thanks.
>
> hw/ppc/spapr.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 50e5a26..86e5023 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -763,6 +763,13 @@ static int spapr_populate_drconf_memory(sPAPRMachineState *spapr, void *fdt)
> int nr_nodes = nb_numa_nodes ? nb_numa_nodes : 1;
>
> /*
> + * Don't create the node if there are no DR LMBs.
> + */
> + if (!nr_lmbs) {
> + return 0;
> + }
> +
> + /*
> * Allocate enough buffer size to fit in ibm,dynamic-memory
> * or ibm,associativity-lookup-arrays
> */
> @@ -868,7 +875,7 @@ int spapr_h_cas_compose_response(sPAPRMachineState *spapr,
> _FDT((spapr_fixup_cpu_dt(fdt, spapr)));
> }
>
> - /* Generate memory nodes or ibm,dynamic-reconfiguration-memory node */
> + /* Generate ibm,dynamic-reconfiguration-memory node if required */
> if (memory_update && smc->dr_lmb_enabled) {
> _FDT((spapr_populate_drconf_memory(spapr, fdt)));
> }
--
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 --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] spapr: Don't create ibm, dynamic-reconfiguration-memory w/o DR LMBs
2016-01-19 5:00 ` David Gibson
@ 2016-01-20 5:30 ` Bharata B Rao
2016-01-21 1:13 ` David Gibson
0 siblings, 1 reply; 4+ messages in thread
From: Bharata B Rao @ 2016-01-20 5:30 UTC (permalink / raw)
To: David Gibson; +Cc: aik, qemu-ppc, qemu-devel
On Tue, Jan 19, 2016 at 04:00:25PM +1100, David Gibson wrote:
> On Tue, Jan 19, 2016 at 10:09:21AM +0530, Bharata B Rao wrote:
> > If guest doesn't have any dynamically reconfigurable (DR) logical memory
> > blocks (LMB), then we shouldn't create ibm,dynamic-reconfiguration-memory
> > device tree node.
> >
> > Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> > ---
> > This applies against ppc-for-2.6 branch of David Gibson's tree.
>
> Applied to ppc-for-2.6, thanks.
There is a slight change in memory nodes representation in DT after this fix
that could result in the following behaviour before and after migration.
For a guest with -m 4G -numa node,nodeid=0,mem=2G -numa node,nodeid=1,mem=2G,
the DT under /proc/device-tree changes like this:
Guest started with QEMU w/o this fix
------------------------------------
memory@0
memory@80000000
ibm,dynamic-reconfiguration-memory
Guest migrated to QEMU w/ this fix included
-------------------------------------------
memory@0
memory@80000000
ibm,dynamic-reconfiguration-memory
After next reboot
-----------------
memory@0
memory@80000000
I guess this is ok, but wanted to sound out this change explicitly.
Regards,
Bharata.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] spapr: Don't create ibm, dynamic-reconfiguration-memory w/o DR LMBs
2016-01-20 5:30 ` Bharata B Rao
@ 2016-01-21 1:13 ` David Gibson
0 siblings, 0 replies; 4+ messages in thread
From: David Gibson @ 2016-01-21 1:13 UTC (permalink / raw)
To: Bharata B Rao; +Cc: aik, qemu-ppc, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1737 bytes --]
On Wed, Jan 20, 2016 at 11:00:39AM +0530, Bharata B Rao wrote:
> On Tue, Jan 19, 2016 at 04:00:25PM +1100, David Gibson wrote:
> > On Tue, Jan 19, 2016 at 10:09:21AM +0530, Bharata B Rao wrote:
> > > If guest doesn't have any dynamically reconfigurable (DR) logical memory
> > > blocks (LMB), then we shouldn't create ibm,dynamic-reconfiguration-memory
> > > device tree node.
> > >
> > > Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> > > ---
> > > This applies against ppc-for-2.6 branch of David Gibson's tree.
> >
> > Applied to ppc-for-2.6, thanks.
>
> There is a slight change in memory nodes representation in DT after this fix
> that could result in the following behaviour before and after migration.
>
> For a guest with -m 4G -numa node,nodeid=0,mem=2G -numa node,nodeid=1,mem=2G,
> the DT under /proc/device-tree changes like this:
>
> Guest started with QEMU w/o this fix
> ------------------------------------
> memory@0
> memory@80000000
> ibm,dynamic-reconfiguration-memory
>
> Guest migrated to QEMU w/ this fix included
> -------------------------------------------
> memory@0
> memory@80000000
> ibm,dynamic-reconfiguration-memory
>
> After next reboot
> -----------------
> memory@0
> memory@80000000
>
> I guess this is ok, but wanted to sound out this change explicitly.
Yeah, I think that should be ok.
Generally device tree changes won't break migration, because the guest
(or SLOF) will have already grabbed the old device tree from the
source qemu.
--
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 --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-01-21 1:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-19 4:39 [Qemu-devel] [PATCH] spapr: Don't create ibm, dynamic-reconfiguration-memory w/o DR LMBs Bharata B Rao
2016-01-19 5:00 ` David Gibson
2016-01-20 5:30 ` Bharata B Rao
2016-01-21 1:13 ` David Gibson
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).