From 4741bcbac4f477701506a184ec8d6a2ffedd93ce Mon Sep 17 00:00:00 2001 From: Kalesh Singh Date: Tue, 8 Nov 2022 09:13:13 -0800 Subject: [PATCH] Revert "FROMLIST: mm: x86: add CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG" This reverts commit 95acc9c28b2420ab98813bb1dbe6c02bd4bcee96. To be replaced with upstream version. Bug: 249601646 Change-Id: Ibcf628e3313140e79c18f33e0437356a23f0ea00 Signed-off-by: Kalesh Singh --- arch/Kconfig | 9 --------- arch/x86/Kconfig | 1 - arch/x86/include/asm/pgtable.h | 3 +-- arch/x86/mm/pgtable.c | 5 +---- include/linux/pgtable.h | 4 ++-- 5 files changed, 4 insertions(+), 18 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index d39f92e9cf51..9528d0bd544d 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -1180,15 +1180,6 @@ config ARCH_SPLIT_ARG64 If a 32-bit architecture requires 64-bit arguments to be split into pairs of 32-bit arguments, select this option. -config ARCH_HAS_NONLEAF_PMD_YOUNG - bool - depends on PGTABLE_LEVELS > 2 - help - Architectures that select this option are capable of setting the - accessed bit in non-leaf PMD entries when using them as part of linear - address translations. Page table walkers that clear the accessed bit - may use this capability to reduce their search space. - source "kernel/gcov/Kconfig" source "scripts/gcc-plugins/Kconfig" diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index f6fb0f6277b9..5e28d4a0dff5 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -76,7 +76,6 @@ config X86 select ARCH_HAS_PMEM_API if X86_64 select ARCH_HAS_PTE_DEVMAP if X86_64 select ARCH_HAS_PTE_SPECIAL - select ARCH_HAS_NONLEAF_PMD_YOUNG select ARCH_HAS_UACCESS_FLUSHCACHE if X86_64 select ARCH_HAS_COPY_MC if X86_64 select ARCH_HAS_SET_MEMORY diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index ed09aca6203a..7792a0624b64 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -846,8 +846,7 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd) static inline int pmd_bad(pmd_t pmd) { - return (pmd_flags(pmd) & ~(_PAGE_USER | _PAGE_ACCESSED)) != - (_KERNPG_TABLE & ~_PAGE_ACCESSED); + return (pmd_flags(pmd) & ~_PAGE_USER) != _KERNPG_TABLE; } static inline unsigned long pages_to_mb(unsigned long npg) diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index fd0f1cb6fc6c..f6a9e2e36642 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c @@ -550,7 +550,7 @@ int ptep_test_and_clear_young(struct vm_area_struct *vma, return ret; } -#if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG) +#ifdef CONFIG_TRANSPARENT_HUGEPAGE int pmdp_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pmd_t *pmdp) { @@ -562,9 +562,6 @@ int pmdp_test_and_clear_young(struct vm_area_struct *vma, return ret; } -#endif - -#ifdef CONFIG_TRANSPARENT_HUGEPAGE int pudp_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pud_t *pudp) { diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index ab7287e59c07..3f6deb434074 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -194,7 +194,7 @@ static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, #endif #ifndef __HAVE_ARCH_PMDP_TEST_AND_CLEAR_YOUNG -#if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG) +#ifdef CONFIG_TRANSPARENT_HUGEPAGE static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp) @@ -215,7 +215,7 @@ static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma, BUILD_BUG(); return 0; } -#endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG */ +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #endif #ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH