summaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm/hw_breakpoint.h
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2015-07-07 17:30:02 +0100
committerMarc Zyngier <marc.zyngier@arm.com>2015-07-21 12:50:43 +0100
commit834bf88726f0f11ddc7ff9679fc9458654c01a12 (patch)
tree9fb71c96dfab5c64a4a2c5972783bd621f266874 /arch/arm64/include/asm/hw_breakpoint.h
parent5540546bc93b49f98a0466fe3f96615286c76574 (diff)
downloadtalos-obmc-linux-834bf88726f0f11ddc7ff9679fc9458654c01a12.tar.gz
talos-obmc-linux-834bf88726f0f11ddc7ff9679fc9458654c01a12.zip
KVM: arm64: enable KVM_CAP_SET_GUEST_DEBUG
Finally advertise the KVM capability for SET_GUEST_DEBUG. Once arm support is added this check can be moved to the common kvm_vm_ioctl_check_extension() code. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Acked-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/hw_breakpoint.h')
-rw-r--r--arch/arm64/include/asm/hw_breakpoint.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/hw_breakpoint.h b/arch/arm64/include/asm/hw_breakpoint.h
index 52b484b6aa1a..4c47cb2fbb52 100644
--- a/arch/arm64/include/asm/hw_breakpoint.h
+++ b/arch/arm64/include/asm/hw_breakpoint.h
@@ -16,6 +16,8 @@
#ifndef __ASM_HW_BREAKPOINT_H
#define __ASM_HW_BREAKPOINT_H
+#include <asm/cputype.h>
+
#ifdef __KERNEL__
struct arch_hw_breakpoint_ctrl {
@@ -132,5 +134,17 @@ static inline void ptrace_hw_copy_thread(struct task_struct *task)
extern struct pmu perf_ops_bp;
+/* Determine number of BRP registers available. */
+static inline int get_num_brps(void)
+{
+ return ((read_cpuid(ID_AA64DFR0_EL1) >> 12) & 0xf) + 1;
+}
+
+/* Determine number of WRP registers available. */
+static inline int get_num_wrps(void)
+{
+ return ((read_cpuid(ID_AA64DFR0_EL1) >> 20) & 0xf) + 1;
+}
+
#endif /* __KERNEL__ */
#endif /* __ASM_BREAKPOINT_H */
OpenPOWER on IntegriCloud