From: Fabian Pflug <f.pflug@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: BAREBOX <barebox@lists.infradead.org>
Subject: Re: [PATCH 1/3] ARM: make arm_mem_scratch respect the OP-TEE stack
Date: Wed, 10 Dec 2025 10:32:13 +0100 [thread overview]
Message-ID: <5ae5767f95d85c9556884def41cd0e627ed2003c.camel@pengutronix.de> (raw)
In-Reply-To: <aTkeuH-uZl2T8Nwi@pengutronix.de>
Hello Sascha :)
On Wed, 2025-12-10 at 08:18 +0100, Sascha Hauer wrote:
> Hi Fabian,
>
> On Mon, Dec 08, 2025 at 10:28:38AM +0100, Fabian Pflug wrote:
> > According to the ASCII-ART above, before the end of memory comes the
> > optee memory, then the scratch stack.
> >
> > Signed-off-by: Fabian Pflug <f.pflug@pengutronix.de>
> > ---
> > arch/arm/include/asm/barebox-arm.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
> > index 11be8b8583..e630969796 100644
> > --- a/arch/arm/include/asm/barebox-arm.h
> > +++ b/arch/arm/include/asm/barebox-arm.h
> > @@ -159,7 +159,7 @@ static inline unsigned long arm_mem_stack_top(unsigned long endmem)
> >
> > static inline const void *arm_mem_scratch_get(void)
> > {
> > - return (const void *)arm_mem_scratch(arm_mem_endmem_get());
> > + return (const void *)arm_mem_scratch(arm_mem_optee(arm_mem_endmem_get()));
>
> arm_mem_scratch() is:
>
> static inline unsigned long arm_mem_scratch(unsigned long endmem)
> {
> return arm_mem_optee(endmem) - SCRATCH_SIZE;
> }
>
> So this already has the OPTEE space substracted. With your patch it's
> substracted twice.
Yes, you are right! Don't know why I did not see that...
This also makes the third patch in the series wrong, because it will remove the offset twice in another way.
I will send a new series after resolving the comment on the other patch. :)
Fabian
>
> Sascha
next prev parent reply other threads:[~2025-12-10 9:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-08 9:28 [PATCH 0/3] Add generic OP-TEE loading for i.MX6 Fabian Pflug
2025-12-08 9:28 ` [PATCH 1/3] ARM: make arm_mem_scratch respect the OP-TEE stack Fabian Pflug
2025-12-10 7:18 ` Sascha Hauer
2025-12-10 9:32 ` Fabian Pflug [this message]
2025-12-08 9:28 ` [PATCH 2/3] ARM: i.MX: scratch: add generic init for imx Fabian Pflug
2025-12-08 9:28 ` [PATCH 3/3] ARM: i.MX6: load optee in PBL before barebox proper Fabian Pflug
2025-12-10 7:40 ` Sascha Hauer
2025-12-10 9:20 ` Fabian Pflug
2025-12-10 10:58 ` Sascha Hauer
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=5ae5767f95d85c9556884def41cd0e627ed2003c.camel@pengutronix.de \
--to=f.pflug@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/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