mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Subject: Re: [PATCH] arm: common: document safe usage of arm_setup_stack
Date: Fri, 14 Dec 2018 16:32:13 +0100	[thread overview]
Message-ID: <c362fe2d-5c2a-b402-88b9-c9d9baa8901c@pengutronix.de> (raw)
In-Reply-To: <20181204091500.2841-1-a.fatoum@pengutronix.de>

Hello,

On 4/12/18 10:15, Ahmad Fatoum wrote:
> 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"
> 

any comments?

Cheers
Ahmad

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2018-12-14 15:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-04  9:15 Ahmad Fatoum
2018-12-14 15:32 ` Ahmad Fatoum [this message]

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=c362fe2d-5c2a-b402-88b9-c9d9baa8901c@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