Skip to content

Commit 4178802

Browse files
committed
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
2 parents ed3c4df + e21da1c commit 4178802

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

arch/arm64/kernel/cpu_errata.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static int enable_smccc_arch_workaround_1(void *data)
178178
case PSCI_CONDUIT_HVC:
179179
arm_smccc_1_1_hvc(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
180180
ARM_SMCCC_ARCH_WORKAROUND_1, &res);
181-
if (res.a0)
181+
if ((int)res.a0 < 0)
182182
return 0;
183183
cb = call_hvc_arch_workaround_1;
184184
smccc_start = __smccc_workaround_1_hvc_start;
@@ -188,7 +188,7 @@ static int enable_smccc_arch_workaround_1(void *data)
188188
case PSCI_CONDUIT_SMC:
189189
arm_smccc_1_1_smc(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
190190
ARM_SMCCC_ARCH_WORKAROUND_1, &res);
191-
if (res.a0)
191+
if ((int)res.a0 < 0)
192192
return 0;
193193
cb = call_smc_arch_workaround_1;
194194
smccc_start = __smccc_workaround_1_smc_start;

arch/arm64/mm/mmu.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static bool pgattr_change_is_safe(u64 old, u64 new)
108108
* The following mapping attributes may be updated in live
109109
* kernel mappings without the need for break-before-make.
110110
*/
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;
112112

113113
/* creating or taking down mappings is always safe */
114114
if (old == 0 || new == 0)
@@ -118,9 +118,9 @@ static bool pgattr_change_is_safe(u64 old, u64 new)
118118
if ((old | new) & PTE_CONT)
119119
return false;
120120

121-
/* Transitioning from Global to Non-Global is safe */
122-
if (((old ^ new) == PTE_NG) && (new & PTE_NG))
123-
return true;
121+
/* Transitioning from Non-Global to Global is unsafe */
122+
if (old & ~new & PTE_NG)
123+
return false;
124124

125125
return ((old ^ new) & ~mask) == 0;
126126
}

drivers/perf/arm_pmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ static int arm_perf_teardown_cpu(unsigned int cpu, struct hlist_node *node)
638638
if (irq_is_percpu_devid(irq))
639639
disable_percpu_irq(irq);
640640
else
641-
disable_irq(irq);
641+
disable_irq_nosync(irq);
642642
}
643643

644644
per_cpu(cpu_armpmu, cpu) = NULL;

0 commit comments

Comments
 (0)