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: <CAPTztWYY6wGBARyTEt2yXCxstyTUXqcGfyUt4ryBue8gGKXrgw@mail.gmail.com>
Date: Tue, 8 Apr 2025 14:08:10 -0700
From: Frank van der Linden <fvdl@...gle.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: muchun.song@...ux.dev, linux-mm@...ck.org, linux-kernel@...r.kernel.org, 
	Geert Uytterhoeven <geert@...ux-m68k.org>
Subject: Re: [PATCH v2] mm/cma: report base address of single range correctly

On Tue, Apr 8, 2025 at 2:03 PM Andrew Morton <akpm@...ux-foundation.org> wrote:
>
> On Tue,  8 Apr 2025 16:40:00 +0000 Frank van der Linden <fvdl@...gle.com> wrote:
>
> > The cma_declare_contiguous_nid code was refactored by
> > commit c009da4258f9 ("mm, cma: support multiple contiguous
> > ranges, if requested"), so that it could use an internal
> > function to attempt a single range area first, and then
> > try a multi-range one.
> >
> > However, that meant that the actual base address used for
> > the !fixed case (base == 0) wasn't available one level up
> > to be printed in the informational message, and it would
> > always end up printing a base address of 0 in the boot
> > message.
> >
> > Make the internal function take a phys_addr_t pointer to
> > the base address, so that the value is available to the
> > caller.
>
> Changes from v1 are:
>
> --- a/mm/cma.c~mm-cma-report-base-address-of-single-range-correctly-v2
> +++ a/mm/cma.c
> @@ -722,14 +722,15 @@ static int __init __cma_declare_contiguo
>         }
>
>         ret = cma_init_reserved_mem(base, size, order_per_bit, name, res_cma);
> -       if (ret)
> +       if (ret) {
>                 memblock_phys_free(base, size);
> -       else {
> -               (*res_cma)->nid = nid;
> -               *basep = base;
> +               return ret;
>         }
>
> -       return ret;
> +       (*res_cma)->nid = nid;
> +       *basep = base;
> +
> +       return 0;
>  }
>
>  static void cma_debug_show_areas(struct cma *cma)
> _
>
> Which appears to be just a little cleanup?

Correct, it just fixes a style nit that Geert pointed out.

- Frank

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ