[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2 05/17] x86/perfctr: return perf counter and event selection bit offset



Hygon Dhyana shares similar perfctr arch with AMD family 17h.
It returns the bit offset of the performance counter register and the
event selection register for Hygon CPU in the similar way as AMD does.

Signed-off-by: Pu Wen <puwen@xxxxxxxx>
---
 arch/x86/kernel/cpu/perfctr-watchdog.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/x86/kernel/cpu/perfctr-watchdog.c 
b/arch/x86/kernel/cpu/perfctr-watchdog.c
index d389083..df46708 100644
--- a/arch/x86/kernel/cpu/perfctr-watchdog.c
+++ b/arch/x86/kernel/cpu/perfctr-watchdog.c
@@ -50,6 +50,10 @@ static inline unsigned int nmi_perfctr_msr_to_bit(unsigned 
int msr)
                if (msr >= MSR_F15H_PERF_CTR)
                        return (msr - MSR_F15H_PERF_CTR) >> 1;
                return msr - MSR_K7_PERFCTR0;
+       case X86_VENDOR_HYGON:
+               if (msr >= MSR_F15H_PERF_CTR)
+                       return (msr - MSR_F15H_PERF_CTR) >> 1;
+               return msr - MSR_K7_PERFCTR0;
        case X86_VENDOR_INTEL:
                if (cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON))
                        return msr - MSR_ARCH_PERFMON_PERFCTR0;
@@ -78,6 +82,10 @@ static inline unsigned int nmi_evntsel_msr_to_bit(unsigned 
int msr)
                if (msr >= MSR_F15H_PERF_CTL)
                        return (msr - MSR_F15H_PERF_CTL) >> 1;
                return msr - MSR_K7_EVNTSEL0;
+       case X86_VENDOR_HYGON:
+               if (msr >= MSR_F15H_PERF_CTL)
+                       return (msr - MSR_F15H_PERF_CTL) >> 1;
+               return msr - MSR_K7_EVNTSEL0;
        case X86_VENDOR_INTEL:
                if (cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON))
                        return msr - MSR_ARCH_PERFMON_EVENTSEL0;
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.