aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/ppc/spapr.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index d112b85..fd4942e 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2975,14 +2975,16 @@ static void spapr_machine_init(MachineState *machine)
}
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;
}
@@ -2992,6 +2994,13 @@ static void spapr_machine_init(MachineState *machine)
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