From: "Nicholas Piggin" <npiggin@gmail.com>
To: "Christophe Leroy" <christophe.leroy@csgroup.eu>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Cc: Alan Modra <amodra@gmail.com>
Subject: Re: [PATCH 1/5] powerpc/64: use 32-bit immediate for STACK_FRAME_REGS_MARKER
Date: Fri, 23 Sep 2022 16:14:13 +1000 [thread overview]
Message-ID: <CN3K5VX0KUD2.3NX10RABZV007@bobo> (raw)
In-Reply-To: <13f6b8bd-ecc3-cd8d-7e7e-71887326fa40@csgroup.eu>
On Fri Sep 23, 2022 at 3:34 PM AEST, Christophe Leroy wrote:
>
>
> Le 23/09/2022 à 05:25, Nicholas Piggin a écrit :
> > Using a 32-bit constant for this marker allows it to be loaded with
> > two ALU instructions, like 32-bit. This avoids a TOC entry and a
> > TOC load that depends on the r2 value that has just been loaded from
> > the PACA.
> >
> > This changes the value for 32-bit as well, so both have the same
> > value in the low 4 bytes and 64-bit has 0xffffffff in the top bytes.
> >
> > Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> > ---
> > arch/powerpc/include/asm/ptrace.h | 5 +++--
> > arch/powerpc/kernel/entry_32.S | 6 +++---
> > arch/powerpc/kernel/exceptions-64e.S | 8 +-------
> > arch/powerpc/kernel/exceptions-64s.S | 2 +-
> > arch/powerpc/kernel/head_64.S | 7 -------
> > arch/powerpc/kernel/interrupt_64.S | 6 +++---
> > 6 files changed, 11 insertions(+), 23 deletions(-)
> >
> > diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h
> > index a03403695cd4..49d720bb888b 100644
> > --- a/arch/powerpc/include/asm/ptrace.h
> > +++ b/arch/powerpc/include/asm/ptrace.h
> > @@ -99,6 +99,9 @@ struct pt_regs
> >
> > #define STACK_FRAME_WITH_PT_REGS (STACK_FRAME_OVERHEAD + sizeof(struct pt_regs))
> >
> > +/* 0xffffffff8d9a988d on 64-bit */
> > +#define STACK_FRAME_REGS_MARKER ASM_CONST(-0x72656773) /* 0x8d9a988d */
> > +
>
> 0x72656773 is "REGS" in ASCII (Big Endian) and you can spot it
> immediatly in a memory dump.
> 0x7265677368657265 is "REGSHERE".
>
> 0x8d9a988d is not printable.
>
> Don't know if it can be a problem.
Oh. I guess it doesn't really matter if it has zeroes or f in the
top 4 bytes so I should keep it "REGS" then. I was thinking about
later moving it into the reserved word next to the CR word on
64-bit so we would only have 4 bytes for it anyway.
Thanks,
Nick
next prev parent reply other threads:[~2022-09-23 6:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-23 3:25 [PATCH 0/5] powerpc/64: avoid GOT addressing, don't put data in TOC Nicholas Piggin
2022-09-23 3:25 ` [PATCH 1/5] powerpc/64: use 32-bit immediate for STACK_FRAME_REGS_MARKER Nicholas Piggin
2022-09-23 5:34 ` Christophe Leroy
2022-09-23 6:14 ` Nicholas Piggin [this message]
2022-09-23 3:25 ` [PATCH 2/5] powerpc/64: asm use consistent global variable declaration and access Nicholas Piggin
2022-09-23 3:25 ` [PATCH 3/5] powerpc/64: switch asm helpers from GOT to TOC relative addressing Nicholas Piggin
2022-09-23 3:25 ` [PATCH 4/5] powerpc/64: provide a helper macro to load r2 with the kernel TOC Nicholas Piggin
2022-09-23 3:25 ` [PATCH 5/5] powerpc/64e: provide an addressing macro for use with TOC in alternate register Nicholas Piggin
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=CN3K5VX0KUD2.3NX10RABZV007@bobo \
--to=npiggin@gmail.com \
--cc=amodra@gmail.com \
--cc=christophe.leroy@csgroup.eu \
--cc=linuxppc-dev@lists.ozlabs.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