diff mbox series

[v3,04/15] lib: Kconfig: add a config symbol for getting lmb memory map updates

Message ID 20241013105522.391414-5-sughosh.ganu@linaro.org
State New
Headers show
Series Make EFI memory allocations synchronous with LMB | expand

Commit Message

Sughosh Ganu Oct. 13, 2024, 10:55 a.m. UTC
Add a Kconfig symbol to enable getting updates on any memory map
changes that might be done by the LMB module. This notification
mechanism can then be used to have a synchronous view of allocated and
free memory.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
---
Changes since V2: None

 lib/Kconfig | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Comments

Tom Rini Oct. 13, 2024, 3:30 p.m. UTC | #1
On Sun, Oct 13, 2024 at 04:25:11PM +0530, Sughosh Ganu wrote:
> Add a Kconfig symbol to enable getting updates on any memory map
> changes that might be done by the LMB module. This notification
> mechanism can then be used to have a synchronous view of allocated and
> free memory.
> 
> Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> ---
> Changes since V2: None
> 
>  lib/Kconfig | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/lib/Kconfig b/lib/Kconfig
> index 1dd4f27159..61452f7ac9 100644
> --- a/lib/Kconfig
> +++ b/lib/Kconfig
> @@ -75,6 +75,23 @@ config LIB_UUID
>  	bool
>  	select SHA1
>  
> +config MEM_MAP_UPDATE_NOTIFY
> +	bool "Get notified of any changes to the LMB memory map"
> +	default y if EFI_LOADER
> +	help
> +	  Enable this option to get notification on any changes to the
> +	  memory that is allocated or freed by the LMB module. This will
> +	  allow different modules that allocate memory or maintain a memory
> +	  map to have a synchronous view of available and allocated memory.
> +
> +config SPL_MEM_MAP_UPDATE_NOTIFY
> +	bool "Get notified of any changes to the LMB memory map in SPL"
> +	help
> +	  Enable this option to get notification on any changes to the
> +	  memory that is allocated or freed by the LMB module. This will
> +	  allow different modules that allocate memory or maintain a memory
> +	  map to have a synchronous view of available and allocated memory.
> +
>  config RANDOM_UUID
>  	bool "GPT Random UUID generation"
>  	select LIB_UUID

Both of these symbols need to be select'd by the other parts of the code
which require them, not prompted. Please do leave the help text for the
entry, just remove the text after "bool" and select from the other code
which requires this. Thanks.
Sughosh Ganu Oct. 14, 2024, 6:48 a.m. UTC | #2
On Sun, 13 Oct 2024 at 21:00, Tom Rini <trini@konsulko.com> wrote:
>
> On Sun, Oct 13, 2024 at 04:25:11PM +0530, Sughosh Ganu wrote:
> > Add a Kconfig symbol to enable getting updates on any memory map
> > changes that might be done by the LMB module. This notification
> > mechanism can then be used to have a synchronous view of allocated and
> > free memory.
> >
> > Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> > ---
> > Changes since V2: None
> >
> >  lib/Kconfig | 17 +++++++++++++++++
> >  1 file changed, 17 insertions(+)
> >
> > diff --git a/lib/Kconfig b/lib/Kconfig
> > index 1dd4f27159..61452f7ac9 100644
> > --- a/lib/Kconfig
> > +++ b/lib/Kconfig
> > @@ -75,6 +75,23 @@ config LIB_UUID
> >       bool
> >       select SHA1
> >
> > +config MEM_MAP_UPDATE_NOTIFY
> > +     bool "Get notified of any changes to the LMB memory map"
> > +     default y if EFI_LOADER
> > +     help
> > +       Enable this option to get notification on any changes to the
> > +       memory that is allocated or freed by the LMB module. This will
> > +       allow different modules that allocate memory or maintain a memory
> > +       map to have a synchronous view of available and allocated memory.
> > +
> > +config SPL_MEM_MAP_UPDATE_NOTIFY
> > +     bool "Get notified of any changes to the LMB memory map in SPL"
> > +     help
> > +       Enable this option to get notification on any changes to the
> > +       memory that is allocated or freed by the LMB module. This will
> > +       allow different modules that allocate memory or maintain a memory
> > +       map to have a synchronous view of available and allocated memory.
> > +
> >  config RANDOM_UUID
> >       bool "GPT Random UUID generation"
> >       select LIB_UUID
>
> Both of these symbols need to be select'd by the other parts of the code
> which require them, not prompted. Please do leave the help text for the
> entry, just remove the text after "bool" and select from the other code
> which requires this. Thanks.

Currently, there isn't a consumer of the SPL variant of this symbol. I
have introduced the SPL variant as the LMB module also gets enabled in
SPL. Do you think the SPL variant be dropped, and introduced only when
needed ?

-sughosh

>
> --
> Tom
Tom Rini Oct. 14, 2024, 3:06 p.m. UTC | #3
On Mon, Oct 14, 2024 at 12:18:55PM +0530, Sughosh Ganu wrote:
> On Sun, 13 Oct 2024 at 21:00, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Sun, Oct 13, 2024 at 04:25:11PM +0530, Sughosh Ganu wrote:
> > > Add a Kconfig symbol to enable getting updates on any memory map
> > > changes that might be done by the LMB module. This notification
> > > mechanism can then be used to have a synchronous view of allocated and
> > > free memory.
> > >
> > > Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> > > ---
> > > Changes since V2: None
> > >
> > >  lib/Kconfig | 17 +++++++++++++++++
> > >  1 file changed, 17 insertions(+)
> > >
> > > diff --git a/lib/Kconfig b/lib/Kconfig
> > > index 1dd4f27159..61452f7ac9 100644
> > > --- a/lib/Kconfig
> > > +++ b/lib/Kconfig
> > > @@ -75,6 +75,23 @@ config LIB_UUID
> > >       bool
> > >       select SHA1
> > >
> > > +config MEM_MAP_UPDATE_NOTIFY
> > > +     bool "Get notified of any changes to the LMB memory map"
> > > +     default y if EFI_LOADER
> > > +     help
> > > +       Enable this option to get notification on any changes to the
> > > +       memory that is allocated or freed by the LMB module. This will
> > > +       allow different modules that allocate memory or maintain a memory
> > > +       map to have a synchronous view of available and allocated memory.
> > > +
> > > +config SPL_MEM_MAP_UPDATE_NOTIFY
> > > +     bool "Get notified of any changes to the LMB memory map in SPL"
> > > +     help
> > > +       Enable this option to get notification on any changes to the
> > > +       memory that is allocated or freed by the LMB module. This will
> > > +       allow different modules that allocate memory or maintain a memory
> > > +       map to have a synchronous view of available and allocated memory.
> > > +
> > >  config RANDOM_UUID
> > >       bool "GPT Random UUID generation"
> > >       select LIB_UUID
> >
> > Both of these symbols need to be select'd by the other parts of the code
> > which require them, not prompted. Please do leave the help text for the
> > entry, just remove the text after "bool" and select from the other code
> > which requires this. Thanks.
> 
> Currently, there isn't a consumer of the SPL variant of this symbol. I
> have introduced the SPL variant as the LMB module also gets enabled in
> SPL. Do you think the SPL variant be dropped, and introduced only when
> needed ?

Yes, lets drop it.
Simon Glass Oct. 14, 2024, 3:50 p.m. UTC | #4
Hi Sughosh,

On Sun, 13 Oct 2024 at 04:55, Sughosh Ganu <sughosh.ganu@linaro.org> wrote:
>
> Add a Kconfig symbol to enable getting updates on any memory map
> changes that might be done by the LMB module. This notification
> mechanism can then be used to have a synchronous view of allocated and
> free memory.
>
> Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> ---
> Changes since V2: None
>
>  lib/Kconfig | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>
> diff --git a/lib/Kconfig b/lib/Kconfig
> index 1dd4f27159..61452f7ac9 100644
> --- a/lib/Kconfig
> +++ b/lib/Kconfig
> @@ -75,6 +75,23 @@ config LIB_UUID
>         bool
>         select SHA1
>
> +config MEM_MAP_UPDATE_NOTIFY
> +       bool "Get notified of any changes to the LMB memory map"
> +       default y if EFI_LOADER
> +       help
> +         Enable this option to get notification on any changes to the
> +         memory that is allocated or freed by the LMB module. This will
> +         allow different modules that allocate memory or maintain a memory
> +         map to have a synchronous view of available and allocated memory.
> +
> +config SPL_MEM_MAP_UPDATE_NOTIFY
> +       bool "Get notified of any changes to the LMB memory map in SPL"
> +       help
> +         Enable this option to get notification on any changes to the
> +         memory that is allocated or freed by the LMB module. This will
> +         allow different modules that allocate memory or maintain a memory
> +         map to have a synchronous view of available and allocated memory.
> +
>  config RANDOM_UUID
>         bool "GPT Random UUID generation"
>         select LIB_UUID
> --
> 2.34.1
>

We should find a way to avoid this complexity. I have proposed a few
including my latest series at [1]. Please take a look.

Regards,
SImon

[1] https://patchwork.ozlabs.org/project/uboot/list/?series=427729
diff mbox series

Patch

diff --git a/lib/Kconfig b/lib/Kconfig
index 1dd4f27159..61452f7ac9 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -75,6 +75,23 @@  config LIB_UUID
 	bool
 	select SHA1
 
+config MEM_MAP_UPDATE_NOTIFY
+	bool "Get notified of any changes to the LMB memory map"
+	default y if EFI_LOADER
+	help
+	  Enable this option to get notification on any changes to the
+	  memory that is allocated or freed by the LMB module. This will
+	  allow different modules that allocate memory or maintain a memory
+	  map to have a synchronous view of available and allocated memory.
+
+config SPL_MEM_MAP_UPDATE_NOTIFY
+	bool "Get notified of any changes to the LMB memory map in SPL"
+	help
+	  Enable this option to get notification on any changes to the
+	  memory that is allocated or freed by the LMB module. This will
+	  allow different modules that allocate memory or maintain a memory
+	  map to have a synchronous view of available and allocated memory.
+
 config RANDOM_UUID
 	bool "GPT Random UUID generation"
 	select LIB_UUID