From: Michael Ellerman <mpe@ellerman.id.au>
To: Borislav Petkov <bp@alien8.de>, Brian Gerst <brgerst@gmail.com>,
linuxppc-dev@lists.ozlabs.org
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
Andy Lutomirski <luto@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
"H . Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH 2/4] ELF: Remove elf_core_copy_kernel_regs()
Date: Wed, 13 Apr 2022 22:31:41 +1000 [thread overview]
Message-ID: <87h76x5fma.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <Yla2+ItaT0TuuDND@zn.tnic>
Borislav Petkov <bp@alien8.de> writes:
> + PPC ML as an FYI that this change will come through tip.
Ack.
cheers
> On Fri, Mar 25, 2022 at 11:39:51AM -0400, Brian Gerst wrote:
>> x86-32 was the last architecture that implemented separate user and
>> kernel registers.
>>
>> Signed-off-by: Brian Gerst <brgerst@gmail.com>
>> ---
>> arch/powerpc/kernel/fadump.c | 2 +-
>> arch/powerpc/platforms/powernv/opal-core.c | 2 +-
>> include/linux/elfcore.h | 9 ---------
>> kernel/kexec_core.c | 2 +-
>> 4 files changed, 3 insertions(+), 12 deletions(-)
>>
>> diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
>> index 4fdb7c77fda1..c0cf17196d6c 100644
>> --- a/arch/powerpc/kernel/fadump.c
>> +++ b/arch/powerpc/kernel/fadump.c
>> @@ -752,7 +752,7 @@ u32 *__init fadump_regs_to_elf_notes(u32 *buf, struct pt_regs *regs)
>> * FIXME: How do i get PID? Do I really need it?
>> * prstatus.pr_pid = ????
>> */
>> - elf_core_copy_kernel_regs(&prstatus.pr_reg, regs);
>> + elf_core_copy_regs(&prstatus.pr_reg, regs);
>> buf = append_elf_note(buf, CRASH_CORE_NOTE_NAME, NT_PRSTATUS,
>> &prstatus, sizeof(prstatus));
>> return buf;
>> diff --git a/arch/powerpc/platforms/powernv/opal-core.c b/arch/powerpc/platforms/powernv/opal-core.c
>> index 0331f1973f0e..dd6e99edff76 100644
>> --- a/arch/powerpc/platforms/powernv/opal-core.c
>> +++ b/arch/powerpc/platforms/powernv/opal-core.c
>> @@ -112,7 +112,7 @@ static void __init fill_prstatus(struct elf_prstatus *prstatus, int pir,
>> struct pt_regs *regs)
>> {
>> memset(prstatus, 0, sizeof(struct elf_prstatus));
>> - elf_core_copy_kernel_regs(&(prstatus->pr_reg), regs);
>> + elf_core_copy_regs(&(prstatus->pr_reg), regs);
>>
>> /*
>> * Overload PID with PIR value.
>> diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
>> index f8e206e82476..346a8b56cdc8 100644
>> --- a/include/linux/elfcore.h
>> +++ b/include/linux/elfcore.h
>> @@ -84,15 +84,6 @@ static inline void elf_core_copy_regs(elf_gregset_t *elfregs, struct pt_regs *re
>> #endif
>> }
>>
>> -static inline void elf_core_copy_kernel_regs(elf_gregset_t *elfregs, struct pt_regs *regs)
>> -{
>> -#ifdef ELF_CORE_COPY_KERNEL_REGS
>> - ELF_CORE_COPY_KERNEL_REGS((*elfregs), regs);
>> -#else
>> - elf_core_copy_regs(elfregs, regs);
>> -#endif
>> -}
>> -
>> static inline int elf_core_copy_task_regs(struct task_struct *t, elf_gregset_t* elfregs)
>> {
>> #if defined (ELF_CORE_COPY_TASK_REGS)
>> diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
>> index 68480f731192..be4b54c2c615 100644
>> --- a/kernel/kexec_core.c
>> +++ b/kernel/kexec_core.c
>> @@ -1078,7 +1078,7 @@ void crash_save_cpu(struct pt_regs *regs, int cpu)
>> return;
>> memset(&prstatus, 0, sizeof(prstatus));
>> prstatus.common.pr_pid = current->pid;
>> - elf_core_copy_kernel_regs(&prstatus.pr_reg, regs);
>> + elf_core_copy_regs(&prstatus.pr_reg, regs);
>> buf = append_elf_note(buf, KEXEC_CORE_NOTE_NAME, NT_PRSTATUS,
>> &prstatus, sizeof(prstatus));
>> final_note(buf);
>> --
>> 2.35.1
>>
>
> --
> Regards/Gruss,
> Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2022-04-13 12:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-25 15:39 [PATCH 0/4] x86-32: Clean up GS segment handling Brian Gerst
2022-03-25 15:39 ` [PATCH 1/4] x86-32: Simplify ELF_CORE_COPY_REGS Brian Gerst
2022-04-15 9:42 ` [tip: x86/core] x86/32: " tip-bot2 for Brian Gerst
2022-03-25 15:39 ` [PATCH 2/4] ELF: Remove elf_core_copy_kernel_regs() Brian Gerst
2022-04-13 11:41 ` Borislav Petkov
2022-04-13 12:31 ` Michael Ellerman [this message]
2022-04-15 9:42 ` [tip: x86/core] " tip-bot2 for Brian Gerst
2022-03-25 15:39 ` [PATCH 3/4] x86-32: Remove lazy GS macros Brian Gerst
2022-04-15 9:42 ` [tip: x86/core] x86/32: " tip-bot2 for Brian Gerst
2022-03-25 15:39 ` [PATCH 4/4] x86: Merge load_gs_index() Brian Gerst
2022-04-15 9:42 ` [tip: x86/core] x86/asm: " tip-bot2 for Brian Gerst
2022-03-25 15:45 ` [PATCH 0/4] x86-32: Clean up GS segment handling Andy Lutomirski
2022-04-05 16:12 ` Thomas Gleixner
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=87h76x5fma.fsf@mpe.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=luto@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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