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

Configure Feed

Select the types of activity you want to include in your feed.

kexec_file, power: print out debugging message if required

Then when specifying '-d' for kexec_file_load interface, loaded locations
of kernel/initrd/cmdline etc can be printed out to help debug.

Here replace pr_debug() with the newly added kexec_dprintk() in kexec_file
loading related codes.

Link: https://lkml.kernel.org/r/20231213055747.61826-7-bhe@redhat.com
Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: Conor Dooley <conor@kernel.org>
Cc: Joe Perches <joe@perches.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Baoquan He and committed by
Andrew Morton
63b642e9 eb7622d9

+13 -13
+4 -4
arch/powerpc/kexec/elf_64.c
··· 59 59 if (ret) 60 60 goto out; 61 61 62 - pr_debug("Loaded the kernel at 0x%lx\n", kernel_load_addr); 62 + kexec_dprintk("Loaded the kernel at 0x%lx\n", kernel_load_addr); 63 63 64 64 ret = kexec_load_purgatory(image, &pbuf); 65 65 if (ret) { ··· 67 67 goto out; 68 68 } 69 69 70 - pr_debug("Loaded purgatory at 0x%lx\n", pbuf.mem); 70 + kexec_dprintk("Loaded purgatory at 0x%lx\n", pbuf.mem); 71 71 72 72 /* Load additional segments needed for panic kernel */ 73 73 if (image->type == KEXEC_TYPE_CRASH) { ··· 99 99 goto out; 100 100 initrd_load_addr = kbuf.mem; 101 101 102 - pr_debug("Loaded initrd at 0x%lx\n", initrd_load_addr); 102 + kexec_dprintk("Loaded initrd at 0x%lx\n", initrd_load_addr); 103 103 } 104 104 105 105 fdt = of_kexec_alloc_and_setup_fdt(image, initrd_load_addr, ··· 132 132 133 133 fdt_load_addr = kbuf.mem; 134 134 135 - pr_debug("Loaded device tree at 0x%lx\n", fdt_load_addr); 135 + kexec_dprintk("Loaded device tree at 0x%lx\n", fdt_load_addr); 136 136 137 137 slave_code = elf_info.buffer + elf_info.proghdrs[0].p_offset; 138 138 ret = setup_purgatory_ppc64(image, slave_code, fdt, kernel_load_addr,
+9 -9
arch/powerpc/kexec/file_load_64.c
··· 577 577 NODE_PATH_LEN, dn); 578 578 return -EOVERFLOW; 579 579 } 580 - pr_debug("Memory node path: %s\n", path); 580 + kexec_dprintk("Memory node path: %s\n", path); 581 581 582 582 /* Now that we know the path, find its offset in kdump kernel's fdt */ 583 583 node = fdt_path_offset(fdt, path); ··· 590 590 /* Get the address & size cells */ 591 591 n_mem_addr_cells = of_n_addr_cells(dn); 592 592 n_mem_size_cells = of_n_size_cells(dn); 593 - pr_debug("address cells: %d, size cells: %d\n", n_mem_addr_cells, 594 - n_mem_size_cells); 593 + kexec_dprintk("address cells: %d, size cells: %d\n", n_mem_addr_cells, 594 + n_mem_size_cells); 595 595 596 596 um_info->idx = 0; 597 597 if (!check_realloc_usable_mem(um_info, 2)) { ··· 664 664 665 665 node = fdt_path_offset(fdt, "/ibm,dynamic-reconfiguration-memory"); 666 666 if (node == -FDT_ERR_NOTFOUND) 667 - pr_debug("No dynamic reconfiguration memory found\n"); 667 + kexec_dprintk("No dynamic reconfiguration memory found\n"); 668 668 else if (node < 0) { 669 669 pr_err("Malformed device tree: error reading /ibm,dynamic-reconfiguration-memory.\n"); 670 670 return -EINVAL; ··· 776 776 for (i = 0; i < ehdr->e_phnum; i++) { 777 777 if (phdr->p_paddr == BACKUP_SRC_START) { 778 778 phdr->p_offset = image->arch.backup_start; 779 - pr_debug("Backup region offset updated to 0x%lx\n", 780 - image->arch.backup_start); 779 + kexec_dprintk("Backup region offset updated to 0x%lx\n", 780 + image->arch.backup_start); 781 781 return; 782 782 } 783 783 } ··· 850 850 pr_err("Failed to load backup segment\n"); 851 851 return ret; 852 852 } 853 - pr_debug("Loaded the backup region at 0x%lx\n", kbuf->mem); 853 + kexec_dprintk("Loaded the backup region at 0x%lx\n", kbuf->mem); 854 854 855 855 /* Load elfcorehdr segment - to export crashing kernel's vmcore */ 856 856 ret = load_elfcorehdr_segment(image, kbuf); ··· 858 858 pr_err("Failed to load elfcorehdr segment\n"); 859 859 return ret; 860 860 } 861 - pr_debug("Loaded elf core header at 0x%lx, bufsz=0x%lx memsz=0x%lx\n", 862 - image->elf_load_addr, kbuf->bufsz, kbuf->memsz); 861 + kexec_dprintk("Loaded elf core header at 0x%lx, bufsz=0x%lx memsz=0x%lx\n", 862 + image->elf_load_addr, kbuf->bufsz, kbuf->memsz); 863 863 864 864 return 0; 865 865 }