From: Andrey Borzenkov <arvidjaar@gmail.com>
To: grub-devel@gnu.org
Subject: Re: [PATCH] arm: fix u-boot port syscall interface va_arg handling (was Re: [PATCH] [ARM] Enable boot module for arm)
Date: Sat, 16 Nov 2013 17:27:33 +0400 [thread overview]
Message-ID: <20131116172733.73f135ac@opensuse.site> (raw)
In-Reply-To: <5287707F.5090207@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1998 bytes --]
В Sat, 16 Nov 2013 14:17:51 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> пишет:
> On 16.11.2013 14:00, Leif Lindholm wrote:
> > On Sat, Nov 16, 2013 at 01:49:51PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> >> On 16.11.2013 13:39, Leif Lindholm wrote:
> >>> - str r9, transition_space + 8
> >> You need to save r9. Otherwise GRUB will crash if compiled with clang.
> >
> > Hmm, but this is a bug in clang in that case.
> >
> > From an ABI perspective, grub_uboot_syscall is a veneer:
> > the only visible side effect it is permitted to have is to corrupt r12.
> >
> According to wikipedia:
> "Subroutines must preserve the contents of r4 to r11 and the stack pointer."
According to ARM ABI documentation
"A subroutine must preserve the contents of the registers r4 - r8, r10,
r11 and SP (and r9 in PCS variants that designate r9 as v6)."
So it sounds like whether r9 is preserved depends on platform.
> So changing r9 sounds to me like this is actually U-Boot bug and
> preserving it sounds like right way to handle it.
> What's the harm in preserving r9? Is it used for something in calling?
> > We need to additionally switch r8 between grub and u-boot copy because
> > u-boot uses it for its global data pointer, and lr because we need to
> > corrupt it to make u-boot return to this veneer to switch the r8 back
> > again.
> >
> > This veneer should not touch anything else - so if we need to
> > temporarily work around a toolchain ABI bug, can we do this via an
> > ifdef and a config option?
> >
> If the bug is on clang side (I doubt it right now), there is no way to
> handle it without side effects and we can invent a test for it, we can
> reject buggy compilers (clang is secondary compiler)
> > /
> > Leif
> >
> > _______________________________________________
> > Grub-devel mailing list
> > Grub-devel@gnu.org
> > https://lists.gnu.org/mailman/listinfo/grub-devel
> >
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2013-11-16 13:27 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-21 13:20 [PATCH] [ARM] Enable boot module for arm Francesco Lavra
2013-07-25 14:36 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-07-25 14:45 ` Francesco Lavra
2013-07-25 15:04 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-07-27 3:46 ` Andrey Borzenkov
2013-07-27 4:21 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-07-27 5:19 ` Andrey Borzenkov
2013-07-27 14:44 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-07-28 16:51 ` Andrey Borzenkov
2013-07-28 18:01 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-07-28 18:18 ` Andrey Borzenkov
2013-07-28 19:01 ` Andrey Borzenkov
2013-11-15 19:13 ` Andrey Borzenkov
2013-11-16 0:45 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-16 12:39 ` Leif Lindholm
2013-11-16 12:49 ` [PATCH] arm: fix u-boot port syscall interface va_arg handling (was Re: [PATCH] [ARM] Enable boot module for arm) Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-16 13:00 ` Leif Lindholm
2013-11-16 13:17 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-16 13:27 ` Andrey Borzenkov [this message]
2013-11-16 13:53 ` Leif Lindholm
2013-11-16 14:03 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-16 14:28 ` Leif Lindholm
2013-11-16 14:45 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-16 14:45 ` Leif Lindholm
2013-11-16 15:19 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-16 15:23 ` Leif Lindholm
2013-11-16 15:31 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-16 12:54 ` [PATCH] [ARM] Enable boot module for arm Andrey Borzenkov
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=20131116172733.73f135ac@opensuse.site \
--to=arvidjaar@gmail.com \
--cc=grub-devel@gnu.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;
as well as URLs for NNTP newsgroup(s).