Skip to content

Commit

Permalink
powerpc/64: Fix watchdog configuration regressions
Browse files Browse the repository at this point in the history
This fixes a couple more bits of fallout from the new hard lockup watchdog
patch.

It restores the required hw_nmi_get_sample_period() function for the
perf watchdog, and removes some function declarations on 64e that are only
defined for 64s. This fixes the 64e build when the hardlockup detector is
enabled.

It restores the default behaviour of disabling the perf watchdog, and also
fixes disabling the 64s watchdog when running as a guest.

Fixes: 2104180 ("powerpc/64s: implement arch-specific hardlockup watchdog")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Nicholas Piggin authored and Michael Ellerman committed Aug 31, 2017
1 parent b68b1d7 commit 70412c5
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
3 changes: 1 addition & 2 deletions arch/powerpc/include/asm/nmi.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 0 additions & 7 deletions arch/powerpc/kernel/kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <linux/kvm_para.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/nmi.h> /* hardlockup_detector_disable() */

#include <asm/reg.h>
#include <asm/sections.h>
Expand Down Expand Up @@ -719,12 +718,6 @@ static __init void kvm_free_tmp(void)

static int __init kvm_guest_init(void)
{
/*
* The hardlockup detector is likely to get false positives in
* KVM guests, so disable it by default.
*/
hardlockup_detector_disable();

if (!kvm_para_available())
goto free_tmp;

Expand Down
28 changes: 28 additions & 0 deletions arch/powerpc/kernel/setup_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,3 +756,31 @@ 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;
}
#endif

/*
* The perf based hardlockup detector breaks PMU event based branches, so
* disable it by default. Book3S has a soft-nmi hardlockup detector based
* on the decrementer interrupt, so it does not suffer from this problem.
*
* It is likely to get false positives in VM guests, so disable it there
* by default too.
*/
static int __init disable_hardlockup_detector(void)
{
#ifdef CONFIG_HARDLOCKUP_DETECTOR_PERF
hardlockup_detector_disable();
#else
if (firmware_has_feature(FW_FEATURE_LPAR))
hardlockup_detector_disable();
#endif

return 0;
}
early_initcall(disable_hardlockup_detector);

0 comments on commit 70412c5

Please sign in to comment.