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


Groups > linux.kernel > #1324616

Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers

From Yury Norov <ynorov@caviumnetworks.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
Date 2016-02-02 21:50 +0100
Message-ID <qXQ3E-93-9@gated-at.bofh.it> (permalink)
References (4 earlier) <qXl9v-207-7@gated-at.bofh.it> <qXDJ7-7w3-5@gated-at.bofh.it> <qXLnl-55B-29@gated-at.bofh.it> <qXLGH-5wZ-37@gated-at.bofh.it> <qXPhg-7Yl-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Feb 02, 2016 at 08:54:34PM +0100, Heiko Carstens wrote:
> Hi Yury,
> 
> On Tue, Feb 02, 2016 at 05:08:26PM +0100, Heiko Carstens wrote:
> > See e.g. 485d52768685 ("sys_personality: change sys_personality() to accept
> > "unsigned int" instead of u_long") would have been a candidate which could
> > silently break architectures which need compat wrappers.
> 
> Ok, this example is of course wrong. But now I can claim that also somebody
> who should know better makes these mistakes.. :)
> 

Yep, this is a bad example. :) Moreover, this patch is coming from year 2010,
and it shows how stable the syscall ABI is.

> > > I don't know much about s390 specifics. Maybe because of that I do not
> > > understand completely your worries. I'm OK with both 1st and 2nd
> > > version, but I'd choose 2nd one because it allows inlines, and we
> > > don't need the compat_wrapper.c.
> > 
> > It would be only nicer if we can guarentee correctness all the time. That
> > being said I'm about to revert my own commit :)
> > 
> > So if you want to go without compat_wrapper.c then we should have a
> > solution which will do the right thing all the time without that a system
> > call author has to know about the sign and zero extension issue some
> > architectures face. It _will_ go wrong.
> 
> So I think I can summarize my point to: if you can enforce correctness, why
> shouldn't you do it if the performance impact is only a single instruction.

For aarch64 it's 5 instructions. But what's more important (if ever),
another wrapper takes another i-cache line...
        <compat_SyS_ftruncate>:
        stp     x29, x30, [sp,#-16]!
        mov     x29, sp
        bl      d40 <do_sys_ftruncate.constprop.3>
        ldp     x29, x30, [sp],#16
        ret

> 
> However I'll try to write an addon patch to your patch series. Maybe we can
> still get rid of compat_wrapper.c in a way which makes both of us happy.
> Also.. the idea with the alias names for compat wrappers does seem to have
> the disadvantage that it will pollute /proc/kallsyms for example.
> 
> Anyway, I'm not sure if I will be able to come up with something this week
> though.

Great, I'm looking forward...

My point is. Syscall ABI is so stable and so important that too much
people are involved in development and testing of it. So automatic
checks are almost useless, as all bugs will be found during
development and review. I think, community is able to pay enough
attention to review a couple of such patches per decade.
But I'm OK with some automatic checker, if it will be :
 - not too complicated, as complex code makes bugs by itself;
 - not too expensive;
 - not too ugly (my one is definitely ugly).

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


Thread

Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic  headers Heiko Carstens <heiko.carstens@de.ibm.com> - 2016-01-28 13:20 +0100
  Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic  headers Yury Norov <ynorov@caviumnetworks.com> - 2016-01-28 17:40 +0100
    Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic  headers Yury Norov <ynorov@caviumnetworks.com> - 2016-02-01 12:50 +0100
      Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic  headers Heiko Carstens <heiko.carstens@de.ibm.com> - 2016-02-02 08:40 +0100
        Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic  headers Yury Norov <ynorov@caviumnetworks.com> - 2016-02-02 16:50 +0100
          Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic  headers Heiko Carstens <heiko.carstens@de.ibm.com> - 2016-02-02 17:10 +0100
            Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic  headers Heiko Carstens <heiko.carstens@de.ibm.com> - 2016-02-02 21:00 +0100
              Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic  headers Yury Norov <ynorov@caviumnetworks.com> - 2016-02-02 21:50 +0100
                Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic  headers Heiko Carstens <heiko.carstens@de.ibm.com> - 2016-02-03 09:10 +0100

csiph-web