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: <20250109160126.199c8325@canb.auug.org.au>
Date: Thu, 9 Jan 2025 16:01:26 +1100
From: Stephen Rothwell <sfr@...b.auug.org.au>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Alistair Popple <apopple@...dia.com>, Linux Kernel Mailing List
 <linux-kernel@...r.kernel.org>, Linux Next Mailing List
 <linux-next@...r.kernel.org>
Subject: Re: linux-next: build failure after merge of the mm tree

Hi all,

On Thu, 9 Jan 2025 15:59:54 +1100 Stephen Rothwell <sfr@...b.auug.org.au> wrote:
>
> After merging the mm tree, today's linux-next build (x86_64 allnoconfig)
> failed like this:

In file included from <command-line>:
mm/rmap.c: In function 'folio_add_file_rmap_pud':
include/linux/compiler_types.h:542:45: error: call to '__compiletime_assert_328' declared with attribute error: BUILD_BUG failed
  542 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |                                             ^
include/linux/compiler_types.h:523:25: note: in definition of macro '__compiletime_assert'
  523 |                         prefix ## suffix();                             \
      |                         ^~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
  542 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |         ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
   39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
      |                                     ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:59:21: note: in expansion of macro 'BUILD_BUG_ON_MSG'
   59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
      |                     ^~~~~~~~~~~~~~~~
include/linux/huge_mm.h:107:28: note: in expansion of macro 'BUILD_BUG'
  107 | #define HPAGE_PUD_SHIFT ({ BUILD_BUG(); 0; })
      |                            ^~~~~~~~~
include/linux/huge_mm.h:115:26: note: in expansion of macro 'HPAGE_PUD_SHIFT'
  115 | #define HPAGE_PUD_ORDER (HPAGE_PUD_SHIFT-PAGE_SHIFT)
      |                          ^~~~~~~~~~~~~~~
include/linux/huge_mm.h:116:26: note: in expansion of macro 'HPAGE_PUD_ORDER'
  116 | #define HPAGE_PUD_NR (1<<HPAGE_PUD_ORDER)
      |                          ^~~~~~~~~~~~~~~
mm/rmap.c:1562:44: note: in expansion of macro 'HPAGE_PUD_NR'
 1562 |         __folio_add_file_rmap(folio, page, HPAGE_PUD_NR, vma, RMAP_LEVEL_PUD);
      |                                            ^~~~~~~~~~~~
mm/rmap.c: In function 'folio_remove_rmap_pud':
include/linux/compiler_types.h:542:45: error: call to '__compiletime_assert_329' declared with attribute error: BUILD_BUG failed
  542 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |                                             ^
include/linux/compiler_types.h:523:25: note: in definition of macro '__compiletime_assert'
  523 |                         prefix ## suffix();                             \
      |                         ^~~~~~
include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
  542 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |         ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
   39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
      |                                     ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:59:21: note: in expansion of macro 'BUILD_BUG_ON_MSG'
   59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
      |                     ^~~~~~~~~~~~~~~~
include/linux/huge_mm.h:107:28: note: in expansion of macro 'BUILD_BUG'
  107 | #define HPAGE_PUD_SHIFT ({ BUILD_BUG(); 0; })
      |                            ^~~~~~~~~
include/linux/huge_mm.h:115:26: note: in expansion of macro 'HPAGE_PUD_SHIFT'
  115 | #define HPAGE_PUD_ORDER (HPAGE_PUD_SHIFT-PAGE_SHIFT)
      |                          ^~~~~~~~~~~~~~~
include/linux/huge_mm.h:116:26: note: in expansion of macro 'HPAGE_PUD_ORDER'
  116 | #define HPAGE_PUD_NR (1<<HPAGE_PUD_ORDER)
      |                          ^~~~~~~~~~~~~~~
mm/rmap.c:1694:42: note: in expansion of macro 'HPAGE_PUD_NR'
 1694 |         __folio_remove_rmap(folio, page, HPAGE_PUD_NR, vma, RMAP_LEVEL_PUD);
      |                                          ^~~~~~~~~~~~

> Caused by commit
> 
>   ce9c7ffcf303 ("rmap: add support for PUD sized mappings to rmap")
> 
> $ grep CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD .config
> CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=y
> $ grep CONFIG_PGTABLE_HAS_HUGE_LEAVES .config
> $
> 
> from include/linux/huge_mm.h:
> 
> #ifdef CONFIG_PGTABLE_HAS_HUGE_LEAVES
> #define HPAGE_PMD_SHIFT PMD_SHIFT
> #define HPAGE_PUD_SHIFT PUD_SHIFT
> #else
> #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
> #define HPAGE_PUD_SHIFT ({ BUILD_BUG(); 0; })
> #endif
> 
> I have applied this hack for today:
> 
> From: Stephen Rothwell <sfr@...b.auug.org.au>
> Date: Thu, 9 Jan 2025 15:39:17 +1100
> Subject: [PATCH] fix up for "rmap: add support for PUD sized mappings to rmap"
> 
> Signed-off-by: Stephen Rothwell <sfr@...b.auug.org.au>
> ---
>  mm/rmap.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/rmap.c b/mm/rmap.c
> index 227c60e38261..721d4f7b7570 100644
> --- a/mm/rmap.c
> +++ b/mm/rmap.c
> @@ -1558,7 +1558,7 @@ void folio_add_file_rmap_pmd(struct folio *folio, struct page *page,
>  void folio_add_file_rmap_pud(struct folio *folio, struct page *page,
>  		struct vm_area_struct *vma)
>  {
> -#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
> +#if defined(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD) && defined(CONFIG_PGTABLE_HAS_HUGE_LEAVES)
>  	__folio_add_file_rmap(folio, page, HPAGE_PUD_NR, vma, RMAP_LEVEL_PUD);
>  #else
>  	WARN_ON_ONCE(true);
> @@ -1690,7 +1690,7 @@ void folio_remove_rmap_pmd(struct folio *folio, struct page *page,
>  void folio_remove_rmap_pud(struct folio *folio, struct page *page,
>  		struct vm_area_struct *vma)
>  {
> -#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
> +#if defined(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD) && defined(CONFIG_PGTABLE_HAS_HUGE_LEAVES)
>  	__folio_remove_rmap(folio, page, HPAGE_PUD_NR, vma, RMAP_LEVEL_PUD);
>  #else
>  	WARN_ON_ONCE(true);

-- 
Cheers,
Stephen Rothwell

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ