Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1224657

Re: [PATCH v4 RESEND] x86/asm/entry/32, selftests: Add 'test_syscall_vdso' test

From Ingo Molnar <mingo@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v4 RESEND] x86/asm/entry/32, selftests: Add 'test_syscall_vdso' test
Date 2015-09-15 08:10 +0200
Message-ID <q8RBg-4I0-13@gated-at.bofh.it> (permalink)
References <q66ZP-1AW-7@gated-at.bofh.it> <q6VJ0-7BX-11@gated-at.bofh.it> <q7fom-22E-13@gated-at.bofh.it> <q8x9x-wy-11@gated-at.bofh.it> <q8GcN-4Xj-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


* Andy Lutomirski <luto@amacapital.net> wrote:

> 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.

Well, read the statement:

  " If you do that, this won't change the ABI: we don't _promise_
    to save them. If we accidentally do, that means nothing. "

of _course_ it means everything: if we preserve R8-R11 and any app learns to rely 
on it, it becomes an ABI.

What we 'promise' with our implementation and what our intentions are are entirely 
irrelevant, they simply don't matter to ABI compatibility: it's only what apps do 
with our released kernels that matters, in 99.998% of the cases..

And I'd really like that thinking to permeate everyone's mind who is regularly 
changing this type of code ...

Thanks,

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 RESEND] x86/asm/entry/32, selftests: Add 'test_syscall_vdso' test Denys Vlasenko <dvlasenk@redhat.com> - 2015-09-07 18:00 +0200
  Re: [PATCH v4 RESEND] x86/asm/entry/32, selftests: Add  'test_syscall_vdso' test Andy Lutomirski <luto@amacapital.net> - 2015-09-10 00:10 +0200
    Re: [PATCH v4 RESEND] x86/asm/entry/32, selftests: Add 'test_syscall_vdso'  test Denys Vlasenko <dvlasenk@redhat.com> - 2015-09-10 21:10 +0200
      Re: [PATCH v4 RESEND] x86/asm/entry/32, selftests: Add  'test_syscall_vdso' test Andy Lutomirski <luto@amacapital.net> - 2015-09-10 21:20 +0200
        Re: [PATCH v4 RESEND] x86/asm/entry/32, selftests: Add  'test_syscall_vdso' test Ingo Molnar <mingo@kernel.org> - 2015-09-14 10:30 +0200
          Re: [PATCH v4 RESEND] x86/asm/entry/32, selftests: Add  'test_syscall_vdso' test Andy Lutomirski <luto@amacapital.net> - 2015-09-14 20:00 +0200
      Re: [PATCH v4 RESEND] x86/asm/entry/32, selftests: Add  'test_syscall_vdso' test Ingo Molnar <mingo@kernel.org> - 2015-09-14 10:20 +0200
        Re: [PATCH v4 RESEND] x86/asm/entry/32, selftests: Add  'test_syscall_vdso' test Andy Lutomirski <luto@amacapital.net> - 2015-09-14 20:00 +0200
          Re: [PATCH v4 RESEND] x86/asm/entry/32, selftests: Add  'test_syscall_vdso' test Ingo Molnar <mingo@kernel.org> - 2015-09-15 08:10 +0200
            Re: [PATCH v4 RESEND] x86/asm/entry/32, selftests: Add  'test_syscall_vdso' test Andy Lutomirski <luto@amacapital.net> - 2015-09-15 20:20 +0200
              Re: [PATCH v4 RESEND] x86/asm/entry/32, selftests: Add  'test_syscall_vdso' test Ingo Molnar <mingo@kernel.org> - 2015-09-16 12:00 +0200
  Re: [PATCH v4 RESEND] x86/asm/entry/32, selftests: Add  'test_syscall_vdso' test Ingo Molnar <mingo@kernel.org> - 2015-09-15 08:10 +0200

csiph-web