All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH v3 1/1] ppc/spapr: Add hotremovable flag on DIMM LMBs on drmem_v2
@ 2020-05-11 20:02 Leonardo Bras
  2020-05-12  3:41 ` David Gibson
  2020-07-06 17:45 ` Leonardo Bras
  0 siblings, 2 replies; 5+ messages in thread
From: Leonardo Bras @ 2020-05-11 20:02 UTC (permalink / raw)
  To: David Gibson, Bharata B Rao
  Cc: Leonardo Bras, Bharata B Rao, qemu-ppc, qemu-devel, Leonardo Bras

From: Leonardo Bras <leonardo@linux.ibm.com>

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_HOTREMOVABLE 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.

This new flag was accepted in Power Architecture documentation.

Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
Reviewed-by: Bharata B Rao <bharata@linux.ibm.com>

---
Changes since v1:
- Flag name changed from SPAPR_LMB_FLAGS_HOTPLUGGED to
	SPAPR_LMB_FLAGS_HOTREMOVABLE
---
 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 9a2bd501aa..fe662e297e 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -446,7 +446,8 @@ static int spapr_dt_dynamic_memory_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_HOTREMOVABLE);
         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 42d64a0368..93e0d43051 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -880,6 +880,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_HOTREMOVABLE 0x00000100
 
 void spapr_do_system_reset_on_cpu(CPUState *cs, run_on_cpu_data arg);
 
-- 
2.25.1



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

* Re: [RESEND PATCH v3 1/1] ppc/spapr: Add hotremovable flag on DIMM LMBs on drmem_v2
  2020-05-11 20:02 [RESEND PATCH v3 1/1] ppc/spapr: Add hotremovable flag on DIMM LMBs on drmem_v2 Leonardo Bras
@ 2020-05-12  3:41 ` David Gibson
  2020-05-14  6:05   ` Cédric Le Goater
  2020-07-06 17:45 ` Leonardo Bras
  1 sibling, 1 reply; 5+ messages in thread
From: David Gibson @ 2020-05-12  3:41 UTC (permalink / raw)
  To: Leonardo Bras
  Cc: Bharata B Rao, Bharata B Rao, qemu-ppc, qemu-devel, Leonardo Bras

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

On Mon, May 11, 2020 at 05:02:02PM -0300, Leonardo Bras wrote:
> From: Leonardo Bras <leonardo@linux.ibm.com>
> 
> 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_HOTREMOVABLE 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.
> 
> This new flag was accepted in Power Architecture documentation.
> 
> Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
> Reviewed-by: Bharata B Rao <bharata@linux.ibm.com>

Applied to ppc-for-5.1, thanks.

> 
> ---
> Changes since v1:
> - Flag name changed from SPAPR_LMB_FLAGS_HOTPLUGGED to
> 	SPAPR_LMB_FLAGS_HOTREMOVABLE
> ---
>  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 9a2bd501aa..fe662e297e 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -446,7 +446,8 @@ static int spapr_dt_dynamic_memory_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_HOTREMOVABLE);
>          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 42d64a0368..93e0d43051 100644
> --- a/include/hw/ppc/spapr.h
> +++ b/include/hw/ppc/spapr.h
> @@ -880,6 +880,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_HOTREMOVABLE 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] 5+ messages in thread

* Re: [RESEND PATCH v3 1/1] ppc/spapr: Add hotremovable flag on DIMM LMBs on drmem_v2
  2020-05-12  3:41 ` David Gibson
@ 2020-05-14  6:05   ` Cédric Le Goater
  2020-05-14  6:46     ` David Gibson
  0 siblings, 1 reply; 5+ messages in thread
From: Cédric Le Goater @ 2020-05-14  6:05 UTC (permalink / raw)
  To: David Gibson, Leonardo Bras
  Cc: Bharata B Rao, Leonardo Bras, qemu-ppc, qemu-devel, Bharata B Rao

>> --- a/hw/ppc/spapr.c
>> +++ b/hw/ppc/spapr.c
>> @@ -446,7 +446,8 @@ static int spapr_dt_dynamic_memory_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_HOTREMOVABLE);


This is missing a ')'

C.


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

* Re: [RESEND PATCH v3 1/1] ppc/spapr: Add hotremovable flag on DIMM LMBs on drmem_v2
  2020-05-14  6:05   ` Cédric Le Goater
@ 2020-05-14  6:46     ` David Gibson
  0 siblings, 0 replies; 5+ messages in thread
From: David Gibson @ 2020-05-14  6:46 UTC (permalink / raw)
  To: Cédric Le Goater
  Cc: Leonardo Bras, qemu-devel, Bharata B Rao, Bharata B Rao,
	qemu-ppc, Leonardo Bras

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

On Thu, May 14, 2020 at 08:05:17AM +0200, Cédric Le Goater wrote:
> >> --- a/hw/ppc/spapr.c
> >> +++ b/hw/ppc/spapr.c
> >> @@ -446,7 +446,8 @@ static int spapr_dt_dynamic_memory_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_HOTREMOVABLE);
> 
> 
> This is missing a ')'

So it is.  I've corrected this in my tree, but please do compile test
your patches before sending.

-- 
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] 5+ messages in thread

* Re: [RESEND PATCH v3 1/1] ppc/spapr: Add hotremovable flag on DIMM LMBs on drmem_v2
  2020-05-11 20:02 [RESEND PATCH v3 1/1] ppc/spapr: Add hotremovable flag on DIMM LMBs on drmem_v2 Leonardo Bras
  2020-05-12  3:41 ` David Gibson
@ 2020-07-06 17:45 ` Leonardo Bras
  1 sibling, 0 replies; 5+ messages in thread
From: Leonardo Bras @ 2020-07-06 17:45 UTC (permalink / raw)
  To: David Gibson, Bharata B Rao; +Cc: qemu-ppc, qemu-devel, Bharata B Rao

On Mon, 2020-05-11 at 17:02 -0300, Leonardo Bras wrote:
> The new SPAPR_LMB_FLAGS_HOTREMOVABLE 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.
> 
> This new flag was accepted in Power Architecture documentation.


FYI: LoPAR released for public review. 
https://openpowerfoundation.org/?resource_lib=linux-on-power-architecture-reference-a-papr-linux-subset-review-draft

It contains the new flag implemented by this patch.



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

end of thread, other threads:[~2020-07-06 17:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11 20:02 [RESEND PATCH v3 1/1] ppc/spapr: Add hotremovable flag on DIMM LMBs on drmem_v2 Leonardo Bras
2020-05-12  3:41 ` David Gibson
2020-05-14  6:05   ` Cédric Le Goater
2020-05-14  6:46     ` David Gibson
2020-07-06 17:45 ` 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.