The physical addresses in struct hvm_start_info are pointing to the
memory where the data is being built instead of the location where it
will finally be moved to.
Fix that. Additionally rename kexec_param_loc to kexec_param_pa to
better reflect the semantics of the variable.
Fixes: b7994b6409a4 ("mini-os: kexec: build parameters for new kernel")
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
V2:
- rename kexec_param_loc to kexec_param_pa (Jason Andryuk)
---
arch/x86/kexec.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kexec.c b/arch/x86/kexec.c
index fc58473e..d0af460d 100644
--- a/arch/x86/kexec.c
+++ b/arch/x86/kexec.c
@@ -197,7 +197,7 @@ bool kexec_arch_need_analyze_shdrs(void)
return kernel_phys_entry == ~0UL;
}
-static unsigned long kexec_param_loc;
+static unsigned long kexec_param_pa;
static unsigned int kexec_param_size;
static unsigned long kexec_param_mem;
@@ -208,7 +208,7 @@ void kexec_set_param_loc(const char *cmdline)
kexec_param_size += strlen(cmdline) + 1;
kexec_last_addr = (kexec_last_addr + 7) & ~7UL;
- kexec_param_loc = kexec_last_addr;
+ kexec_param_pa = kexec_last_addr;
kexec_last_addr += kexec_param_size;
kexec_last_addr = round_pgup(kexec_last_addr);
}
@@ -233,9 +233,9 @@ int kexec_get_entry(const char *cmdline)
memset(info, 0, sizeof(*info));
info->magic = XEN_HVM_START_MAGIC_VALUE;
info->version = 1;
- info->cmdline_paddr = kexec_param_mem + sizeof(*info) +
+ info->cmdline_paddr = kexec_param_pa + sizeof(*info) +
e820_entries * sizeof(struct hvm_memmap_table_entry);
- info->memmap_paddr = kexec_param_mem + sizeof(*info);
+ info->memmap_paddr = kexec_param_pa + sizeof(*info);
info->memmap_entries = e820_entries;
mmap = (struct hvm_memmap_table_entry *)(info + 1);
@@ -249,13 +249,13 @@ int kexec_get_entry(const char *cmdline)
strcpy((char *)mmap, cmdline);
- if ( kexec_add_action(KEXEC_COPY, to_virt(kexec_param_loc), info,
+ if ( kexec_add_action(KEXEC_COPY, to_virt(kexec_param_pa), info,
kexec_param_size) )
return ENOSPC;
/* The call of the new kernel happens via the physical address! */
if ( kexec_add_action(KEXEC_CALL, (void *)kernel_phys_entry,
- (void *)kexec_param_loc, 0) )
+ (void *)kexec_param_pa, 0) )
return ENOSPC;
return 0;
--
2.43.0