summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/process.c
diff options
context:
space:
mode:
authorMichael Ellerman2018-03-27 14:55:49 +0200
committerMichael Ellerman2018-03-27 14:55:49 +0200
commitc0b346729b5dd3c7d0232f043f5b15947ffc7978 (patch)
treea790a37bfc5815b46c8f9a4faf9a2d38c74d2cdb /arch/powerpc/kernel/process.c
parentpowerpc/eeh: Add eeh_state_active() helper (diff)
parentpowerpc: Disable DAWR in the base POWER9 CPU features (diff)
downloadkernel-qcow2-linux-c0b346729b5dd3c7d0232f043f5b15947ffc7978.tar.gz
kernel-qcow2-linux-c0b346729b5dd3c7d0232f043f5b15947ffc7978.tar.xz
kernel-qcow2-linux-c0b346729b5dd3c7d0232f043f5b15947ffc7978.zip
Merge branch 'topic/ppc-kvm' into next
Merge the DAWR series, which touches arch code and KVM code and may need to be merged into the kvm-ppc tree.
Diffstat (limited to 'arch/powerpc/kernel/process.c')
-rw-r--r--arch/powerpc/kernel/process.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index ec4f363ebb89..24a591b4dbe9 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -827,6 +827,18 @@ void set_breakpoint(struct arch_hw_breakpoint *brk)
preempt_enable();
}
+/* Check if we have DAWR or DABR hardware */
+bool ppc_breakpoint_available(void)
+{
+ if (cpu_has_feature(CPU_FTR_DAWR))
+ return true; /* POWER8 DAWR */
+ if (cpu_has_feature(CPU_FTR_ARCH_207S))
+ return false; /* POWER9 with DAWR disabled */
+ /* DABR: Everything but POWER8 and POWER9 */
+ return true;
+}
+EXPORT_SYMBOL_GPL(ppc_breakpoint_available);
+
#ifdef CONFIG_PPC64
DEFINE_PER_CPU(struct cpu_usage, cpu_usage_array);
#endif