diff options
| -rw-r--r-- | arch/x86/kernel/cpu/addon_cpuid_features.c | 8 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/amd.c | 9 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/intel.c | 18 | ||||
| -rw-r--r-- | arch/x86/kernel/process.c | 2 | ||||
| -rw-r--r-- | drivers/acpi/processor_idle.c | 6 |
5 files changed, 36 insertions, 7 deletions
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c index ef8f831af823..2cf23634b6d9 100644 --- a/arch/x86/kernel/cpu/addon_cpuid_features.c +++ b/arch/x86/kernel/cpu/addon_cpuid_features.c | |||
| @@ -120,9 +120,17 @@ void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c) | |||
| 120 | c->cpu_core_id = phys_pkg_id(c->initial_apicid, ht_mask_width) | 120 | c->cpu_core_id = phys_pkg_id(c->initial_apicid, ht_mask_width) |
| 121 | & core_select_mask; | 121 | & core_select_mask; |
| 122 | c->phys_proc_id = phys_pkg_id(c->initial_apicid, core_plus_mask_width); | 122 | c->phys_proc_id = phys_pkg_id(c->initial_apicid, core_plus_mask_width); |
| 123 | /* | ||
| 124 | * Reinit the apicid, now that we have extended initial_apicid. | ||
| 125 | */ | ||
| 126 | c->apicid = phys_pkg_id(c->initial_apicid, 0); | ||
| 123 | #else | 127 | #else |
| 124 | c->cpu_core_id = phys_pkg_id(ht_mask_width) & core_select_mask; | 128 | c->cpu_core_id = phys_pkg_id(ht_mask_width) & core_select_mask; |
| 125 | c->phys_proc_id = phys_pkg_id(core_plus_mask_width); | 129 | c->phys_proc_id = phys_pkg_id(core_plus_mask_width); |
| 130 | /* | ||
| 131 | * Reinit the apicid, now that we have extended initial_apicid. | ||
| 132 | */ | ||
| 133 | c->apicid = phys_pkg_id(0); | ||
| 126 | #endif | 134 | #endif |
| 127 | c->x86_max_cores = (core_level_siblings / smp_num_siblings); | 135 | c->x86_max_cores = (core_level_siblings / smp_num_siblings); |
| 128 | 136 | ||
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 8f1e31db2ad5..7c878f6aa919 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c | |||
| @@ -283,9 +283,14 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c) | |||
| 283 | { | 283 | { |
| 284 | early_init_amd_mc(c); | 284 | early_init_amd_mc(c); |
| 285 | 285 | ||
| 286 | /* c->x86_power is 8000_0007 edx. Bit 8 is constant TSC */ | 286 | /* |
| 287 | if (c->x86_power & (1<<8)) | 287 | * c->x86_power is 8000_0007 edx. Bit 8 is TSC runs at constant rate |
| 288 | * with P/T states and does not stop in deep C-states | ||
| 289 | */ | ||
| 290 | if (c->x86_power & (1 << 8)) { | ||
| 288 | set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); | 291 | set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); |
| 292 | set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC); | ||
| 293 | } | ||
| 289 | 294 | ||
| 290 | #ifdef CONFIG_X86_64 | 295 | #ifdef CONFIG_X86_64 |
| 291 | set_cpu_cap(c, X86_FEATURE_SYSCALL32); | 296 | set_cpu_cap(c, X86_FEATURE_SYSCALL32); |
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 816f27f289b1..ccfd2047630c 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c | |||
| @@ -41,6 +41,16 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c) | |||
| 41 | if (c->x86 == 15 && c->x86_cache_alignment == 64) | 41 | if (c->x86 == 15 && c->x86_cache_alignment == 64) |
| 42 | c->x86_cache_alignment = 128; | 42 | c->x86_cache_alignment = 128; |
| 43 | #endif | 43 | #endif |
| 44 | |||
| 45 | /* | ||
| 46 | * c->x86_power is 8000_0007 edx. Bit 8 is TSC runs at constant rate | ||
| 47 | * with P/T states and does not stop in deep C-states | ||
| 48 | */ | ||
| 49 | if (c->x86_power & (1 << 8)) { | ||
| 50 | set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); | ||
| 51 | set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC); | ||
| 52 | } | ||
| 53 | |||
| 44 | } | 54 | } |
| 45 | 55 | ||
| 46 | #ifdef CONFIG_X86_32 | 56 | #ifdef CONFIG_X86_32 |
| @@ -242,6 +252,13 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c) | |||
| 242 | 252 | ||
| 243 | intel_workarounds(c); | 253 | intel_workarounds(c); |
| 244 | 254 | ||
| 255 | /* | ||
| 256 | * Detect the extended topology information if available. This | ||
| 257 | * will reinitialise the initial_apicid which will be used | ||
| 258 | * in init_intel_cacheinfo() | ||
| 259 | */ | ||
| 260 | detect_extended_topology(c); | ||
| 261 | |||
| 245 | l2 = init_intel_cacheinfo(c); | 262 | l2 = init_intel_cacheinfo(c); |
| 246 | if (c->cpuid_level > 9) { | 263 | if (c->cpuid_level > 9) { |
| 247 | unsigned eax = cpuid_eax(10); | 264 | unsigned eax = cpuid_eax(10); |
| @@ -312,7 +329,6 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c) | |||
| 312 | if (cpu_has_bts) | 329 | if (cpu_has_bts) |
| 313 | ptrace_bts_init_intel(c); | 330 | ptrace_bts_init_intel(c); |
| 314 | 331 | ||
| 315 | detect_extended_topology(c); | ||
| 316 | if (!cpu_has(c, X86_FEATURE_XTOPOLOGY)) { | 332 | if (!cpu_has(c, X86_FEATURE_XTOPOLOGY)) { |
| 317 | /* | 333 | /* |
| 318 | * let's use the legacy cpuid vector 0x1 and 0x4 for topology | 334 | * let's use the legacy cpuid vector 0x1 and 0x4 for topology |
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 9bfc3f719d47..b8f3e9dbabd7 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
| @@ -287,7 +287,7 @@ static void c1e_idle(void) | |||
| 287 | rdmsr(MSR_K8_INT_PENDING_MSG, lo, hi); | 287 | rdmsr(MSR_K8_INT_PENDING_MSG, lo, hi); |
| 288 | if (lo & K8_INTP_C1E_ACTIVE_MASK) { | 288 | if (lo & K8_INTP_C1E_ACTIVE_MASK) { |
| 289 | c1e_detected = 1; | 289 | c1e_detected = 1; |
| 290 | if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) | 290 | if (!boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) |
| 291 | mark_tsc_unstable("TSC halt in AMD C1E"); | 291 | mark_tsc_unstable("TSC halt in AMD C1E"); |
| 292 | printk(KERN_INFO "System has AMD C1E enabled\n"); | 292 | printk(KERN_INFO "System has AMD C1E enabled\n"); |
| 293 | set_cpu_cap(&boot_cpu_data, X86_FEATURE_AMDC1E); | 293 | set_cpu_cap(&boot_cpu_data, X86_FEATURE_AMDC1E); |
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 5f8d746a9b81..38aca048e951 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
| @@ -374,15 +374,15 @@ static int tsc_halts_in_c(int state) | |||
| 374 | { | 374 | { |
| 375 | switch (boot_cpu_data.x86_vendor) { | 375 | switch (boot_cpu_data.x86_vendor) { |
| 376 | case X86_VENDOR_AMD: | 376 | case X86_VENDOR_AMD: |
| 377 | case X86_VENDOR_INTEL: | ||
| 377 | /* | 378 | /* |
| 378 | * AMD Fam10h TSC will tick in all | 379 | * AMD Fam10h TSC will tick in all |
| 379 | * C/P/S0/S1 states when this bit is set. | 380 | * C/P/S0/S1 states when this bit is set. |
| 380 | */ | 381 | */ |
| 381 | if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) | 382 | if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) |
| 382 | return 0; | 383 | return 0; |
| 384 | |||
| 383 | /*FALL THROUGH*/ | 385 | /*FALL THROUGH*/ |
| 384 | case X86_VENDOR_INTEL: | ||
| 385 | /* Several cases known where TSC halts in C2 too */ | ||
| 386 | default: | 386 | default: |
| 387 | return state > ACPI_STATE_C1; | 387 | return state > ACPI_STATE_C1; |
| 388 | } | 388 | } |
