From: Sascha Hauer <s.hauer@pengutronix.de>
To: Fabian Pflug <f.pflug@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 08:18:16 +0100 [thread overview]
Message-ID: <aTkeuH-uZl2T8Nwi@pengutronix.de> (raw)
In-Reply-To: <20251208-v2025-11-0-topic-optee-imx6-start-v1-1-0907128cdb8f@pengutronix.de>
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.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2025-12-10 7:18 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 [this message]
2025-12-10 9:32 ` Fabian Pflug
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=aTkeuH-uZl2T8Nwi@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=f.pflug@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