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: <58caeb32-f50a-4056-828a-476d958955ad@kernel.org>
Date: Mon, 17 Nov 2025 18:49:26 +0100
From: "David Hildenbrand (Red Hat)" <david@...nel.org>
To: Luiz Capitulino <luizcap@...hat.com>, linux-kernel@...r.kernel.org,
 linux-mm@...ck.org
Cc: ryan.roberts@....com, akpm@...ux-foundation.org,
 lorenzo.stoakes@...cle.com
Subject: Re: [RFC 10/10] mm: thp: x86: cleanup PSE feature bit usage

On 06.11.25 22:28, Luiz Capitulino wrote:
> Historically, THP support on x86 checked the PSE feature bit to enable
> THP. On 64-bit, this check is redundant since PSE is always enabled by
> default for compatibility. On 32-bit, PSE enables 4MB page support and

Or 2MB support with 4byte PTEs I guess?

> must be checked. To clean this up, this commit:
> 

Likely the subject should start with: "x86/mm:"


> 1. Drops arch_has_pmd_leaves() from common x86 code. For 64-bit,
>     we assume PMD-sized pages are always supported
> 
> 2. Checks for PSE only on 32-bit, using arch_has_pmd_leaves()
> 
> Signed-off-by: Luiz Capitulino <luizcap@...hat.com>
> ---
>   arch/x86/include/asm/pgtable.h    | 6 ------
>   arch/x86/include/asm/pgtable_32.h | 6 ++++++
>   2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
> index 08d109280e36..55b88de5178f 100644
> --- a/arch/x86/include/asm/pgtable.h
> +++ b/arch/x86/include/asm/pgtable.h
> @@ -313,12 +313,6 @@ static inline int pud_trans_huge(pud_t pud)
>   }
>   #endif
>   
> -#define arch_has_pmd_leaves arch_has_pmd_leaves
> -static inline int arch_has_pmd_leaves(void)
> -{
> -	return boot_cpu_has(X86_FEATURE_PSE);
> -}
> -
>   #ifdef CONFIG_ARCH_SUPPORTS_PMD_PFNMAP
>   static inline bool pmd_special(pmd_t pmd)
>   {
> diff --git a/arch/x86/include/asm/pgtable_32.h b/arch/x86/include/asm/pgtable_32.h
> index b612cc57a4d3..3bd51cfa431e 100644
> --- a/arch/x86/include/asm/pgtable_32.h
> +++ b/arch/x86/include/asm/pgtable_32.h
> @@ -45,6 +45,12 @@ do {						\
>   	flush_tlb_one_kernel((vaddr));		\
>   } while (0)
>   
> +#define arch_has_pmd_leaves arch_has_pmd_leaves
> +static inline int arch_has_pmd_leaves(void)
> +{
> +	return boot_cpu_has(X86_FEATURE_PSE);
> +}
> +
>   #endif /* !__ASSEMBLER__ */
>   
>   /*

Right, IIUC 64bit should neve rrequire this check.

-- 
Cheers

David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ