diff options
author | Steven Honeyman <stevenhoneyman@gmail.com> | 2014-11-05 17:52:18 -0500 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2015-01-10 19:54:54 -0500 |
commit | f94fe119f2e53362a3038ee856fa58412f728bc9 (patch) | |
tree | f867c3d09563112495ee7fb950678016501129b3 | |
parent | b1940cd21c0f4abdce101253e860feff547291b0 (diff) |
x86, CPU: Fix trivial printk formatting issues with dmesg
dmesg (from util-linux) currently has two methods for reading the kernel
message ring buffer: /dev/kmsg and syslog(2). Since kernel 3.5.0 kmsg
has been the default, which escapes control characters (e.g. new lines)
before they are shown.
This change means that when dmesg is using /dev/kmsg, a 2 line printk
makes the output messy, because the second line does not get a
timestamp.
For example:
[ 0.012863] CPU0: Thermal monitoring enabled (TM1)
[ 0.012869] Last level iTLB entries: 4KB 1024, 2MB 1024, 4MB 1024
Last level dTLB entries: 4KB 1024, 2MB 1024, 4MB 1024, 1GB 4
[ 0.012958] Freeing SMP alternatives memory: 28K (ffffffff81d86000 - ffffffff81d8d000)
[ 0.014961] dmar: Host address width 39
Because printk.c intentionally escapes control characters, they should
not be there in the first place. This patch fixes two occurrences of
this.
Signed-off-by: Steven Honeyman <stevenhoneyman@gmail.com>
Link: https://lkml.kernel.org/r/1414856696-8094-1-git-send-email-stevenhoneyman@gmail.com
[ Boris: make cpu_detect_tlb() static, while at it. ]
Signed-off-by: Borislav Petkov <bp@suse.de>
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 13 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/intel.c | 6 |
2 files changed, 9 insertions, 10 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index c6049650c093..4973d6308938 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -491,17 +491,18 @@ u16 __read_mostly tlb_lld_2m[NR_INFO]; | |||
491 | u16 __read_mostly tlb_lld_4m[NR_INFO]; | 491 | u16 __read_mostly tlb_lld_4m[NR_INFO]; |
492 | u16 __read_mostly tlb_lld_1g[NR_INFO]; | 492 | u16 __read_mostly tlb_lld_1g[NR_INFO]; |
493 | 493 | ||
494 | void cpu_detect_tlb(struct cpuinfo_x86 *c) | 494 | static void cpu_detect_tlb(struct cpuinfo_x86 *c) |
495 | { | 495 | { |
496 | if (this_cpu->c_detect_tlb) | 496 | if (this_cpu->c_detect_tlb) |
497 | this_cpu->c_detect_tlb(c); | 497 | this_cpu->c_detect_tlb(c); |
498 | 498 | ||
499 | printk(KERN_INFO "Last level iTLB entries: 4KB %d, 2MB %d, 4MB %d\n" | 499 | pr_info("Last level iTLB entries: 4KB %d, 2MB %d, 4MB %d\n", |
500 | "Last level dTLB entries: 4KB %d, 2MB %d, 4MB %d, 1GB %d\n", | ||
501 | tlb_lli_4k[ENTRIES], tlb_lli_2m[ENTRIES], | 500 | tlb_lli_4k[ENTRIES], tlb_lli_2m[ENTRIES], |
502 | tlb_lli_4m[ENTRIES], tlb_lld_4k[ENTRIES], | 501 | tlb_lli_4m[ENTRIES]); |
503 | tlb_lld_2m[ENTRIES], tlb_lld_4m[ENTRIES], | 502 | |
504 | tlb_lld_1g[ENTRIES]); | 503 | pr_info("Last level dTLB entries: 4KB %d, 2MB %d, 4MB %d, 1GB %d\n", |
504 | tlb_lld_4k[ENTRIES], tlb_lld_2m[ENTRIES], | ||
505 | tlb_lld_4m[ENTRIES], tlb_lld_1g[ENTRIES]); | ||
505 | } | 506 | } |
506 | 507 | ||
507 | void detect_ht(struct cpuinfo_x86 *c) | 508 | void detect_ht(struct cpuinfo_x86 *c) |
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 9cc6b6f25f42..94d7dcb12145 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c | |||
@@ -487,10 +487,8 @@ static void init_intel(struct cpuinfo_x86 *c) | |||
487 | 487 | ||
488 | rdmsrl(MSR_IA32_ENERGY_PERF_BIAS, epb); | 488 | rdmsrl(MSR_IA32_ENERGY_PERF_BIAS, epb); |
489 | if ((epb & 0xF) == ENERGY_PERF_BIAS_PERFORMANCE) { | 489 | if ((epb & 0xF) == ENERGY_PERF_BIAS_PERFORMANCE) { |
490 | printk_once(KERN_WARNING "ENERGY_PERF_BIAS:" | 490 | pr_warn_once("ENERGY_PERF_BIAS: Set to 'normal', was 'performance'\n"); |
491 | " Set to 'normal', was 'performance'\n" | 491 | pr_warn_once("ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)\n"); |
492 | "ENERGY_PERF_BIAS: View and update with" | ||
493 | " x86_energy_perf_policy(8)\n"); | ||
494 | epb = (epb & ~0xF) | ENERGY_PERF_BIAS_NORMAL; | 492 | epb = (epb & ~0xF) | ENERGY_PERF_BIAS_NORMAL; |
495 | wrmsrl(MSR_IA32_ENERGY_PERF_BIAS, epb); | 493 | wrmsrl(MSR_IA32_ENERGY_PERF_BIAS, epb); |
496 | } | 494 | } |