aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-03-09 19:49:30 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-03-09 19:49:30 -0500
commit4178802c771440322177718de57c9024fa5608e9 (patch)
tree7281bfc57044e5cdb345cd93c9603c1461200340
parented3c4dff8d20e181b7f5d07f59b7d8ef3644f9a7 (diff)
parente21da1c992007594d391e7b301779cf30f438691 (diff)
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Catalin Marinas: - The SMCCC firmware interface for the spectre variant 2 mitigation has been updated to allow the discovery of whether the CPU needs the workaround. This pull request relaxes the kernel check on the return value from firmware. - Fix the commit allowing changing from global to non-global page table entries which inadvertently disallowed other safe attribute changes. - Fix sleeping in atomic during the arm_perf_teardown_cpu() code. * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Relax ARM_SMCCC_ARCH_WORKAROUND_1 discovery arm_pmu: Use disable_irq_nosync when disabling SPI in CPU teardown hook arm64: mm: fix thinko in non-global page table attribute check
-rw-r--r--arch/arm64/kernel/cpu_errata.c4
-rw-r--r--arch/arm64/mm/mmu.c8
-rw-r--r--drivers/perf/arm_pmu.c2
3 files changed, 7 insertions, 7 deletions
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index 52f15cd896e1..b5a28336c077 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -178,7 +178,7 @@ static int enable_smccc_arch_workaround_1(void *data)
178 case PSCI_CONDUIT_HVC: 178 case PSCI_CONDUIT_HVC:
179 arm_smccc_1_1_hvc(ARM_SMCCC_ARCH_FEATURES_FUNC_ID, 179 arm_smccc_1_1_hvc(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
180 ARM_SMCCC_ARCH_WORKAROUND_1, &res); 180 ARM_SMCCC_ARCH_WORKAROUND_1, &res);
181 if (res.a0) 181 if ((int)res.a0 < 0)
182 return 0; 182 return 0;
183 cb = call_hvc_arch_workaround_1; 183 cb = call_hvc_arch_workaround_1;
184 smccc_start = __smccc_workaround_1_hvc_start; 184 smccc_start = __smccc_workaround_1_hvc_start;
@@ -188,7 +188,7 @@ static int enable_smccc_arch_workaround_1(void *data)
188 case PSCI_CONDUIT_SMC: 188 case PSCI_CONDUIT_SMC:
189 arm_smccc_1_1_smc(ARM_SMCCC_ARCH_FEATURES_FUNC_ID, 189 arm_smccc_1_1_smc(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
190 ARM_SMCCC_ARCH_WORKAROUND_1, &res); 190 ARM_SMCCC_ARCH_WORKAROUND_1, &res);
191 if (res.a0) 191 if ((int)res.a0 < 0)
192 return 0; 192 return 0;
193 cb = call_smc_arch_workaround_1; 193 cb = call_smc_arch_workaround_1;
194 smccc_start = __smccc_workaround_1_smc_start; 194 smccc_start = __smccc_workaround_1_smc_start;
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index 84a019f55022..8c704f1e53c2 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -108,7 +108,7 @@ static bool pgattr_change_is_safe(u64 old, u64 new)
108 * The following mapping attributes may be updated in live 108 * The following mapping attributes may be updated in live
109 * kernel mappings without the need for break-before-make. 109 * kernel mappings without the need for break-before-make.
110 */ 110 */
111 static const pteval_t mask = PTE_PXN | PTE_RDONLY | PTE_WRITE; 111 static const pteval_t mask = PTE_PXN | PTE_RDONLY | PTE_WRITE | PTE_NG;
112 112
113 /* creating or taking down mappings is always safe */ 113 /* creating or taking down mappings is always safe */
114 if (old == 0 || new == 0) 114 if (old == 0 || new == 0)
@@ -118,9 +118,9 @@ static bool pgattr_change_is_safe(u64 old, u64 new)
118 if ((old | new) & PTE_CONT) 118 if ((old | new) & PTE_CONT)
119 return false; 119 return false;
120 120
121 /* Transitioning from Global to Non-Global is safe */ 121 /* Transitioning from Non-Global to Global is unsafe */
122 if (((old ^ new) == PTE_NG) && (new & PTE_NG)) 122 if (old & ~new & PTE_NG)
123 return true; 123 return false;
124 124
125 return ((old ^ new) & ~mask) == 0; 125 return ((old ^ new) & ~mask) == 0;
126} 126}
diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
index 0c2ed11c0603..f63db346c219 100644
--- a/drivers/perf/arm_pmu.c
+++ b/drivers/perf/arm_pmu.c
@@ -638,7 +638,7 @@ static int arm_perf_teardown_cpu(unsigned int cpu, struct hlist_node *node)
638 if (irq_is_percpu_devid(irq)) 638 if (irq_is_percpu_devid(irq))
639 disable_percpu_irq(irq); 639 disable_percpu_irq(irq);
640 else 640 else
641 disable_irq(irq); 641 disable_irq_nosync(irq);
642 } 642 }
643 643
644 per_cpu(cpu_armpmu, cpu) = NULL; 644 per_cpu(cpu_armpmu, cpu) = NULL;