public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Leif Lindholm <leif.lindholm@linaro.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	Laszlo Ersek <lersek@redhat.com>,
	"Gao, Liming" <liming.gao@intel.com>
Subject: Re: [PATCH v2] ArmPlatformPkg/PrePeiCore: seed temporary stack before entering PEI core
Date: Wed, 8 Nov 2017 16:12:46 +0000	[thread overview]
Message-ID: <20171108161246.2c7ppy562fpizjcd@bivouac.eciton.net> (raw)
In-Reply-To: <CAKv+Gu_OFvHnwJOnQUC9Gh69QkfA95JckdPHVRwrrecKLUoHUg@mail.gmail.com>

On Sun, Nov 05, 2017 at 04:29:15PM +0000, Ard Biesheuvel wrote:
> >> OK, this may sound completely unreasonable, but seeing those
> >> implementations overwrite callee-saved registers without saving them
> >> makes my brain unhappy. (Yes, I know.)
> >>
> >> Could they either:
> >> - Have a comment prepended establishing the implicit ABI of which
> >>   registers the caller cannot rely on reusing after return.
> >>   Preferably somewhat echoed at the call site.
> >> - Be rewritten to use only scratch registers?
> >>
> >
> > I think it is implied that the startup code does not adhere to the
> > AAPCS. That code already uses r5 and r6 without stacking them, simply
> > because we're in the middle of preparing the stack and other execution
> > context, precisely so the C code we call into can rely on AAPCS
> > guarantees.
> 
> Ehm, hold on, what do you mean by 'call site'? This code just runs and
> jumps back to a local label. There are no functions calls here until
> the point where we call into C (with the exception of the lovely
> ArmPlatformPeiBootAction() we added so Juno can find out how much DRAM
> it can use)

Yeah, you're right, I was misreading the block as a subroutine.

Seems the only register that must be preserved across jumps is r5/x5,
and neither of these modifications touch those (or change that fact).

Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

/
    Leif


  parent reply	other threads:[~2017-11-08 16:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-03 11:33 [PATCH v2] ArmPlatformPkg/PrePeiCore: seed temporary stack before entering PEI core Ard Biesheuvel
2017-11-05  5:52 ` Leif Lindholm
2017-11-05 16:27   ` Ard Biesheuvel
2017-11-05 16:29     ` Ard Biesheuvel
2017-11-07 18:09       ` Laszlo Ersek
2017-11-07 18:13         ` Ard Biesheuvel
2017-11-09 21:11           ` Ard Biesheuvel
2017-11-10  9:29             ` Laszlo Ersek
2017-11-10 11:01               ` Ard Biesheuvel
2017-11-08 16:12       ` Leif Lindholm [this message]
2017-11-09 21:09         ` Ard Biesheuvel
2017-11-06  4:25 ` Gao, Liming

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-list 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=20171108161246.2c7ppy562fpizjcd@bivouac.eciton.net \
    --to=devel@edk2.groups.io \
    /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