Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/debug: Add KERN_<LEVEL> to bare printks, convert printks to pr_<level>

Use a more current logging style:

- Bare printks should have a KERN_<LEVEL> for consistency's sake
- Add pr_fmt where appropriate
- Neaten some macro definitions
- Convert some Ok output to OK
- Use "%s: ", __func__ in pr_fmt for summit
- Convert some printks to pr_<level>

Message output is not identical in all cases.

Signed-off-by: Joe Perches <joe@perches.com>
Cc: levinsasha928@gmail.com
Link: http://lkml.kernel.org/r/1337655007.24226.10.camel@joe2Laptop
[ merged two similar patches, tidied up the changelog ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Joe Perches and committed by
Ingo Molnar
c767a54b f9ba7179

+301 -279
+1 -1
arch/x86/include/asm/floppy.h
··· 99 99 virtual_dma_residue += virtual_dma_count; 100 100 virtual_dma_count = 0; 101 101 #ifdef TRACE_FLPY_INT 102 - printk("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n", 102 + printk(KERN_DEBUG "count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n", 103 103 virtual_dma_count, virtual_dma_residue, calls, bytes, 104 104 dma_wait); 105 105 calls = 0;
+6 -2
arch/x86/include/asm/pci_x86.h
··· 7 7 #undef DEBUG 8 8 9 9 #ifdef DEBUG 10 - #define DBG(x...) printk(x) 10 + #define DBG(fmt, ...) printk(fmt, ##__VA_ARGS__) 11 11 #else 12 - #define DBG(x...) 12 + #define DBG(fmt, ...) \ 13 + do { \ 14 + if (0) \ 15 + printk(fmt, ##__VA_ARGS__); \ 16 + } while (0) 13 17 #endif 14 18 15 19 #define PCI_PROBE_BIOS 0x0001
+2 -2
arch/x86/include/asm/pgtable-2level.h
··· 2 2 #define _ASM_X86_PGTABLE_2LEVEL_H 3 3 4 4 #define pte_ERROR(e) \ 5 - printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, (e).pte_low) 5 + pr_err("%s:%d: bad pte %08lx\n", __FILE__, __LINE__, (e).pte_low) 6 6 #define pgd_ERROR(e) \ 7 - printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) 7 + pr_err("%s:%d: bad pgd %08lx\n", __FILE__, __LINE__, pgd_val(e)) 8 8 9 9 /* 10 10 * Certain architectures need to do special things when PTEs
+3 -3
arch/x86/include/asm/pgtable-3level.h
··· 9 9 */ 10 10 11 11 #define pte_ERROR(e) \ 12 - printk("%s:%d: bad pte %p(%08lx%08lx).\n", \ 12 + pr_err("%s:%d: bad pte %p(%08lx%08lx)\n", \ 13 13 __FILE__, __LINE__, &(e), (e).pte_high, (e).pte_low) 14 14 #define pmd_ERROR(e) \ 15 - printk("%s:%d: bad pmd %p(%016Lx).\n", \ 15 + pr_err("%s:%d: bad pmd %p(%016Lx)\n", \ 16 16 __FILE__, __LINE__, &(e), pmd_val(e)) 17 17 #define pgd_ERROR(e) \ 18 - printk("%s:%d: bad pgd %p(%016Lx).\n", \ 18 + pr_err("%s:%d: bad pgd %p(%016Lx)\n", \ 19 19 __FILE__, __LINE__, &(e), pgd_val(e)) 20 20 21 21 /* Rules for using set_pte: the pte being assigned *must* be
+4 -4
arch/x86/include/asm/pgtable_64.h
··· 26 26 extern void paging_init(void); 27 27 28 28 #define pte_ERROR(e) \ 29 - printk("%s:%d: bad pte %p(%016lx).\n", \ 29 + pr_err("%s:%d: bad pte %p(%016lx)\n", \ 30 30 __FILE__, __LINE__, &(e), pte_val(e)) 31 31 #define pmd_ERROR(e) \ 32 - printk("%s:%d: bad pmd %p(%016lx).\n", \ 32 + pr_err("%s:%d: bad pmd %p(%016lx)\n", \ 33 33 __FILE__, __LINE__, &(e), pmd_val(e)) 34 34 #define pud_ERROR(e) \ 35 - printk("%s:%d: bad pud %p(%016lx).\n", \ 35 + pr_err("%s:%d: bad pud %p(%016lx)\n", \ 36 36 __FILE__, __LINE__, &(e), pud_val(e)) 37 37 #define pgd_ERROR(e) \ 38 - printk("%s:%d: bad pgd %p(%016lx).\n", \ 38 + pr_err("%s:%d: bad pgd %p(%016lx)\n", \ 39 39 __FILE__, __LINE__, &(e), pgd_val(e)) 40 40 41 41 struct mm_struct;
+11 -6
arch/x86/kernel/alternative.c
··· 1 + #define pr_fmt(fmt) "SMP alternatives: " fmt 2 + 1 3 #include <linux/module.h> 2 4 #include <linux/sched.h> 3 5 #include <linux/mutex.h> ··· 65 63 __setup("noreplace-paravirt", setup_noreplace_paravirt); 66 64 #endif 67 65 68 - #define DPRINTK(fmt, args...) if (debug_alternative) \ 69 - printk(KERN_DEBUG fmt, args) 66 + #define DPRINTK(fmt, ...) \ 67 + do { \ 68 + if (debug_alternative) \ 69 + printk(KERN_DEBUG fmt, ##__VA_ARGS__); \ 70 + } while (0) 70 71 71 72 /* 72 73 * Each GENERIC_NOPX is of X bytes, and defined as an array of bytes ··· 433 428 * If this still occurs then you should see a hang 434 429 * or crash shortly after this line: 435 430 */ 436 - printk("lockdep: fixing up alternatives.\n"); 431 + pr_info("lockdep: fixing up alternatives\n"); 437 432 #endif 438 433 439 434 if (noreplace_smp || smp_alt_once || skip_smp_alternatives) ··· 449 444 if (smp == smp_mode) { 450 445 /* nothing */ 451 446 } else if (smp) { 452 - printk(KERN_INFO "SMP alternatives: switching to SMP code\n"); 447 + pr_info("switching to SMP code\n"); 453 448 clear_cpu_cap(&boot_cpu_data, X86_FEATURE_UP); 454 449 clear_cpu_cap(&cpu_data(0), X86_FEATURE_UP); 455 450 list_for_each_entry(mod, &smp_alt_modules, next) 456 451 alternatives_smp_lock(mod->locks, mod->locks_end, 457 452 mod->text, mod->text_end); 458 453 } else { 459 - printk(KERN_INFO "SMP alternatives: switching to UP code\n"); 454 + pr_info("switching to UP code\n"); 460 455 set_cpu_cap(&boot_cpu_data, X86_FEATURE_UP); 461 456 set_cpu_cap(&cpu_data(0), X86_FEATURE_UP); 462 457 list_for_each_entry(mod, &smp_alt_modules, next) ··· 551 546 #ifdef CONFIG_SMP 552 547 if (smp_alt_once) { 553 548 if (1 == num_possible_cpus()) { 554 - printk(KERN_INFO "SMP alternatives: switching to UP code\n"); 549 + pr_info("switching to UP code\n"); 555 550 set_cpu_cap(&boot_cpu_data, X86_FEATURE_UP); 556 551 set_cpu_cap(&cpu_data(0), X86_FEATURE_UP); 557 552
+6 -4
arch/x86/kernel/amd_nb.c
··· 2 2 * Shared support code for AMD K8 northbridges and derivates. 3 3 * Copyright 2006 Andi Kleen, SUSE Labs. Subject to GPLv2. 4 4 */ 5 + 6 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 7 + 5 8 #include <linux/types.h> 6 9 #include <linux/slab.h> 7 10 #include <linux/init.h> ··· 261 258 } 262 259 spin_unlock_irqrestore(&gart_lock, flags); 263 260 if (!flushed) 264 - printk("nothing to flush?\n"); 261 + pr_notice("nothing to flush?\n"); 265 262 } 266 263 EXPORT_SYMBOL_GPL(amd_flush_garts); 267 264 ··· 272 269 err = amd_cache_northbridges(); 273 270 274 271 if (err < 0) 275 - printk(KERN_NOTICE "AMD NB: Cannot enumerate AMD northbridges.\n"); 272 + pr_notice("Cannot enumerate AMD northbridges\n"); 276 273 277 274 if (amd_cache_gart() < 0) 278 - printk(KERN_NOTICE "AMD NB: Cannot initialize GART flush words, " 279 - "GART support disabled.\n"); 275 + pr_notice("Cannot initialize GART flush words, GART support disabled\n"); 280 276 281 277 return err; 282 278 }
+19 -19
arch/x86/kernel/apic/io_apic.c
··· 448 448 449 449 entry = alloc_irq_pin_list(node); 450 450 if (!entry) { 451 - printk(KERN_ERR "can not alloc irq_pin_list (%d,%d,%d)\n", 452 - node, apic, pin); 451 + pr_err("can not alloc irq_pin_list (%d,%d,%d)\n", 452 + node, apic, pin); 453 453 return -ENOMEM; 454 454 } 455 455 entry->apic = apic; ··· 661 661 ioapic_mask_entry(apic, pin); 662 662 entry = ioapic_read_entry(apic, pin); 663 663 if (entry.irr) 664 - printk(KERN_ERR "Unable to reset IRR for apic: %d, pin :%d\n", 664 + pr_err("Unable to reset IRR for apic: %d, pin :%d\n", 665 665 mpc_ioapic_id(apic), pin); 666 666 } 667 667 ··· 895 895 } 896 896 case 2: /* reserved */ 897 897 { 898 - printk(KERN_WARNING "broken BIOS!!\n"); 898 + pr_warn("broken BIOS!!\n"); 899 899 polarity = 1; 900 900 break; 901 901 } ··· 906 906 } 907 907 default: /* invalid */ 908 908 { 909 - printk(KERN_WARNING "broken BIOS!!\n"); 909 + pr_warn("broken BIOS!!\n"); 910 910 polarity = 1; 911 911 break; 912 912 } ··· 948 948 } 949 949 default: 950 950 { 951 - printk(KERN_WARNING "broken BIOS!!\n"); 951 + pr_warn("broken BIOS!!\n"); 952 952 trigger = 1; 953 953 break; 954 954 } ··· 962 962 } 963 963 case 2: /* reserved */ 964 964 { 965 - printk(KERN_WARNING "broken BIOS!!\n"); 965 + pr_warn("broken BIOS!!\n"); 966 966 trigger = 1; 967 967 break; 968 968 } ··· 973 973 } 974 974 default: /* invalid */ 975 975 { 976 - printk(KERN_WARNING "broken BIOS!!\n"); 976 + pr_warn("broken BIOS!!\n"); 977 977 trigger = 0; 978 978 break; 979 979 } ··· 991 991 * Debugging check, we are in big trouble if this message pops up! 992 992 */ 993 993 if (mp_irqs[idx].dstirq != pin) 994 - printk(KERN_ERR "broken BIOS or MPTABLE parser, ayiee!!\n"); 994 + pr_err("broken BIOS or MPTABLE parser, ayiee!!\n"); 995 995 996 996 if (test_bit(bus, mp_bus_not_pci)) { 997 997 irq = mp_irqs[idx].srcbusirq; ··· 1521 1521 reg_03.raw = io_apic_read(ioapic_idx, 3); 1522 1522 raw_spin_unlock_irqrestore(&ioapic_lock, flags); 1523 1523 1524 - printk("\n"); 1525 1524 printk(KERN_DEBUG "IO APIC #%d......\n", mpc_ioapic_id(ioapic_idx)); 1526 1525 printk(KERN_DEBUG ".... register #00: %08X\n", reg_00.raw); 1527 1526 printk(KERN_DEBUG "....... : physical APIC id: %02X\n", reg_00.bits.ID); ··· 1577 1578 i, 1578 1579 ir_entry->index 1579 1580 ); 1580 - printk("%1d %1d %1d %1d %1d " 1581 + pr_cont("%1d %1d %1d %1d %1d " 1581 1582 "%1d %1d %X %02X\n", 1582 1583 ir_entry->format, 1583 1584 ir_entry->mask, ··· 1597 1598 i, 1598 1599 entry.dest 1599 1600 ); 1600 - printk("%1d %1d %1d %1d %1d " 1601 + pr_cont("%1d %1d %1d %1d %1d " 1601 1602 "%1d %1d %02X\n", 1602 1603 entry.mask, 1603 1604 entry.trigger, ··· 1650 1651 continue; 1651 1652 printk(KERN_DEBUG "IRQ%d ", irq); 1652 1653 for_each_irq_pin(entry, cfg->irq_2_pin) 1653 - printk("-> %d:%d", entry->apic, entry->pin); 1654 - printk("\n"); 1654 + pr_cont("-> %d:%d", entry->apic, entry->pin); 1655 + pr_cont("\n"); 1655 1656 } 1656 1657 1657 1658 printk(KERN_INFO ".................................... done.\n"); ··· 1664 1665 printk(KERN_DEBUG); 1665 1666 1666 1667 for (i = 0; i < 8; i++) 1667 - printk(KERN_CONT "%08x", apic_read(base + i*0x10)); 1668 + pr_cont("%08x", apic_read(base + i*0x10)); 1668 1669 1669 - printk(KERN_CONT "\n"); 1670 + pr_cont("\n"); 1670 1671 } 1671 1672 1672 1673 __apicdebuginit(void) print_local_APIC(void *dummy) ··· 1768 1769 printk(KERN_DEBUG "... APIC EILVT%d: %08x\n", i, v); 1769 1770 } 1770 1771 } 1771 - printk("\n"); 1772 + pr_cont("\n"); 1772 1773 } 1773 1774 1774 1775 __apicdebuginit(void) print_local_APICs(int maxcpu) ··· 2064 2065 reg_00.raw = io_apic_read(ioapic_idx, 0); 2065 2066 raw_spin_unlock_irqrestore(&ioapic_lock, flags); 2066 2067 if (reg_00.bits.ID != mpc_ioapic_id(ioapic_idx)) 2067 - printk("could not set ID!\n"); 2068 + pr_cont("could not set ID!\n"); 2068 2069 else 2069 2070 apic_printk(APIC_VERBOSE, " ok.\n"); 2070 2071 } ··· 3562 3563 3563 3564 /* Sanity check */ 3564 3565 if (reg_00.bits.ID != apic_id) { 3565 - printk("IOAPIC[%d]: Unable to change apic_id!\n", ioapic); 3566 + pr_err("IOAPIC[%d]: Unable to change apic_id!\n", 3567 + ioapic); 3566 3568 return -1; 3567 3569 } 3568 3570 }
+13 -9
arch/x86/kernel/apic/summit_32.c
··· 26 26 * 27 27 */ 28 28 29 + #define pr_fmt(fmt) "summit: %s: " fmt, __func__ 30 + 29 31 #include <linux/mm.h> 30 32 #include <linux/init.h> 31 33 #include <asm/io.h> ··· 237 235 238 236 static void summit_setup_apic_routing(void) 239 237 { 240 - printk("Enabling APIC mode: Summit. Using %d I/O APICs\n", 241 - nr_ioapics); 238 + pr_info("Enabling APIC mode: Summit. Using %d I/O APICs\n", 239 + nr_ioapics); 242 240 } 243 241 244 242 static int summit_cpu_present_to_apicid(int mps_cpu) ··· 277 275 int new_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu); 278 276 279 277 if (round && APIC_CLUSTER(apicid) != APIC_CLUSTER(new_apicid)) { 280 - printk("%s: Not a valid mask!\n", __func__); 278 + pr_err("Not a valid mask!\n"); 281 279 return BAD_APICID; 282 280 } 283 281 apicid |= new_apicid; ··· 357 355 } 358 356 } 359 357 if (i == rio_table_hdr->num_rio_dev) { 360 - printk(KERN_ERR "%s: Couldn't find owner Cyclone for Winnipeg!\n", __func__); 358 + pr_err("Couldn't find owner Cyclone for Winnipeg!\n"); 361 359 return last_bus; 362 360 } 363 361 ··· 368 366 } 369 367 } 370 368 if (i == rio_table_hdr->num_scal_dev) { 371 - printk(KERN_ERR "%s: Couldn't find owner Twister for Cyclone!\n", __func__); 369 + pr_err("Couldn't find owner Twister for Cyclone!\n"); 372 370 return last_bus; 373 371 } 374 372 ··· 398 396 num_buses = 9; 399 397 break; 400 398 default: 401 - printk(KERN_INFO "%s: Unsupported Winnipeg type!\n", __func__); 399 + pr_info("Unsupported Winnipeg type!\n"); 402 400 return last_bus; 403 401 } 404 402 ··· 413 411 int i, scal_detail_size, rio_detail_size; 414 412 415 413 if (rio_table_hdr->num_scal_dev > MAX_NUMNODES) { 416 - printk(KERN_WARNING "%s: MAX_NUMNODES too low! Defined as %d, but system has %d nodes.\n", __func__, MAX_NUMNODES, rio_table_hdr->num_scal_dev); 414 + pr_warn("MAX_NUMNODES too low! Defined as %d, but system has %d nodes\n", 415 + MAX_NUMNODES, rio_table_hdr->num_scal_dev); 417 416 return 0; 418 417 } 419 418 420 419 switch (rio_table_hdr->version) { 421 420 default: 422 - printk(KERN_WARNING "%s: Invalid Rio Grande Table Version: %d\n", __func__, rio_table_hdr->version); 421 + pr_warn("Invalid Rio Grande Table Version: %d\n", 422 + rio_table_hdr->version); 423 423 return 0; 424 424 case 2: 425 425 scal_detail_size = 11; ··· 466 462 offset = *((unsigned short *)(ptr + offset)); 467 463 } 468 464 if (!rio_table_hdr) { 469 - printk(KERN_ERR "%s: Unable to locate Rio Grande Table in EBDA - bailing!\n", __func__); 465 + pr_err("Unable to locate Rio Grande Table in EBDA - bailing!\n"); 470 466 return; 471 467 } 472 468
+14 -15
arch/x86/kernel/apm_32.c
··· 201 201 * http://www.microsoft.com/whdc/archive/amp_12.mspx] 202 202 */ 203 203 204 + #define pr_fmt(fmt) "apm: " fmt 205 + 204 206 #include <linux/module.h> 205 207 206 208 #include <linux/poll.h> ··· 487 485 if (error_table[i].key == err) 488 486 break; 489 487 if (i < ERROR_COUNT) 490 - printk(KERN_NOTICE "apm: %s: %s\n", str, error_table[i].msg); 488 + pr_notice("%s: %s\n", str, error_table[i].msg); 491 489 else if (err < 0) 492 - printk(KERN_NOTICE "apm: %s: linux error code %i\n", str, err); 490 + pr_notice("%s: linux error code %i\n", str, err); 493 491 else 494 - printk(KERN_NOTICE "apm: %s: unknown error code %#2.2x\n", 492 + pr_notice("%s: unknown error code %#2.2x\n", 495 493 str, err); 496 494 } 497 495 ··· 1186 1184 static int notified; 1187 1185 1188 1186 if (notified++ == 0) 1189 - printk(KERN_ERR "apm: an event queue overflowed\n"); 1187 + pr_err("an event queue overflowed\n"); 1190 1188 if (++as->event_tail >= APM_MAX_EVENTS) 1191 1189 as->event_tail = 0; 1192 1190 } ··· 1449 1447 static int check_apm_user(struct apm_user *as, const char *func) 1450 1448 { 1451 1449 if (as == NULL || as->magic != APM_BIOS_MAGIC) { 1452 - printk(KERN_ERR "apm: %s passed bad filp\n", func); 1450 + pr_err("%s passed bad filp\n", func); 1453 1451 return 1; 1454 1452 } 1455 1453 return 0; ··· 1588 1586 as1 = as1->next) 1589 1587 ; 1590 1588 if (as1 == NULL) 1591 - printk(KERN_ERR "apm: filp not in user list\n"); 1589 + pr_err("filp not in user list\n"); 1592 1590 else 1593 1591 as1->next = as->next; 1594 1592 } ··· 1602 1600 struct apm_user *as; 1603 1601 1604 1602 as = kmalloc(sizeof(*as), GFP_KERNEL); 1605 - if (as == NULL) { 1606 - printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n", 1607 - sizeof(*as)); 1603 + if (as == NULL) 1608 1604 return -ENOMEM; 1609 - } 1605 + 1610 1606 as->magic = APM_BIOS_MAGIC; 1611 1607 as->event_tail = as->event_head = 0; 1612 1608 as->suspends_pending = as->standbys_pending = 0; ··· 2313 2313 } 2314 2314 2315 2315 if (apm_info.disabled) { 2316 - printk(KERN_NOTICE "apm: disabled on user request.\n"); 2316 + pr_notice("disabled on user request.\n"); 2317 2317 return -ENODEV; 2318 2318 } 2319 2319 if ((num_online_cpus() > 1) && !power_off && !smp) { 2320 - printk(KERN_NOTICE "apm: disabled - APM is not SMP safe.\n"); 2320 + pr_notice("disabled - APM is not SMP safe.\n"); 2321 2321 apm_info.disabled = 1; 2322 2322 return -ENODEV; 2323 2323 } 2324 2324 if (!acpi_disabled) { 2325 - printk(KERN_NOTICE "apm: overridden by ACPI.\n"); 2325 + pr_notice("overridden by ACPI.\n"); 2326 2326 apm_info.disabled = 1; 2327 2327 return -ENODEV; 2328 2328 } ··· 2356 2356 2357 2357 kapmd_task = kthread_create(apm, NULL, "kapmd"); 2358 2358 if (IS_ERR(kapmd_task)) { 2359 - printk(KERN_ERR "apm: disabled - Unable to start kernel " 2360 - "thread.\n"); 2359 + pr_err("disabled - Unable to start kernel thread\n"); 2361 2360 err = PTR_ERR(kapmd_task); 2362 2361 kapmd_task = NULL; 2363 2362 remove_proc_entry("apm", NULL);
+10 -10
arch/x86/kernel/cpu/bugs.c
··· 55 55 56 56 if (!boot_cpu_data.hard_math) { 57 57 #ifndef CONFIG_MATH_EMULATION 58 - printk(KERN_EMERG "No coprocessor found and no math emulation present.\n"); 59 - printk(KERN_EMERG "Giving up.\n"); 58 + pr_emerg("No coprocessor found and no math emulation present\n"); 59 + pr_emerg("Giving up\n"); 60 60 for (;;) ; 61 61 #endif 62 62 return; ··· 86 86 87 87 boot_cpu_data.fdiv_bug = fdiv_bug; 88 88 if (boot_cpu_data.fdiv_bug) 89 - printk(KERN_WARNING "Hmm, FPU with FDIV bug.\n"); 89 + pr_warn("Hmm, FPU with FDIV bug\n"); 90 90 } 91 91 92 92 static void __init check_hlt(void) ··· 94 94 if (boot_cpu_data.x86 >= 5 || paravirt_enabled()) 95 95 return; 96 96 97 - printk(KERN_INFO "Checking 'hlt' instruction... "); 97 + pr_info("Checking 'hlt' instruction... "); 98 98 if (!boot_cpu_data.hlt_works_ok) { 99 - printk("disabled\n"); 99 + pr_cont("disabled\n"); 100 100 return; 101 101 } 102 102 halt(); 103 103 halt(); 104 104 halt(); 105 105 halt(); 106 - printk(KERN_CONT "OK.\n"); 106 + pr_cont("OK\n"); 107 107 } 108 108 109 109 /* ··· 116 116 #ifndef CONFIG_X86_POPAD_OK 117 117 int res, inp = (int) &res; 118 118 119 - printk(KERN_INFO "Checking for popad bug... "); 119 + pr_info("Checking for popad bug... "); 120 120 __asm__ __volatile__( 121 121 "movl $12345678,%%eax; movl $0,%%edi; pusha; popa; movl (%%edx,%%edi),%%ecx " 122 122 : "=&a" (res) ··· 127 127 * CPU hard. Too bad. 128 128 */ 129 129 if (res != 12345678) 130 - printk(KERN_CONT "Buggy.\n"); 130 + pr_cont("Buggy\n"); 131 131 else 132 - printk(KERN_CONT "OK.\n"); 132 + pr_cont("OK\n"); 133 133 #endif 134 134 } 135 135 ··· 161 161 { 162 162 identify_boot_cpu(); 163 163 #ifndef CONFIG_SMP 164 - printk(KERN_INFO "CPU: "); 164 + pr_info("CPU: "); 165 165 print_cpu_info(&boot_cpu_data); 166 166 #endif 167 167 check_config();
+12 -10
arch/x86/kernel/cpu/mcheck/mce.c
··· 7 7 * Copyright 2008 Intel Corporation 8 8 * Author: Andi Kleen 9 9 */ 10 + 11 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 12 + 10 13 #include <linux/thread_info.h> 11 14 #include <linux/capability.h> 12 15 #include <linux/miscdevice.h> ··· 213 210 cpu_relax(); 214 211 215 212 if (!m->finished && retries >= 4) { 216 - pr_err("MCE: skipping error being logged currently!\n"); 213 + pr_err("skipping error being logged currently!\n"); 217 214 break; 218 215 } 219 216 } ··· 1170 1167 { 1171 1168 /* mce_severity() should not hand us an ACTION_REQUIRED error */ 1172 1169 BUG_ON(flags & MF_ACTION_REQUIRED); 1173 - printk(KERN_ERR "Uncorrected memory error in page 0x%lx ignored\n" 1174 - "Rebuild kernel with CONFIG_MEMORY_FAILURE=y for smarter handling\n", pfn); 1170 + pr_err("Uncorrected memory error in page 0x%lx ignored\n" 1171 + "Rebuild kernel with CONFIG_MEMORY_FAILURE=y for smarter handling\n", 1172 + pfn); 1175 1173 1176 1174 return 0; 1177 1175 } ··· 1362 1358 1363 1359 b = cap & MCG_BANKCNT_MASK; 1364 1360 if (!banks) 1365 - printk(KERN_INFO "mce: CPU supports %d MCE banks\n", b); 1361 + pr_info("CPU supports %d MCE banks\n", b); 1366 1362 1367 1363 if (b > MAX_NR_BANKS) { 1368 - printk(KERN_WARNING 1369 - "MCE: Using only %u machine check banks out of %u\n", 1364 + pr_warn("Using only %u machine check banks out of %u\n", 1370 1365 MAX_NR_BANKS, b); 1371 1366 b = MAX_NR_BANKS; 1372 1367 } ··· 1422 1419 static int __cpuinit __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c) 1423 1420 { 1424 1421 if (c->x86_vendor == X86_VENDOR_UNKNOWN) { 1425 - pr_info("MCE: unknown CPU type - not enabling MCE support.\n"); 1422 + pr_info("unknown CPU type - not enabling MCE support\n"); 1426 1423 return -EOPNOTSUPP; 1427 1424 } 1428 1425 ··· 1577 1574 /* Handle unconfigured int18 (should never happen) */ 1578 1575 static void unexpected_machine_check(struct pt_regs *regs, long error_code) 1579 1576 { 1580 - printk(KERN_ERR "CPU#%d: Unexpected int18 (Machine Check).\n", 1577 + pr_err("CPU#%d: Unexpected int18 (Machine Check)\n", 1581 1578 smp_processor_id()); 1582 1579 } 1583 1580 ··· 1896 1893 get_option(&str, &monarch_timeout); 1897 1894 } 1898 1895 } else { 1899 - printk(KERN_INFO "mce argument %s ignored. Please use /sys\n", 1900 - str); 1896 + pr_info("mce argument %s ignored. Please use /sys\n", str); 1901 1897 return 0; 1902 1898 } 1903 1899 return 1;
+8 -6
arch/x86/kernel/cpu/perf_event_intel.c
··· 5 5 * among events on a single PMU. 6 6 */ 7 7 8 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 9 + 8 10 #include <linux/stddef.h> 9 11 #include <linux/types.h> 10 12 #include <linux/init.h> ··· 1002 1000 1003 1001 local_irq_save(flags); 1004 1002 1005 - printk("clearing PMU state on CPU#%d\n", smp_processor_id()); 1003 + pr_info("clearing PMU state on CPU#%d\n", smp_processor_id()); 1006 1004 1007 1005 for (idx = 0; idx < x86_pmu.num_counters; idx++) { 1008 1006 checking_wrmsrl(x86_pmu_config_addr(idx), 0ull); ··· 1640 1638 * But taken together it might just make sense to not enable PEBS on 1641 1639 * these chips. 1642 1640 */ 1643 - printk(KERN_WARNING "PEBS disabled due to CPU errata.\n"); 1641 + pr_warn("PEBS disabled due to CPU errata\n"); 1644 1642 x86_pmu.pebs = 0; 1645 1643 x86_pmu.pebs_constraints = NULL; 1646 1644 } 1647 1645 1648 1646 static __init void intel_sandybridge_quirk(void) 1649 1647 { 1650 - printk(KERN_WARNING "PEBS disabled due to CPU errata.\n"); 1648 + pr_warn("PEBS disabled due to CPU errata\n"); 1651 1649 x86_pmu.pebs = 0; 1652 1650 x86_pmu.pebs_constraints = NULL; 1653 1651 } ··· 1669 1667 /* disable event that reported as not presend by cpuid */ 1670 1668 for_each_set_bit(bit, x86_pmu.events_mask, ARRAY_SIZE(intel_arch_events_map)) { 1671 1669 intel_perfmon_event_map[intel_arch_events_map[bit].id] = 0; 1672 - printk(KERN_WARNING "CPUID marked event: \'%s\' unavailable\n", 1673 - intel_arch_events_map[bit].name); 1670 + pr_warn("CPUID marked event: \'%s\' unavailable\n", 1671 + intel_arch_events_map[bit].name); 1674 1672 } 1675 1673 } 1676 1674 ··· 1689 1687 intel_perfmon_event_map[PERF_COUNT_HW_BRANCH_MISSES] = 0x7f89; 1690 1688 ebx.split.no_branch_misses_retired = 0; 1691 1689 x86_pmu.events_maskl = ebx.full; 1692 - printk(KERN_INFO "CPU erratum AAJ80 worked around\n"); 1690 + pr_info("CPU erratum AAJ80 worked around\n"); 1693 1691 } 1694 1692 } 1695 1693
+2 -2
arch/x86/kernel/dumpstack.c
··· 27 27 28 28 void printk_address(unsigned long address, int reliable) 29 29 { 30 - printk(" [<%p>] %s%pB\n", (void *) address, 31 - reliable ? "" : "? ", (void *) address); 30 + pr_cont(" [<%p>] %s%pB\n", 31 + (void *)address, reliable ? "" : "? ", (void *)address); 32 32 } 33 33 34 34 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
+12 -12
arch/x86/kernel/dumpstack_32.c
··· 73 73 if (kstack_end(stack)) 74 74 break; 75 75 if (i && ((i % STACKSLOTS_PER_LINE) == 0)) 76 - printk(KERN_CONT "\n"); 77 - printk(KERN_CONT " %08lx", *stack++); 76 + pr_cont("\n"); 77 + pr_cont(" %08lx", *stack++); 78 78 touch_nmi_watchdog(); 79 79 } 80 - printk(KERN_CONT "\n"); 80 + pr_cont("\n"); 81 81 show_trace_log_lvl(task, regs, sp, bp, log_lvl); 82 82 } 83 83 ··· 89 89 print_modules(); 90 90 __show_regs(regs, !user_mode_vm(regs)); 91 91 92 - printk(KERN_EMERG "Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)\n", 93 - TASK_COMM_LEN, current->comm, task_pid_nr(current), 94 - current_thread_info(), current, task_thread_info(current)); 92 + pr_emerg("Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)\n", 93 + TASK_COMM_LEN, current->comm, task_pid_nr(current), 94 + current_thread_info(), current, task_thread_info(current)); 95 95 /* 96 96 * When in-kernel, we also print out the stack and code at the 97 97 * time of the fault.. ··· 102 102 unsigned char c; 103 103 u8 *ip; 104 104 105 - printk(KERN_EMERG "Stack:\n"); 105 + pr_emerg("Stack:\n"); 106 106 show_stack_log_lvl(NULL, regs, &regs->sp, 0, KERN_EMERG); 107 107 108 - printk(KERN_EMERG "Code: "); 108 + pr_emerg("Code:"); 109 109 110 110 ip = (u8 *)regs->ip - code_prologue; 111 111 if (ip < (u8 *)PAGE_OFFSET || probe_kernel_address(ip, c)) { ··· 116 116 for (i = 0; i < code_len; i++, ip++) { 117 117 if (ip < (u8 *)PAGE_OFFSET || 118 118 probe_kernel_address(ip, c)) { 119 - printk(KERN_CONT " Bad EIP value."); 119 + pr_cont(" Bad EIP value."); 120 120 break; 121 121 } 122 122 if (ip == (u8 *)regs->ip) 123 - printk(KERN_CONT "<%02x> ", c); 123 + pr_cont(" <%02x>", c); 124 124 else 125 - printk(KERN_CONT "%02x ", c); 125 + pr_cont(" %02x", c); 126 126 } 127 127 } 128 - printk(KERN_CONT "\n"); 128 + pr_cont("\n"); 129 129 } 130 130 131 131 int is_valid_bugaddr(unsigned long ip)
+10 -10
arch/x86/kernel/dumpstack_64.c
··· 228 228 if (stack >= irq_stack && stack <= irq_stack_end) { 229 229 if (stack == irq_stack_end) { 230 230 stack = (unsigned long *) (irq_stack_end[-1]); 231 - printk(KERN_CONT " <EOI> "); 231 + pr_cont(" <EOI> "); 232 232 } 233 233 } else { 234 234 if (((long) stack & (THREAD_SIZE-1)) == 0) 235 235 break; 236 236 } 237 237 if (i && ((i % STACKSLOTS_PER_LINE) == 0)) 238 - printk(KERN_CONT "\n"); 239 - printk(KERN_CONT " %016lx", *stack++); 238 + pr_cont("\n"); 239 + pr_cont(" %016lx", *stack++); 240 240 touch_nmi_watchdog(); 241 241 } 242 242 preempt_enable(); 243 243 244 - printk(KERN_CONT "\n"); 244 + pr_cont("\n"); 245 245 show_trace_log_lvl(task, regs, sp, bp, log_lvl); 246 246 } 247 247 ··· 256 256 printk("CPU %d ", cpu); 257 257 print_modules(); 258 258 __show_regs(regs, 1); 259 - printk("Process %s (pid: %d, threadinfo %p, task %p)\n", 260 - cur->comm, cur->pid, task_thread_info(cur), cur); 259 + printk(KERN_DEFAULT "Process %s (pid: %d, threadinfo %p, task %p)\n", 260 + cur->comm, cur->pid, task_thread_info(cur), cur); 261 261 262 262 /* 263 263 * When in-kernel, we also print out the stack and code at the ··· 284 284 for (i = 0; i < code_len; i++, ip++) { 285 285 if (ip < (u8 *)PAGE_OFFSET || 286 286 probe_kernel_address(ip, c)) { 287 - printk(KERN_CONT " Bad RIP value."); 287 + pr_cont(" Bad RIP value."); 288 288 break; 289 289 } 290 290 if (ip == (u8 *)regs->ip) 291 - printk(KERN_CONT "<%02x> ", c); 291 + pr_cont("<%02x> ", c); 292 292 else 293 - printk(KERN_CONT "%02x ", c); 293 + pr_cont("%02x ", c); 294 294 } 295 295 } 296 - printk(KERN_CONT "\n"); 296 + pr_cont("\n"); 297 297 } 298 298 299 299 int is_valid_bugaddr(unsigned long ip)
+2 -2
arch/x86/kernel/irq.c
··· 294 294 raw_spin_unlock(&desc->lock); 295 295 296 296 if (break_affinity && set_affinity) 297 - printk("Broke affinity for irq %i\n", irq); 297 + pr_notice("Broke affinity for irq %i\n", irq); 298 298 else if (!set_affinity) 299 - printk("Cannot set affinity for irq %i\n", irq); 299 + pr_notice("Cannot set affinity for irq %i\n", irq); 300 300 } 301 301 302 302 /*
+20 -12
arch/x86/kernel/module.c
··· 15 15 along with this program; if not, write to the Free Software 16 16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 */ 18 + 19 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 20 + 18 21 #include <linux/moduleloader.h> 19 22 #include <linux/elf.h> 20 23 #include <linux/vmalloc.h> ··· 33 30 #include <asm/pgtable.h> 34 31 35 32 #if 0 36 - #define DEBUGP printk 33 + #define DEBUGP(fmt, ...) \ 34 + printk(KERN_DEBUG fmt, ##__VA_ARGS__) 37 35 #else 38 - #define DEBUGP(fmt...) 36 + #define DEBUGP(fmt, ...) \ 37 + do { \ 38 + if (0) \ 39 + printk(KERN_DEBUG fmt, ##__VA_ARGS__); \ 40 + } while (0) 39 41 #endif 40 42 41 43 void *module_alloc(unsigned long size) ··· 64 56 Elf32_Sym *sym; 65 57 uint32_t *location; 66 58 67 - DEBUGP("Applying relocate section %u to %u\n", relsec, 68 - sechdrs[relsec].sh_info); 59 + DEBUGP("Applying relocate section %u to %u\n", 60 + relsec, sechdrs[relsec].sh_info); 69 61 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { 70 62 /* This is where to make the change */ 71 63 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr ··· 85 77 *location += sym->st_value - (uint32_t)location; 86 78 break; 87 79 default: 88 - printk(KERN_ERR "module %s: Unknown relocation: %u\n", 80 + pr_err("%s: Unknown relocation: %u\n", 89 81 me->name, ELF32_R_TYPE(rel[i].r_info)); 90 82 return -ENOEXEC; 91 83 } ··· 105 97 void *loc; 106 98 u64 val; 107 99 108 - DEBUGP("Applying relocate section %u to %u\n", relsec, 109 - sechdrs[relsec].sh_info); 100 + DEBUGP("Applying relocate section %u to %u\n", 101 + relsec, sechdrs[relsec].sh_info); 110 102 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { 111 103 /* This is where to make the change */ 112 104 loc = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr ··· 118 110 + ELF64_R_SYM(rel[i].r_info); 119 111 120 112 DEBUGP("type %d st_value %Lx r_addend %Lx loc %Lx\n", 121 - (int)ELF64_R_TYPE(rel[i].r_info), 122 - sym->st_value, rel[i].r_addend, (u64)loc); 113 + (int)ELF64_R_TYPE(rel[i].r_info), 114 + sym->st_value, rel[i].r_addend, (u64)loc); 123 115 124 116 val = sym->st_value + rel[i].r_addend; 125 117 ··· 148 140 #endif 149 141 break; 150 142 default: 151 - printk(KERN_ERR "module %s: Unknown rela relocation: %llu\n", 143 + pr_err("%s: Unknown rela relocation: %llu\n", 152 144 me->name, ELF64_R_TYPE(rel[i].r_info)); 153 145 return -ENOEXEC; 154 146 } ··· 156 148 return 0; 157 149 158 150 overflow: 159 - printk(KERN_ERR "overflow in relocation type %d val %Lx\n", 151 + pr_err("overflow in relocation type %d val %Lx\n", 160 152 (int)ELF64_R_TYPE(rel[i].r_info), val); 161 - printk(KERN_ERR "`%s' likely not compiled with -mcmodel=kernel\n", 153 + pr_err("`%s' likely not compiled with -mcmodel=kernel\n", 162 154 me->name); 163 155 return -ENOEXEC; 164 156 }
+16 -18
arch/x86/kernel/pci-calgary_64.c
··· 22 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 23 */ 24 24 25 + #define pr_fmt(fmt) "Calgary: " fmt 26 + 25 27 #include <linux/kernel.h> 26 28 #include <linux/init.h> 27 29 #include <linux/types.h> ··· 247 245 offset = iommu_area_alloc(tbl->it_map, tbl->it_size, 0, 248 246 npages, 0, boundary_size, 0); 249 247 if (offset == ~0UL) { 250 - printk(KERN_WARNING "Calgary: IOMMU full.\n"); 248 + pr_warn("IOMMU full\n"); 251 249 spin_unlock_irqrestore(&tbl->it_lock, flags); 252 250 if (panic_on_overflow) 253 251 panic("Calgary: fix the allocator.\n"); ··· 273 271 entry = iommu_range_alloc(dev, tbl, npages); 274 272 275 273 if (unlikely(entry == DMA_ERROR_CODE)) { 276 - printk(KERN_WARNING "Calgary: failed to allocate %u pages in " 277 - "iommu %p\n", npages, tbl); 274 + pr_warn("failed to allocate %u pages in iommu %p\n", 275 + npages, tbl); 278 276 return DMA_ERROR_CODE; 279 277 } 280 278 ··· 563 561 i++; 564 562 } while ((val & 0xff) != 0xff && i < 100); 565 563 if (i == 100) 566 - printk(KERN_WARNING "Calgary: PCI bus not quiesced, " 567 - "continuing anyway\n"); 564 + pr_warn("PCI bus not quiesced, continuing anyway\n"); 568 565 569 566 /* invalidate TCE cache */ 570 567 target = calgary_reg(bbar, tar_offset(tbl->it_busno)); ··· 605 604 i++; 606 605 } while ((val64 & 0xff) != 0xff && i < 100); 607 606 if (i == 100) 608 - printk(KERN_WARNING "CalIOC2: PCI bus not quiesced, " 609 - "continuing anyway\n"); 607 + pr_warn("CalIOC2: PCI bus not quiesced, continuing anyway\n"); 610 608 611 609 /* 3. poll Page Migration DEBUG for SoftStopFault */ 612 610 target = calgary_reg(bbar, phb_offset(bus) | PHB_PAGE_MIG_DEBUG); ··· 617 617 if (++count < 100) 618 618 goto begin; 619 619 else { 620 - printk(KERN_WARNING "CalIOC2: too many SoftStopFaults, " 621 - "aborting TCE cache flush sequence!\n"); 620 + pr_warn("CalIOC2: too many SoftStopFaults, aborting TCE cache flush sequence!\n"); 622 621 return; /* pray for the best */ 623 622 } 624 623 } ··· 839 840 plssr = be32_to_cpu(readl(target)); 840 841 841 842 /* If no error, the agent ID in the CSR is not valid */ 842 - printk(KERN_EMERG "Calgary: DMA error on Calgary PHB 0x%x, " 843 - "0x%08x@CSR 0x%08x@PLSSR\n", tbl->it_busno, csr, plssr); 843 + pr_emerg("DMA error on Calgary PHB 0x%x, 0x%08x@CSR 0x%08x@PLSSR\n", 844 + tbl->it_busno, csr, plssr); 844 845 } 845 846 846 847 static void calioc2_dump_error_regs(struct iommu_table *tbl) ··· 866 867 target = calgary_reg(bbar, phboff | 0x800); 867 868 mck = be32_to_cpu(readl(target)); 868 869 869 - printk(KERN_EMERG "Calgary: DMA error on CalIOC2 PHB 0x%x\n", 870 - tbl->it_busno); 870 + pr_emerg("DMA error on CalIOC2 PHB 0x%x\n", tbl->it_busno); 871 871 872 - printk(KERN_EMERG "Calgary: 0x%08x@CSR 0x%08x@PLSSR 0x%08x@CSMR 0x%08x@MCK\n", 873 - csr, plssr, csmr, mck); 872 + pr_emerg("0x%08x@CSR 0x%08x@PLSSR 0x%08x@CSMR 0x%08x@MCK\n", 873 + csr, plssr, csmr, mck); 874 874 875 875 /* dump rest of error regs */ 876 - printk(KERN_EMERG "Calgary: "); 876 + pr_emerg(""); 877 877 for (i = 0; i < ARRAY_SIZE(errregs); i++) { 878 878 /* err regs are at 0x810 - 0x870 */ 879 879 erroff = (0x810 + (i * 0x10)); 880 880 target = calgary_reg(bbar, phboff | erroff); 881 881 errregs[i] = be32_to_cpu(readl(target)); 882 - printk("0x%08x@0x%lx ", errregs[i], erroff); 882 + pr_cont("0x%08x@0x%lx ", errregs[i], erroff); 883 883 } 884 - printk("\n"); 884 + pr_cont("\n"); 885 885 886 886 /* root complex status */ 887 887 target = calgary_reg(bbar, phboff | PHB_ROOT_COMPLEX_STATUS);
+16 -18
arch/x86/kernel/process.c
··· 1 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 2 + 1 3 #include <linux/errno.h> 2 4 #include <linux/kernel.h> 3 5 #include <linux/mm.h> ··· 147 145 /* Board Name is optional */ 148 146 board = dmi_get_system_info(DMI_BOARD_NAME); 149 147 150 - printk(KERN_CONT "\n"); 151 - printk(KERN_DEFAULT "Pid: %d, comm: %.20s %s %s %.*s", 152 - current->pid, current->comm, print_tainted(), 153 - init_utsname()->release, 154 - (int)strcspn(init_utsname()->version, " "), 155 - init_utsname()->version); 156 - printk(KERN_CONT " %s %s", vendor, product); 157 - if (board) 158 - printk(KERN_CONT "/%s", board); 159 - printk(KERN_CONT "\n"); 148 + printk(KERN_DEFAULT "Pid: %d, comm: %.20s %s %s %.*s %s %s%s%s\n", 149 + current->pid, current->comm, print_tainted(), 150 + init_utsname()->release, 151 + (int)strcspn(init_utsname()->version, " "), 152 + init_utsname()->version, 153 + vendor, product, 154 + board ? "/" : "", 155 + board ? board : ""); 160 156 } 161 157 162 158 void flush_thread(void) ··· 645 645 amd_e400_c1e_detected = true; 646 646 if (!boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) 647 647 mark_tsc_unstable("TSC halt in AMD C1E"); 648 - printk(KERN_INFO "System has AMD C1E enabled\n"); 648 + pr_info("System has AMD C1E enabled\n"); 649 649 } 650 650 } 651 651 ··· 659 659 */ 660 660 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_FORCE, 661 661 &cpu); 662 - printk(KERN_INFO "Switch to broadcast mode on CPU%d\n", 663 - cpu); 662 + pr_info("Switch to broadcast mode on CPU%d\n", cpu); 664 663 } 665 664 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu); 666 665 ··· 680 681 { 681 682 #ifdef CONFIG_SMP 682 683 if (pm_idle == poll_idle && smp_num_siblings > 1) { 683 - printk_once(KERN_WARNING "WARNING: polling idle and HT enabled," 684 - " performance may degrade.\n"); 684 + pr_warn_once("WARNING: polling idle and HT enabled, performance may degrade\n"); 685 685 } 686 686 #endif 687 687 if (pm_idle) ··· 690 692 /* 691 693 * One CPU supports mwait => All CPUs supports mwait 692 694 */ 693 - printk(KERN_INFO "using mwait in idle threads.\n"); 695 + pr_info("using mwait in idle threads\n"); 694 696 pm_idle = mwait_idle; 695 697 } else if (cpu_has_amd_erratum(amd_erratum_400)) { 696 698 /* E400: APIC timer interrupt does not wake up CPU from C1e */ 697 - printk(KERN_INFO "using AMD E400 aware idle routine\n"); 699 + pr_info("using AMD E400 aware idle routine\n"); 698 700 pm_idle = amd_e400_idle; 699 701 } else 700 702 pm_idle = default_idle; ··· 713 715 return -EINVAL; 714 716 715 717 if (!strcmp(str, "poll")) { 716 - printk("using polling idle threads.\n"); 718 + pr_info("using polling idle threads\n"); 717 719 pm_idle = poll_idle; 718 720 boot_option_idle_override = IDLE_POLL; 719 721 } else if (!strcmp(str, "mwait")) {
+4 -4
arch/x86/kernel/process_64.c
··· 117 117 { 118 118 if (dead_task->mm) { 119 119 if (dead_task->mm->context.size) { 120 - printk("WARNING: dead process %8s still has LDT? <%p/%d>\n", 121 - dead_task->comm, 122 - dead_task->mm->context.ldt, 123 - dead_task->mm->context.size); 120 + pr_warn("WARNING: dead process %8s still has LDT? <%p/%d>\n", 121 + dead_task->comm, 122 + dead_task->mm->context.ldt, 123 + dead_task->mm->context.size); 124 124 BUG(); 125 125 } 126 126 }
+9 -5
arch/x86/kernel/reboot.c
··· 1 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 2 + 1 3 #include <linux/module.h> 2 4 #include <linux/reboot.h> 3 5 #include <linux/init.h> ··· 154 152 { 155 153 if (reboot_type != BOOT_BIOS) { 156 154 reboot_type = BOOT_BIOS; 157 - printk(KERN_INFO "%s series board detected. Selecting BIOS-method for reboots.\n", d->ident); 155 + pr_info("%s series board detected. Selecting %s-method for reboots.\n", 156 + "BIOS", d->ident); 158 157 } 159 158 return 0; 160 159 } ··· 210 207 { 211 208 if (reboot_type != BOOT_CF9) { 212 209 reboot_type = BOOT_CF9; 213 - printk(KERN_INFO "%s series board detected. " 214 - "Selecting PCI-method for reboots.\n", d->ident); 210 + pr_info("%s series board detected. Selecting %s-method for reboots.\n", 211 + "PCI", d->ident); 215 212 } 216 213 return 0; 217 214 } ··· 220 217 { 221 218 if (reboot_type != BOOT_KBD) { 222 219 reboot_type = BOOT_KBD; 223 - printk(KERN_INFO "%s series board detected. Selecting KBD-method for reboot.\n", d->ident); 220 + pr_info("%s series board detected. Selecting %s-method for reboot.\n", 221 + "KBD", d->ident); 224 222 } 225 223 return 0; 226 224 } ··· 672 668 673 669 static void native_machine_restart(char *__unused) 674 670 { 675 - printk("machine restart\n"); 671 + pr_notice("machine restart\n"); 676 672 677 673 if (!reboot_force) 678 674 machine_shutdown();
+4 -1
arch/x86/kernel/signal.c
··· 6 6 * 2000-06-20 Pentium III FXSR, SSE support by Gareth Hughes 7 7 * 2000-2002 x86-64 support by Andi Kleen 8 8 */ 9 + 10 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 11 + 9 12 #include <linux/sched.h> 10 13 #include <linux/mm.h> 11 14 #include <linux/smp.h> ··· 817 814 me->comm, me->pid, where, frame, 818 815 regs->ip, regs->sp, regs->orig_ax); 819 816 print_vma_addr(" in ", regs->ip); 820 - printk(KERN_CONT "\n"); 817 + pr_cont("\n"); 821 818 } 822 819 823 820 force_sig(SIGSEGV, me);
+45 -52
arch/x86/kernel/smpboot.c
··· 1 - /* 1 + /* 2 2 * x86 SMP booting functions 3 3 * 4 4 * (c) 1995 Alan Cox, Building #3 <alan@lxorguk.ukuu.org.uk> ··· 38 38 * Ashok Raj : CPU hotplug support 39 39 * Glauber Costa : i386 and x86_64 integration 40 40 */ 41 + 42 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 41 43 42 44 #include <linux/init.h> 43 45 #include <linux/smp.h> ··· 186 184 * boards) 187 185 */ 188 186 189 - pr_debug("CALLIN, before setup_local_APIC().\n"); 187 + pr_debug("CALLIN, before setup_local_APIC()\n"); 190 188 if (apic->smp_callin_clear_local_apic) 191 189 apic->smp_callin_clear_local_apic(); 192 190 setup_local_APIC(); ··· 422 420 /* 423 421 * Allow the user to impress friends. 424 422 */ 425 - pr_debug("Before bogomips.\n"); 423 + pr_debug("Before bogomips\n"); 426 424 for_each_possible_cpu(cpu) 427 425 if (cpumask_test_cpu(cpu, cpu_callout_mask)) 428 426 bogosum += cpu_data(cpu).loops_per_jiffy; 429 - printk(KERN_INFO 430 - "Total of %d processors activated (%lu.%02lu BogoMIPS).\n", 427 + pr_info("Total of %d processors activated (%lu.%02lu BogoMIPS)\n", 431 428 num_online_cpus(), 432 429 bogosum/(500000/HZ), 433 430 (bogosum/(5000/HZ))%100); 434 431 435 - pr_debug("Before bogocount - setting activated=1.\n"); 432 + pr_debug("Before bogocount - setting activated=1\n"); 436 433 } 437 434 438 435 void __inquire_remote_apic(int apicid) ··· 441 440 int timeout; 442 441 u32 status; 443 442 444 - printk(KERN_INFO "Inquiring remote APIC 0x%x...\n", apicid); 443 + pr_info("Inquiring remote APIC 0x%x...\n", apicid); 445 444 446 445 for (i = 0; i < ARRAY_SIZE(regs); i++) { 447 - printk(KERN_INFO "... APIC 0x%x %s: ", apicid, names[i]); 446 + pr_info("... APIC 0x%x %s: ", apicid, names[i]); 448 447 449 448 /* 450 449 * Wait for idle. 451 450 */ 452 451 status = safe_apic_wait_icr_idle(); 453 452 if (status) 454 - printk(KERN_CONT 455 - "a previous APIC delivery may have failed\n"); 453 + pr_cont("a previous APIC delivery may have failed\n"); 456 454 457 455 apic_icr_write(APIC_DM_REMRD | regs[i], apicid); 458 456 ··· 464 464 switch (status) { 465 465 case APIC_ICR_RR_VALID: 466 466 status = apic_read(APIC_RRR); 467 - printk(KERN_CONT "%08x\n", status); 467 + pr_cont("%08x\n", status); 468 468 break; 469 469 default: 470 - printk(KERN_CONT "failed\n"); 470 + pr_cont("failed\n"); 471 471 } 472 472 } 473 473 } ··· 501 501 apic_write(APIC_ESR, 0); 502 502 accept_status = (apic_read(APIC_ESR) & 0xEF); 503 503 } 504 - pr_debug("NMI sent.\n"); 504 + pr_debug("NMI sent\n"); 505 505 506 506 if (send_status) 507 - printk(KERN_ERR "APIC never delivered???\n"); 507 + pr_err("APIC never delivered???\n"); 508 508 if (accept_status) 509 - printk(KERN_ERR "APIC delivery error (%lx).\n", accept_status); 509 + pr_err("APIC delivery error (%lx)\n", accept_status); 510 510 511 511 return (send_status | accept_status); 512 512 } ··· 528 528 apic_read(APIC_ESR); 529 529 } 530 530 531 - pr_debug("Asserting INIT.\n"); 531 + pr_debug("Asserting INIT\n"); 532 532 533 533 /* 534 534 * Turn INIT on target chip ··· 544 544 545 545 mdelay(10); 546 546 547 - pr_debug("Deasserting INIT.\n"); 547 + pr_debug("Deasserting INIT\n"); 548 548 549 549 /* Target chip */ 550 550 /* Send IPI */ ··· 577 577 /* 578 578 * Run STARTUP IPI loop. 579 579 */ 580 - pr_debug("#startup loops: %d.\n", num_starts); 580 + pr_debug("#startup loops: %d\n", num_starts); 581 581 582 582 for (j = 1; j <= num_starts; j++) { 583 - pr_debug("Sending STARTUP #%d.\n", j); 583 + pr_debug("Sending STARTUP #%d\n", j); 584 584 if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */ 585 585 apic_write(APIC_ESR, 0); 586 586 apic_read(APIC_ESR); 587 - pr_debug("After apic_write.\n"); 587 + pr_debug("After apic_write\n"); 588 588 589 589 /* 590 590 * STARTUP IPI ··· 601 601 */ 602 602 udelay(300); 603 603 604 - pr_debug("Startup point 1.\n"); 604 + pr_debug("Startup point 1\n"); 605 605 606 606 pr_debug("Waiting for send to finish...\n"); 607 607 send_status = safe_apic_wait_icr_idle(); ··· 616 616 if (send_status || accept_status) 617 617 break; 618 618 } 619 - pr_debug("After Startup.\n"); 619 + pr_debug("After Startup\n"); 620 620 621 621 if (send_status) 622 - printk(KERN_ERR "APIC never delivered???\n"); 622 + pr_err("APIC never delivered???\n"); 623 623 if (accept_status) 624 - printk(KERN_ERR "APIC delivery error (%lx).\n", accept_status); 624 + pr_err("APIC delivery error (%lx)\n", accept_status); 625 625 626 626 return (send_status | accept_status); 627 627 } ··· 635 635 if (system_state == SYSTEM_BOOTING) { 636 636 if (node != current_node) { 637 637 if (current_node > (-1)) 638 - pr_cont(" Ok.\n"); 638 + pr_cont(" OK\n"); 639 639 current_node = node; 640 640 pr_info("Booting Node %3d, Processors ", node); 641 641 } 642 - pr_cont(" #%d%s", cpu, cpu == (nr_cpu_ids - 1) ? " Ok.\n" : ""); 642 + pr_cont(" #%d%s", cpu, cpu == (nr_cpu_ids - 1) ? " OK\n" : ""); 643 643 return; 644 644 } else 645 645 pr_info("Booting Node %d Processor %d APIC 0x%x\n", ··· 719 719 /* 720 720 * allow APs to start initializing. 721 721 */ 722 - pr_debug("Before Callout %d.\n", cpu); 722 + pr_debug("Before Callout %d\n", cpu); 723 723 cpumask_set_cpu(cpu, cpu_callout_mask); 724 - pr_debug("After Callout %d.\n", cpu); 724 + pr_debug("After Callout %d\n", cpu); 725 725 726 726 /* 727 727 * Wait 5s total for a response ··· 749 749 pr_err("CPU%d: Stuck ??\n", cpu); 750 750 else 751 751 /* trampoline code not run */ 752 - pr_err("CPU%d: Not responding.\n", cpu); 752 + pr_err("CPU%d: Not responding\n", cpu); 753 753 if (apic->inquire_remote_apic) 754 754 apic->inquire_remote_apic(apicid); 755 755 } ··· 794 794 if (apicid == BAD_APICID || apicid == boot_cpu_physical_apicid || 795 795 !physid_isset(apicid, phys_cpu_present_map) || 796 796 !apic->apic_id_valid(apicid)) { 797 - printk(KERN_ERR "%s: bad cpu %d\n", __func__, cpu); 797 + pr_err("%s: bad cpu %d\n", __func__, cpu); 798 798 return -EINVAL; 799 799 } 800 800 ··· 875 875 unsigned int cpu; 876 876 unsigned nr; 877 877 878 - printk(KERN_WARNING 879 - "More than 8 CPUs detected - skipping them.\n" 880 - "Use CONFIG_X86_BIGSMP.\n"); 878 + pr_warn("More than 8 CPUs detected - skipping them\n" 879 + "Use CONFIG_X86_BIGSMP\n"); 881 880 882 881 nr = 0; 883 882 for_each_present_cpu(cpu) { ··· 897 898 #endif 898 899 899 900 if (!physid_isset(hard_smp_processor_id(), phys_cpu_present_map)) { 900 - printk(KERN_WARNING 901 - "weird, boot CPU (#%d) not listed by the BIOS.\n", 901 + pr_warn("weird, boot CPU (#%d) not listed by the BIOS\n", 902 902 hard_smp_processor_id()); 903 903 904 904 physid_set(hard_smp_processor_id(), phys_cpu_present_map); ··· 909 911 */ 910 912 if (!smp_found_config && !acpi_lapic) { 911 913 preempt_enable(); 912 - printk(KERN_NOTICE "SMP motherboard not detected.\n"); 914 + pr_notice("SMP motherboard not detected\n"); 913 915 disable_smp(); 914 916 if (APIC_init_uniprocessor()) 915 - printk(KERN_NOTICE "Local APIC not detected." 916 - " Using dummy APIC emulation.\n"); 917 + pr_notice("Local APIC not detected. Using dummy APIC emulation.\n"); 917 918 return -1; 918 919 } 919 920 ··· 921 924 * CPU too, but we do it for the sake of robustness anyway. 922 925 */ 923 926 if (!apic->check_phys_apicid_present(boot_cpu_physical_apicid)) { 924 - printk(KERN_NOTICE 925 - "weird, boot CPU (#%d) not listed by the BIOS.\n", 926 - boot_cpu_physical_apicid); 927 + pr_notice("weird, boot CPU (#%d) not listed by the BIOS\n", 928 + boot_cpu_physical_apicid); 927 929 physid_set(hard_smp_processor_id(), phys_cpu_present_map); 928 930 } 929 931 preempt_enable(); ··· 935 939 if (!disable_apic) { 936 940 pr_err("BIOS bug, local APIC #%d not detected!...\n", 937 941 boot_cpu_physical_apicid); 938 - pr_err("... forcing use of dummy APIC emulation." 939 - "(tell your hw vendor)\n"); 942 + pr_err("... forcing use of dummy APIC emulation (tell your hw vendor)\n"); 940 943 } 941 944 smpboot_clear_io_apic(); 942 945 disable_ioapic_support(); ··· 948 953 * If SMP should be disabled, then really disable it! 949 954 */ 950 955 if (!max_cpus) { 951 - printk(KERN_INFO "SMP mode deactivated.\n"); 956 + pr_info("SMP mode deactivated\n"); 952 957 smpboot_clear_io_apic(); 953 958 954 959 connect_bsp_APIC(); ··· 1000 1005 1001 1006 1002 1007 if (smp_sanity_check(max_cpus) < 0) { 1003 - printk(KERN_INFO "SMP disabled\n"); 1008 + pr_info("SMP disabled\n"); 1004 1009 disable_smp(); 1005 1010 goto out; 1006 1011 } ··· 1038 1043 * Set up local APIC timer on boot CPU. 1039 1044 */ 1040 1045 1041 - printk(KERN_INFO "CPU%d: ", 0); 1046 + pr_info("CPU%d: ", 0); 1042 1047 print_cpu_info(&cpu_data(0)); 1043 1048 x86_init.timers.setup_percpu_clockev(); 1044 1049 ··· 1088 1093 1089 1094 void __init native_smp_cpus_done(unsigned int max_cpus) 1090 1095 { 1091 - pr_debug("Boot done.\n"); 1096 + pr_debug("Boot done\n"); 1092 1097 1093 1098 nmi_selftest(); 1094 1099 impress_friends(); ··· 1149 1154 1150 1155 /* nr_cpu_ids could be reduced via nr_cpus= */ 1151 1156 if (possible > nr_cpu_ids) { 1152 - printk(KERN_WARNING 1153 - "%d Processors exceeds NR_CPUS limit of %d\n", 1157 + pr_warn("%d Processors exceeds NR_CPUS limit of %d\n", 1154 1158 possible, nr_cpu_ids); 1155 1159 possible = nr_cpu_ids; 1156 1160 } ··· 1158 1164 if (!setup_max_cpus) 1159 1165 #endif 1160 1166 if (possible > i) { 1161 - printk(KERN_WARNING 1162 - "%d Processors exceeds max_cpus limit of %u\n", 1167 + pr_warn("%d Processors exceeds max_cpus limit of %u\n", 1163 1168 possible, setup_max_cpus); 1164 1169 possible = i; 1165 1170 } 1166 1171 1167 - printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n", 1172 + pr_info("Allowing %d CPUs, %d hotplug CPUs\n", 1168 1173 possible, max_t(int, possible - num_processors, 0)); 1169 1174 1170 1175 for (i = 0; i < possible; i++)
+10 -9
arch/x86/kernel/traps.c
··· 9 9 /* 10 10 * Handle hardware traps and faults. 11 11 */ 12 + 13 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 14 + 12 15 #include <linux/interrupt.h> 13 16 #include <linux/kallsyms.h> 14 17 #include <linux/spinlock.h> ··· 146 143 #ifdef CONFIG_X86_64 147 144 if (show_unhandled_signals && unhandled_signal(tsk, signr) && 148 145 printk_ratelimit()) { 149 - printk(KERN_INFO 150 - "%s[%d] trap %s ip:%lx sp:%lx error:%lx", 151 - tsk->comm, tsk->pid, str, 152 - regs->ip, regs->sp, error_code); 146 + pr_info("%s[%d] trap %s ip:%lx sp:%lx error:%lx", 147 + tsk->comm, tsk->pid, str, 148 + regs->ip, regs->sp, error_code); 153 149 print_vma_addr(" in ", regs->ip); 154 - printk("\n"); 150 + pr_cont("\n"); 155 151 } 156 152 #endif 157 153 ··· 271 269 272 270 if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) && 273 271 printk_ratelimit()) { 274 - printk(KERN_INFO 275 - "%s[%d] general protection ip:%lx sp:%lx error:%lx", 272 + pr_info("%s[%d] general protection ip:%lx sp:%lx error:%lx", 276 273 tsk->comm, task_pid_nr(tsk), 277 274 regs->ip, regs->sp, error_code); 278 275 print_vma_addr(" in ", regs->ip); 279 - printk("\n"); 276 + pr_cont("\n"); 280 277 } 281 278 282 279 force_sig(SIGSEGV, tsk); ··· 571 570 conditional_sti(regs); 572 571 #if 0 573 572 /* No need to warn about this any longer. */ 574 - printk(KERN_INFO "Ignoring P6 Local APIC Spurious Interrupt Bug...\n"); 573 + pr_info("Ignoring P6 Local APIC Spurious Interrupt Bug...\n"); 575 574 #endif 576 575 } 577 576
+24 -26
arch/x86/kernel/tsc.c
··· 1 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 2 + 1 3 #include <linux/kernel.h> 2 4 #include <linux/sched.h> 3 5 #include <linux/init.h> ··· 86 84 #ifdef CONFIG_X86_TSC 87 85 int __init notsc_setup(char *str) 88 86 { 89 - printk(KERN_WARNING "notsc: Kernel compiled with CONFIG_X86_TSC, " 90 - "cannot disable TSC completely.\n"); 87 + pr_warn("Kernel compiled with CONFIG_X86_TSC, cannot disable TSC completely\n"); 91 88 tsc_disabled = 1; 92 89 return 1; 93 90 } ··· 374 373 goto success; 375 374 } 376 375 } 377 - printk("Fast TSC calibration failed\n"); 376 + pr_err("Fast TSC calibration failed\n"); 378 377 return 0; 379 378 380 379 success: ··· 393 392 */ 394 393 delta *= PIT_TICK_RATE; 395 394 do_div(delta, i*256*1000); 396 - printk("Fast TSC calibration using PIT\n"); 395 + pr_info("Fast TSC calibration using PIT\n"); 397 396 return delta; 398 397 } 399 398 ··· 488 487 * use the reference value, as it is more precise. 489 488 */ 490 489 if (delta >= 90 && delta <= 110) { 491 - printk(KERN_INFO 492 - "TSC: PIT calibration matches %s. %d loops\n", 493 - hpet ? "HPET" : "PMTIMER", i + 1); 490 + pr_info("PIT calibration matches %s. %d loops\n", 491 + hpet ? "HPET" : "PMTIMER", i + 1); 494 492 return tsc_ref_min; 495 493 } 496 494 ··· 511 511 */ 512 512 if (tsc_pit_min == ULONG_MAX) { 513 513 /* PIT gave no useful value */ 514 - printk(KERN_WARNING "TSC: Unable to calibrate against PIT\n"); 514 + pr_warn("Unable to calibrate against PIT\n"); 515 515 516 516 /* We don't have an alternative source, disable TSC */ 517 517 if (!hpet && !ref1 && !ref2) { 518 - printk("TSC: No reference (HPET/PMTIMER) available\n"); 518 + pr_notice("No reference (HPET/PMTIMER) available\n"); 519 519 return 0; 520 520 } 521 521 522 522 /* The alternative source failed as well, disable TSC */ 523 523 if (tsc_ref_min == ULONG_MAX) { 524 - printk(KERN_WARNING "TSC: HPET/PMTIMER calibration " 525 - "failed.\n"); 524 + pr_warn("HPET/PMTIMER calibration failed\n"); 526 525 return 0; 527 526 } 528 527 529 528 /* Use the alternative source */ 530 - printk(KERN_INFO "TSC: using %s reference calibration\n", 531 - hpet ? "HPET" : "PMTIMER"); 529 + pr_info("using %s reference calibration\n", 530 + hpet ? "HPET" : "PMTIMER"); 532 531 533 532 return tsc_ref_min; 534 533 } 535 534 536 535 /* We don't have an alternative source, use the PIT calibration value */ 537 536 if (!hpet && !ref1 && !ref2) { 538 - printk(KERN_INFO "TSC: Using PIT calibration value\n"); 537 + pr_info("Using PIT calibration value\n"); 539 538 return tsc_pit_min; 540 539 } 541 540 542 541 /* The alternative source failed, use the PIT calibration value */ 543 542 if (tsc_ref_min == ULONG_MAX) { 544 - printk(KERN_WARNING "TSC: HPET/PMTIMER calibration failed. " 545 - "Using PIT calibration\n"); 543 + pr_warn("HPET/PMTIMER calibration failed. Using PIT calibration.\n"); 546 544 return tsc_pit_min; 547 545 } 548 546 ··· 549 551 * the PIT value as we know that there are PMTIMERs around 550 552 * running at double speed. At least we let the user know: 551 553 */ 552 - printk(KERN_WARNING "TSC: PIT calibration deviates from %s: %lu %lu.\n", 553 - hpet ? "HPET" : "PMTIMER", tsc_pit_min, tsc_ref_min); 554 - printk(KERN_INFO "TSC: Using PIT calibration value\n"); 554 + pr_warn("PIT calibration deviates from %s: %lu %lu\n", 555 + hpet ? "HPET" : "PMTIMER", tsc_pit_min, tsc_ref_min); 556 + pr_info("Using PIT calibration value\n"); 555 557 return tsc_pit_min; 556 558 } 557 559 ··· 783 785 tsc_unstable = 1; 784 786 sched_clock_stable = 0; 785 787 disable_sched_clock_irqtime(); 786 - printk(KERN_INFO "Marking TSC unstable due to %s\n", reason); 788 + pr_info("Marking TSC unstable due to %s\n", reason); 787 789 /* Change only the rating, when not registered */ 788 790 if (clocksource_tsc.mult) 789 791 clocksource_mark_unstable(&clocksource_tsc); ··· 910 912 goto out; 911 913 912 914 tsc_khz = freq; 913 - printk(KERN_INFO "Refined TSC clocksource calibration: " 914 - "%lu.%03lu MHz.\n", (unsigned long)tsc_khz / 1000, 915 - (unsigned long)tsc_khz % 1000); 915 + pr_info("Refined TSC clocksource calibration: %lu.%03lu MHz\n", 916 + (unsigned long)tsc_khz / 1000, 917 + (unsigned long)tsc_khz % 1000); 916 918 917 919 out: 918 920 clocksource_register_khz(&clocksource_tsc, tsc_khz); ··· 968 970 return; 969 971 } 970 972 971 - printk("Detected %lu.%03lu MHz processor.\n", 972 - (unsigned long)cpu_khz / 1000, 973 - (unsigned long)cpu_khz % 1000); 973 + pr_info("Detected %lu.%03lu MHz processor\n", 974 + (unsigned long)cpu_khz / 1000, 975 + (unsigned long)cpu_khz % 1000); 974 976 975 977 /* 976 978 * Secondary CPUs do not run through tsc_init(), so set up
+4 -2
arch/x86/kernel/vm86_32.c
··· 28 28 * 29 29 */ 30 30 31 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 32 + 31 33 #include <linux/capability.h> 32 34 #include <linux/errno.h> 33 35 #include <linux/interrupt.h> ··· 139 137 local_irq_enable(); 140 138 141 139 if (!current->thread.vm86_info) { 142 - printk("no vm86_info: BAD\n"); 140 + pr_alert("no vm86_info: BAD\n"); 143 141 do_exit(SIGSEGV); 144 142 } 145 143 set_flags(regs->pt.flags, VEFLAGS, X86_EFLAGS_VIF | current->thread.v86mask); 146 144 tmp = copy_vm86_regs_to_user(&current->thread.vm86_info->regs, regs); 147 145 tmp += put_user(current->thread.screen_bitmap, &current->thread.vm86_info->screen_bitmap); 148 146 if (tmp) { 149 - printk("vm86: could not access userspace vm86_info\n"); 147 + pr_alert("could not access userspace vm86_info\n"); 150 148 do_exit(SIGSEGV); 151 149 } 152 150
+7 -10
arch/x86/kernel/vsyscall_64.c
··· 18 18 * use the vDSO. 19 19 */ 20 20 21 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 22 + 21 23 #include <linux/time.h> 22 24 #include <linux/init.h> 23 25 #include <linux/kernel.h> ··· 113 111 static void warn_bad_vsyscall(const char *level, struct pt_regs *regs, 114 112 const char *message) 115 113 { 116 - static DEFINE_RATELIMIT_STATE(rs, DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST); 117 - struct task_struct *tsk; 118 - 119 - if (!show_unhandled_signals || !__ratelimit(&rs)) 114 + if (!show_unhandled_signals) 120 115 return; 121 116 122 - tsk = current; 123 - 124 - printk("%s%s[%d] %s ip:%lx cs:%lx sp:%lx ax:%lx si:%lx di:%lx\n", 125 - level, tsk->comm, task_pid_nr(tsk), 126 - message, regs->ip, regs->cs, 127 - regs->sp, regs->ax, regs->si, regs->di); 117 + pr_notice_ratelimited("%s%s[%d] %s ip:%lx cs:%lx sp:%lx ax:%lx si:%lx di:%lx\n", 118 + level, current->comm, task_pid_nr(current), 119 + message, regs->ip, regs->cs, 120 + regs->sp, regs->ax, regs->si, regs->di); 128 121 } 129 122 130 123 static int addr_to_vsyscall_nr(unsigned long addr)
+7 -5
arch/x86/kernel/xsave.c
··· 3 3 * 4 4 * Author: Suresh Siddha <suresh.b.siddha@intel.com> 5 5 */ 6 + 7 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 8 + 6 9 #include <linux/bootmem.h> 7 10 #include <linux/compat.h> 8 11 #include <asm/i387.h> ··· 165 162 BUG_ON(sig_xstate_size < xstate_size); 166 163 167 164 if ((unsigned long)buf % 64) 168 - printk("save_i387_xstate: bad fpstate %p\n", buf); 165 + pr_err("%s: bad fpstate %p\n", __func__, buf); 169 166 170 167 if (!used_math()) 171 168 return 0; ··· 425 422 pcntxt_mask = eax + ((u64)edx << 32); 426 423 427 424 if ((pcntxt_mask & XSTATE_FPSSE) != XSTATE_FPSSE) { 428 - printk(KERN_ERR "FP/SSE not shown under xsave features 0x%llx\n", 425 + pr_err("FP/SSE not shown under xsave features 0x%llx\n", 429 426 pcntxt_mask); 430 427 BUG(); 431 428 } ··· 448 445 449 446 setup_xstate_init(); 450 447 451 - printk(KERN_INFO "xsave/xrstor: enabled xstate_bv 0x%llx, " 452 - "cntxt size 0x%x\n", 453 - pcntxt_mask, xstate_size); 448 + pr_info("enabled xstate_bv 0x%llx, cntxt size 0x%x\n", 449 + pcntxt_mask, xstate_size); 454 450 } 455 451 456 452 /*