ia64/xen-unstable
changeset 18930:f827181eadd4
x86: Decode CPUID for TSC guarantees.
Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Wei Gang <gang.wei@intel.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Mon Dec 15 11:37:14 2008 +0000 (2008-12-15) |
parents | 65bbc9ec3849 |
children | 5b73fa1b9562 |
files | xen/arch/x86/cpu/amd.c xen/arch/x86/cpu/intel.c xen/include/asm-x86/cpufeature.h |
line diff
1.1 --- a/xen/arch/x86/cpu/amd.c Mon Dec 15 11:23:22 2008 +0000 1.2 +++ b/xen/arch/x86/cpu/amd.c Mon Dec 15 11:37:14 2008 +0000 1.3 @@ -461,8 +461,10 @@ static void __devinit init_amd(struct cp 1.4 1.5 if (cpuid_eax(0x80000000) >= 0x80000007) { 1.6 c->x86_power = cpuid_edx(0x80000007); 1.7 - if (c->x86_power & (1<<8)) 1.8 + if (c->x86_power & (1<<8)) { 1.9 set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability); 1.10 + set_bit(X86_FEATURE_NOSTOP_TSC, c->x86_capability); 1.11 + } 1.12 } 1.13 1.14 #ifdef CONFIG_X86_HT
2.1 --- a/xen/arch/x86/cpu/intel.c Mon Dec 15 11:23:22 2008 +0000 2.2 +++ b/xen/arch/x86/cpu/intel.c Mon Dec 15 11:37:14 2008 +0000 2.3 @@ -218,6 +218,10 @@ static void __devinit init_intel(struct 2.4 if ((c->x86 == 0xf && c->x86_model >= 0x03) || 2.5 (c->x86 == 0x6 && c->x86_model >= 0x0e)) 2.6 set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability); 2.7 + if (cpuid_edx(0x80000007) & (1u<<8)) { 2.8 + set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability); 2.9 + set_bit(X86_FEATURE_NOSTOP_TSC, c->x86_capability); 2.10 + } 2.11 2.12 start_vmx(); 2.13 }
3.1 --- a/xen/include/asm-x86/cpufeature.h Mon Dec 15 11:23:22 2008 +0000 3.2 +++ b/xen/include/asm-x86/cpufeature.h Mon Dec 15 11:37:14 2008 +0000 3.3 @@ -74,6 +74,7 @@ 3.4 #define X86_FEATURE_P3 (3*32+ 6) /* P3 */ 3.5 #define X86_FEATURE_P4 (3*32+ 7) /* P4 */ 3.6 #define X86_FEATURE_CONSTANT_TSC (3*32+ 8) /* TSC ticks at a constant rate */ 3.7 +#define X86_FEATURE_NOSTOP_TSC (3*32+ 9) /* TSC does not stop in C states */ 3.8 3.9 /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ 3.10 #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */