Revert "arm64: errata: Workaround possible Cortex-A715 [ESR|FAR]_ELx corruption"
authorWill Deacon <will@kernel.org>
Thu, 15 Dec 2022 17:59:12 +0000 (17:59 +0000)
committerWill Deacon <will@kernel.org>
Thu, 15 Dec 2022 17:59:12 +0000 (17:59 +0000)
This reverts commit 44ecda71fd8a70185c270f5914ac563827fe1d4c.

All versions of this patch on the mailing list, including the version
that ended up getting merged, have portions of code guarded by the
non-existent CONFIG_ARM64_WORKAROUND_2645198 option. Although Anshuman
says he tested the code with some additional debug changes [1], I'm
hesitant to fix the CONFIG option and light up a bunch of code right
before I (and others) disappear for the end of year holidays, during
which time we won't be around to deal with any fallout.

So revert the change for now. We can bring back a fixed, tested version
for a later -rc when folks are thinking about things other than trees
and turkeys.

[1] https://lore.kernel.org/r/b6f61241-e436-5db1-1053-3b441080b8d6@arm.com
Reported-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Link: https://lore.kernel.org/r/20221215094811.23188-1-lukas.bulwahn@gmail.com
Signed-off-by: Will Deacon <will@kernel.org>
Documentation/arm64/silicon-errata.rst
arch/arm64/Kconfig
arch/arm64/include/asm/hugetlb.h
arch/arm64/include/asm/pgtable.h
arch/arm64/kernel/cpu_errata.c
arch/arm64/mm/hugetlbpage.c
arch/arm64/mm/mmu.c
arch/arm64/tools/cpucaps

index ec5f889..808ade4 100644 (file)
@@ -120,8 +120,6 @@ stable kernels.
 +----------------+-----------------+-----------------+-----------------------------+
 | ARM            | Cortex-A710     | #2224489        | ARM64_ERRATUM_2224489       |
 +----------------+-----------------+-----------------+-----------------------------+
-| ARM            | Cortex-A715     | #2645198        | ARM64_ERRATUM_2645198       |
-+----------------+-----------------+-----------------+-----------------------------+
 | ARM            | Cortex-X2       | #2119858        | ARM64_ERRATUM_2119858       |
 +----------------+-----------------+-----------------+-----------------------------+
 | ARM            | Cortex-X2       | #2224489        | ARM64_ERRATUM_2224489       |
index c6d15dd..1ccf7e0 100644 (file)
@@ -971,22 +971,6 @@ config ARM64_ERRATUM_2457168
 
          If unsure, say Y.
 
-config ARM64_ERRATUM_2645198
-       bool "Cortex-A715: 2645198: Workaround possible [ESR|FAR]_ELx corruption"
-       default y
-       help
-         This option adds the workaround for ARM Cortex-A715 erratum 2645198.
-
-         If a Cortex-A715 cpu sees a page mapping permissions change from executable
-         to non-executable, it may corrupt the ESR_ELx and FAR_ELx registers on the
-         next instruction abort caused by permission fault.
-
-         Only user-space does executable to non-executable permission transition via
-         mprotect() system call. Workaround the problem by doing a break-before-make
-         TLB invalidation, for all changes to executable user space mappings.
-
-         If unsure, say Y.
-
 config CAVIUM_ERRATUM_22375
        bool "Cavium erratum 22375, 24313"
        default y
index 6a4a1ab..d20f5da 100644 (file)
@@ -49,15 +49,6 @@ extern pte_t huge_ptep_get(pte_t *ptep);
 
 void __init arm64_hugetlb_cma_reserve(void);
 
-#define huge_ptep_modify_prot_start huge_ptep_modify_prot_start
-extern pte_t huge_ptep_modify_prot_start(struct vm_area_struct *vma,
-                                        unsigned long addr, pte_t *ptep);
-
-#define huge_ptep_modify_prot_commit huge_ptep_modify_prot_commit
-extern void huge_ptep_modify_prot_commit(struct vm_area_struct *vma,
-                                        unsigned long addr, pte_t *ptep,
-                                        pte_t old_pte, pte_t new_pte);
-
 #include <asm-generic/hugetlb.h>
 
 #endif /* __ASM_HUGETLB_H */
index 0dd3cd3..323ee23 100644 (file)
@@ -1095,15 +1095,6 @@ static inline bool pud_sect_supported(void)
 }
 
 
-#define __HAVE_ARCH_PTEP_MODIFY_PROT_TRANSACTION
-#define ptep_modify_prot_start ptep_modify_prot_start
-extern pte_t ptep_modify_prot_start(struct vm_area_struct *vma,
-                                   unsigned long addr, pte_t *ptep);
-
-#define ptep_modify_prot_commit ptep_modify_prot_commit
-extern void ptep_modify_prot_commit(struct vm_area_struct *vma,
-                                   unsigned long addr, pte_t *ptep,
-                                   pte_t old_pte, pte_t new_pte);
 #endif /* !__ASSEMBLY__ */
 
 #endif /* __ASM_PGTABLE_H */
index 307faa2..89ac000 100644 (file)
@@ -661,13 +661,6 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
                CAP_MIDR_RANGE_LIST(trbe_write_out_of_range_cpus),
        },
 #endif
-#ifdef CONFIG_ARM64_ERRATUM_2645198
-       {
-               .desc = "ARM erratum 2645198",
-               .capability = ARM64_WORKAROUND_2645198,
-               ERRATA_MIDR_ALL_VERSIONS(MIDR_CORTEX_A715)
-       },
-#endif
 #ifdef CONFIG_ARM64_ERRATUM_2077057
        {
                .desc = "ARM erratum 2077057",
index cd8d96e..35e9a46 100644 (file)
@@ -559,24 +559,3 @@ bool __init arch_hugetlb_valid_size(unsigned long size)
 {
        return __hugetlb_valid_size(size);
 }
-
-pte_t huge_ptep_modify_prot_start(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
-{
-       if (IS_ENABLED(CONFIG_ARM64_WORKAROUND_2645198) &&
-           cpus_have_const_cap(ARM64_WORKAROUND_2645198)) {
-               /*
-                * Break-before-make (BBM) is required for all user space mappings
-                * when the permission changes from executable to non-executable
-                * in cases where cpu is affected with errata #2645198.
-                */
-               if (pte_user_exec(READ_ONCE(*ptep)))
-                       return huge_ptep_clear_flush(vma, addr, ptep);
-       }
-       return huge_ptep_get_and_clear(vma->vm_mm, addr, ptep);
-}
-
-void huge_ptep_modify_prot_commit(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep,
-                                 pte_t old_pte, pte_t pte)
-{
-       set_huge_pte_at(vma->vm_mm, addr, ptep, pte);
-}
index 2368e4d..d386033 100644 (file)
@@ -1702,24 +1702,3 @@ static int __init prevent_bootmem_remove_init(void)
 }
 early_initcall(prevent_bootmem_remove_init);
 #endif
-
-pte_t ptep_modify_prot_start(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
-{
-       if (IS_ENABLED(CONFIG_ARM64_WORKAROUND_2645198) &&
-           cpus_have_const_cap(ARM64_WORKAROUND_2645198)) {
-               /*
-                * Break-before-make (BBM) is required for all user space mappings
-                * when the permission changes from executable to non-executable
-                * in cases where cpu is affected with errata #2645198.
-                */
-               if (pte_user_exec(READ_ONCE(*ptep)))
-                       return ptep_clear_flush(vma, addr, ptep);
-       }
-       return ptep_get_and_clear(vma->vm_mm, addr, ptep);
-}
-
-void ptep_modify_prot_commit(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep,
-                            pte_t old_pte, pte_t pte)
-{
-       set_pte_at(vma->vm_mm, addr, ptep, pte);
-}
index dfeb2c5..a86ee37 100644 (file)
@@ -71,7 +71,6 @@ WORKAROUND_2038923
 WORKAROUND_2064142
 WORKAROUND_2077057
 WORKAROUND_2457168
-WORKAROUND_2645198
 WORKAROUND_2658417
 WORKAROUND_TRBE_OVERWRITE_FILL_MODE
 WORKAROUND_TSB_FLUSH_FAILURE