linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Dufour <ldufour@linux.ibm.com>
To: Sourabh Jain <sourabhjain@linux.ibm.com>,
	linuxppc-dev@ozlabs.org, mpe@ellerman.id.au
Cc: mahesh@linux.vnet.ibm.com, eric.devolder@oracle.com,
	kexec@lists.infradead.org, bhe@redhat.com,
	hbathini@linux.ibm.com
Subject: Re: [PATCH v7 4/8] crash: add phdr for possible CPUs in elfcorehdr
Date: Fri, 20 Jan 2023 12:39:10 +0100	[thread overview]
Message-ID: <e12d2441-576a-d049-3cd8-523b7c41b15e@linux.ibm.com> (raw)
In-Reply-To: <51fa22e4-efab-a931-fb8f-48180baaac61@linux.ibm.com>

On 19/01/2023 19:29:52, Laurent Dufour wrote:
> On 15/01/2023 16:02:02, Sourabh Jain wrote:
>> On architectures like PowerPC the crash notes are available for all
>> possible CPUs. So let's populate the elfcorehdr for all possible
>> CPUs having crash notes to avoid updating elfcorehdr during in-kernel
>> crash update on CPU hotplug events.
>>
>> The similar technique is used in kexec-tool for kexec_load case.
>>
>> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
>> ---
>>  kernel/crash_core.c | 9 ++++++---
>>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> This patch is not applying on ppc/next (53ab112a9508).
> 
> As far as I could see, crash_prepare_elf64_headers() is defined in the file
> kernel/kexec_file.c and that's not recent, see babac4a84a88 (kexec_file,
> x86: move re-factored code to generic side, 2018-04-13)
> 
> Am I missing something?

My mistake, sounds that your series is based on top of the Eric's one (not yet upstream):

https://lore.kernel.org/lkml/20230118213544.2128-1-eric.devolder@oracle.com/

> 
>>
>> diff --git a/kernel/crash_core.c b/kernel/crash_core.c
>> index 910d377ea317e..19f987b3851e8 100644
>> --- a/kernel/crash_core.c
>> +++ b/kernel/crash_core.c
>> @@ -364,8 +364,8 @@ int crash_prepare_elf64_headers(struct kimage *image, struct crash_mem *mem,
>>  	ehdr->e_ehsize = sizeof(Elf64_Ehdr);
>>  	ehdr->e_phentsize = sizeof(Elf64_Phdr);
>>  
>> -	/* Prepare one phdr of type PT_NOTE for each present CPU */
>> -	for_each_present_cpu(cpu) {
>> +	/* Prepare one phdr of type PT_NOTE for possible CPU with crash note. */
>> +	for_each_possible_cpu(cpu) {
>>  #ifdef CONFIG_CRASH_HOTPLUG
>>  		if (IS_ENABLED(CONFIG_HOTPLUG_CPU)) {
>>  			/* Skip the soon-to-be offlined cpu */
>> @@ -373,8 +373,11 @@ int crash_prepare_elf64_headers(struct kimage *image, struct crash_mem *mem,
>>  				continue;
>>  		}
>>  #endif
>> -		phdr->p_type = PT_NOTE;
>>  		notes_addr = per_cpu_ptr_to_phys(per_cpu_ptr(crash_notes, cpu));
>> +		if (!notes_addr)
>> +			continue;
>> +
>> +		phdr->p_type = PT_NOTE;
>>  		phdr->p_offset = phdr->p_paddr = notes_addr;
>>  		phdr->p_filesz = phdr->p_memsz = sizeof(note_buf_t);
>>  		(ehdr->e_phnum)++;
> 


  reply	other threads:[~2023-01-20 11:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-15 15:01 [PATCH v7 0/8] In kernel handling of CPU hotplug events for crash kernel Sourabh Jain
2023-01-15 15:01 ` [PATCH v7 1/8] powerpc/kexec: turn some static helper functions public Sourabh Jain
2023-01-15 15:02 ` [PATCH v7 2/8] powerpc/crash hp: introduce a new config option CRASH_HOTPLUG Sourabh Jain
2023-01-15 15:02 ` [PATCH v7 3/8] powerpc/crash: update kimage_arch struct Sourabh Jain
2023-01-19 18:57   ` Laurent Dufour
2023-01-23  5:23     ` Sourabh Jain
2023-01-15 15:02 ` [PATCH v7 4/8] crash: add phdr for possible CPUs in elfcorehdr Sourabh Jain
2023-01-19 18:29   ` Laurent Dufour
2023-01-20 11:39     ` Laurent Dufour [this message]
2023-01-23  5:27       ` Sourabh Jain
2023-01-15 15:02 ` [PATCH v7 5/8] crash: pass hotplug action type to arch crash hotplug handler Sourabh Jain
2023-01-15 15:02 ` [PATCH v7 6/8] powerpc/crash: add crash CPU hotplug support Sourabh Jain
2023-01-15 15:02 ` [PATCH v7 7/8] crash: forward memory_notify args to arch crash hotplug handler Sourabh Jain
2023-01-15 15:02 ` [PATCH v7 8/8] powerpc/kexec: add crash memory hotplug support Sourabh Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e12d2441-576a-d049-3cd8-523b7c41b15e@linux.ibm.com \
    --to=ldufour@linux.ibm.com \
    --cc=bhe@redhat.com \
    --cc=eric.devolder@oracle.com \
    --cc=hbathini@linux.ibm.com \
    --cc=kexec@lists.infradead.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mahesh@linux.vnet.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=sourabhjain@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).