public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Leif Lindholm <leif.lindholm@linaro.org>
Cc: edk2-devel-01 <edk2-devel@lists.01.org>,
	"Gao, Liming" <liming.gao@intel.com>
Subject: Re: [PATCH] MdePkg/BaseLib AARCH64: terminate stack frame list on stack switch
Date: Fri, 9 Sep 2016 13:03:59 +0100	[thread overview]
Message-ID: <CAKv+Gu_xJk=8hrpP405+Q3iR5Rjj34xjhCmzS2ENt6jJSOosSQ@mail.gmail.com> (raw)
In-Reply-To: <20160909111810.GM16080@bivouac.eciton.net>

On 9 September 2016 at 12:18, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> On Fri, Sep 09, 2016 at 08:21:26AM +0100, Ard Biesheuvel wrote:
>> When switching to the DXE phase stack, set the frame pointer to zero so
>> that code walking the stack frame will not try to access stack frames\
>
> Trailing '\'.
>
>> belonging to the old stack.
>
> Do you mean that code will check for zero and stop processing, or that
> it will be accessing rubbish instead of parsing a valid-looking frame?
>

I don't understand this question. If it is zero, it will stop
processing. If it is not zero, it will proceed, and potentially
traverse stack frames in memory that is now owned by someone else.

> Either is an improvement, but if it is the latter I would prefer it
> more explicitly stated.
>


> You can fix up on commit:
> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> ---
>>  MdePkg/Library/BaseLib/AArch64/SwitchStack.S | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/MdePkg/Library/BaseLib/AArch64/SwitchStack.S b/MdePkg/Library/BaseLib/AArch64/SwitchStack.S
>> index 2bce9c998f4f..c3ac8d7e4dfe 100644
>> --- a/MdePkg/Library/BaseLib/AArch64/SwitchStack.S
>> +++ b/MdePkg/Library/BaseLib/AArch64/SwitchStack.S
>> @@ -40,6 +40,7 @@ InternalSwitchStackAsm (
>>    );
>>  **/
>>  ASM_PFX(InternalSwitchStackAsm):
>> +    mov   x29, #0
>>      mov   x30, x0
>>      mov   sp, x3
>>      mov   x0, x1
>> --
>> 2.7.4
>>


  reply	other threads:[~2016-09-09 12:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-09  7:21 [PATCH] MdePkg/BaseLib AARCH64: terminate stack frame list on stack switch Ard Biesheuvel
2016-09-09 11:18 ` Leif Lindholm
2016-09-09 12:03   ` Ard Biesheuvel [this message]
2016-09-09 12:10     ` Leif Lindholm

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='CAKv+Gu_xJk=8hrpP405+Q3iR5Rjj34xjhCmzS2ENt6jJSOosSQ@mail.gmail.com' \
    --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