diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-06 13:02:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-06 13:02:36 -0400 |
commit | 0f477dd0851bdcee82923da66a7fc4a44cb1bc3d (patch) | |
tree | cf8937ba8c7800c6143aa3c9758c6e184c1289ec /arch/x86/kernel/process.c | |
parent | c4efd6b569b2646e1346a08a4c40286f8bcb5f11 (diff) | |
parent | e8c534ec068af1a0845aceda373a9bfd2de62030 (diff) |
Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86: Fix keeping track of AMD C1E
x86, cpu: Package Level Thermal Control, Power Limit Notification definitions
x86, cpu: Export AMD errata definitions
x86, cpu: Use AMD errata checking framework for erratum 383
x86, cpu: Clean up AMD erratum 400 workaround
x86, cpu: AMD errata checking framework
x86, cpu: Split addon_cpuid_features.c
x86, cpu: Clean up formatting in cpufeature.h, remove override
x86, cpu: Enumerate xsaveopt
x86, cpu: Add xsaveopt cpufeature
x86, cpu: Make init_scattered_cpuid_features() consider cpuid subleaves
x86, cpu: Support the features flags in new CPUID leaf 7
x86, cpu: Add CPU flags for F16C and RDRND
x86: Look for IA32_ENERGY_PERF_BIAS support
x86, AMD: Extend support to future families
x86, cacheinfo: Carve out L3 cache slot accessors
x86, xsave: Cleanup return codes in check_for_xstate()
Diffstat (limited to 'arch/x86/kernel/process.c')
-rw-r--r-- | arch/x86/kernel/process.c | 45 |
1 files changed, 6 insertions, 39 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index cbcf013a0ec6..d401f1d2d06e 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -526,44 +526,10 @@ static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c) | |||
526 | return (edx & MWAIT_EDX_C1); | 526 | return (edx & MWAIT_EDX_C1); |
527 | } | 527 | } |
528 | 528 | ||
529 | /* | 529 | bool c1e_detected; |
530 | * Check for AMD CPUs, where APIC timer interrupt does not wake up CPU from C1e. | 530 | EXPORT_SYMBOL(c1e_detected); |
531 | * For more information see | ||
532 | * - Erratum #400 for NPT family 0xf and family 0x10 CPUs | ||
533 | * - Erratum #365 for family 0x11 (not affected because C1e not in use) | ||
534 | */ | ||
535 | static int __cpuinit check_c1e_idle(const struct cpuinfo_x86 *c) | ||
536 | { | ||
537 | u64 val; | ||
538 | if (c->x86_vendor != X86_VENDOR_AMD) | ||
539 | goto no_c1e_idle; | ||
540 | |||
541 | /* Family 0x0f models < rev F do not have C1E */ | ||
542 | if (c->x86 == 0x0F && c->x86_model >= 0x40) | ||
543 | return 1; | ||
544 | |||
545 | if (c->x86 == 0x10) { | ||
546 | /* | ||
547 | * check OSVW bit for CPUs that are not affected | ||
548 | * by erratum #400 | ||
549 | */ | ||
550 | if (cpu_has(c, X86_FEATURE_OSVW)) { | ||
551 | rdmsrl(MSR_AMD64_OSVW_ID_LENGTH, val); | ||
552 | if (val >= 2) { | ||
553 | rdmsrl(MSR_AMD64_OSVW_STATUS, val); | ||
554 | if (!(val & BIT(1))) | ||
555 | goto no_c1e_idle; | ||
556 | } | ||
557 | } | ||
558 | return 1; | ||
559 | } | ||
560 | |||
561 | no_c1e_idle: | ||
562 | return 0; | ||
563 | } | ||
564 | 531 | ||
565 | static cpumask_var_t c1e_mask; | 532 | static cpumask_var_t c1e_mask; |
566 | static int c1e_detected; | ||
567 | 533 | ||
568 | void c1e_remove_cpu(int cpu) | 534 | void c1e_remove_cpu(int cpu) |
569 | { | 535 | { |
@@ -585,12 +551,12 @@ static void c1e_idle(void) | |||
585 | u32 lo, hi; | 551 | u32 lo, hi; |
586 | 552 | ||
587 | rdmsr(MSR_K8_INT_PENDING_MSG, lo, hi); | 553 | rdmsr(MSR_K8_INT_PENDING_MSG, lo, hi); |
554 | |||
588 | if (lo & K8_INTP_C1E_ACTIVE_MASK) { | 555 | if (lo & K8_INTP_C1E_ACTIVE_MASK) { |
589 | c1e_detected = 1; | 556 | c1e_detected = true; |
590 | if (!boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) | 557 | if (!boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) |
591 | mark_tsc_unstable("TSC halt in AMD C1E"); | 558 | mark_tsc_unstable("TSC halt in AMD C1E"); |
592 | printk(KERN_INFO "System has AMD C1E enabled\n"); | 559 | printk(KERN_INFO "System has AMD C1E enabled\n"); |
593 | set_cpu_cap(&boot_cpu_data, X86_FEATURE_AMDC1E); | ||
594 | } | 560 | } |
595 | } | 561 | } |
596 | 562 | ||
@@ -639,7 +605,8 @@ void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c) | |||
639 | */ | 605 | */ |
640 | printk(KERN_INFO "using mwait in idle threads.\n"); | 606 | printk(KERN_INFO "using mwait in idle threads.\n"); |
641 | pm_idle = mwait_idle; | 607 | pm_idle = mwait_idle; |
642 | } else if (check_c1e_idle(c)) { | 608 | } else if (cpu_has_amd_erratum(amd_erratum_400)) { |
609 | /* E400: APIC timer interrupt does not wake up CPU from C1e */ | ||
643 | printk(KERN_INFO "using C1E aware idle routine\n"); | 610 | printk(KERN_INFO "using C1E aware idle routine\n"); |
644 | pm_idle = c1e_idle; | 611 | pm_idle = c1e_idle; |
645 | } else | 612 | } else |