diff options
author | Linus Torvalds | 2022-12-16 13:46:41 -0600 |
---|---|---|
committer | Linus Torvalds | 2022-12-16 13:46:41 -0600 |
commit | 77856d911a8c8724ee8e2b09d55979fc1de8f1c0 (patch) | |
tree | e895658d3ec29c6892ec20412765698c39ab3aa9 /arch | |
parent | aa4800e31c547ed00681318335ca2298c4bca33a (diff) | |
parent | c0cd1d541704c45030cbb2031612fdd68e8e15d5 (diff) |
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Will Deacon:
- Fix Kconfig dependencies to re-allow the enabling of function graph
tracer and shadow call stacks at the same time.
- Revert the workaround for CPU erratum #2645198 since the CONFIG_
guards were incorrect and the code has therefore not seen any real
exposure in -next.
* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
Revert "arm64: errata: Workaround possible Cortex-A715 [ESR|FAR]_ELx corruption"
ftrace: Allow WITH_ARGS flavour of graph tracer with shadow call stack
Diffstat (limited to 'arch')
-rw-r--r-- | arch/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm64/Kconfig | 16 | ||||
-rw-r--r-- | arch/arm64/include/asm/hugetlb.h | 9 | ||||
-rw-r--r-- | arch/arm64/include/asm/pgtable.h | 9 | ||||
-rw-r--r-- | arch/arm64/kernel/cpu_errata.c | 7 | ||||
-rw-r--r-- | arch/arm64/mm/hugetlbpage.c | 21 | ||||
-rw-r--r-- | arch/arm64/mm/mmu.c | 21 | ||||
-rw-r--r-- | arch/arm64/tools/cpucaps | 1 |
8 files changed, 1 insertions, 85 deletions
diff --git a/arch/Kconfig b/arch/Kconfig index a3c47c2a79cd..12e3ddabac9d 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -638,7 +638,7 @@ config ARCH_SUPPORTS_SHADOW_CALL_STACK config SHADOW_CALL_STACK bool "Shadow Call Stack" depends on ARCH_SUPPORTS_SHADOW_CALL_STACK - depends on DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER + depends on DYNAMIC_FTRACE_WITH_ARGS || DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER help This option enables the compiler's Shadow Call Stack, which uses a shadow stack to protect function return addresses from diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index cf6d1cd8b6dc..03934808b2ed 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -972,22 +972,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 diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h index 6a4a1ab8eb23..d20f5da2d76f 100644 --- a/arch/arm64/include/asm/hugetlb.h +++ b/arch/arm64/include/asm/hugetlb.h @@ -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 */ diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 6914add66bcf..b4bbeed80fb6 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -1093,15 +1093,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 */ diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c index 307faa2b4395..89ac00084f38 100644 --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c @@ -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", diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c index cd8d96e1fa1a..35e9a468d13e 100644 --- a/arch/arm64/mm/hugetlbpage.c +++ b/arch/arm64/mm/hugetlbpage.c @@ -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); -} diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 12915f379c22..14c87e8d69d8 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -1630,24 +1630,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); -} diff --git a/arch/arm64/tools/cpucaps b/arch/arm64/tools/cpucaps index dfeb2c51e257..a86ee376920a 100644 --- a/arch/arm64/tools/cpucaps +++ b/arch/arm64/tools/cpucaps @@ -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 |