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: <aPZf1aOyhVHVedok@gourry-fedora-PF4VCD3F>
Date: Mon, 20 Oct 2025 12:14:13 -0400
From: Gregory Price <gourry@...rry.net>
To: David Hildenbrand <david@...hat.com>
Cc: linux-mm@...ck.org, muchun.song@...ux.dev, osalvador@...e.de,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] hugetlb.h: flatten logic in
 arch_hugetlb_migration_supported

On Mon, Oct 13, 2025 at 10:10:05AM +0200, David Hildenbrand wrote:
> On 08.10.25 23:26, Gregory Price wrote:
> > diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
> > index 526d27e88b3b..b030850975ef 100644
> > --- a/include/linux/hugetlb.h
> > +++ b/include/linux/hugetlb.h
> > @@ -876,12 +876,9 @@ static inline void folio_clear_hugetlb_hwpoison(struct folio *folio)
> >   #ifndef arch_hugetlb_migration_supported
> >   static inline bool arch_hugetlb_migration_supported(struct hstate *h)
> >   {
> > -	if ((huge_page_shift(h) == PMD_SHIFT) ||
> > +	return ((huge_page_shift(h) == PMD_SHIFT) ||
> >   		(huge_page_shift(h) == PUD_SHIFT) ||
> > -			(huge_page_shift(h) == PGDIR_SHIFT))
> > -		return true;
> > -	else
> > -		return false;
> > +		(huge_page_shift(h) == PGDIR_SHIFT));
> 
> switch (huge_page_shift(h)) {
> case PMD_SHIFT:
> case PUD_SHIFT:
> case PGDIR_SHIFT:

PGDIR_SHIFT is not a constant on x86.

~Gregory

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ