All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 1/1] ppc/spapr: Add hotplugged flag on DIMM LMBs on drmem_v2
@ 2020-03-06  0:22 Leonardo Bras
  2020-03-10  2:39 ` David Gibson
  0 siblings, 1 reply; 4+ messages in thread
From: Leonardo Bras @ 2020-03-06  0:22 UTC (permalink / raw)
  To: David Gibson, bharata.rao; +Cc: Leonardo Bras, qemu-ppc, qemu-devel

On reboot, all memory that was previously added using object_add and
device_add is placed in this DIMM area.

The new SPAPR_LMB_FLAGS_HOTPLUGGED flag helps Linux to put this memory in
the correct memory zone, so no unmovable allocations are made there,
allowing the object to be easily hot-removed by device_del and
object_del.

Signed-off-by: Leonardo Bras <leonardo@linux.ibm.com>

---
The new flag was already proposed on Power Architecture documentation,
and it's waiting for approval.

I would like to get your comments on this change, but it's still not
ready for being merged.

Matching Linux change is here:
http://patchwork.ozlabs.org/patch/1249917/
---
 hw/ppc/spapr.c         | 3 ++-
 include/hw/ppc/spapr.h | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index cc10798be4..01611b7953 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -699,7 +699,8 @@ static int spapr_populate_drmem_v2(SpaprMachineState *spapr, void *fdt,
         g_assert(drc);
         elem = spapr_get_drconf_cell(size / lmb_size, addr,
                                      spapr_drc_index(drc), node,
-                                     SPAPR_LMB_FLAGS_ASSIGNED);
+                                     (SPAPR_LMB_FLAGS_ASSIGNED |
+                                      SPAPR_LMB_FLAGS_HOTPLUGGED);
         QSIMPLEQ_INSERT_TAIL(&drconf_queue, elem, entry);
         nr_entries++;
         cur_addr = addr + size;
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 09110961a5..64a138d4d4 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -870,6 +870,7 @@ int spapr_rtc_import_offset(SpaprRtcState *rtc, int64_t legacy_offset);
 #define SPAPR_LMB_FLAGS_ASSIGNED 0x00000008
 #define SPAPR_LMB_FLAGS_DRC_INVALID 0x00000020
 #define SPAPR_LMB_FLAGS_RESERVED 0x00000080
+#define SPAPR_LMB_FLAGS_HOTPLUGGED 0x00000100
 
 void spapr_do_system_reset_on_cpu(CPUState *cs, run_on_cpu_data arg);
 
-- 
2.24.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH 1/1] ppc/spapr: Add hotplugged flag on DIMM LMBs on drmem_v2
  2020-03-06  0:22 [RFC PATCH 1/1] ppc/spapr: Add hotplugged flag on DIMM LMBs on drmem_v2 Leonardo Bras
@ 2020-03-10  2:39 ` David Gibson
  2020-04-02  9:16   ` Bharata B Rao
  0 siblings, 1 reply; 4+ messages in thread
From: David Gibson @ 2020-03-10  2:39 UTC (permalink / raw)
  To: Leonardo Bras; +Cc: bharata.rao, qemu-ppc, qemu-devel

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

On Thu, Mar 05, 2020 at 09:22:02PM -0300, Leonardo Bras wrote:
> On reboot, all memory that was previously added using object_add and
> device_add is placed in this DIMM area.
> 
> The new SPAPR_LMB_FLAGS_HOTPLUGGED flag helps Linux to put this memory in
> the correct memory zone, so no unmovable allocations are made there,
> allowing the object to be easily hot-removed by device_del and
> object_del.
> 
> Signed-off-by: Leonardo Bras <leonardo@linux.ibm.com>
> 
> ---
> The new flag was already proposed on Power Architecture documentation,
> and it's waiting for approval.
> 
> I would like to get your comments on this change, but it's still not
> ready for being merged.

This looks reasonable to me - at the very least it doesn't look like
it could do much harm.

> 
> Matching Linux change is here:
> http://patchwork.ozlabs.org/patch/1249917/
> ---
>  hw/ppc/spapr.c         | 3 ++-
>  include/hw/ppc/spapr.h | 1 +
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index cc10798be4..01611b7953 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -699,7 +699,8 @@ static int spapr_populate_drmem_v2(SpaprMachineState *spapr, void *fdt,
>          g_assert(drc);
>          elem = spapr_get_drconf_cell(size / lmb_size, addr,
>                                       spapr_drc_index(drc), node,
> -                                     SPAPR_LMB_FLAGS_ASSIGNED);
> +                                     (SPAPR_LMB_FLAGS_ASSIGNED |
> +                                      SPAPR_LMB_FLAGS_HOTPLUGGED);
>          QSIMPLEQ_INSERT_TAIL(&drconf_queue, elem, entry);
>          nr_entries++;
>          cur_addr = addr + size;
> diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
> index 09110961a5..64a138d4d4 100644
> --- a/include/hw/ppc/spapr.h
> +++ b/include/hw/ppc/spapr.h
> @@ -870,6 +870,7 @@ int spapr_rtc_import_offset(SpaprRtcState *rtc, int64_t legacy_offset);
>  #define SPAPR_LMB_FLAGS_ASSIGNED 0x00000008
>  #define SPAPR_LMB_FLAGS_DRC_INVALID 0x00000020
>  #define SPAPR_LMB_FLAGS_RESERVED 0x00000080
> +#define SPAPR_LMB_FLAGS_HOTPLUGGED 0x00000100
>  
>  void spapr_do_system_reset_on_cpu(CPUState *cs, run_on_cpu_data arg);
>  

-- 
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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH 1/1] ppc/spapr: Add hotplugged flag on DIMM LMBs on drmem_v2
  2020-03-10  2:39 ` David Gibson
@ 2020-04-02  9:16   ` Bharata B Rao
  2020-04-02 17:11     ` Leonardo Bras
  0 siblings, 1 reply; 4+ messages in thread
From: Bharata B Rao @ 2020-04-02  9:16 UTC (permalink / raw)
  To: David Gibson; +Cc: Leonardo Bras, qemu-ppc, qemu-devel, Bharata B Rao

On Tue, Mar 10, 2020 at 8:24 AM David Gibson
<david@gibson.dropbear.id.au> wrote:
>
> On Thu, Mar 05, 2020 at 09:22:02PM -0300, Leonardo Bras wrote:
> > On reboot, all memory that was previously added using object_add and
> > device_add is placed in this DIMM area.
> >
> > The new SPAPR_LMB_FLAGS_HOTPLUGGED flag helps Linux to put this memory in
> > the correct memory zone, so no unmovable allocations are made there,
> > allowing the object to be easily hot-removed by device_del and
> > object_del.
> >
> > Signed-off-by: Leonardo Bras <leonardo@linux.ibm.com>
> >
> > ---
> > The new flag was already proposed on Power Architecture documentation,
> > and it's waiting for approval.
> >
> > I would like to get your comments on this change, but it's still not
> > ready for being merged.
>
> This looks reasonable to me - at the very least it doesn't look like
> it could do much harm.

Looks good to me, also tested with PowerKVM guests.

Reviewed-by: Bharata B Rao <bharata@linux.ibm.com>

Regards,
Bharata.
-- 
http://raobharata.wordpress.com/


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH 1/1] ppc/spapr: Add hotplugged flag on DIMM LMBs on drmem_v2
  2020-04-02  9:16   ` Bharata B Rao
@ 2020-04-02 17:11     ` Leonardo Bras
  0 siblings, 0 replies; 4+ messages in thread
From: Leonardo Bras @ 2020-04-02 17:11 UTC (permalink / raw)
  To: Bharata B Rao, David Gibson; +Cc: Bharata B Rao, qemu-ppc, qemu-devel

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

Hello Bharata, thank you for reviewing and testing!

During review of this new flag, it was suggested to change it's name to
a better one (on platform's viewpoint). 

So I will have to change the flag name from SPAPR_LMB_FLAGS_HOTPLUGGED
to SPAPR_LMB_FLAGS_HOTREMOVABLE.

Everything should work the same as today.

Best regards,
Leonardo



On Thu, 2020-04-02 at 14:46 +0530, Bharata B Rao wrote:
> On Tue, Mar 10, 2020 at 8:24 AM David Gibson
> <david@gibson.dropbear.id.au> wrote:
> > On Thu, Mar 05, 2020 at 09:22:02PM -0300, Leonardo Bras wrote:
> > > On reboot, all memory that was previously added using object_add and
> > > device_add is placed in this DIMM area.
> > > 
> > > The new SPAPR_LMB_FLAGS_HOTPLUGGED flag helps Linux to put this memory in
> > > the correct memory zone, so no unmovable allocations are made there,
> > > allowing the object to be easily hot-removed by device_del and
> > > object_del.
> > > 
> > > Signed-off-by: Leonardo Bras <leonardo@linux.ibm.com>
> > > 
> > > ---
> > > The new flag was already proposed on Power Architecture documentation,
> > > and it's waiting for approval.
> > > 
> > > I would like to get your comments on this change, but it's still not
> > > ready for being merged.
> > 
> > This looks reasonable to me - at the very least it doesn't look like
> > it could do much harm.
> 
> Looks good to me, also tested with PowerKVM guests.
> 
> Reviewed-by: Bharata B Rao <bharata@linux.ibm.com>
> 
> Regards,
> Bharata.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-02 17:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06  0:22 [RFC PATCH 1/1] ppc/spapr: Add hotplugged flag on DIMM LMBs on drmem_v2 Leonardo Bras
2020-03-10  2:39 ` David Gibson
2020-04-02  9:16   ` Bharata B Rao
2020-04-02 17:11     ` Leonardo Bras

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.