Commit 74bf0f1a authored by Anshuman Khandual's avatar Anshuman Khandual Committed by Liu Shixin
Browse files

arm64/mm: Drop setting PTE_TYPE_PAGE in pte_mkcont()

mainline inclusion
from mainline-v6.13-rc1
commit ced841702ee7013ef08159a2cb5cadf0e0820b13
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBPX2S

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ced841702ee7013ef08159a2cb5cadf0e0820b13



--------------------------------

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 in commit f8192813dcbe ("arm64/mm: Re-organize
arch_make_huge_pte()"), which dropped pte_mkhuge() completely, setting
back PTE_TYPE_PAGE bits is no longer necessary. Change pte_mkcont() to
only set PTE_CONT.

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: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
Link: https://lore.kernel.org/r/20241104041617.3804617-1-anshuman.khandual@arm.com


Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
parent 1d6991f2
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -236,8 +236,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)