diff options
Diffstat (limited to 'arch/x86/kernel/process.c')
| -rw-r--r-- | arch/x86/kernel/process.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 7fc4d5b0a6a0..ec7a2ba9bce8 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
| @@ -185,7 +185,8 @@ static void mwait_idle(void) | |||
| 185 | static void poll_idle(void) | 185 | static void poll_idle(void) |
| 186 | { | 186 | { |
| 187 | local_irq_enable(); | 187 | local_irq_enable(); |
| 188 | cpu_relax(); | 188 | while (!need_resched()) |
| 189 | cpu_relax(); | ||
| 189 | } | 190 | } |
| 190 | 191 | ||
| 191 | /* | 192 | /* |
| @@ -246,6 +247,14 @@ static int __cpuinit check_c1e_idle(const struct cpuinfo_x86 *c) | |||
| 246 | return 1; | 247 | return 1; |
| 247 | } | 248 | } |
| 248 | 249 | ||
| 250 | static cpumask_t c1e_mask = CPU_MASK_NONE; | ||
| 251 | static int c1e_detected; | ||
| 252 | |||
| 253 | void c1e_remove_cpu(int cpu) | ||
| 254 | { | ||
| 255 | cpu_clear(cpu, c1e_mask); | ||
| 256 | } | ||
| 257 | |||
| 249 | /* | 258 | /* |
| 250 | * C1E aware idle routine. We check for C1E active in the interrupt | 259 | * C1E aware idle routine. We check for C1E active in the interrupt |
| 251 | * pending message MSR. If we detect C1E, then we handle it the same | 260 | * pending message MSR. If we detect C1E, then we handle it the same |
| @@ -253,9 +262,6 @@ static int __cpuinit check_c1e_idle(const struct cpuinfo_x86 *c) | |||
| 253 | */ | 262 | */ |
| 254 | static void c1e_idle(void) | 263 | static void c1e_idle(void) |
| 255 | { | 264 | { |
| 256 | static cpumask_t c1e_mask = CPU_MASK_NONE; | ||
| 257 | static int c1e_detected; | ||
| 258 | |||
| 259 | if (need_resched()) | 265 | if (need_resched()) |
| 260 | return; | 266 | return; |
| 261 | 267 | ||
| @@ -265,8 +271,10 @@ static void c1e_idle(void) | |||
| 265 | rdmsr(MSR_K8_INT_PENDING_MSG, lo, hi); | 271 | rdmsr(MSR_K8_INT_PENDING_MSG, lo, hi); |
| 266 | if (lo & K8_INTP_C1E_ACTIVE_MASK) { | 272 | if (lo & K8_INTP_C1E_ACTIVE_MASK) { |
| 267 | c1e_detected = 1; | 273 | c1e_detected = 1; |
| 268 | mark_tsc_unstable("TSC halt in C1E"); | 274 | if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) |
| 269 | printk(KERN_INFO "System has C1E enabled\n"); | 275 | mark_tsc_unstable("TSC halt in AMD C1E"); |
| 276 | printk(KERN_INFO "System has AMD C1E enabled\n"); | ||
| 277 | set_cpu_cap(&boot_cpu_data, X86_FEATURE_AMDC1E); | ||
| 270 | } | 278 | } |
| 271 | } | 279 | } |
| 272 | 280 | ||
