]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] i386: Implement X86_FEATURE_SYNC_RDTSC on i386
authorAndi Kleen <ak@suse.de>
Wed, 2 May 2007 17:27:20 +0000 (19:27 +0200)
committerAndi Kleen <andi@basil.nowhere.org>
Wed, 2 May 2007 17:27:20 +0000 (19:27 +0200)
Syncs up with x86-64.

Signed-off-by: Andi Kleen <ak@suse.de>
arch/i386/kernel/cpu/intel.c
include/asm-i386/cpufeature.h
include/asm-i386/tsc.h

index 56fe26584957f7b9b733ea4e8fcd41b189ab0936..dc4e08147b1f14b90541b94419cd129ab58ac9a7 100644 (file)
@@ -188,8 +188,10 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c)
        }
 #endif
 
-       if (c->x86 == 15)
+       if (c->x86 == 15) {
                set_bit(X86_FEATURE_P4, c->x86_capability);
+               set_bit(X86_FEATURE_SYNC_RDTSC, c->x86_capability);
+       }
        if (c->x86 == 6) 
                set_bit(X86_FEATURE_P3, c->x86_capability);
        if ((c->x86 == 0xf && c->x86_model >= 0x03) ||
index 20e849ae6ddca16e208af8fe9bdd82957316ecc9..b8a3a5a85fd3f466383e0927d2d0e4afaa244d15 100644 (file)
@@ -79,6 +79,7 @@
 #define X86_FEATURE_PEBS       (3*32+12)  /* Precise-Event Based Sampling */
 #define X86_FEATURE_BTS                (3*32+13)  /* Branch Trace Store */
 #define X86_FEATURE_LAPIC_TIMER_BROKEN (3*32+ 14) /* lapic timer broken in C1 */
+#define X86_FEATURE_SYNC_RDTSC (3*32+15)  /* RDTSC synchronizes the CPU */
 
 /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
 #define X86_FEATURE_XMM3       (4*32+ 0) /* Streaming SIMD Extensions-3 */
index 346976632e15f586e1615a545460c23079fdc7bc..0181f9df75393cf56174778f85b21e9f87d54ff0 100644 (file)
@@ -35,7 +35,6 @@ static inline cycles_t get_cycles(void)
 static __always_inline cycles_t get_cycles_sync(void)
 {
        unsigned long long ret;
-#ifdef X86_FEATURE_SYNC_RDTSC
        unsigned eax;
 
        /*
@@ -44,9 +43,6 @@ static __always_inline cycles_t get_cycles_sync(void)
         */
        alternative_io("cpuid", ASM_NOP2, X86_FEATURE_SYNC_RDTSC,
                          "=a" (eax), "0" (1) : "ebx","ecx","edx","memory");
-#else
-       sync_core();
-#endif
        rdtscll(ret);
 
        return ret;