]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
perf_counter, x86: remove X86_FEATURE_ARCH_PERFMON flag for AMD cpus
authorRobert Richter <robert.richter@amd.com>
Wed, 29 Apr 2009 10:46:58 +0000 (12:46 +0200)
committerIngo Molnar <mingo@elte.hu>
Wed, 29 Apr 2009 12:51:00 +0000 (14:51 +0200)
X86_FEATURE_ARCH_PERFMON is an Intel hardware feature that does not
work on AMD CPUs. The flag is now only used in Intel specific code
(especially initialization).

[ Impact: refactor code ]

Signed-off-by: Robert Richter <robert.richter@amd.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1241002046-8832-2-git-send-email-robert.richter@amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/cpu/amd.c
arch/x86/kernel/cpu/perf_counter.c

index fd69c514ca2ac277004658ec8d86a83243628922..7e4a459daa644f30309f50e9ca65ece4be85fad7 100644 (file)
@@ -420,10 +420,6 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
        if (c->x86 >= 6)
                set_cpu_cap(c, X86_FEATURE_FXSAVE_LEAK);
 
-       /* Enable Performance counter for K7 and later */
-       if (c->x86 > 6 && c->x86 <= 0x11)
-               set_cpu_cap(c, X86_FEATURE_ARCH_PERFMON);
-
        if (!c->x86_model_id[0]) {
                switch (c->x86) {
                case 0xf:
index 0fcbaab83f9bf1276653b4fceb7100177a27601d..7d0f81dcb524786f827fdcb03af03158264d6d45 100644 (file)
@@ -949,6 +949,9 @@ static struct pmc_x86_ops *pmc_intel_init(void)
        unsigned int unused;
        unsigned int ebx;
 
+       if (!cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON))
+               return NULL;
+
        /*
         * Check whether the Architectural PerfMon supports
         * Branch Misses Retired Event or not.
@@ -987,9 +990,6 @@ static struct pmc_x86_ops *pmc_amd_init(void)
 
 void __init init_hw_perf_counters(void)
 {
-       if (!cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON))
-               return;
-
        switch (boot_cpu_data.x86_vendor) {
        case X86_VENDOR_INTEL:
                pmc_ops = pmc_intel_init();