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: <aGZOkpE8DRv9uawi@localhost.localdomain>
Date: Thu, 3 Jul 2025 11:34:10 +0200
From: Oscar Salvador <osalvador@...e.de>
To: Mike Rapoport <rppt@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
	Alexandre Ghiti <alexghiti@...osinc.com>,
	David Hildenbrand <david@...hat.com>,
	Pratyush Yadav <ptyadav@...zon.de>, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org
Subject: Re: [PATCH 2/3] cma: split resrvation of fixed area into a helper
 function

On Wed, Jul 02, 2025 at 08:36:04PM +0300, Mike Rapoport wrote:
> From: "Mike Rapoport (Microsoft)" <rppt@...nel.org>
> 
> Move the check that verifies that reservation of fixed area does not
> cross HIGHMEM boundary and the actual memblock_resrve() call into a
> helper function.
> 
> This makes code more readable and decouples logic related to
> CONFIG_HIGHMEM from the core functionality of
> __cma_declare_contiguous_nid().
> 
> Signed-off-by: Mike Rapoport (Microsoft) <rppt@...nel.org>

Looks good to me, nit below:

Acked-by: Oscar Salvador <osalvador@...e.de>


> @@ -433,10 +448,10 @@ static int __init __cma_declare_contiguous_nid(phys_addr_t *basep,
>  
>  	/* Reserve memory */
>  	if (fixed) {
> -		if (memblock_is_region_reserved(base, size) ||
> -		    memblock_reserve(base, size) < 0) {
> -			return -EBUSY;
> -		}
> +		int err = cma_fixed_reserve(base, size);

There's no need for 'err', you can use the already declared 'ret'.

 

-- 
Oscar Salvador
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ