[PATCH] arm64/mm: Drop setting PTE_TYPE_PAGE in pte_mkcont()

Anshuman Khandual posted 1 patch 2 weeks, 6 days ago
arch/arm64/include/asm/pgtable.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH] arm64/mm: Drop setting PTE_TYPE_PAGE in pte_mkcont()
Posted by Anshuman Khandual 2 weeks, 6 days ago
PTE_TYPE_PAGE bits were being set in pte_mkcont() because PTE_TABLE_BIT was
being cleared in pte_mkhuge(). But after arch_make_huge_pte() modification,
which dropped pte_mkhuge() completely, setting back PTE_TYPE_PAGE bits are
no longer necessary. Hence this changes pte_mkcont() to just set PTE_CONT.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
This applies on v6.12-rc6 after applying the earlier arch_make_huge_pte()
re-organization patch.

https://lore.kernel.org/all/20241029044529.2624785-1-anshuman.khandual@arm.com/
 
 arch/arm64/include/asm/pgtable.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index fa4c32a9f572..17f7fb05e79e 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -265,8 +265,7 @@ static inline pte_t pte_mkspecial(pte_t pte)
 
 static inline pte_t pte_mkcont(pte_t pte)
 {
-	pte = set_pte_bit(pte, __pgprot(PTE_CONT));
-	return set_pte_bit(pte, __pgprot(PTE_TYPE_PAGE));
+	return set_pte_bit(pte, __pgprot(PTE_CONT));
 }
 
 static inline pte_t pte_mknoncont(pte_t pte)
-- 
2.30.2
Re: [PATCH] arm64/mm: Drop setting PTE_TYPE_PAGE in pte_mkcont()
Posted by Catalin Marinas 2 weeks, 5 days ago
On Mon, 04 Nov 2024 09:46:17 +0530, Anshuman Khandual wrote:
> PTE_TYPE_PAGE bits were being set in pte_mkcont() because PTE_TABLE_BIT was
> being cleared in pte_mkhuge(). But after arch_make_huge_pte() modification,
> which dropped pte_mkhuge() completely, setting back PTE_TYPE_PAGE bits are
> no longer necessary. Hence this changes pte_mkcont() to just set PTE_CONT.
> 
> 

Applied to arm64 (for-next/misc), thanks!

[1/1] arm64/mm: Drop setting PTE_TYPE_PAGE in pte_mkcont()
      https://git.kernel.org/arm64/c/ced841702ee7

-- 
Catalin