From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] arm: common: document safe usage of arm_setup_stack
Date: Tue, 4 Dec 2018 10:15:01 +0100 [thread overview]
Message-ID: <20181204091500.2841-1-a.fatoum@pengutronix.de> (raw)
Cc: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/arm/include/asm/common.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/arm/include/asm/common.h b/arch/arm/include/asm/common.h
index c32cdfe5ec2f..72ac988cc131 100644
--- a/arch/arm/include/asm/common.h
+++ b/arch/arm/include/asm/common.h
@@ -46,6 +46,12 @@ static inline unsigned long get_sp(void)
return sp;
}
+/*
+ * At least with GCC 7.3.1, listing sp in the clobber register can generate
+ * erroneous accesses to the fp, even in __naked functions. Therefore _always_
+ * branch to a noinline function as soon as possible (usually after relocation
+ * and c_setup).
+ */
static inline void arm_setup_stack(unsigned long top)
{
__asm__ __volatile__("mov sp, %0"
--
2.19.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2018-12-04 9:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-04 9:15 Ahmad Fatoum [this message]
2018-12-14 15:32 ` Ahmad Fatoum
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=20181204091500.2841-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.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