From nobody Wed Feb 11 05:14:41 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E64BA311C21 for ; Mon, 9 Feb 2026 22:15:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770675323; cv=none; b=P3ijUgQiEIkZ3P6ToEVFeFqmM4VMELtvEuTrCj2ADVCBdVivqP+2RlJMlxAgK2VgIpBx/MLR/0V+diWrApUwdUrFW633MnxLHB5ymDRtfvNiYDqsJbyT3GFlAO7VbDISCSiCa+Qjcm73jYcZjU9PkZtxyymscd9YGJYVrDZTEcc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770675323; c=relaxed/simple; bh=c+dQoUKxCKQJ3RMdjtHRktAK00Nsp9a+z0lb5WyAZig=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DmYgg/RxQ48yxOd6xnZbpy98P7J/VQtmmKyg6blMMaH1GdVjL4ywlijG/0l1SaTO4HJpuBic06h37GC7mkanmz8X0vsJv2ni/krHnlY9jzntQBbhHdRvXeZTlHAEo+X3l6JfcIADzlNPLddkyQR5RvuIIZ+KQ5+VAKtrY8Z1DMc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ZkViLxYi; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZkViLxYi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770675308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k0qxewW2YSQTThSWCJkjfHByvyqMVZJcNKxWE2448z8=; b=ZkViLxYiwzqCG5lNTQ/OpV59wHqoPURgBIicYcMqckJYEOMvxsWe1oEN7+fQQRKaylvSUh AoxKZPlprdRewRQhG+h97/oUstlcOzv0EwbnE8+urJbfTb+JLqAddMrQWIgoYWC4O4B3i5 FHC2WOZUjxL/e0+YBCU3gkryHLrvcuM= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-456--g__dwcwP3G8CSOQpiOS9Q-1; Mon, 09 Feb 2026 17:15:03 -0500 X-MC-Unique: -g__dwcwP3G8CSOQpiOS9Q-1 X-Mimecast-MFC-AGG-ID: -g__dwcwP3G8CSOQpiOS9Q_1770675302 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 40DB61956095; Mon, 9 Feb 2026 22:15:02 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.65.66]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2595318003F6; Mon, 9 Feb 2026 22:15:01 +0000 (UTC) From: Luiz Capitulino To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, david@kernel.org, baolin.wang@linux.alibaba.com Cc: ryan.roberts@arm.com, akpm@linux-foundation.org, lorenzo.stoakes@oracle.com Subject: [PATCH v2 11/11] mm: thp: x86: cleanup PSE feature bit usage Date: Mon, 9 Feb 2026 17:14:33 -0500 Message-ID: In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" 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 can enable 2 MiB or 4 MiB page sizes so it must be checked. To clean this up, this commit: 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 by implementing arch_has_pmd_leaves() Signed-off-by: Luiz Capitulino --- 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 =20 -#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/pgtab= le_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) =20 +#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__ */ =20 /* --=20 2.53.0