aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2015-04-08 22:52:56 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2015-04-11 06:49:27 -0400
commitc54b2bf1b5e99760d53ea0376e96a046f93df6ae (patch)
treed81302ccfeed24918d147f0b5b8ddd5dbcab1873 /arch/powerpc
parentaf9feebe60add19fdd15adee80ac5b4eeb2a489b (diff)
powerpc: Add ppc64 hard lockup detector support
The hard lockup detector uses a PMU event as a periodic NMI to detect if we are stuck (where stuck means no timer interrupts have occurred). Ben's rework of the ppc64 soft disable code has made ppc64 PMU exceptions a partial NMI. They can get disabled if an external interrupt comes in, but otherwise PMU interrupts will fire in interrupt disabled regions. We disable the hard lockup detector by default for a few reasons: - It breaks userspace event based branches on POWER8. - It is likely to produce false positives on KVM guests. - Since PMCs can only count to 2^31, counting cycles means we might take multiple PMU exceptions per second per hardware thread even if our hard lockup timeout is 10 seconds. It can be enabled via a boot option, or via procfs. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/Kconfig1
-rw-r--r--arch/powerpc/include/asm/nmi.h4
-rw-r--r--arch/powerpc/kernel/setup_64.c20
3 files changed, 25 insertions, 0 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index c102668b4225..716c9e6a3160 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -152,6 +152,7 @@ config PPC
152 select DCACHE_WORD_ACCESS if PPC64 && CPU_LITTLE_ENDIAN 152 select DCACHE_WORD_ACCESS if PPC64 && CPU_LITTLE_ENDIAN
153 select NO_BOOTMEM 153 select NO_BOOTMEM
154 select HAVE_GENERIC_RCU_GUP 154 select HAVE_GENERIC_RCU_GUP
155 select HAVE_PERF_EVENTS_NMI if PPC64
155 156
156config GENERIC_CSUM 157config GENERIC_CSUM
157 def_bool CPU_LITTLE_ENDIAN 158 def_bool CPU_LITTLE_ENDIAN
diff --git a/arch/powerpc/include/asm/nmi.h b/arch/powerpc/include/asm/nmi.h
new file mode 100644
index 000000000000..ff1ccb375e60
--- /dev/null
+++ b/arch/powerpc/include/asm/nmi.h
@@ -0,0 +1,4 @@
1#ifndef _ASM_NMI_H
2#define _ASM_NMI_H
3
4#endif /* _ASM_NMI_H */
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 49f553bbb360..7551e5692597 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -37,6 +37,7 @@
37#include <linux/memblock.h> 37#include <linux/memblock.h>
38#include <linux/hugetlb.h> 38#include <linux/hugetlb.h>
39#include <linux/memory.h> 39#include <linux/memory.h>
40#include <linux/nmi.h>
40 41
41#include <asm/io.h> 42#include <asm/io.h>
42#include <asm/kdump.h> 43#include <asm/kdump.h>
@@ -779,3 +780,22 @@ unsigned long memory_block_size_bytes(void)
779struct ppc_pci_io ppc_pci_io; 780struct ppc_pci_io ppc_pci_io;
780EXPORT_SYMBOL(ppc_pci_io); 781EXPORT_SYMBOL(ppc_pci_io);
781#endif 782#endif
783
784#ifdef CONFIG_HARDLOCKUP_DETECTOR
785u64 hw_nmi_get_sample_period(int watchdog_thresh)
786{
787 return ppc_proc_freq * watchdog_thresh;
788}
789
790/*
791 * The hardlockup detector breaks PMU event based branches and is likely
792 * to get false positives in KVM guests, so disable it by default.
793 */
794static int __init disable_hardlockup_detector(void)
795{
796 watchdog_enable_hardlockup_detector(false);
797
798 return 0;
799}
800early_initcall(disable_hardlockup_detector);
801#endif