diff mbox series

[v2,02/14] lmb: add a flag to allow suppressing memory map change notification

Message ID 20241008181435.1753814-3-sughosh.ganu@linaro.org
State Superseded
Headers show
Series Make EFI memory allocations synchronous with LMB | expand

Commit Message

Sughosh Ganu Oct. 8, 2024, 6:14 p.m. UTC
Add a flag LMB_NONOTIFY that can be passed to the LMB API's for
reserving memory. This will then result in no notification being sent
from the LMB module for the changes to the LMB's memory map.

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

 include/lmb.h | 1 +
 lib/lmb.c     | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Ilias Apalodimas Oct. 11, 2024, 10:18 a.m. UTC | #1
Hi Sughosh

On Tue, 8 Oct 2024 at 21:14, Sughosh Ganu <sughosh.ganu@linaro.org> wrote:
>
> Add a flag LMB_NONOTIFY that can be passed to the LMB API's for
> reserving memory. This will then result in no notification being sent
> from the LMB module for the changes to the LMB's memory map.
>
> Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> ---
> Changes since V1: None
>
>  include/lmb.h | 1 +
>  lib/lmb.c     | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/include/lmb.h b/include/lmb.h
> index 0e8426f4379..a76262d520d 100644
> --- a/include/lmb.h
> +++ b/include/lmb.h
> @@ -23,6 +23,7 @@ enum lmb_flags {
>         LMB_NONE                = 0,
>         LMB_NOMAP               = BIT(1),
>         LMB_NOOVERWRITE         = BIT(2),
> +       LMB_NONOTIFY            = BIT(3),

I haven't gone through the rest of the series yet, but if if we remove
the notification event why we would we want the flag?
The LMB will directly update the mappings no?

Thanks
/Ilias
>  };
>
>  /**
> diff --git a/lib/lmb.c b/lib/lmb.c
> index 0763f6174c1..a4886db4c45 100644
> --- a/lib/lmb.c
> +++ b/lib/lmb.c
> @@ -30,7 +30,7 @@ static struct lmb lmb;
>  static void lmb_print_region_flags(enum lmb_flags flags)
>  {
>         u64 bitpos;
> -       const char *flag_str[] = { "none", "no-map", "no-overwrite" };
> +       const char *flag_str[] = { "none", "no-map", "no-overwrite", "no-notify" };
>
>         do {
>                 bitpos = flags ? fls(flags) - 1 : 0;
> --
> 2.34.1
>
Sughosh Ganu Oct. 12, 2024, 7:36 a.m. UTC | #2
On Fri, 11 Oct 2024 at 15:48, Ilias Apalodimas
<ilias.apalodimas@linaro.org> wrote:
>
> Hi Sughosh
>
> On Tue, 8 Oct 2024 at 21:14, Sughosh Ganu <sughosh.ganu@linaro.org> wrote:
> >
> > Add a flag LMB_NONOTIFY that can be passed to the LMB API's for
> > reserving memory. This will then result in no notification being sent
> > from the LMB module for the changes to the LMB's memory map.
> >
> > Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> > ---
> > Changes since V1: None
> >
> >  include/lmb.h | 1 +
> >  lib/lmb.c     | 2 +-
> >  2 files changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/lmb.h b/include/lmb.h
> > index 0e8426f4379..a76262d520d 100644
> > --- a/include/lmb.h
> > +++ b/include/lmb.h
> > @@ -23,6 +23,7 @@ enum lmb_flags {
> >         LMB_NONE                = 0,
> >         LMB_NOMAP               = BIT(1),
> >         LMB_NOOVERWRITE         = BIT(2),
> > +       LMB_NONOTIFY            = BIT(3),
>
> I haven't gone through the rest of the series yet, but if if we remove
> the notification event why we would we want the flag?
> The LMB will directly update the mappings no?

We are no longer using the event framework for notifying the EFI
memory module of the changes to the LMB memory map, but the
notification still ends up happening. The efi_add_memory_map_pg() does
get called from lmb_map_update_notify().

-sughosh

>
> Thanks
> /Ilias
> >  };
> >
> >  /**
> > diff --git a/lib/lmb.c b/lib/lmb.c
> > index 0763f6174c1..a4886db4c45 100644
> > --- a/lib/lmb.c
> > +++ b/lib/lmb.c
> > @@ -30,7 +30,7 @@ static struct lmb lmb;
> >  static void lmb_print_region_flags(enum lmb_flags flags)
> >  {
> >         u64 bitpos;
> > -       const char *flag_str[] = { "none", "no-map", "no-overwrite" };
> > +       const char *flag_str[] = { "none", "no-map", "no-overwrite", "no-notify" };
> >
> >         do {
> >                 bitpos = flags ? fls(flags) - 1 : 0;
> > --
> > 2.34.1
> >
diff mbox series

Patch

diff --git a/include/lmb.h b/include/lmb.h
index 0e8426f4379..a76262d520d 100644
--- a/include/lmb.h
+++ b/include/lmb.h
@@ -23,6 +23,7 @@  enum lmb_flags {
 	LMB_NONE		= 0,
 	LMB_NOMAP		= BIT(1),
 	LMB_NOOVERWRITE		= BIT(2),
+	LMB_NONOTIFY		= BIT(3),
 };
 
 /**
diff --git a/lib/lmb.c b/lib/lmb.c
index 0763f6174c1..a4886db4c45 100644
--- a/lib/lmb.c
+++ b/lib/lmb.c
@@ -30,7 +30,7 @@  static struct lmb lmb;
 static void lmb_print_region_flags(enum lmb_flags flags)
 {
 	u64 bitpos;
-	const char *flag_str[] = { "none", "no-map", "no-overwrite" };
+	const char *flag_str[] = { "none", "no-map", "no-overwrite", "no-notify" };
 
 	do {
 		bitpos = flags ? fls(flags) - 1 : 0;