From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cH5Dc-0007DR-0D for kexec@lists.infradead.org; Wed, 14 Dec 2016 08:47:20 +0000 Subject: Re: [PATCH 1/2] kexec: add a dummy note for each offline cpu References: <1481695887-21090-1-git-send-email-piliu@redhat.com> From: Xunlei Pang Message-ID: <58510759.1080603@redhat.com> Date: Wed, 14 Dec 2016 16:48:25 +0800 MIME-Version: 1.0 In-Reply-To: <1481695887-21090-1-git-send-email-piliu@redhat.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: xlpang@redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Pingfan Liu , kexec@lists.infradead.org Cc: Dave Young , Baoquan He , kernelfans@gmail.com On 12/14/2016 at 02:11 PM, Pingfan Liu wrote: > kexec-tools always allocates program headers for each possible cpu. This > incurs zero PT_NOTE for offline cpu. We mark this case so that later, > the capture kernel can distinguish it from the mistake of allocated > program header. > The counterpart of the capture kernel comes in next patch. Hmm, we can initialize the cpu crash note buf in crash_notes_memory_init(), needless to do it at the crash moment, right? BTW, does this cause any issue, for example the crash utility can't parse the vmcore properly? or just reproduce lots of warnings after offline multiple cpus? Regards, Xunlei > > Signed-off-by: Pingfan Liu > --- > This unnecessary warning buzz on all archs when there is offline cpu > > include/uapi/linux/elf.h | 1 + > kernel/kexec_core.c | 9 +++++++++ > 2 files changed, 10 insertions(+) > > diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h > index b59ee07..9744f1e 100644 > --- a/include/uapi/linux/elf.h > +++ b/include/uapi/linux/elf.h > @@ -367,6 +367,7 @@ typedef struct elf64_shdr { > * using the corresponding note types via the PTRACE_GETREGSET and > * PTRACE_SETREGSET requests. > */ > +#define NT_DUMMY 0 > #define NT_PRSTATUS 1 > #define NT_PRFPREG 2 > #define NT_PRPSINFO 3 > diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c > index 5616755..aeac16e 100644 > --- a/kernel/kexec_core.c > +++ b/kernel/kexec_core.c > @@ -891,9 +891,12 @@ void __crash_kexec(struct pt_regs *regs) > if (mutex_trylock(&kexec_mutex)) { > if (kexec_crash_image) { > struct pt_regs fixed_regs; > + unsigned int cpu; > > crash_setup_regs(&fixed_regs, regs); > crash_save_vmcoreinfo(); > + for_each_cpu_not(cpu, cpu_online_mask) > + crash_save_cpu(NULL, cpu); > machine_crash_shutdown(&fixed_regs); > machine_kexec(kexec_crash_image); > } > @@ -1040,6 +1043,12 @@ void crash_save_cpu(struct pt_regs *regs, int cpu) > buf = (u32 *)per_cpu_ptr(crash_notes, cpu); > if (!buf) > return; > + if (regs == NULL) { > + buf = append_elf_note(buf, KEXEC_CORE_NOTE_NAME, NT_DUMMY, > + NULL, 0); > + final_note(buf); > + return; > + } > memset(&prstatus, 0, sizeof(prstatus)); > prstatus.pr_pid = current->pid; > elf_core_copy_kernel_regs(&prstatus.pr_reg, regs); _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec