lkml.org 
[lkml]   [2015]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4 RESEND] x86/asm/entry/32, selftests: Add 'test_syscall_vdso' test
On Sep 14, 2015 1:15 AM, "Ingo Molnar" <mingo@kernel.org> wrote:
>
>
> * Denys Vlasenko <dvlasenk@redhat.com> wrote:
>
> > >> + /* INT80 syscall entrypoint can be used by
> > >> + * 64-bit programs too, unlike SYSCALL/SYSENTER.
> > >> + * Therefore it must preserve R12+
> > >> + * (they are callee-saved registers in 64-bit C ABI).
> > >> + *
> > >> + * This was probably historically not intended,
> > >> + * but R8..11 are clobbered (cleared to 0).
> > >> + * IOW: they are the only registers which aren't
> > >> + * preserved across INT80 syscall.
> > >> + */
> > >> + if (*r64 == 0 && num <= 11)
> > >> + continue;
> > >
> > > Ugh. I'll change my big entry patchset to preserve these and maybe to
> > > preserve all of the 64-bit regs.
> >
> > If you do that, this won't change the ABI: we don't _promise_
> > to save them. If we accidentally do, that means nothing.
>
> Argh, that's dangerous nonsense! You _still_ don't seem to understand what the
> Linux ABI means and how to change code that implements it...

I think Denys might be taking about R8-R11 here. If we change them
from clobbered to saved, that's probably fine. Certainly I have to
save R12-R15 -- my v1 is just buggy there. I was too deep in
__kernel_vsyscall when I wrote that code, and I wasn't thinking about
the raw int $0x80 entry variant.

I'd be rather surprised if anything broke if we started preserving
R8-R11 instead of zeroing them.

--Andy


\
 
 \ /
  Last update: 2015-09-14 20:21    [W:0.247 / U:0.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site