Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1604186
| From | Xunlei Pang <xlpang@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v3 2/3] powerpc/fadump: Use the correct VMCOREINFO_NOTE_SIZE for phdr |
| Date | 2017-03-20 07:00 +0100 |
| Message-ID | <tmYwi-c3-3@gated-at.bofh.it> (permalink) |
| References | <tmYmB-8E-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
vmcoreinfo_max_size stands for the vmcoreinfo_data, the
correct one we should use is vmcoreinfo_note whose total
size is VMCOREINFO_NOTE_SIZE.
Like explained in commit 77019967f06b ("kdump: fix exported
size of vmcoreinfo note"), it does not affect the actual
function, we better fix it, also this change should be safe
and backward compatible.
After this, we can get rid of variable vmcoreinfo_max_size,
let's use the macro VMCOREINFO_BYTES instead, fewer variables
means more safety for vmcoreinfo operation.
Signed-off-by: Xunlei Pang <xlpang@redhat.com>
---
arch/powerpc/kernel/fadump.c | 3 +--
include/linux/kexec.h | 1 -
kernel/kexec_core.c | 3 +--
3 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 8ff0dd4..b8e15cf 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -906,8 +906,7 @@ static int fadump_create_elfcore_headers(char *bufp)
phdr->p_paddr = fadump_relocate(paddr_vmcoreinfo_note());
phdr->p_offset = phdr->p_paddr;
- phdr->p_memsz = vmcoreinfo_max_size;
- phdr->p_filesz = vmcoreinfo_max_size;
+ phdr->p_memsz = phdr->p_filesz = VMCOREINFO_NOTE_SIZE;
/* Increment number of program headers. */
(elf->e_phnum)++;
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index f1c601b..6918fda 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -319,7 +319,6 @@ extern void *kexec_purgatory_get_symbol_addr(struct kimage *image,
extern note_buf_t __percpu *crash_notes;
extern u32 *vmcoreinfo_note;
extern size_t vmcoreinfo_size;
-extern size_t vmcoreinfo_max_size;
/* flag to track if kexec reboot is in progress */
extern bool kexec_in_progress;
diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index e3a4bda..e503b48 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -54,7 +54,6 @@
/* vmcoreinfo stuff */
static unsigned char *vmcoreinfo_data;
size_t vmcoreinfo_size;
-size_t vmcoreinfo_max_size = VMCOREINFO_BYTES;
u32 *vmcoreinfo_note;
/* Flag to indicate we are going to kexec a new kernel */
@@ -1386,7 +1385,7 @@ void vmcoreinfo_append_str(const char *fmt, ...)
r = vscnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
- r = min(r, vmcoreinfo_max_size - vmcoreinfo_size);
+ r = min(r, VMCOREINFO_BYTES - vmcoreinfo_size);
memcpy(&vmcoreinfo_data[vmcoreinfo_size], buf, r);
--
1.8.3.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section Xunlei Pang <xlpang@redhat.com> - 2017-03-20 06:50 +0100
[PATCH v3 2/3] powerpc/fadump: Use the correct VMCOREINFO_NOTE_SIZE for phdr Xunlei Pang <xlpang@redhat.com> - 2017-03-20 07:00 +0100
[PATCH v3 3/3] kdump: Relocate vmcoreinfo to the crash memory range Xunlei Pang <xlpang@redhat.com> - 2017-03-20 07:00 +0100
Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section ebiederm@xmission.com (Eric W. Biederman) - 2017-03-21 04:40 +0100
Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section Dave Young <dyoung@redhat.com> - 2017-03-22 04:10 +0100
Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section ebiederm@xmission.com (Eric W. Biederman) - 2017-03-22 04:30 +0100
Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section Dave Young <dyoung@redhat.com> - 2017-03-22 05:40 +0100
Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section Xunlei Pang <xpang@redhat.com> - 2017-03-22 10:40 +0100
Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section Hari Bathini <hbathini@linux.vnet.ibm.com> - 2017-03-22 13:20 +0100
Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section Hari Bathini <hbathini@linux.vnet.ibm.com> - 2017-03-22 12:50 +0100
Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section Michael Holzheu <holzheu@linux.vnet.ibm.com> - 2017-03-22 21:50 +0100
Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section Xunlei Pang <xpang@redhat.com> - 2017-03-23 10:30 +0100
Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section Michael Holzheu <holzheu@linux.vnet.ibm.com> - 2017-03-23 18:50 +0100
Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section Xunlei Pang <xpang@redhat.com> - 2017-03-24 12:10 +0100
Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section Xunlei Pang <xpang@redhat.com> - 2017-03-22 10:00 +0100
Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section Xunlei Pang <xpang@redhat.com> - 2017-03-22 10:20 +0100
Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section Xunlei Pang <xpang@redhat.com> - 2017-03-22 10:30 +0100
Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section Petr Tesarik <ptesarik@suse.cz> - 2017-03-21 10:30 +0100
csiph-web