diff options
| -rw-r--r-- | arch/x86/kernel/acpi/cstate.c | 4 | ||||
| -rw-r--r-- | drivers/idle/intel_idle.c | 204 | ||||
| -rw-r--r-- | tools/power/x86/turbostat/turbostat.8 | 127 | ||||
| -rw-r--r-- | tools/power/x86/turbostat/turbostat.c | 240 |
4 files changed, 362 insertions, 213 deletions
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c index e69182fd01cf..4b28159e0421 100644 --- a/arch/x86/kernel/acpi/cstate.c +++ b/arch/x86/kernel/acpi/cstate.c | |||
| @@ -87,7 +87,9 @@ static long acpi_processor_ffh_cstate_probe_cpu(void *_cx) | |||
| 87 | num_cstate_subtype = edx_part & MWAIT_SUBSTATE_MASK; | 87 | num_cstate_subtype = edx_part & MWAIT_SUBSTATE_MASK; |
| 88 | 88 | ||
| 89 | retval = 0; | 89 | retval = 0; |
| 90 | if (num_cstate_subtype < (cx->address & MWAIT_SUBSTATE_MASK)) { | 90 | /* If the HW does not support any sub-states in this C-state */ |
| 91 | if (num_cstate_subtype == 0) { | ||
| 92 | pr_warn(FW_BUG "ACPI MWAIT C-state 0x%x not supported by HW (0x%x)\n", cx->address, edx_part); | ||
| 91 | retval = -1; | 93 | retval = -1; |
| 92 | goto out; | 94 | goto out; |
| 93 | } | 95 | } |
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index 8e1939f564f4..9ddbf550bafa 100644 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c | |||
| @@ -196,6 +196,53 @@ static struct cpuidle_state snb_cstates[] = { | |||
| 196 | .enter = NULL } | 196 | .enter = NULL } |
| 197 | }; | 197 | }; |
| 198 | 198 | ||
| 199 | static struct cpuidle_state byt_cstates[] = { | ||
| 200 | { | ||
| 201 | .name = "C1-BYT", | ||
| 202 | .desc = "MWAIT 0x00", | ||
| 203 | .flags = MWAIT2flg(0x00) | CPUIDLE_FLAG_TIME_VALID, | ||
| 204 | .exit_latency = 1, | ||
| 205 | .target_residency = 1, | ||
| 206 | .enter = &intel_idle }, | ||
| 207 | { | ||
| 208 | .name = "C1E-BYT", | ||
| 209 | .desc = "MWAIT 0x01", | ||
| 210 | .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_TIME_VALID, | ||
| 211 | .exit_latency = 15, | ||
| 212 | .target_residency = 30, | ||
| 213 | .enter = &intel_idle }, | ||
| 214 | { | ||
| 215 | .name = "C6N-BYT", | ||
| 216 | .desc = "MWAIT 0x58", | ||
| 217 | .flags = MWAIT2flg(0x58) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, | ||
| 218 | .exit_latency = 40, | ||
| 219 | .target_residency = 275, | ||
| 220 | .enter = &intel_idle }, | ||
| 221 | { | ||
| 222 | .name = "C6S-BYT", | ||
| 223 | .desc = "MWAIT 0x52", | ||
| 224 | .flags = MWAIT2flg(0x52) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, | ||
| 225 | .exit_latency = 140, | ||
| 226 | .target_residency = 560, | ||
| 227 | .enter = &intel_idle }, | ||
| 228 | { | ||
| 229 | .name = "C7-BYT", | ||
| 230 | .desc = "MWAIT 0x60", | ||
| 231 | .flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, | ||
| 232 | .exit_latency = 1200, | ||
| 233 | .target_residency = 1500, | ||
| 234 | .enter = &intel_idle }, | ||
| 235 | { | ||
| 236 | .name = "C7S-BYT", | ||
| 237 | .desc = "MWAIT 0x64", | ||
| 238 | .flags = MWAIT2flg(0x64) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, | ||
| 239 | .exit_latency = 10000, | ||
| 240 | .target_residency = 20000, | ||
| 241 | .enter = &intel_idle }, | ||
| 242 | { | ||
| 243 | .enter = NULL } | ||
| 244 | }; | ||
| 245 | |||
| 199 | static struct cpuidle_state ivb_cstates[] = { | 246 | static struct cpuidle_state ivb_cstates[] = { |
| 200 | { | 247 | { |
| 201 | .name = "C1-IVB", | 248 | .name = "C1-IVB", |
| @@ -236,6 +283,105 @@ static struct cpuidle_state ivb_cstates[] = { | |||
| 236 | .enter = NULL } | 283 | .enter = NULL } |
| 237 | }; | 284 | }; |
| 238 | 285 | ||
| 286 | static struct cpuidle_state ivt_cstates[] = { | ||
| 287 | { | ||
| 288 | .name = "C1-IVT", | ||
| 289 | .desc = "MWAIT 0x00", | ||
| 290 | .flags = MWAIT2flg(0x00) | CPUIDLE_FLAG_TIME_VALID, | ||
| 291 | .exit_latency = 1, | ||
| 292 | .target_residency = 1, | ||
| 293 | .enter = &intel_idle }, | ||
| 294 | { | ||
| 295 | .name = "C1E-IVT", | ||
| 296 | .desc = "MWAIT 0x01", | ||
| 297 | .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_TIME_VALID, | ||
| 298 | .exit_latency = 10, | ||
| 299 | .target_residency = 80, | ||
| 300 | .enter = &intel_idle }, | ||
| 301 | { | ||
| 302 | .name = "C3-IVT", | ||
| 303 | .desc = "MWAIT 0x10", | ||
| 304 | .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, | ||
| 305 | .exit_latency = 59, | ||
| 306 | .target_residency = 156, | ||
| 307 | .enter = &intel_idle }, | ||
| 308 | { | ||
| 309 | .name = "C6-IVT", | ||
| 310 | .desc = "MWAIT 0x20", | ||
| 311 | .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, | ||
| 312 | .exit_latency = 82, | ||
| 313 | .target_residency = 300, | ||
| 314 | .enter = &intel_idle }, | ||
| 315 | { | ||
| 316 | .enter = NULL } | ||
| 317 | }; | ||
| 318 | |||
| 319 | static struct cpuidle_state ivt_cstates_4s[] = { | ||
| 320 | { | ||
| 321 | .name = "C1-IVT-4S", | ||
| 322 | .desc = "MWAIT 0x00", | ||
| 323 | .flags = MWAIT2flg(0x00) | CPUIDLE_FLAG_TIME_VALID, | ||
| 324 | .exit_latency = 1, | ||
| 325 | .target_residency = 1, | ||
| 326 | .enter = &intel_idle }, | ||
| 327 | { | ||
| 328 | .name = "C1E-IVT-4S", | ||
| 329 | .desc = "MWAIT 0x01", | ||
| 330 | .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_TIME_VALID, | ||
| 331 | .exit_latency = 10, | ||
| 332 | .target_residency = 250, | ||
| 333 | .enter = &intel_idle }, | ||
| 334 | { | ||
| 335 | .name = "C3-IVT-4S", | ||
| 336 | .desc = "MWAIT 0x10", | ||
| 337 | .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, | ||
| 338 | .exit_latency = 59, | ||
| 339 | .target_residency = 300, | ||
| 340 | .enter = &intel_idle }, | ||
| 341 | { | ||
| 342 | .name = "C6-IVT-4S", | ||
| 343 | .desc = "MWAIT 0x20", | ||
| 344 | .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, | ||
| 345 | .exit_latency = 84, | ||
| 346 | .target_residency = 400, | ||
| 347 | .enter = &intel_idle }, | ||
| 348 | { | ||
| 349 | .enter = NULL } | ||
| 350 | }; | ||
| 351 | |||
| 352 | static struct cpuidle_state ivt_cstates_8s[] = { | ||
| 353 | { | ||
| 354 | .name = "C1-IVT-8S", | ||
| 355 | .desc = "MWAIT 0x00", | ||
| 356 | .flags = MWAIT2flg(0x00) | CPUIDLE_FLAG_TIME_VALID, | ||
| 357 | .exit_latency = 1, | ||
| 358 | .target_residency = 1, | ||
| 359 | .enter = &intel_idle }, | ||
| 360 | { | ||
| 361 | .name = "C1E-IVT-8S", | ||
| 362 | .desc = "MWAIT 0x01", | ||
| 363 | .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_TIME_VALID, | ||
| 364 | .exit_latency = 10, | ||
| 365 | .target_residency = 500, | ||
| 366 | .enter = &intel_idle }, | ||
| 367 | { | ||
| 368 | .name = "C3-IVT-8S", | ||
| 369 | .desc = "MWAIT 0x10", | ||
| 370 | .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, | ||
| 371 | .exit_latency = 59, | ||
| 372 | .target_residency = 600, | ||
| 373 | .enter = &intel_idle }, | ||
| 374 | { | ||
| 375 | .name = "C6-IVT-8S", | ||
| 376 | .desc = "MWAIT 0x20", | ||
| 377 | .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, | ||
| 378 | .exit_latency = 88, | ||
| 379 | .target_residency = 700, | ||
| 380 | .enter = &intel_idle }, | ||
| 381 | { | ||
| 382 | .enter = NULL } | ||
| 383 | }; | ||
| 384 | |||
| 239 | static struct cpuidle_state hsw_cstates[] = { | 385 | static struct cpuidle_state hsw_cstates[] = { |
| 240 | { | 386 | { |
| 241 | .name = "C1-HSW", | 387 | .name = "C1-HSW", |
| @@ -464,11 +610,21 @@ static const struct idle_cpu idle_cpu_snb = { | |||
| 464 | .disable_promotion_to_c1e = true, | 610 | .disable_promotion_to_c1e = true, |
| 465 | }; | 611 | }; |
| 466 | 612 | ||
| 613 | static const struct idle_cpu idle_cpu_byt = { | ||
| 614 | .state_table = byt_cstates, | ||
| 615 | .disable_promotion_to_c1e = true, | ||
| 616 | }; | ||
| 617 | |||
| 467 | static const struct idle_cpu idle_cpu_ivb = { | 618 | static const struct idle_cpu idle_cpu_ivb = { |
| 468 | .state_table = ivb_cstates, | 619 | .state_table = ivb_cstates, |
| 469 | .disable_promotion_to_c1e = true, | 620 | .disable_promotion_to_c1e = true, |
| 470 | }; | 621 | |
