powerpc/64e: Fix perf hardlockup detector build
Nicholas Piggin
reviewerPATCH 1/1 powerpc/64e: Fix perf hardlockup detector build
This fixes a couple more bits of fallout when enabling the hardlockup detector for 64e.
It restores the required hw_nmi_get_sample_period() function for the perf watchdog, and restores disabling of the watchdog there. It also removes API definitions that are only defined for 64s.
Fixes 2104180a53 ("powerpc/64s: implement arch-specific hardlockup watchdog")
Signed-off-by Nicholas Piggin <[email protected]>
---
This patch should go on top of the previous:
http://patchwork.ozlabs.org/patch/796202/
arch/powerpc/include/asm/nmi.h | 3 +-- arch/powerpc/kernel/setup_64.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-)
arch/powerpc/include/asm/nmi.h +1 -2
@@ -1,9 +1,8 @@#ifndef _ASM_NMI_H#define _ASM_NMI_H -#ifdef CONFIG_HARDLOCKUP_DETECTOR +#ifdef CONFIG_PPC_WATCHDOG extern void arch_touch_nmi_watchdog (void ); -extern void arch_trigger_cpumask_backtrace (const cpumask_t *mask,bool exclude_self);#define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace
arch/powerpc/kernel/setup_64.c +21 -0
@@ -751,3 +751,24 @@ unsigned long memory_block_size_bytes(void)struct ppc_pci_io ppc_pci_io;EXPORT_SYMBOL (ppc_pci_io);#endif + +#ifdef CONFIG_HARDLOCKUP_DETECTOR_PERF +u64 hw_nmi_get_sample_period (int watchdog_thresh) +{ +return ppc_proc_freq * watchdog_thresh; +} + +/* +* The perf based hardlockup detector breaks PMU event based branches and is +* likely to get false positives in KVM guests, so disable it by default. +* Book3S has a soft-nmi version based on the decrementer interrupt so it does +* not suffer from these problems. +*/ +static int __init disable_hardlockup_detector (void ) +{ +hardlockup_detector_disable (); + +return 0 ; +} +early_initcall (disable_hardlockup_detector); +#endif
Signature · 1 line
2.13.3