arm64/debug: Make use of the system wide safe value
[cascardo/linux.git] / arch / arm64 / kernel / debug-monitors.c
index 8eef30f..1429044 100644 (file)
 #include <linux/stat.h>
 #include <linux/uaccess.h>
 
-#include <asm/debug-monitors.h>
+#include <asm/cpufeature.h>
 #include <asm/cputype.h>
+#include <asm/debug-monitors.h>
 #include <asm/system_misc.h>
 
 /* Determine debug architecture. */
 u8 debug_monitors_arch(void)
 {
-       return read_cpuid(ID_AA64DFR0_EL1) & 0xf;
+       return cpuid_feature_extract_field(read_system_reg(SYS_ID_AA64DFR0_EL1),
+                                               ID_AA64DFR0_DEBUGVER_SHIFT);
 }
 
 /*