Skip to content

Commit 1b74dde

Browse files
lomipsIngo Molnar
authored andcommitted
x86/cpu: Convert printk(KERN_<LEVEL> ...) to pr_<level>(...)
- Use the more current logging style pr_<level>(...) instead of the old printk(KERN_<LEVEL> ...). - Convert pr_warning() to pr_warn(). Signed-off-by: Chen Yucong <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 16aaa53 commit 1b74dde

27 files changed

+146
-159
lines changed

arch/x86/kernel/cpu/amd.c

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
117117
void (*f_vide)(void);
118118
u64 d, d2;
119119

120-
printk(KERN_INFO "AMD K6 stepping B detected - ");
120+
pr_info("AMD K6 stepping B detected - ");
121121

122122
/*
123123
* It looks like AMD fixed the 2.6.2 bug and improved indirect
@@ -133,10 +133,9 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
133133
d = d2-d;
134134

135135
if (d > 20*K6_BUG_LOOP)
136-
printk(KERN_CONT
137-
"system stability may be impaired when more than 32 MB are used.\n");
136+
pr_cont("system stability may be impaired when more than 32 MB are used.\n");
138137
else
139-
printk(KERN_CONT "probably OK (after B9730xxxx).\n");
138+
pr_cont("probably OK (after B9730xxxx).\n");
140139
}
141140

142141
/* K6 with old style WHCR */
@@ -154,7 +153,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
154153
wbinvd();
155154
wrmsr(MSR_K6_WHCR, l, h);
156155
local_irq_restore(flags);
157-
printk(KERN_INFO "Enabling old style K6 write allocation for %d Mb\n",
156+
pr_info("Enabling old style K6 write allocation for %d Mb\n",
158157
mbytes);
159158
}
160159
return;
@@ -175,7 +174,7 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
175174
wbinvd();
176175
wrmsr(MSR_K6_WHCR, l, h);
177176
local_irq_restore(flags);
178-
printk(KERN_INFO "Enabling new style K6 write allocation for %d Mb\n",
177+
pr_info("Enabling new style K6 write allocation for %d Mb\n",
179178
mbytes);
180179
}
181180

@@ -202,7 +201,7 @@ static void init_amd_k7(struct cpuinfo_x86 *c)
202201
*/
203202
if (c->x86_model >= 6 && c->x86_model <= 10) {
204203
if (!cpu_has(c, X86_FEATURE_XMM)) {
205-
printk(KERN_INFO "Enabling disabled K7/SSE Support.\n");
204+
pr_info("Enabling disabled K7/SSE Support.\n");
206205
msr_clear_bit(MSR_K7_HWCR, 15);
207206
set_cpu_cap(c, X86_FEATURE_XMM);
208207
}
@@ -216,9 +215,8 @@ static void init_amd_k7(struct cpuinfo_x86 *c)
216215
if ((c->x86_model == 8 && c->x86_mask >= 1) || (c->x86_model > 8)) {
217216
rdmsr(MSR_K7_CLK_CTL, l, h);
218217
if ((l & 0xfff00000) != 0x20000000) {
219-
printk(KERN_INFO
220-
"CPU: CLK_CTL MSR was %x. Reprogramming to %x\n",
221-
l, ((l & 0x000fffff)|0x20000000));
218+
pr_info("CPU: CLK_CTL MSR was %x. Reprogramming to %x\n",
219+
l, ((l & 0x000fffff)|0x20000000));
222220
wrmsr(MSR_K7_CLK_CTL, (l & 0x000fffff)|0x20000000, h);
223221
}
224222
}
@@ -485,7 +483,7 @@ static void bsp_init_amd(struct cpuinfo_x86 *c)
485483
if (!rdmsrl_safe(MSR_K8_TSEG_ADDR, &tseg)) {
486484
unsigned long pfn = tseg >> PAGE_SHIFT;
487485

488-
printk(KERN_DEBUG "tseg: %010llx\n", tseg);
486+
pr_debug("tseg: %010llx\n", tseg);
489487
if (pfn_range_is_mapped(pfn, pfn + 1))
490488
set_memory_4k((unsigned long)__va(tseg), 1);
491489
}
@@ -500,8 +498,7 @@ static void bsp_init_amd(struct cpuinfo_x86 *c)
500498

501499
rdmsrl(MSR_K7_HWCR, val);
502500
if (!(val & BIT(24)))
503-
printk(KERN_WARNING FW_BUG "TSC doesn't count "
504-
"with P0 frequency!\n");
501+
pr_warn(FW_BUG "TSC doesn't count with P0 frequency!\n");
505502
}
506503
}
507504

arch/x86/kernel/cpu/bugs_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void __init check_bugs(void)
1515
{
1616
identify_boot_cpu();
1717
#if !defined(CONFIG_SMP)
18-
printk(KERN_INFO "CPU: ");
18+
pr_info("CPU: ");
1919
print_cpu_info(&boot_cpu_data);
2020
#endif
2121
alternative_instructions();

arch/x86/kernel/cpu/centaur.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ static void init_c3(struct cpuinfo_x86 *c)
2929
rdmsr(MSR_VIA_FCR, lo, hi);
3030
lo |= ACE_FCR; /* enable ACE unit */
3131
wrmsr(MSR_VIA_FCR, lo, hi);
32-
printk(KERN_INFO "CPU: Enabled ACE h/w crypto\n");
32+
pr_info("CPU: Enabled ACE h/w crypto\n");
3333
}
3434

3535
/* enable RNG unit, if present and disabled */
3636
if ((tmp & (RNG_PRESENT | RNG_ENABLED)) == RNG_PRESENT) {
3737
rdmsr(MSR_VIA_RNG, lo, hi);
3838
lo |= RNG_ENABLE; /* enable RNG unit */
3939
wrmsr(MSR_VIA_RNG, lo, hi);
40-
printk(KERN_INFO "CPU: Enabled h/w RNG\n");
40+
pr_info("CPU: Enabled h/w RNG\n");
4141
}
4242

4343
/* store Centaur Extended Feature Flags as
@@ -130,7 +130,7 @@ static void init_centaur(struct cpuinfo_x86 *c)
130130
name = "C6";
131131
fcr_set = ECX8|DSMC|EDCTLB|EMMX|ERETSTK;
132132
fcr_clr = DPDC;
133-
printk(KERN_NOTICE "Disabling bugged TSC.\n");
133+
pr_notice("Disabling bugged TSC.\n");
134134
clear_cpu_cap(c, X86_FEATURE_TSC);
135135
break;
136136
case 8:
@@ -163,11 +163,11 @@ static void init_centaur(struct cpuinfo_x86 *c)
163163
newlo = (lo|fcr_set) & (~fcr_clr);
164164

165165
if (newlo != lo) {
166-
printk(KERN_INFO "Centaur FCR was 0x%X now 0x%X\n",
166+
pr_info("Centaur FCR was 0x%X now 0x%X\n",
167167
lo, newlo);
168168
wrmsr(MSR_IDT_FCR1, newlo, hi);
169169
} else {
170-
printk(KERN_INFO "Centaur FCR is 0x%X\n", lo);
170+
pr_info("Centaur FCR is 0x%X\n", lo);
171171
}
172172
/* Emulate MTRRs using Centaur's MCR. */
173173
set_cpu_cap(c, X86_FEATURE_CENTAUR_MCR);

arch/x86/kernel/cpu/common.c

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ static void squash_the_stupid_serial_number(struct cpuinfo_x86 *c)
228228
lo |= 0x200000;
229229
wrmsr(MSR_IA32_BBL_CR_CTL, lo, hi);
230230

231-
printk(KERN_NOTICE "CPU serial number disabled.\n");
231+
pr_notice("CPU serial number disabled.\n");
232232
clear_cpu_cap(c, X86_FEATURE_PN);
233233

234234
/* Disabling the serial number may affect the cpuid level */
@@ -329,9 +329,8 @@ static void filter_cpuid_features(struct cpuinfo_x86 *c, bool warn)
329329
if (!warn)
330330
continue;
331331

332-
printk(KERN_WARNING
333-
"CPU: CPU feature " X86_CAP_FMT " disabled, no CPUID level 0x%x\n",
334-
x86_cap_flag(df->feature), df->level);
332+
pr_warn("CPU: CPU feature " X86_CAP_FMT " disabled, no CPUID level 0x%x\n",
333+
x86_cap_flag(df->feature), df->level);
335334
}
336335
}
337336

@@ -510,7 +509,7 @@ void detect_ht(struct cpuinfo_x86 *c)
510509
smp_num_siblings = (ebx & 0xff0000) >> 16;
511510

512511
if (smp_num_siblings == 1) {
513-
printk_once(KERN_INFO "CPU0: Hyper-Threading is disabled\n");
512+
pr_info_once("CPU0: Hyper-Threading is disabled\n");
514513
goto out;
515514
}
516515

@@ -531,10 +530,10 @@ void detect_ht(struct cpuinfo_x86 *c)
531530

532531
out:
533532
if (!printed && (c->x86_max_cores * smp_num_siblings) > 1) {
534-
printk(KERN_INFO "CPU: Physical Processor ID: %d\n",
535-
c->phys_proc_id);
536-
printk(KERN_INFO "CPU: Processor Core ID: %d\n",
537-
c->cpu_core_id);
533+
pr_info("CPU: Physical Processor ID: %d\n",
534+
c->phys_proc_id);
535+
pr_info("CPU: Processor Core ID: %d\n",
536+
c->cpu_core_id);
538537
printed = 1;
539538
}
540539
#endif
@@ -559,9 +558,8 @@ static void get_cpu_vendor(struct cpuinfo_x86 *c)
559558
}
560559
}
561560

562-
printk_once(KERN_ERR
563-
"CPU: vendor_id '%s' unknown, using generic init.\n" \
564-
"CPU: Your system may be unstable.\n", v);
561+
pr_err_once("CPU: vendor_id '%s' unknown, using generic init.\n" \
562+
"CPU: Your system may be unstable.\n", v);
565563

566564
c->x86_vendor = X86_VENDOR_UNKNOWN;
567565
this_cpu = &default_cpu;
@@ -760,7 +758,7 @@ void __init early_cpu_init(void)
760758
int count = 0;
761759

762760
#ifdef CONFIG_PROCESSOR_SELECT
763-
printk(KERN_INFO "KERNEL supported cpus:\n");
761+
pr_info("KERNEL supported cpus:\n");
764762
#endif
765763

766764
for (cdev = __x86_cpu_dev_start; cdev < __x86_cpu_dev_end; cdev++) {
@@ -778,7 +776,7 @@ void __init early_cpu_init(void)
778776
for (j = 0; j < 2; j++) {
779777
if (!cpudev->c_ident[j])
780778
continue;
781-
printk(KERN_INFO " %s %s\n", cpudev->c_vendor,
779+
pr_info(" %s %s\n", cpudev->c_vendor,
782780
cpudev->c_ident[j]);
783781
}
784782
}
@@ -1061,7 +1059,7 @@ static void __print_cpu_msr(void)
10611059
for (index = index_min; index < index_max; index++) {
10621060
if (rdmsrl_safe(index, &val))
10631061
continue;
1064-
printk(KERN_INFO " MSR%08x: %016llx\n", index, val);
1062+
pr_info(" MSR%08x: %016llx\n", index, val);
10651063
}
10661064
}
10671065
}
@@ -1100,19 +1098,19 @@ void print_cpu_info(struct cpuinfo_x86 *c)
11001098
}
11011099

11021100
if (vendor && !strstr(c->x86_model_id, vendor))
1103-
printk(KERN_CONT "%s ", vendor);
1101+
pr_cont("%s ", vendor);
11041102

11051103
if (c->x86_model_id[0])
1106-
printk(KERN_CONT "%s", c->x86_model_id);
1104+
pr_cont("%s", c->x86_model_id);
11071105
else
1108-
printk(KERN_CONT "%d86", c->x86);
1106+
pr_cont("%d86", c->x86);
11091107

1110-
printk(KERN_CONT " (family: 0x%x, model: 0x%x", c->x86, c->x86_model);
1108+
pr_cont(" (family: 0x%x, model: 0x%x", c->x86, c->x86_model);
11111109

11121110
if (c->x86_mask || c->cpuid_level >= 0)
1113-
printk(KERN_CONT ", stepping: 0x%x)\n", c->x86_mask);
1111+
pr_cont(", stepping: 0x%x)\n", c->x86_mask);
11141112
else
1115-
printk(KERN_CONT ")\n");
1113+
pr_cont(")\n");
11161114

11171115
print_cpu_msr(c);
11181116
}
@@ -1438,7 +1436,7 @@ void cpu_init(void)
14381436

14391437
show_ucode_info_early();
14401438

1441-
printk(KERN_INFO "Initializing CPU#%d\n", cpu);
1439+
pr_info("Initializing CPU#%d\n", cpu);
14421440

14431441
if (cpu_feature_enabled(X86_FEATURE_VME) ||
14441442
cpu_has_tsc ||

arch/x86/kernel/cpu/cyrix.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static void check_cx686_slop(struct cpuinfo_x86 *c)
103103
local_irq_restore(flags);
104104

105105
if (ccr5 & 2) { /* possible wrong calibration done */
106-
printk(KERN_INFO "Recalibrating delay loop with SLOP bit reset\n");
106+
pr_info("Recalibrating delay loop with SLOP bit reset\n");
107107
calibrate_delay();
108108
c->loops_per_jiffy = loops_per_jiffy;
109109
}
@@ -115,7 +115,7 @@ static void set_cx86_reorder(void)
115115
{
116116
u8 ccr3;
117117

118-
printk(KERN_INFO "Enable Memory access reorder on Cyrix/NSC processor.\n");
118+
pr_info("Enable Memory access reorder on Cyrix/NSC processor.\n");
119119
ccr3 = getCx86(CX86_CCR3);
120120
setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
121121

@@ -128,7 +128,7 @@ static void set_cx86_reorder(void)
128128

129129
static void set_cx86_memwb(void)
130130
{
131-
printk(KERN_INFO "Enable Memory-Write-back mode on Cyrix/NSC processor.\n");
131+
pr_info("Enable Memory-Write-back mode on Cyrix/NSC processor.\n");
132132

133133
/* CCR2 bit 2: unlock NW bit */
134134
setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) & ~0x04);
@@ -268,7 +268,7 @@ static void init_cyrix(struct cpuinfo_x86 *c)
268268
* VSA1 we work around however.
269269
*/
270270

271-
printk(KERN_INFO "Working around Cyrix MediaGX virtual DMA bugs.\n");
271+
pr_info("Working around Cyrix MediaGX virtual DMA bugs.\n");
272272
isa_dma_bridge_buggy = 2;
273273

274274
/* We do this before the PCI layer is running. However we
@@ -426,7 +426,7 @@ static void cyrix_identify(struct cpuinfo_x86 *c)
426426
if (dir0 == 5 || dir0 == 3) {
427427
unsigned char ccr3;
428428
unsigned long flags;
429-
printk(KERN_INFO "Enabling CPUID on Cyrix processor.\n");
429+
pr_info("Enabling CPUID on Cyrix processor.\n");
430430
local_irq_save(flags);
431431
ccr3 = getCx86(CX86_CCR3);
432432
/* enable MAPEN */

arch/x86/kernel/cpu/hypervisor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ detect_hypervisor_vendor(void)
5656
}
5757

5858
if (max_pri)
59-
printk(KERN_INFO "Hypervisor detected: %s\n", x86_hyper->name);
59+
pr_info("Hypervisor detected: %s\n", x86_hyper->name);
6060
}
6161

6262
void init_hypervisor(struct cpuinfo_x86 *c)

arch/x86/kernel/cpu/intel.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static void early_init_intel(struct cpuinfo_x86 *c)
6161
*/
6262
if (c->x86 == 6 && c->x86_model == 0x1c && c->x86_mask <= 2 &&
6363
c->microcode < 0x20e) {
64-
printk(KERN_WARNING "Atom PSE erratum detected, BIOS microcode update recommended\n");
64+
pr_warn("Atom PSE erratum detected, BIOS microcode update recommended\n");
6565
clear_cpu_cap(c, X86_FEATURE_PSE);
6666
}
6767

@@ -140,7 +140,7 @@ static void early_init_intel(struct cpuinfo_x86 *c)
140140
if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) {
141141
rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
142142
if (!(misc_enable & MSR_IA32_MISC_ENABLE_FAST_STRING)) {
143-
printk(KERN_INFO "Disabled fast string operations\n");
143+
pr_info("Disabled fast string operations\n");
144144
setup_clear_cpu_cap(X86_FEATURE_REP_GOOD);
145145
setup_clear_cpu_cap(X86_FEATURE_ERMS);
146146
}
@@ -176,7 +176,7 @@ int ppro_with_ram_bug(void)
176176
boot_cpu_data.x86 == 6 &&
177177
boot_cpu_data.x86_model == 1 &&
178178
boot_cpu_data.x86_mask < 8) {
179-
printk(KERN_INFO "Pentium Pro with Errata#50 detected. Taking evasive action.\n");
179+
pr_info("Pentium Pro with Errata#50 detected. Taking evasive action.\n");
180180
return 1;
181181
}
182182
return 0;
@@ -225,7 +225,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c)
225225

226226
set_cpu_bug(c, X86_BUG_F00F);
227227
if (!f00f_workaround_enabled) {
228-
printk(KERN_NOTICE "Intel Pentium with F0 0F bug - workaround enabled.\n");
228+
pr_notice("Intel Pentium with F0 0F bug - workaround enabled.\n");
229229
f00f_workaround_enabled = 1;
230230
}
231231
}
@@ -244,7 +244,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c)
244244
* Forcefully enable PAE if kernel parameter "forcepae" is present.
245245
*/
246246
if (forcepae) {
247-
printk(KERN_WARNING "PAE forced!\n");
247+
pr_warn("PAE forced!\n");
248248
set_cpu_cap(c, X86_FEATURE_PAE);
249249
add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_NOW_UNRELIABLE);
250250
}

arch/x86/kernel/cpu/intel_cacheinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ static ssize_t store_cache_disable(struct cacheinfo *this_leaf,
444444
err = amd_set_l3_disable_slot(nb, cpu, slot, val);
445445
if (err) {
446446
if (err == -EEXIST)
447-
pr_warning("L3 slot %d in use/index already disabled!\n",
447+
pr_warn("L3 slot %d in use/index already disabled!\n",
448448
slot);
449449
return err;
450450
}

0 commit comments

Comments
 (0)