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]
Date:   Fri, 18 Mar 2022 09:40:38 -0700
From:   Luis Chamberlain <mcgrof@...nel.org>
To:     Muchun Song <songmuchun@...edance.com>
Cc:     corbet@....net, mike.kravetz@...cle.com, akpm@...ux-foundation.org,
        keescook@...omium.org, yzaikin@...gle.com, osalvador@...e.de,
        david@...hat.com, linux-doc@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        duanxiongchun@...edance.com, smuchun@...il.com
Subject: Re: [PATCH v4 1/4] mm: hugetlb_vmemmap: introduce
 STRUCT_PAGE_SIZE_IS_POWER_OF_2

On Fri, Mar 18, 2022 at 06:07:17PM +0800, Muchun Song wrote:

You can add Suggested-by tag here.

> Signed-off-by: Muchun Song <songmuchun@...edance.com>
> ---
>  Kbuild                           | 12 ++++++++++++
>  fs/Kconfig                       |  2 +-
>  include/linux/mm_types.h         |  2 ++
>  mm/Kconfig                       |  3 +++
>  mm/hugetlb_vmemmap.c             |  6 ------
>  mm/struct_page_size.c            | 19 +++++++++++++++++++
>  scripts/check_struct_page_po2.sh | 11 +++++++++++
>  7 files changed, 48 insertions(+), 7 deletions(-)
>  create mode 100644 mm/struct_page_size.c
>  create mode 100755 scripts/check_struct_page_po2.sh
> 
> diff --git a/Kbuild b/Kbuild
> index fa441b98c9f6..6bb97d348d62 100644
> --- a/Kbuild
> +++ b/Kbuild
> @@ -14,6 +14,18 @@ $(bounds-file): kernel/bounds.s FORCE
>  	$(call filechk,offsets,__LINUX_BOUNDS_H__)
>  
>  #####
> +# Generate struct_page_size.h. Must follows bounds.h.
> +
> +struct_page_size-file := include/generated/struct_page_size.h
> +
> +always-y := $(struct_page_size-file)
> +targets := mm/struct_page_size.s
> +
> +$(struct_page_size-file): mm/struct_page_size.s FORCE
> +	$(call filechk,offsets,__LINUX_STRUCT_PAGE_SIZE_H__)
> +	$(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
> +
> +#####

Shouldn't this go into mm/Makefile instead?

> diff --git a/mm/Kconfig b/mm/Kconfig
> index 034d87953600..9314bd34f49e 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -2,6 +2,9 @@
>  
>  menu "Memory Management options"
>  
> +config STRUCT_PAGE_SIZE_IS_POWER_OF_2
> +	def_bool $(success,test "$(shell, $(srctree)/scripts/check_struct_page_po2.sh)" = 1)
> +
>  config SELECT_MEMORY_MODEL
>  	def_bool y
>  	depends on ARCH_SELECT_MEMORY_MODEL
> new file mode 100755
> index 000000000000..9547ad3aca05
> --- /dev/null
> +++ b/scripts/check_struct_page_po2.sh
> @@ -0,0 +1,11 @@
> +#!/bin/sh
> +# SPDX-License-Identifier: GPL-2.0
> +#
> +# Check if the size of "struct page" is power of 2
> +
> +file="include/generated/struct_page_size.h"
> +if [ ! -f "$file" ]; then

Does this really work if one is workig off of a very clean build
like make mrproper and then make menuconfig or or mrproper followed
by a defconfig file ? Have you tried it for both cases po2 and npo2?

Because isn't include/generated/struct_page_size.h generated? At
which point does it get generated and why would the condition hole
true that the file exists at a new 'make menuconfig' time?

  Luis

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ