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] [day] [month] [year] [list]
Date:   Sat, 5 Mar 2022 15:28:51 +0200
From:   Mike Rapoport <rppt@...nel.org>
To:     Tiezhu Yang <yangtiezhu@...ngson.cn>
Cc:     Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Xuefeng Li <lixuefeng@...ngson.cn>, linux-mips@...r.kernel.org,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 1/4] memblock: Introduce
 memblock_mem_range_remove_map()

On Sat, Mar 05, 2022 at 02:21:26PM +0800, Tiezhu Yang wrote:
> This is preparation for supporting mem=limit@...e and memmap=limit@...e
> parameters, no functionality change.
> 
> Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>

NAK.

We already have enough memory capping interfaces in memblock, we don't need
yet another one.

> ---
>  include/linux/memblock.h | 1 +
>  mm/memblock.c            | 9 +++++++--
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/memblock.h b/include/linux/memblock.h
> index 50ad196..e558d2c 100644
> --- a/include/linux/memblock.h
> +++ b/include/linux/memblock.h
> @@ -482,6 +482,7 @@ phys_addr_t memblock_end_of_DRAM(void);
>  void memblock_enforce_memory_limit(phys_addr_t memory_limit);
>  void memblock_cap_memory_range(phys_addr_t base, phys_addr_t size);
>  void memblock_mem_limit_remove_map(phys_addr_t limit);
> +void memblock_mem_range_remove_map(phys_addr_t base, phys_addr_t limit);
>  bool memblock_is_memory(phys_addr_t addr);
>  bool memblock_is_map_memory(phys_addr_t addr);
>  bool memblock_is_region_memory(phys_addr_t base, phys_addr_t size);
> diff --git a/mm/memblock.c b/mm/memblock.c
> index 1018e50..2476d15d 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -1723,7 +1723,7 @@ void __init memblock_cap_memory_range(phys_addr_t base, phys_addr_t size)
>  			base + size, PHYS_ADDR_MAX);
>  }
>  
> -void __init memblock_mem_limit_remove_map(phys_addr_t limit)
> +void __init memblock_mem_range_remove_map(phys_addr_t base, phys_addr_t limit)
>  {
>  	phys_addr_t max_addr;
>  
> @@ -1736,7 +1736,12 @@ void __init memblock_mem_limit_remove_map(phys_addr_t limit)
>  	if (max_addr == PHYS_ADDR_MAX)
>  		return;
>  
> -	memblock_cap_memory_range(0, max_addr);
> +	memblock_cap_memory_range(base, max_addr);
> +}
> +
> +void __init memblock_mem_limit_remove_map(phys_addr_t limit)
> +{
> +	memblock_mem_range_remove_map(0, limit);
>  }
>  
>  static int __init_memblock memblock_search(struct memblock_type *type, phys_addr_t addr)
> -- 
> 2.1.0
> 

-- 
Sincerely yours,
Mike.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ