Commit 365811d6f9bd98543bedc02b72d94f0f0faf3670

Authored by Bjorn Helgaas
Committed by Linus Torvalds
1 parent 91eb0f67c3

x86: print physical addresses consistently with other parts of kernel

Print physical address info in a style consistent with the %pR style used
elsewhere in the kernel.  For example:

    -found SMP MP-table at [ffff8800000fce90] fce90
    +found SMP MP-table at [mem 0x000fce90-0x000fce9f] mapped at [ffff8800000fce90]
    -initial memory mapped : 0 - 20000000
    +initial memory mapped: [mem 0x00000000-0x1fffffff]
    -Base memory trampoline at [ffff88000009c000] 9c000 size 8192
    +Base memory trampoline [mem 0x0009c000-0x0009dfff] mapped at [ffff88000009c000]
    -SRAT: Node 0 PXM 0 0-80000000
    +SRAT: Node 0 PXM 0 [mem 0x00000000-0x7fffffff]

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 7 changed files with 63 additions and 62 deletions Side-by-side Diff

arch/x86/kernel/mpparse.c
... ... @@ -568,8 +568,8 @@
568 568 struct mpf_intel *mpf;
569 569 unsigned long mem;
570 570  
571   - apic_printk(APIC_VERBOSE, "Scan SMP from %p for %ld bytes.\n",
572   - bp, length);
  571 + apic_printk(APIC_VERBOSE, "Scan for SMP in [mem %#010lx-%#010lx]\n",
  572 + base, base + length - 1);
573 573 BUILD_BUG_ON(sizeof(*mpf) != 16);
574 574  
575 575 while (length > 0) {
... ... @@ -584,8 +584,10 @@
584 584 #endif
585 585 mpf_found = mpf;
586 586  
587   - printk(KERN_INFO "found SMP MP-table at [%p] %llx\n",
588   - mpf, (u64)virt_to_phys(mpf));
  587 + printk(KERN_INFO "found SMP MP-table at [mem %#010llx-%#010llx] mapped at [%p]\n",
  588 + (unsigned long long) virt_to_phys(mpf),
  589 + (unsigned long long) virt_to_phys(mpf) +
  590 + sizeof(*mpf) - 1, mpf);
589 591  
590 592 mem = virt_to_phys(mpf);
591 593 memblock_reserve(mem, sizeof(*mpf));
arch/x86/kernel/setup.c
... ... @@ -334,8 +334,8 @@
334 334 memblock_reserve(ramdisk_here, area_size);
335 335 initrd_start = ramdisk_here + PAGE_OFFSET;
336 336 initrd_end = initrd_start + ramdisk_size;
337   - printk(KERN_INFO "Allocated new RAMDISK: %08llx - %08llx\n",
338   - ramdisk_here, ramdisk_here + ramdisk_size);
  337 + printk(KERN_INFO "Allocated new RAMDISK: [mem %#010llx-%#010llx]\n",
  338 + ramdisk_here, ramdisk_here + ramdisk_size - 1);
339 339  
340 340 q = (char *)initrd_start;
341 341  
... ... @@ -366,8 +366,8 @@
366 366 /* high pages is not converted by early_res_to_bootmem */
367 367 ramdisk_image = boot_params.hdr.ramdisk_image;
368 368 ramdisk_size = boot_params.hdr.ramdisk_size;
369   - printk(KERN_INFO "Move RAMDISK from %016llx - %016llx to"
370   - " %08llx - %08llx\n",
  369 + printk(KERN_INFO "Move RAMDISK from [mem %#010llx-%#010llx] to"
  370 + " [mem %#010llx-%#010llx]\n",
371 371 ramdisk_image, ramdisk_image + ramdisk_size - 1,
372 372 ramdisk_here, ramdisk_here + ramdisk_size - 1);
373 373 }
... ... @@ -392,8 +392,8 @@
392 392 ramdisk_size, end_of_lowmem>>1);
393 393 }
394 394  
395   - printk(KERN_INFO "RAMDISK: %08llx - %08llx\n", ramdisk_image,
396   - ramdisk_end);
  395 + printk(KERN_INFO "RAMDISK: [mem %#010llx-%#010llx]\n", ramdisk_image,
  396 + ramdisk_end - 1);
397 397  
398 398  
399 399 if (ramdisk_end <= end_of_lowmem) {
... ... @@ -906,8 +906,8 @@
906 906 setup_bios_corruption_check();
907 907 #endif
908 908  
909   - printk(KERN_DEBUG "initial memory mapped : 0 - %08lx\n",
910   - max_pfn_mapped<<PAGE_SHIFT);
  909 + printk(KERN_DEBUG "initial memory mapped: [mem 0x00000000-%#010lx]\n",
  910 + (max_pfn_mapped<<PAGE_SHIFT) - 1);
911 911  
912 912 setup_trampolines();
913 913  
... ... @@ -84,8 +84,9 @@
84 84 pgt_buf_end = pgt_buf_start;
85 85 pgt_buf_top = pgt_buf_start + (tables >> PAGE_SHIFT);
86 86  
87   - printk(KERN_DEBUG "kernel direct mapping tables up to %lx @ %lx-%lx\n",
88   - end, pgt_buf_start << PAGE_SHIFT, pgt_buf_top << PAGE_SHIFT);
  87 + printk(KERN_DEBUG "kernel direct mapping tables up to %#lx @ [mem %#010lx-%#010lx]\n",
  88 + end - 1, pgt_buf_start << PAGE_SHIFT,
  89 + (pgt_buf_top << PAGE_SHIFT) - 1);
89 90 }
90 91  
91 92 void __init native_pagetable_reserve(u64 start, u64 end)
... ... @@ -132,7 +133,8 @@
132 133 int nr_range, i;
133 134 int use_pse, use_gbpages;
134 135  
135   - printk(KERN_INFO "init_memory_mapping: %016lx-%016lx\n", start, end);
  136 + printk(KERN_INFO "init_memory_mapping: [mem %#010lx-%#010lx]\n",
  137 + start, end - 1);
136 138  
137 139 #if defined(CONFIG_DEBUG_PAGEALLOC) || defined(CONFIG_KMEMCHECK)
138 140 /*
... ... @@ -251,8 +253,8 @@
251 253 }
252 254  
253 255 for (i = 0; i < nr_range; i++)
254   - printk(KERN_DEBUG " %010lx - %010lx page %s\n",
255   - mr[i].start, mr[i].end,
  256 + printk(KERN_DEBUG " [mem %#010lx-%#010lx] page %s\n",
  257 + mr[i].start, mr[i].end - 1,
256 258 (mr[i].page_size_mask & (1<<PG_LEVEL_1G))?"1G":(
257 259 (mr[i].page_size_mask & (1<<PG_LEVEL_2M))?"2M":"4k"));
258 260  
... ... @@ -350,8 +352,8 @@
350 352 * create a kernel page fault:
351 353 */
352 354 #ifdef CONFIG_DEBUG_PAGEALLOC
353   - printk(KERN_INFO "debug: unmapping init memory %08lx..%08lx\n",
354   - begin, end);
  355 + printk(KERN_INFO "debug: unmapping init [mem %#010lx-%#010lx]\n",
  356 + begin, end - 1);
355 357 set_memory_np(begin, (end - begin) >> PAGE_SHIFT);
356 358 #else
357 359 /*
... ... @@ -141,8 +141,8 @@
141 141  
142 142 /* whine about and ignore invalid blks */
143 143 if (start > end || nid < 0 || nid >= MAX_NUMNODES) {
144   - pr_warning("NUMA: Warning: invalid memblk node %d (%Lx-%Lx)\n",
145   - nid, start, end);
  144 + pr_warning("NUMA: Warning: invalid memblk node %d [mem %#010Lx-%#010Lx]\n",
  145 + nid, start, end - 1);
146 146 return 0;
147 147 }
148 148  
... ... @@ -210,8 +210,8 @@
210 210  
211 211 start = roundup(start, ZONE_ALIGN);
212 212  
213   - printk(KERN_INFO "Initmem setup node %d %016Lx-%016Lx\n",
214   - nid, start, end);
  213 + printk(KERN_INFO "Initmem setup node %d [mem %#010Lx-%#010Lx]\n",
  214 + nid, start, end - 1);
215 215  
216 216 /*
217 217 * Allocate node data. Try remap allocator first, node-local
... ... @@ -232,7 +232,7 @@
232 232 }
233 233  
234 234 /* report and initialize */
235   - printk(KERN_INFO " NODE_DATA [%016Lx - %016Lx]%s\n",
  235 + printk(KERN_INFO " NODE_DATA [mem %#010Lx-%#010Lx]%s\n",
236 236 nd_pa, nd_pa + nd_size - 1, remapped ? " (remapped)" : "");
237 237 tnid = early_pfn_to_nid(nd_pa >> PAGE_SHIFT);
238 238 if (!remapped && tnid != nid)
239 239  
... ... @@ -291,14 +291,14 @@
291 291 */
292 292 if (bi->end > bj->start && bi->start < bj->end) {
293 293 if (bi->nid != bj->nid) {
294   - pr_err("NUMA: node %d (%Lx-%Lx) overlaps with node %d (%Lx-%Lx)\n",
295   - bi->nid, bi->start, bi->end,
296   - bj->nid, bj->start, bj->end);
  294 + pr_err("NUMA: node %d [mem %#010Lx-%#010Lx] overlaps with node %d [mem %#010Lx-%#010Lx]\n",
  295 + bi->nid, bi->start, bi->end - 1,
  296 + bj->nid, bj->start, bj->end - 1);
297 297 return -EINVAL;
298 298 }
299   - pr_warning("NUMA: Warning: node %d (%Lx-%Lx) overlaps with itself (%Lx-%Lx)\n",
300   - bi->nid, bi->start, bi->end,
301   - bj->start, bj->end);
  299 + pr_warning("NUMA: Warning: node %d [mem %#010Lx-%#010Lx] overlaps with itself [mem %#010Lx-%#010Lx]\n",
  300 + bi->nid, bi->start, bi->end - 1,
  301 + bj->start, bj->end - 1);
302 302 }
303 303  
304 304 /*
... ... @@ -320,9 +320,9 @@
320 320 }
321 321 if (k < mi->nr_blks)
322 322 continue;
323   - printk(KERN_INFO "NUMA: Node %d [%Lx,%Lx) + [%Lx,%Lx) -> [%Lx,%Lx)\n",
324   - bi->nid, bi->start, bi->end, bj->start, bj->end,
325   - start, end);
  323 + printk(KERN_INFO "NUMA: Node %d [mem %#010Lx-%#010Lx] + [mem %#010Lx-%#010Lx] -> [mem %#010Lx-%#010Lx]\n",
  324 + bi->nid, bi->start, bi->end - 1, bj->start,
  325 + bj->end - 1, start, end - 1);
326 326 bi->start = start;
327 327 bi->end = end;
328 328 numa_remove_memblk_from(j--, mi);
... ... @@ -616,8 +616,8 @@
616 616 {
617 617 printk(KERN_INFO "%s\n",
618 618 numa_off ? "NUMA turned off" : "No NUMA configuration found");
619   - printk(KERN_INFO "Faking a node at %016Lx-%016Lx\n",
620   - 0LLU, PFN_PHYS(max_pfn));
  619 + printk(KERN_INFO "Faking a node at [mem %#018Lx-%#018Lx]\n",
  620 + 0LLU, PFN_PHYS(max_pfn) - 1);
621 621  
622 622 node_set(0, numa_nodes_parsed);
623 623 numa_add_memblk(0, 0, PFN_PHYS(max_pfn));
arch/x86/mm/numa_emulation.c
... ... @@ -68,8 +68,8 @@
68 68 numa_remove_memblk_from(phys_blk, pi);
69 69 }
70 70  
71   - printk(KERN_INFO "Faking node %d at %016Lx-%016Lx (%LuMB)\n", nid,
72   - eb->start, eb->end, (eb->end - eb->start) >> 20);
  71 + printk(KERN_INFO "Faking node %d at [mem %#018Lx-%#018Lx] (%LuMB)\n",
  72 + nid, eb->start, eb->end - 1, (eb->end - eb->start) >> 20);
73 73 return 0;
74 74 }
75 75  
... ... @@ -209,9 +209,8 @@
209 209 page = pfn_to_page(pfn);
210 210 type = get_page_memtype(page);
211 211 if (type != -1) {
212   - printk(KERN_INFO "reserve_ram_pages_type failed "
213   - "0x%Lx-0x%Lx, track 0x%lx, req 0x%lx\n",
214   - start, end, type, req_type);
  212 + printk(KERN_INFO "reserve_ram_pages_type failed [mem %#010Lx-%#010Lx], track 0x%lx, req 0x%lx\n",
  213 + start, end - 1, type, req_type);
215 214 if (new_type)
216 215 *new_type = type;
217 216  
... ... @@ -314,9 +313,9 @@
314 313  
315 314 err = rbt_memtype_check_insert(new, new_type);
316 315 if (err) {
317   - printk(KERN_INFO "reserve_memtype failed 0x%Lx-0x%Lx, "
318   - "track %s, req %s\n",
319   - start, end, cattr_name(new->type), cattr_name(req_type));
  316 + printk(KERN_INFO "reserve_memtype failed [mem %#010Lx-%#010Lx], track %s, req %s\n",
  317 + start, end - 1,
  318 + cattr_name(new->type), cattr_name(req_type));
320 319 kfree(new);
321 320 spin_unlock(&memtype_lock);
322 321  
... ... @@ -325,8 +324,8 @@
325 324  
326 325 spin_unlock(&memtype_lock);
327 326  
328   - dprintk("reserve_memtype added 0x%Lx-0x%Lx, track %s, req %s, ret %s\n",
329   - start, end, cattr_name(new->type), cattr_name(req_type),
  327 + dprintk("reserve_memtype added [mem %#010Lx-%#010Lx], track %s, req %s, ret %s\n",
  328 + start, end - 1, cattr_name(new->type), cattr_name(req_type),
330 329 new_type ? cattr_name(*new_type) : "-");
331 330  
332 331 return err;
333 332  
... ... @@ -360,14 +359,14 @@
360 359 spin_unlock(&memtype_lock);
361 360  
362 361 if (!entry) {
363   - printk(KERN_INFO "%s:%d freeing invalid memtype %Lx-%Lx\n",
364   - current->comm, current->pid, start, end);
  362 + printk(KERN_INFO "%s:%d freeing invalid memtype [mem %#010Lx-%#010Lx]\n",
  363 + current->comm, current->pid, start, end - 1);
365 364 return -EINVAL;
366 365 }
367 366  
368 367 kfree(entry);
369 368  
370   - dprintk("free_memtype request 0x%Lx-0x%Lx\n", start, end);
  369 + dprintk("free_memtype request [mem %#010Lx-%#010Lx]\n", start, end - 1);
371 370  
372 371 return 0;
373 372 }
... ... @@ -491,9 +490,8 @@
491 490  
492 491 while (cursor < to) {
493 492 if (!devmem_is_allowed(pfn)) {
494   - printk(KERN_INFO
495   - "Program %s tried to access /dev/mem between %Lx->%Lx.\n",
496   - current->comm, from, to);
  493 + printk(KERN_INFO "Program %s tried to access /dev/mem between [mem %#010Lx-%#010Lx]\n",
  494 + current->comm, from, to - 1);
497 495 return 0;
498 496 }
499 497 cursor += PAGE_SIZE;
500 498  
... ... @@ -554,12 +552,11 @@
554 552 size;
555 553  
556 554 if (ioremap_change_attr((unsigned long)__va(base), id_sz, flags) < 0) {
557   - printk(KERN_INFO
558   - "%s:%d ioremap_change_attr failed %s "
559   - "for %Lx-%Lx\n",
  555 + printk(KERN_INFO "%s:%d ioremap_change_attr failed %s "
  556 + "for [mem %#010Lx-%#010Lx]\n",
560 557 current->comm, current->pid,
561 558 cattr_name(flags),
562   - base, (unsigned long long)(base + size));
  559 + base, (unsigned long long)(base + size-1));
563 560 return -EINVAL;
564 561 }
565 562 return 0;
566 563  
... ... @@ -591,12 +588,11 @@
591 588  
592 589 flags = lookup_memtype(paddr);
593 590 if (want_flags != flags) {
594   - printk(KERN_WARNING
595   - "%s:%d map pfn RAM range req %s for %Lx-%Lx, got %s\n",
  591 + printk(KERN_WARNING "%s:%d map pfn RAM range req %s for [mem %#010Lx-%#010Lx], got %s\n",
596 592 current->comm, current->pid,
597 593 cattr_name(want_flags),
598 594 (unsigned long long)paddr,
599   - (unsigned long long)(paddr + size),
  595 + (unsigned long long)(paddr + size - 1),
600 596 cattr_name(flags));
601 597 *vma_prot = __pgprot((pgprot_val(*vma_prot) &
602 598 (~_PAGE_CACHE_MASK)) |
603 599  
... ... @@ -614,11 +610,11 @@
614 610 !is_new_memtype_allowed(paddr, size, want_flags, flags)) {
615 611 free_memtype(paddr, paddr + size);
616 612 printk(KERN_ERR "%s:%d map pfn expected mapping type %s"
617   - " for %Lx-%Lx, got %s\n",
  613 + " for [mem %#010Lx-%#010Lx], got %s\n",
618 614 current->comm, current->pid,
619 615 cattr_name(want_flags),
620 616 (unsigned long long)paddr,
621   - (unsigned long long)(paddr + size),
  617 + (unsigned long long)(paddr + size - 1),
622 618 cattr_name(flags));
623 619 return -EINVAL;
624 620 }
... ... @@ -176,8 +176,9 @@
176 176 return;
177 177 }
178 178  
179   - printk(KERN_INFO "SRAT: Node %u PXM %u %Lx-%Lx\n", node, pxm,
180   - start, end);
  179 + printk(KERN_INFO "SRAT: Node %u PXM %u [mem %#010Lx-%#010Lx]\n",
  180 + node, pxm,
  181 + (unsigned long long) start, (unsigned long long) end - 1);
181 182 }
182 183  
183 184 void __init acpi_numa_arch_fixup(void) {}