Skip to content

Commit 5236647

Browse files
committed
Merge tag 'powerpc-5.6-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: "Some more powerpc fixes for 5.6: - One fix for a recent regression to our breakpoint/watchpoint code. - Another fix for our KUAP support, this time a missing annotation in a rarely used path in signal handling. - A fix for our handling of a CPU feature that effects the PMU, when booting guests in some configurations. - A minor fix to our linker script to explicitly include the .BTF section. Thanks to: Christophe Leroy, Desnes A. Nunes do Rosario, Leonardo Bras, Naveen N. Rao, Ravi Bangoria, Stefan Berger" * tag 'powerpc-5.6-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/mm: Fix missing KUAP disable in flush_coherent_icache() powerpc: fix hardware PMU exception bug on PowerVM compatibility mode systems powerpc: Include .BTF section powerpc/watchpoint: Don't call dar_within_range() for Book3S
2 parents cbee7c8 + 59bee45 commit 5236647

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

arch/powerpc/kernel/cputable.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2193,11 +2193,13 @@ static struct cpu_spec * __init setup_cpu_spec(unsigned long offset,
21932193
* oprofile_cpu_type already has a value, then we are
21942194
* possibly overriding a real PVR with a logical one,
21952195
* and, in that case, keep the current value for
2196-
* oprofile_cpu_type.
2196+
* oprofile_cpu_type. Futhermore, let's ensure that the
2197+
* fix for the PMAO bug is enabled on compatibility mode.
21972198
*/
21982199
if (old.oprofile_cpu_type != NULL) {
21992200
t->oprofile_cpu_type = old.oprofile_cpu_type;
22002201
t->oprofile_type = old.oprofile_type;
2202+
t->cpu_features |= old.cpu_features & CPU_FTR_PMAO_BUG;
22012203
}
22022204
}
22032205

arch/powerpc/kernel/hw_breakpoint.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,13 @@ int hw_breakpoint_handler(struct die_args *args)
331331
}
332332

333333
info->type &= ~HW_BRK_TYPE_EXTRANEOUS_IRQ;
334-
if (!dar_within_range(regs->dar, info))
335-
info->type |= HW_BRK_TYPE_EXTRANEOUS_IRQ;
336-
337-
if (!IS_ENABLED(CONFIG_PPC_8xx) && !stepping_handler(regs, bp, info))
338-
goto out;
334+
if (IS_ENABLED(CONFIG_PPC_8xx)) {
335+
if (!dar_within_range(regs->dar, info))
336+
info->type |= HW_BRK_TYPE_EXTRANEOUS_IRQ;
337+
} else {
338+
if (!stepping_handler(regs, bp, info))
339+
goto out;
340+
}
339341

340342
/*
341343
* As a policy, the callback is invoked in a 'trigger-after-execute'

arch/powerpc/kernel/vmlinux.lds.S

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,12 @@ SECTIONS
303303
*(.branch_lt)
304304
}
305305

306+
#ifdef CONFIG_DEBUG_INFO_BTF
307+
.BTF : AT(ADDR(.BTF) - LOAD_OFFSET) {
308+
*(.BTF)
309+
}
310+
#endif
311+
306312
.opd : AT(ADDR(.opd) - LOAD_OFFSET) {
307313
__start_opd = .;
308314
KEEP(*(.opd))

arch/powerpc/mm/mem.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,9 @@ static inline bool flush_coherent_icache(unsigned long addr)
373373
*/
374374
if (cpu_has_feature(CPU_FTR_COHERENT_ICACHE)) {
375375
mb(); /* sync */
376+
allow_read_from_user((const void __user *)addr, L1_CACHE_BYTES);
376377
icbi((void *)addr);
378+
prevent_read_from_user((const void __user *)addr, L1_CACHE_BYTES);
377379
mb(); /* sync */
378380
isync();
379381
return true;

0 commit comments

Comments
 (0)