diff options
| -rw-r--r-- | Documentation/arm64/silicon-errata.txt | 1 | ||||
| -rw-r--r-- | arch/arm64/Kconfig | 12 | ||||
| -rw-r--r-- | arch/arm64/include/asm/assembler.h | 10 | ||||
| -rw-r--r-- | arch/arm64/include/asm/cpufeature.h | 3 | ||||
| -rw-r--r-- | arch/arm64/include/asm/cputype.h | 2 | ||||
| -rw-r--r-- | arch/arm64/include/asm/pgtable.h | 41 | ||||
| -rw-r--r-- | arch/arm64/kernel/cpu-reset.S | 1 | ||||
| -rw-r--r-- | arch/arm64/kernel/cpufeature.c | 3 | ||||
| -rw-r--r-- | arch/arm64/kernel/efi-entry.S | 2 | ||||
| -rw-r--r-- | arch/arm64/kernel/fpsimd.c | 2 | ||||
| -rw-r--r-- | arch/arm64/kernel/head.S | 1 | ||||
| -rw-r--r-- | arch/arm64/kernel/hw_breakpoint.c | 2 | ||||
| -rw-r--r-- | arch/arm64/kernel/relocate_kernel.S | 1 | ||||
| -rw-r--r-- | arch/arm64/kvm/hyp-init.S | 1 | ||||
| -rw-r--r-- | arch/arm64/mm/dump.c | 2 | ||||
| -rw-r--r-- | arch/arm64/mm/fault.c | 5 | ||||
| -rw-r--r-- | arch/arm64/mm/init.c | 3 |
17 files changed, 64 insertions, 28 deletions
diff --git a/Documentation/arm64/silicon-errata.txt b/Documentation/arm64/silicon-errata.txt index 304bf22bb83c..fc1c884fea10 100644 --- a/Documentation/arm64/silicon-errata.txt +++ b/Documentation/arm64/silicon-errata.txt | |||
| @@ -75,3 +75,4 @@ stable kernels. | |||
| 75 | | Qualcomm Tech. | Falkor v1 | E1003 | QCOM_FALKOR_ERRATUM_1003 | | 75 | | Qualcomm Tech. | Falkor v1 | E1003 | QCOM_FALKOR_ERRATUM_1003 | |
| 76 | | Qualcomm Tech. | Falkor v1 | E1009 | QCOM_FALKOR_ERRATUM_1009 | | 76 | | Qualcomm Tech. | Falkor v1 | E1009 | QCOM_FALKOR_ERRATUM_1009 | |
| 77 | | Qualcomm Tech. | QDF2400 ITS | E0065 | QCOM_QDF2400_ERRATUM_0065 | | 77 | | Qualcomm Tech. | QDF2400 ITS | E0065 | QCOM_QDF2400_ERRATUM_0065 | |
| 78 | | Qualcomm Tech. | Falkor v{1,2} | E1041 | QCOM_FALKOR_ERRATUM_1041 | | ||
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index a93339f5178f..c9a7e9e1414f 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig | |||
| @@ -557,7 +557,6 @@ config QCOM_QDF2400_ERRATUM_0065 | |||
| 557 | 557 | ||
| 558 | If unsure, say Y. | 558 | If unsure, say Y. |
| 559 | 559 | ||
| 560 | |||
| 561 | config SOCIONEXT_SYNQUACER_PREITS | 560 | config SOCIONEXT_SYNQUACER_PREITS |
| 562 | bool "Socionext Synquacer: Workaround for GICv3 pre-ITS" | 561 | bool "Socionext Synquacer: Workaround for GICv3 pre-ITS" |
| 563 | default y | 562 | default y |
| @@ -576,6 +575,17 @@ config HISILICON_ERRATUM_161600802 | |||
| 576 | a 128kB offset to be applied to the target address in this commands. | 575 | a 128kB offset to be applied to the target address in this commands. |
| 577 | 576 | ||
| 578 | If unsure, say Y. | 577 | If unsure, say Y. |
| 578 | |||
| 579 | config QCOM_FALKOR_ERRATUM_E1041 | ||
| 580 | bool "Falkor E1041: Speculative instruction fetches might cause errant memory access" | ||
| 581 | default y | ||
| 582 | help | ||
| 583 | Falkor CPU may speculatively fetch instructions from an improper | ||
| 584 | memory location when MMU translation is changed from SCTLR_ELn[M]=1 | ||
| 585 | to SCTLR_ELn[M]=0. Prefix an ISB instruction to fix the problem. | ||
| 586 | |||
| 587 | If unsure, say Y. | ||
| 588 | |||
| 579 | endmenu | 589 | endmenu |
| 580 | 590 | ||
| 581 | 591 | ||
diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index aef72d886677..8b168280976f 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h | |||
| @@ -512,4 +512,14 @@ alternative_else_nop_endif | |||
| 512 | #endif | 512 | #endif |
| 513 | .endm | 513 | .endm |
| 514 | 514 | ||
| 515 | /** | ||
| 516 | * Errata workaround prior to disable MMU. Insert an ISB immediately prior | ||
| 517 | * to executing the MSR that will change SCTLR_ELn[M] from a value of 1 to 0. | ||
| 518 | */ | ||
| 519 | .macro pre_disable_mmu_workaround | ||
| 520 | #ifdef CONFIG_QCOM_FALKOR_ERRATUM_E1041 | ||
| 521 | isb | ||
| 522 | #endif | ||
| 523 | .endm | ||
| 524 | |||
| 515 | #endif /* __ASM_ASSEMBLER_H */ | 525 | #endif /* __ASM_ASSEMBLER_H */ |
diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h index ac67cfc2585a..060e3a4008ab 100644 --- a/arch/arm64/include/asm/cpufeature.h +++ b/arch/arm64/include/asm/cpufeature.h | |||
| @@ -60,6 +60,9 @@ enum ftr_type { | |||
| 60 | #define FTR_VISIBLE true /* Feature visible to the user space */ | 60 | #define FTR_VISIBLE true /* Feature visible to the user space */ |
| 61 | #define FTR_HIDDEN false /* Feature is hidden from the user */ | 61 | #define FTR_HIDDEN false /* Feature is hidden from the user */ |
| 62 | 62 | ||
| 63 | #define FTR_VISIBLE_IF_IS_ENABLED(config) \ | ||
| 64 | (IS_ENABLED(config) ? FTR_VISIBLE : FTR_HIDDEN) | ||
| 65 | |||
| 63 | struct arm64_ftr_bits { | 66 | struct arm64_ftr_bits { |
| 64 | bool sign; /* Value is signed ? */ | 67 | bool sign; /* Value is signed ? */ |
| 65 | bool visible; | 68 | bool visible; |
diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h index 235e77d98261..cbf08d7cbf30 100644 --- a/arch/arm64/include/asm/cputype.h +++ b/arch/arm64/include/asm/cputype.h | |||
| @@ -91,6 +91,7 @@ | |||
| 91 | #define BRCM_CPU_PART_VULCAN 0x516 | 91 | #define BRCM_CPU_PART_VULCAN 0x516 |
| 92 | 92 | ||
| 93 | #define QCOM_CPU_PART_FALKOR_V1 0x800 | 93 | #define QCOM_CPU_PART_FALKOR_V1 0x800 |
| 94 | #define QCOM_CPU_PART_FALKOR 0xC00 | ||
| 94 | 95 | ||
| 95 | #define MIDR_CORTEX_A53 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A53) | 96 | #define MIDR_CORTEX_A53 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A53) |
| 96 | #define MIDR_CORTEX_A57 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A57) | 97 | #define MIDR_CORTEX_A57 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A57) |
| @@ -99,6 +100,7 @@ | |||
| 99 | #define MIDR_THUNDERX_81XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_81XX) | 100 | #define MIDR_THUNDERX_81XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_81XX) |
| 100 | #define MIDR_THUNDERX_83XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_83XX) | 101 | #define MIDR_THUNDERX_83XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_83XX) |
| 101 | #define MIDR_QCOM_FALKOR_V1 MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_FALKOR_V1) | 102 | #define MIDR_QCOM_FALKOR_V1 MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_FALKOR_V1) |
| 103 | #define MIDR_QCOM_FALKOR MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_FALKOR) | ||
| 102 | 104 | ||
| 103 | #ifndef __ASSEMBLY__ | 105 | #ifndef __ASSEMBLY__ |
| 104 | 106 | ||
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 149d05fb9421..bdcc7f1c9d06 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h | |||
| @@ -42,6 +42,8 @@ | |||
| 42 | #include <asm/cmpxchg.h> | 42 | #include <asm/cmpxchg.h> |
| 43 | #include <asm/fixmap.h> | 43 | #include <asm/fixmap.h> |
| 44 | #include <linux/mmdebug.h> | 44 | #include <linux/mmdebug.h> |
| 45 | #include <linux/mm_types.h> | ||
| 46 | #include <linux/sched.h> | ||
| 45 | 47 | ||
| 46 | extern void __pte_error(const char *file, int line, unsigned long val); | 48 | extern void __pte_error(const char *file, int line, unsigned long val); |
| 47 | extern void __pmd_error(const char *file, int line, unsigned long val); | 49 | extern void __pmd_error(const char *file, int line, unsigned long val); |
| @@ -149,12 +151,20 @@ static inline pte_t pte_mkwrite(pte_t pte) | |||
| 149 | 151 | ||
| 150 | static inline pte_t pte_mkclean(pte_t pte) | 152 | static inline pte_t pte_mkclean(pte_t pte) |
| 151 | { | 153 | { |
| 152 | return clear_pte_bit(pte, __pgprot(PTE_DIRTY)); | 154 | pte = clear_pte_bit(pte, __pgprot(PTE_DIRTY)); |
| 155 | pte = set_pte_bit(pte, __pgprot(PTE_RDONLY)); | ||
| 156 | |||
| 157 | return pte; | ||
| 153 | } | 158 | } |
| 154 | 159 | ||
| 155 | static inline pte_t pte_mkdirty(pte_t pte) | 160 | static inline pte_t pte_mkdirty(pte_t pte) |
| 156 | { | 161 | { |
| 157 | return set_pte_bit(pte, __pgprot(PTE_DIRTY)); | 162 | pte = set_pte_bit(pte, __pgprot(PTE_DIRTY)); |
| 163 | |||
| 164 | if (pte_write(pte)) | ||
| 165 | pte = clear_pte_bit(pte, __pgprot(PTE_RDONLY)); | ||
| 166 | |||
| 167 | return pte; | ||
| 158 | } | 168 | } |
| 159 | 169 | ||
| 160 | static inline pte_t pte_mkold(pte_t pte) | 170 | static inline pte_t pte_mkold(pte_t pte) |
| @@ -207,9 +217,6 @@ static inline void set_pte(pte_t *ptep, pte_t pte) | |||
| 207 | } | 217 | } |
| 208 | } | 218 | } |
| 209 | 219 | ||
| 210 | struct mm_struct; | ||
| 211 | struct vm_area_struct; | ||
| 212 | |||
| 213 | extern void __sync_icache_dcache(pte_t pteval, unsigned long addr); | 220 | extern void __sync_icache_dcache(pte_t pteval, unsigned long addr); |
| 214 | 221 | ||
| 215 | /* | 222 | /* |
| @@ -238,7 +245,8 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, | |||
| 238 | * hardware updates of the pte (ptep_set_access_flags safely changes | 245 | * hardware updates of the pte (ptep_set_access_flags safely changes |
| 239 | * valid ptes without going through an invalid entry). | 246 | * valid ptes without going through an invalid entry). |
| 240 | */ | 247 | */ |
| 241 | if (pte_valid(*ptep) && pte_valid(pte)) { | 248 | if (IS_ENABLED(CONFIG_DEBUG_VM) && pte_valid(*ptep) && pte_valid(pte) && |
| 249 | (mm == current->active_mm || atomic_read(&mm->mm_users) > 1)) { | ||
| 242 | VM_WARN_ONCE(!pte_young(pte), | 250 | VM_WARN_ONCE(!pte_young(pte), |
| 243 | "%s: racy access flag clearing: 0x%016llx -> 0x%016llx", | 251 | "%s: racy access flag clearing: 0x%016llx -> 0x%016llx", |
| 244 | __func__, pte_val(*ptep), pte_val(pte)); | 252 | __func__, pte_val(*ptep), pte_val(pte)); |
| @@ -641,28 +649,23 @@ static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm, | |||
| 641 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | 649 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ |
| 642 | 650 | ||
| 643 | /* | 651 | /* |
| 644 | * ptep_set_wrprotect - mark read-only while preserving the hardware update of | 652 | * ptep_set_wrprotect - mark read-only while trasferring potential hardware |
| 645 | * the Access Flag. | 653 | * dirty status (PTE_DBM && !PTE_RDONLY) to the software PTE_DIRTY bit. |
| 646 | */ | 654 | */ |
| 647 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT | 655 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT |
| 648 | static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long address, pte_t *ptep) | 656 | static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long address, pte_t *ptep) |
| 649 | { | 657 | { |
| 650 | pte_t old_pte, pte; | 658 | pte_t old_pte, pte; |
| 651 | 659 | ||
| 652 | /* | ||
| 653 | * ptep_set_wrprotect() is only called on CoW mappings which are | ||
| 654 | * private (!VM_SHARED) with the pte either read-only (!PTE_WRITE && | ||
| 655 | * PTE_RDONLY) or writable and software-dirty (PTE_WRITE && | ||
| 656 | * !PTE_RDONLY && PTE_DIRTY); see is_cow_mapping() and | ||
| 657 | * protection_map[]. There is no race with the hardware update of the | ||
| 658 | * dirty state: clearing of PTE_RDONLY when PTE_WRITE (a.k.a. PTE_DBM) | ||
| 659 | * is set. | ||
| 660 | */ | ||
| 661 | VM_WARN_ONCE(pte_write(*ptep) && !pte_dirty(*ptep), | ||
| 662 | "%s: potential race with hardware DBM", __func__); | ||
| 663 | pte = READ_ONCE(*ptep); | 660 | pte = READ_ONCE(*ptep); |
| 664 | do { | 661 | do { |
| 665 | old_pte = pte; | 662 | old_pte = pte; |
| 663 | /* | ||
| 664 | * If hardware-dirty (PTE_WRITE/DBM bit set and PTE_RDONLY | ||
| 665 | * clear), set the PTE_DIRTY bit. | ||
| 666 | */ | ||
| 667 | if (pte_hw_dirty(pte)) | ||
| 668 | pte = pte_mkdirty(pte); | ||
| 666 | pte = pte_wrprotect(pte); | 669 | pte = pte_wrprotect(pte); |
| 667 | pte_val(pte) = cmpxchg_relaxed(&pte_val(*ptep), | 670 | pte_val(pte) = cmpxchg_relaxed(&pte_val(*ptep), |
| 668 | pte_val(old_pte), pte_val(pte)); | 671 | pte_val(old_pte), pte_val(pte)); |
diff --git a/arch/arm64/kernel/cpu-reset.S b/arch/arm64/kernel/cpu-reset.S index 65f42d257414..2a752cb2a0f3 100644 --- a/arch/arm64/kernel/cpu-reset.S +++ b/arch/arm64/kernel/cpu-reset.S | |||
| @@ -37,6 +37,7 @@ ENTRY(__cpu_soft_restart) | |||
| 37 | mrs x12, sctlr_el1 | 37 | mrs x12, sctlr_el1 |
| 38 | ldr x13, =SCTLR_ELx_FLAGS | 38 | ldr x13, =SCTLR_ELx_FLAGS |
| 39 | bic x12, x12, x13 | 39 | bic x12, x12, x13 |
| 40 | pre_disable_mmu_workaround | ||
| 40 | msr sctlr_el1, x12 | 41 | msr sctlr_el1, x12 |
| 41 | isb | 42 | isb |
| 42 | 43 | ||
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index c5ba0097887f..a73a5928f09b 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c | |||
| @@ -145,7 +145,8 @@ static const struct arm64_ftr_bits ftr_id_aa64isar1[] = { | |||
| 145 | }; | 145 | }; |
| 146 | 146 | ||
| 147 | static const struct arm64_ftr_bits ftr_id_aa64pfr0[] = { | 147 | static const struct arm64_ftr_bits ftr_id_aa64pfr0[] = { |
| 148 | ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64PFR0_SVE_SHIFT, 4, 0), | 148 | ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SVE), |
| 149 | FTR_STRICT, FTR_LOWER_SAFE, ID_AA64PFR0_SVE_SHIFT, 4, 0), | ||
| 149 | ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64PFR0_GIC_SHIFT, 4, 0), | 150 | ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64PFR0_GIC_SHIFT, 4, 0), |
| 150 | S_ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64PFR0_ASIMD_SHIFT, 4, ID_AA64PFR0_ASIMD_NI), | 151 | S_ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64PFR0_ASIMD_SHIFT, 4, ID_AA64PFR0_ASIMD_NI), |
| 151 | S_ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64PFR0_FP_SHIFT, 4, ID_AA64PFR0_FP_NI), | 152 | S_ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64PFR0_FP_SHIFT, 4, ID_AA64PFR0_FP_NI), |
diff --git a/arch/arm64/kernel/efi-entry.S b/arch/arm64/kernel/efi-entry.S index 4e6ad355bd05..6b9736c3fb56 100644 --- a/arch/arm64/kernel/efi-entry.S +++ b/arch/arm64/kernel/efi-entry.S | |||
| @@ -96,6 +96,7 @@ ENTRY(entry) | |||
| 96 | mrs x0, sctlr_el2 | 96 | mrs x0, sctlr_el2 |
| 97 | bic x0, x0, #1 << 0 // clear SCTLR.M | 97 | bic x0, x0, #1 << 0 // clear SCTLR.M |
| 98 | bic x0, x0, #1 << 2 // clear SCTLR.C | 98 | bic x0, x0, #1 << 2 // clear SCTLR.C |
| 99 | pre_disable_mmu_workaround | ||
| 99 | msr sctlr_el2, x0 | 100 | msr sctlr_el2, x0 |
| 100 | isb | 101 | isb |
| 101 | b 2f | 102 | b 2f |
| @@ -103,6 +104,7 @@ ENTRY(entry) | |||
| 103 | mrs x0, sctlr_el1 | 104 | mrs x0, sctlr_el1 |
| 104 | bic x0, x0, #1 << 0 // clear SCTLR.M | 105 | bic x0, x0, #1 << 0 // clear SCTLR.M |
| 105 | bic x0, x0, #1 << 2 // clear SCTLR.C | 106 | bic x0, x0, #1 << 2 // clear SCTLR.C |
| 107 | pre_disable_mmu_workaround | ||
| 106 | msr sctlr_el1, x0 | 108 | msr sctlr_el1, x0 |
| 107 | isb | 109 | isb |
| 108 | 2: | 110 | 2: |
diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c index 540a1e010eb5..fae81f7964b4 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c | |||
| @@ -1043,7 +1043,7 @@ void fpsimd_update_current_state(struct fpsimd_state *state) | |||
| 1043 | 1043 | ||
| 1044 | local_bh_disable(); | 1044 | local_bh_disable(); |
| 1045 | 1045 | ||
| 1046 | current->thread.fpsimd_state = *state; | 1046 | current->thread.fpsimd_state.user_fpsimd = state->user_fpsimd; |
| 1047 | if (system_supports_sve() && test_thread_flag(TIF_SVE)) | 1047 | if (system_supports_sve() && test_thread_flag(TIF_SVE)) |
| 1048 | fpsimd_to_sve(current); | 1048 | fpsimd_to_sve(current); |
| 1049 | 1049 | ||
diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index 67e86a0f57ac..e3cb9fbf96b6 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S | |||
| @@ -750,6 +750,7 @@ __primary_switch: | |||
| 750 | * to take into account by discarding the current kernel mapping and | 750 | * to take into account by discarding the current kernel mapping and |
| 751 | * creating a new one. | 751 | * creating a new one. |
| 752 | */ | 752 | */ |
| 753 | pre_disable_mmu_workaround | ||
| 753 | msr sctlr_el1, x20 // disable the MMU | 754 | msr sctlr_el1, x20 // disable the MMU |
| 754 | isb | 755 | isb |
| 755 | bl __create_page_tables // recreate kernel mapping | 756 | bl __create_page_tables // recreate kernel mapping |
diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c index 749f81779420..74bb56f656ef 100644 --- a/arch/arm64/kernel/hw_breakpoint.c +++ b/arch/arm64/kernel/hw_breakpoint.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/perf_event.h> | 28 | #include <linux/perf_event.h> |
| 29 | #include <linux/ptrace.h> | 29 | #include <linux/ptrace.h> |
| 30 | #include <linux/smp.h> | 30 | #include <linux/smp.h> |
| 31 | #include <linux/uaccess.h> | ||
| 31 | 32 | ||
| 32 | #include <asm/compat.h> | 33 | #include <asm/compat.h> |
| 33 | #include <asm/current.h> | 34 | #include <asm/current.h> |
| @@ -36,7 +37,6 @@ | |||
| 36 | #include <asm/traps.h> | 37 | #include <asm/traps.h> |
| 37 | #include <asm/cputype.h> | 38 | #include <asm/cputype.h> |
| 38 | #include <asm/system_misc.h> | 39 | #include <asm/system_misc.h> |
| 39 | #include <asm/uaccess.h> | ||
| 40 | 40 | ||
| 41 | /* Breakpoint currently in use for each BRP. */ | 41 | /* Breakpoint currently in use for each BRP. */ |
| 42 | static DEFINE_PER_CPU(struct perf_event *, bp_on_reg[ARM_MAX_BRP]); | 42 | static DEFINE_PER_CPU(struct perf_event *, bp_on_reg[ARM_MAX_BRP]); |
diff --git a/arch/arm64/kernel/relocate_kernel.S b/arch/arm64/kernel/relocate_kernel.S index ce704a4aeadd..f407e422a720 100644 --- a/arch/arm64/kernel/relocate_kernel.S +++ b/arch/arm64/kernel/relocate_kernel.S | |||
| @@ -45,6 +45,7 @@ ENTRY(arm64_relocate_new_kernel) | |||
| 45 | mrs x0, sctlr_el2 | 45 | mrs x0, sctlr_el2 |
| 46 | ldr x1, =SCTLR_ELx_FLAGS | 46 | ldr x1, =SCTLR_ELx_FLAGS |
| 47 | bic x0, x0, x1 | 47 | bic x0, x0, x1 |
| 48 | pre_disable_mmu_workaround | ||
| 48 | msr sctlr_el2, x0 | 49 | msr sctlr_el2, x0 |
| 49 | isb | 50 | isb |
| 50 | 1: | 51 | 1: |
diff --git a/arch/arm64/kvm/hyp-init.S b/arch/arm64/kvm/hyp-init.S index 3f9615582377..870828c364c5 100644 --- a/arch/arm64/kvm/hyp-init.S +++ b/arch/arm64/kvm/hyp-init.S | |||
| @@ -151,6 +151,7 @@ reset: | |||
| 151 | mrs x5, sctlr_el2 | 151 | mrs x5, sctlr_el2 |
| 152 | ldr x6, =SCTLR_ELx_FLAGS | 152 | ldr x6, =SCTLR_ELx_FLAGS |
| 153 | bic x5, x5, x6 // Clear SCTL_M and etc | 153 | bic x5, x5, x6 // Clear SCTL_M and etc |
| 154 | pre_disable_mmu_workaround | ||
| 154 | msr sctlr_el2, x5 | 155 | msr sctlr_el2, x5 |
| 155 | isb | 156 | isb |
| 156 | 157 | ||
diff --git a/arch/arm64/mm/dump.c b/arch/arm64/mm/dump.c index ca74a2aace42..7b60d62ac593 100644 --- a/arch/arm64/mm/dump.c +++ b/arch/arm64/mm/dump.c | |||
| @@ -389,7 +389,7 @@ void ptdump_check_wx(void) | |||
| 389 | .check_wx = true, | 389 | .check_wx = true, |
| 390 | }; | 390 | }; |
| 391 | 391 | ||
| 392 | walk_pgd(&st, &init_mm, 0); | 392 | walk_pgd(&st, &init_mm, VA_START); |
| 393 | note_page(&st, 0, 0, 0); | 393 | note_page(&st, 0, 0, 0); |
| 394 | if (st.wx_pages || st.uxn_pages) | 394 | if (st.wx_pages || st.uxn_pages) |
| 395 | pr_warn("Checked W+X mappings: FAILED, %lu W+X pages found, %lu non-UXN pages found\n", | 395 | pr_warn("Checked W+X mappings: FAILED, %lu W+X pages found, %lu non-UXN pages found\n", |
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 22168cd0dde7..9b7f89df49db 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c | |||
| @@ -574,7 +574,6 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs) | |||
| 574 | { | 574 | { |
| 575 | struct siginfo info; | 575 | struct siginfo info; |
| 576 | const struct fault_info *inf; | 576 | const struct fault_info *inf; |
| 577 | int ret = 0; | ||
| 578 | 577 | ||
| 579 | inf = esr_to_fault_info(esr); | 578 | inf = esr_to_fault_info(esr); |
| 580 | pr_err("Synchronous External Abort: %s (0x%08x) at 0x%016lx\n", | 579 | pr_err("Synchronous External Abort: %s (0x%08x) at 0x%016lx\n", |
| @@ -589,7 +588,7 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs) | |||
| 589 | if (interrupts_enabled(regs)) | 588 | if (interrupts_enabled(regs)) |
| 590 | nmi_enter(); | 589 | nmi_enter(); |
| 591 | 590 | ||
| 592 | ret = ghes_notify_sea(); | 591 | ghes_notify_sea(); |
| 593 | 592 | ||
| 594 | if (interrupts_enabled(regs)) | 593 | if (interrupts_enabled(regs)) |
| 595 | nmi_exit(); | 594 | nmi_exit(); |
| @@ -604,7 +603,7 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs) | |||
| 604 | info.si_addr = (void __user *)addr; | 603 | info.si_addr = (void __user *)addr; |
| 605 | arm64_notify_die("", regs, &info, esr); | 604 | arm64_notify_die("", regs, &info, esr); |
| 606 | 605 | ||
| 607 | return ret; | 606 | return 0; |
| 608 | } | 607 | } |
| 609 | 608 | ||
| 610 | static const struct fault_info fault_info[] = { | 609 | static const struct fault_info fault_info[] = { |
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 5960bef0170d..00e7b900ca41 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c | |||
| @@ -476,6 +476,8 @@ void __init arm64_memblock_init(void) | |||
| 476 | 476 | ||
| 477 | reserve_elfcorehdr(); | 477 | reserve_elfcorehdr(); |
| 478 | 478 | ||
| 479 | high_memory = __va(memblock_end_of_DRAM() - 1) + 1; | ||
| 480 | |||
| 479 | dma_contiguous_reserve(arm64_dma_phys_limit); | 481 | dma_contiguous_reserve(arm64_dma_phys_limit); |
| 480 | 482 | ||
| 481 | memblock_allow_resize(); | 483 | memblock_allow_resize(); |
| @@ -502,7 +504,6 @@ void __init bootmem_init(void) | |||
| 502 | sparse_init(); | 504 | sparse_init(); |
| 503 | zone_sizes_init(min, max); | 505 | zone_sizes_init(min, max); |
| 504 | 506 | ||
| 505 | high_memory = __va((max << PAGE_SHIFT) - 1) + 1; | ||
| 506 | memblock_dump_all(); | 507 | memblock_dump_all(); |
| 507 | } | 508 | } |
| 508 | 509 | ||
