Message ID | 20200430163142.27282-3-l.stelmach@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Make memory size reporting in kexec_file_load() accurate | expand |
It was <2020-04-30 czw 18:31>, when Łukasz Stelmach wrote: > The value of kbuf->memsz may be different than kbuf->bufsz after calling > kexec_add_buffer(). Hence both values should be logged. > > Fixes: ec2b9bfaac44e ("kexec_file: Change kexec_add_buffer to take kexec_buf as argument.") > Fixes: 27f48d3e633be ("kexec-bzImage64: support for loading bzImage using 64bit entry") > Fixes: dd5f726076cc7 ("kexec: support for kexec on panic using new system call") > Cc: Vivek Goyal <vgoyal@redhat.com> > Cc: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> > Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com> > --- > arch/x86/kernel/crash.c | 2 +- > arch/x86/kernel/kexec-bzimage64.c | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c > index fd87b59452a3..d408e5b536fa 100644 > --- a/arch/x86/kernel/crash.c > +++ b/arch/x86/kernel/crash.c > @@ -420,7 +420,7 @@ int crash_load_segments(struct kimage *image) > } > image->arch.elf_load_addr = kbuf.mem; > pr_debug("Loaded ELF headers at 0x%lx bufsz=0x%lx memsz=0x%lx\n", > - image->arch.elf_load_addr, kbuf.bufsz, kbuf.bufsz); > + image->arch.elf_load_addr, kbuf.bufsz, kbuf.memsz); > > return ret; > } > diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c > index db6578d45157..420393c58a73 100644 > --- a/arch/x86/kernel/kexec-bzimage64.c > +++ b/arch/x86/kernel/kexec-bzimage64.c > @@ -434,7 +434,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel, > goto out_free_params; > bootparam_load_addr = kbuf.mem; > pr_debug("Loaded boot_param, command line and misc at 0x%lx bufsz=0x%lx memsz=0x%lx\n", > - bootparam_load_addr, kbuf.bufsz, kbuf.bufsz); > + bootparam_load_addr, kbuf.bufsz, kbuf.memsz); > > /* Load kernel */ > kbuf.buffer = kernel + kern16_size; > @@ -464,7 +464,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel, > initrd_load_addr = kbuf.mem; > > pr_debug("Loaded initrd at 0x%lx bufsz=0x%lx memsz=0x%lx\n", > - initrd_load_addr, initrd_len, initrd_len); > + initrd_load_addr, kbuf.bufsz, kbuf.memsz); > > setup_initrd(params, initrd_load_addr, initrd_len); > } Ping? Any chance this patch follows its arm64 counterpart into mainline? Kind regards,
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index fd87b59452a3..d408e5b536fa 100644 --- a/arch/x86/kernel/crash.c +++ b/arch/x86/kernel/crash.c @@ -420,7 +420,7 @@ int crash_load_segments(struct kimage *image) } image->arch.elf_load_addr = kbuf.mem; pr_debug("Loaded ELF headers at 0x%lx bufsz=0x%lx memsz=0x%lx\n", - image->arch.elf_load_addr, kbuf.bufsz, kbuf.bufsz); + image->arch.elf_load_addr, kbuf.bufsz, kbuf.memsz); return ret; } diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c index db6578d45157..420393c58a73 100644 --- a/arch/x86/kernel/kexec-bzimage64.c +++ b/arch/x86/kernel/kexec-bzimage64.c @@ -434,7 +434,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel, goto out_free_params; bootparam_load_addr = kbuf.mem; pr_debug("Loaded boot_param, command line and misc at 0x%lx bufsz=0x%lx memsz=0x%lx\n", - bootparam_load_addr, kbuf.bufsz, kbuf.bufsz); + bootparam_load_addr, kbuf.bufsz, kbuf.memsz); /* Load kernel */ kbuf.buffer = kernel + kern16_size; @@ -464,7 +464,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel, initrd_load_addr = kbuf.mem; pr_debug("Loaded initrd at 0x%lx bufsz=0x%lx memsz=0x%lx\n", - initrd_load_addr, initrd_len, initrd_len); + initrd_load_addr, kbuf.bufsz, kbuf.memsz); setup_initrd(params, initrd_load_addr, initrd_len); }
The value of kbuf->memsz may be different than kbuf->bufsz after calling kexec_add_buffer(). Hence both values should be logged. Fixes: ec2b9bfaac44e ("kexec_file: Change kexec_add_buffer to take kexec_buf as argument.") Fixes: 27f48d3e633be ("kexec-bzImage64: support for loading bzImage using 64bit entry") Fixes: dd5f726076cc7 ("kexec: support for kexec on panic using new system call") Cc: Vivek Goyal <vgoyal@redhat.com> Cc: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com> --- arch/x86/kernel/crash.c | 2 +- arch/x86/kernel/kexec-bzimage64.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)