Skip to content

Commit 4989900

Browse files
committed
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux
Pull idle update from Len Brown: "Two Intel-platform-specific updates to intel_idle, and a cosmetic tweak to the turbostat utility" * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: tools/power turbostat: tweak whitespace in output format intel_idle: Broadwell support intel_idle: Disable Baytrail Core and Module C6 auto-demotion
2 parents 6fedb0f + e7c95ff commit 4989900

File tree

3 files changed

+119
-41
lines changed

3 files changed

+119
-41
lines changed

arch/x86/include/uapi/asm/msr-index.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@
149149

150150
#define MSR_CORE_C1_RES 0x00000660
151151

152+
#define MSR_CC6_DEMOTION_POLICY_CONFIG 0x00000668
153+
#define MSR_MC6_DEMOTION_POLICY_CONFIG 0x00000669
154+
152155
#define MSR_AMD64_MC0_MASK 0xc0010044
153156

154157
#define MSR_IA32_MCx_CTL(x) (MSR_IA32_MC0_CTL + 4*(x))

drivers/idle/intel_idle.c

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ struct idle_cpu {
8989
* Indicate which enable bits to clear here.
9090
*/
9191
unsigned long auto_demotion_disable_flags;
92+
bool byt_auto_demotion_disable_flag;
9293
bool disable_promotion_to_c1e;
9394
};
9495

@@ -442,6 +443,66 @@ static struct cpuidle_state hsw_cstates[] = {
442443
{
443444
.enter = NULL }
444445
};
446+
static struct cpuidle_state bdw_cstates[] = {
447+
{
448+
.name = "C1-BDW",
449+
.desc = "MWAIT 0x00",
450+
.flags = MWAIT2flg(0x00) | CPUIDLE_FLAG_TIME_VALID,
451+
.exit_latency = 2,
452+
.target_residency = 2,
453+
.enter = &intel_idle },
454+
{
455+
.name = "C1E-BDW",
456+
.desc = "MWAIT 0x01",
457+
.flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_TIME_VALID,
458+
.exit_latency = 10,
459+
.target_residency = 20,
460+
.enter = &intel_idle },
461+
{
462+
.name = "C3-BDW",
463+
.desc = "MWAIT 0x10",
464+
.flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
465+
.exit_latency = 40,
466+
.target_residency = 100,
467+
.enter = &intel_idle },
468+
{
469+
.name = "C6-BDW",
470+
.desc = "MWAIT 0x20",
471+
.flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
472+
.exit_latency = 133,
473+
.target_residency = 400,
474+
.enter = &intel_idle },
475+
{
476+
.name = "C7s-BDW",
477+
.desc = "MWAIT 0x32",
478+
.flags = MWAIT2flg(0x32) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
479+
.exit_latency = 166,
480+
.target_residency = 500,
481+
.enter = &intel_idle },
482+
{
483+
.name = "C8-BDW",
484+
.desc = "MWAIT 0x40",
485+
.flags = MWAIT2flg(0x40) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
486+
.exit_latency = 300,
487+
.target_residency = 900,
488+
.enter = &intel_idle },
489+
{
490+
.name = "C9-BDW",
491+
.desc = "MWAIT 0x50",
492+
.flags = MWAIT2flg(0x50) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
493+
.exit_latency = 600,
494+
.target_residency = 1800,
495+
.enter = &intel_idle },
496+
{
497+
.name = "C10-BDW",
498+
.desc = "MWAIT 0x60",
499+
.flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
500+
.exit_latency = 2600,
501+
.target_residency = 7700,
502+
.enter = &intel_idle },
503+
{
504+
.enter = NULL }
505+
};
445506

446507
static struct cpuidle_state atom_cstates[] = {
447508
{
@@ -613,6 +674,7 @@ static const struct idle_cpu idle_cpu_snb = {
613674
static const struct idle_cpu idle_cpu_byt = {
614675
.state_table = byt_cstates,
615676
.disable_promotion_to_c1e = true,
677+
.byt_auto_demotion_disable_flag = true,
616678
};
617679

618680
static const struct idle_cpu idle_cpu_ivb = {
@@ -630,6 +692,11 @@ static const struct idle_cpu idle_cpu_hsw = {
630692
.disable_promotion_to_c1e = true,
631693
};
632694

695+
static const struct idle_cpu idle_cpu_bdw = {
696+
.state_table = bdw_cstates,
697+
.disable_promotion_to_c1e = true,
698+
};
699+
633700
static const struct idle_cpu idle_cpu_avn = {
634701
.state_table = avn_cstates,
635702
.disable_promotion_to_c1e = true,
@@ -658,7 +725,10 @@ static const struct x86_cpu_id intel_idle_ids[] = {
658725
ICPU(0x3f, idle_cpu_hsw),
659726
ICPU(0x45, idle_cpu_hsw),
660727
ICPU(0x46, idle_cpu_hsw),
661-
ICPU(0x4D, idle_cpu_avn),
728+
ICPU(0x4d, idle_cpu_avn),
729+
ICPU(0x3d, idle_cpu_bdw),
730+
ICPU(0x4f, idle_cpu_bdw),
731+
ICPU(0x56, idle_cpu_bdw),
662732
{}
663733
};
664734
MODULE_DEVICE_TABLE(x86cpu, intel_idle_ids);
@@ -814,6 +884,11 @@ static int __init intel_idle_cpuidle_driver_init(void)
814884
if (icpu->auto_demotion_disable_flags)
815885
on_each_cpu(auto_demotion_disable, NULL, 1);
816886

887+
if (icpu->byt_auto_demotion_disable_flag) {
888+
wrmsrl(MSR_CC6_DEMOTION_POLICY_CONFIG, 0);
889+
wrmsrl(MSR_MC6_DEMOTION_POLICY_CONFIG, 0);
890+
}
891+
817892
if (icpu->disable_promotion_to_c1e) /* each-cpu is redundant */
818893
on_each_cpu(c1e_promotion_disable, NULL, 1);
819894

tools/power/x86/turbostat/turbostat.c

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -267,90 +267,90 @@ int get_msr(int cpu, off_t offset, unsigned long long *msr)
267267
/*
268268
* Example Format w/ field column widths:
269269
*
270-
* Package Core CPU Avg_MHz Bzy_MHz TSC_MHz SMI %Busy CPU_%c1 CPU_%c3 CPU_%c6 CPU_%c7 CoreTmp PkgTmp Pkg%pc2 Pkg%pc3 Pkg%pc6 Pkg%pc7 PkgWatt CorWatt GFXWatt
271-
* 1234567 1234567 1234567 1234567 1234567 1234567 1234567 1234567 1234567 1234567 1234567 1234567 1234567 1234567 1234567 1234567 1234567 1234567 1234567 1234567 1234567
270+
* Package Core CPU Avg_MHz Bzy_MHz TSC_MHz SMI %Busy CPU_%c1 CPU_%c3 CPU_%c6 CPU_%c7 CoreTmp PkgTmp Pkg%pc2 Pkg%pc3 Pkg%pc6 Pkg%pc7 PkgWatt CorWatt GFXWatt
271+
* 123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678
272272
*/
273273

274274
void print_header(void)
275275
{
276276
if (show_pkg)
277-
outp += sprintf(outp, "Package ");
277+
outp += sprintf(outp, " Package");
278278
if (show_core)
279-
outp += sprintf(outp, " Core ");
279+
outp += sprintf(outp, " Core");
280280
if (show_cpu)
281-
outp += sprintf(outp, " CPU ");
281+
outp += sprintf(outp, " CPU");
282282
if (has_aperf)
283-
outp += sprintf(outp, "Avg_MHz ");
283+
outp += sprintf(outp, " Avg_MHz");
284284
if (do_nhm_cstates)
285-
outp += sprintf(outp, " %%Busy ");
285+
outp += sprintf(outp, " %%Busy");
286286
if (has_aperf)
287-
outp += sprintf(outp, "Bzy_MHz ");
288-
outp += sprintf(outp, "TSC_MHz ");
287+
outp += sprintf(outp, " Bzy_MHz");
288+
outp += sprintf(outp, " TSC_MHz");
289289
if (do_smi)
290-
outp += sprintf(outp, " SMI ");
290+
outp += sprintf(outp, " SMI");
291291
if (extra_delta_offset32)
292-
outp += sprintf(outp, " count 0x%03X ", extra_delta_offset32);
292+
outp += sprintf(outp, " count 0x%03X", extra_delta_offset32);
293293
if (extra_delta_offset64)
294-
outp += sprintf(outp, " COUNT 0x%03X ", extra_delta_offset64);
294+
outp += sprintf(outp, " COUNT 0x%03X", extra_delta_offset64);
295295
if (extra_msr_offset32)
296-
outp += sprintf(outp, " MSR 0x%03X ", extra_msr_offset32);
296+
outp += sprintf(outp, " MSR 0x%03X", extra_msr_offset32);
297297
if (extra_msr_offset64)
298-
outp += sprintf(outp, " MSR 0x%03X ", extra_msr_offset64);
298+
outp += sprintf(outp, " MSR 0x%03X", extra_msr_offset64);
299299
if (do_nhm_cstates)
300-
outp += sprintf(outp, " CPU%%c1 ");
300+
outp += sprintf(outp, " CPU%%c1");
301301
if (do_nhm_cstates && !do_slm_cstates)
302-
outp += sprintf(outp, " CPU%%c3 ");
302+
outp += sprintf(outp, " CPU%%c3");
303303
if (do_nhm_cstates)
304-
outp += sprintf(outp, " CPU%%c6 ");
304+
outp += sprintf(outp, " CPU%%c6");
305305
if (do_snb_cstates)
306-
outp += sprintf(outp, " CPU%%c7 ");
306+
outp += sprintf(outp, " CPU%%c7");
307307

308308
if (do_dts)
309-
outp += sprintf(outp, "CoreTmp ");
309+
outp += sprintf(outp, " CoreTmp");
310310
if (do_ptm)
311-
outp += sprintf(outp, " PkgTmp ");
311+
outp += sprintf(outp, " PkgTmp");
312312

313313
if (do_snb_cstates)
314-
outp += sprintf(outp, "Pkg%%pc2 ");
314+
outp += sprintf(outp, " Pkg%%pc2");
315315
if (do_nhm_cstates && !do_slm_cstates)
316-
outp += sprintf(outp, "Pkg%%pc3 ");
316+
outp += sprintf(outp, " Pkg%%pc3");
317317
if (do_nhm_cstates && !do_slm_cstates)
318-
outp += sprintf(outp, "Pkg%%pc6 ");
318+
outp += sprintf(outp, " Pkg%%pc6");
319319
if (do_snb_cstates)
320-
outp += sprintf(outp, "Pkg%%pc7 ");
320+
outp += sprintf(outp, " Pkg%%pc7");
321321
if (do_c8_c9_c10) {
322-
outp += sprintf(outp, "Pkg%%pc8 ");
323-
outp += sprintf(outp, "Pkg%%pc9 ");
324-
outp += sprintf(outp, "Pk%%pc10 ");
322+
outp += sprintf(outp, " Pkg%%pc8");
323+
outp += sprintf(outp, " Pkg%%pc9");
324+
outp += sprintf(outp, " Pk%%pc10");
325325
}
326326

327327
if (do_rapl && !rapl_joules) {
328328
if (do_rapl & RAPL_PKG)
329-
outp += sprintf(outp, "PkgWatt ");
329+
outp += sprintf(outp, " PkgWatt");
330330
if (do_rapl & RAPL_CORES)
331-
outp += sprintf(outp, "CorWatt ");
331+
outp += sprintf(outp, " CorWatt");
332332
if (do_rapl & RAPL_GFX)
333-
outp += sprintf(outp, "GFXWatt ");
333+
outp += sprintf(outp, " GFXWatt");
334334
if (do_rapl & RAPL_DRAM)
335-
outp += sprintf(outp, "RAMWatt ");
335+
outp += sprintf(outp, " RAMWatt");
336336
if (do_rapl & RAPL_PKG_PERF_STATUS)
337-
outp += sprintf(outp, " PKG_%% ");
337+
outp += sprintf(outp, " PKG_%%");
338338
if (do_rapl & RAPL_DRAM_PERF_STATUS)
339-
outp += sprintf(outp, " RAM_%% ");
339+
outp += sprintf(outp, " RAM_%%");
340340
} else {
341341
if (do_rapl & RAPL_PKG)
342-
outp += sprintf(outp, " Pkg_J ");
342+
outp += sprintf(outp, " Pkg_J");
343343
if (do_rapl & RAPL_CORES)
344-
outp += sprintf(outp, " Cor_J ");
344+
outp += sprintf(outp, " Cor_J");
345345
if (do_rapl & RAPL_GFX)
346-
outp += sprintf(outp, " GFX_J ");
346+
outp += sprintf(outp, " GFX_J");
347347
if (do_rapl & RAPL_DRAM)
348-
outp += sprintf(outp, " RAM_W ");
348+
outp += sprintf(outp, " RAM_W");
349349
if (do_rapl & RAPL_PKG_PERF_STATUS)
350-
outp += sprintf(outp, " PKG_%% ");
350+
outp += sprintf(outp, " PKG_%%");
351351
if (do_rapl & RAPL_DRAM_PERF_STATUS)
352-
outp += sprintf(outp, " RAM_%% ");
353-
outp += sprintf(outp, " time ");
352+
outp += sprintf(outp, " RAM_%%");
353+
outp += sprintf(outp, " time");
354354

355355
}
356356
outp += sprintf(outp, "\n");

0 commit comments

Comments
 (0)