lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zi-rPSnLX8zaueeY@kernel.org>
Date: Mon, 29 Apr 2024 17:14:21 +0300
From: Mike Rapoport <rppt@...nel.org>
To: DaeRo Lee <skseofh@...il.com>
Cc: robh@...nel.org, saravanak@...gle.com, devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org, Daero Lee <daero_le.lee@...sung.com>
Subject: Re: [PATCH] of: of_reserved_mem: clean-up reserved memory with no-map

On Sun, Apr 28, 2024 at 10:10:17PM +0900, DaeRo Lee wrote:
> 2024년 4월 28일 (일) 오후 9:55, <skseofh@...il.com>님이 작성:
> >
> > From: Daero Lee <daero_le.lee@...sung.com>
> >
> > In early_init_dt_reserve_memory we only add memory w/o no-map flag to
> > memblock.reserved. But we need to add memory w/ no-map flag to
> > memblock.reserved, because NOMAP and memblock.reserved are semantically
> > different.
> >
> > Signed-off-by: Daero Lee <daero_le.lee@...sung.com>
> > ---
> >  drivers/of/of_reserved_mem.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
> > index 8236ecae2953..1c916da8adaf 100644
> > --- a/drivers/of/of_reserved_mem.c
> > +++ b/drivers/of/of_reserved_mem.c
> > @@ -91,7 +91,8 @@ static int __init early_init_dt_reserve_memory(phys_addr_t base,
> >                     memblock_is_region_reserved(base, size))
> >                         return -EBUSY;
> >
> > -               return memblock_mark_nomap(base, size);
> > +               if (memblock_mark_nomap(base, size))
> > +                       return;
> Sorry. The return value is wrong.
> 
> Here is what I want to do:
> 
> --- a/drivers/of/of_reserved_mem.c
> +++ b/drivers/of/of_reserved_mem.c
> @@ -81,6 +81,7 @@ static void __init
> fdt_reserved_mem_save_node(unsigned long node, const char *un
>  static int __init early_init_dt_reserve_memory(phys_addr_t base,
>                                                phys_addr_t size, bool nomap)
>  {
> +       int err = 0;
>         if (nomap) {
>                 /*
>                  * If the memory is already reserved (by another region), we
> @@ -91,7 +92,10 @@ static int __init
> early_init_dt_reserve_memory(phys_addr_t base,
>                     memblock_is_region_reserved(base, size))
>                         return -EBUSY;
> 
> -               return memblock_mark_nomap(base, size);
> +
> +               err = memblock_mark_nomap(base, size);
> +               if (err)
> +                       return err;
>         }
>         return memblock_reserve(base, size);
>  }

Makes sense to me.

> Regards,
> DaeRo Lee

-- 
Sincerely yours,
Mike.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ