}
if (kernel_filename) {
+ uint64_t loaded_addr = 0;
+
spapr->kernel_size = load_elf(kernel_filename, NULL,
translate_kernel_address, spapr,
- NULL, NULL, NULL, NULL, 1,
+ NULL, &loaded_addr, NULL, NULL, 1,
PPC_ELF_MACHINE, 0, 0);
if (spapr->kernel_size == ELF_LOAD_WRONG_ENDIAN) {
spapr->kernel_size = load_elf(kernel_filename, NULL,
translate_kernel_address, spapr,
- NULL, NULL, NULL, NULL, 0,
+ NULL, &loaded_addr, NULL, NULL, 0,
PPC_ELF_MACHINE, 0, 0);
spapr->kernel_le = spapr->kernel_size > 0;
}
exit(1);
}
+ if (spapr->kernel_addr != loaded_addr) {
+ warn_report("spapr: kernel_addr changed from 0x%"PRIx64
+ " to 0x%"PRIx64,
+ spapr->kernel_addr, loaded_addr);
+ spapr->kernel_addr = loaded_addr;
+ }
+
/* load initrd */
if (initrd_filename) {
/* Try to locate the initrd in the gap between the kernel