2013-03-28 03:09:52

by Ley Foon Tan

[permalink] [raw]
Subject: Generic syscall ABI support

Need advise regarding the generic syscall ABI support.

We are planning to upstream our Nios II kernel (arch/nios2) to mainline.
But it doesn't support generic syscall ABI yet (It requires an updated
Glibc port as well).

The question is, is it a requirement for new arch to support generic
syscall ABI when upstreaming? Can we upstream a non-generic syscall ABI
first and migrate to generic syscall ABI in future?
Thanks.

Regards
LFTAN



2013-03-28 05:35:39

by H. Peter Anvin

[permalink] [raw]
Subject: Re: Generic syscall ABI support

On 03/27/2013 08:09 PM, Ley Foon Tan wrote:
> Need advise regarding the generic syscall ABI support.
>
> We are planning to upstream our Nios II kernel (arch/nios2) to mainline.
> But it doesn't support generic syscall ABI yet (It requires an updated
> Glibc port as well).
>
> The question is, is it a requirement for new arch to support generic
> syscall ABI when upstreaming? Can we upstream a non-generic syscall ABI
> first and migrate to generic syscall ABI in future?
> Thanks.
>
> Regards
> LFTAN
>

That would be extremely difficult.

In general, you should use the generic ABI for a new port unless you
have *very* strong and convincing reasons not to.

Given how long the Nios2 port has been in upstreaming (unfortunate, I
like to play with FPGAs ;) it seems worthwhile to adjust it before
pushing it.

-hpa

2013-03-28 07:44:34

by Arnd Bergmann

[permalink] [raw]
Subject: Re: Generic syscall ABI support

On Thursday 28 March 2013, H. Peter Anvin wrote:
> On 03/27/2013 08:09 PM, Ley Foon Tan wrote:

> > The question is, is it a requirement for new arch to support generic
> > syscall ABI when upstreaming? Can we upstream a non-generic syscall ABI
> > first and migrate to generic syscall ABI in future?
> > Thanks.
>
> In general, you should use the generic ABI for a new port unless you
> have very strong and convincing reasons not to.

Yes, absolutely. What a couple of the previous architectures have done is
to keep out of tree patches for their old ABI for a while, and to submit
only code that follows the generic ABI upstream. Usually it doesn't take
long for users to migrate to a new user space after that, but it gives
people a migration strategy. Normally you have other patches that are
required on top of the stuff that is already upstream while you are
getting everything merged, so this is not much different to a device
driver that needs to get rewritten to adapt to a new kernel subsystem.

Arnd

2013-03-28 08:32:26

by Ley Foon Tan

[permalink] [raw]
Subject: Re: Generic syscall ABI support

On Thu, 2013-03-28 at 07:44 +0000, Arnd Bergmann wrote:

> Yes, absolutely. What a couple of the previous architectures have done is
> to keep out of tree patches for their old ABI for a while, and to submit
> only code that follows the generic ABI upstream. Usually it doesn't take
> long for users to migrate to a new user space after that, but it gives
> people a migration strategy. Normally you have other patches that are
> required on top of the stuff that is already upstream while you are
> getting everything merged, so this is not much different to a device
> driver that needs to get rewritten to adapt to a new kernel subsystem.
>
> Arnd
>
Thanks for the reply.
We will working on generic ABI for kernel and Glibc. This might take
some times.

Regards
LFTAN

2013-03-28 10:40:24

by Arnd Bergmann

[permalink] [raw]
Subject: Re: Generic syscall ABI support

On Thursday 28 March 2013, Ley Foon Tan wrote:
> We will working on generic ABI for kernel and Glibc. This might take
> some times.

Ok. Don't let that hold you up from submitting the kernel patches
for review though.

Arnd

2013-03-28 11:31:01

by Ley Foon Tan

[permalink] [raw]
Subject: Re: Generic syscall ABI support

On Thu, 2013-03-28 at 10:40 +0000, Arnd Bergmann wrote:
> On Thursday 28 March 2013, Ley Foon Tan wrote:
> > We will working on generic ABI for kernel and Glibc. This might take
> > some times.
>
> Ok. Don't let that hold you up from submitting the kernel patches
> for review though.
>
> Arnd
>
Do you mean we can submit the patches for review before we got the
generic ABI support?

Regards
LFTAN

2013-03-28 11:42:57

by Arnd Bergmann

[permalink] [raw]
Subject: Re: Generic syscall ABI support

On Thursday 28 March 2013, Ley Foon Tan wrote:
> On Thu, 2013-03-28 at 10:40 +0000, Arnd Bergmann wrote:
> > On Thursday 28 March 2013, Ley Foon Tan wrote:
> > > We will working on generic ABI for kernel and Glibc. This might take
> > > some times.
> >
> > Ok. Don't let that hold you up from submitting the kernel patches
> > for review though.
>
> Do you mean we can submit the patches for review before we got the
> generic ABI support?

I mean you can send the other patches for review already. Changing
your implementtion to use the generic ABI will basically just mean
not sending the patches tht implement your own ABI, so that's not
hard. Of course until you also have a new glibc port, you won't be
able to test that it actually works, but that is not essential for
the reviewing stage.

Arnd

2013-03-29 04:41:43

by Rob Landley

[permalink] [raw]
Subject: Re: Generic syscall ABI support

On 03/28/2013 06:42:47 AM, Arnd Bergmann wrote:
> On Thursday 28 March 2013, Ley Foon Tan wrote:
> > On Thu, 2013-03-28 at 10:40 +0000, Arnd Bergmann wrote:
> > > On Thursday 28 March 2013, Ley Foon Tan wrote:
> > > > We will working on generic ABI for kernel and Glibc. This might
> take
> > > > some times.
> > >
> > > Ok. Don't let that hold you up from submitting the kernel patches
> > > for review though.
> >
> > Do you mean we can submit the patches for review before we got the
> > generic ABI support?
>
> I mean you can send the other patches for review already. Changing
> your implementtion to use the generic ABI will basically just mean
> not sending the patches tht implement your own ABI, so that's not
> hard. Of course until you also have a new glibc port, you won't be
> able to test that it actually works, but that is not essential for
> the reviewing stage.

You don't need a new glibc port, you need a new klibc or musl port.

http://www.openwall.com/lists/musl/2012/07/08/1

Way less work than getting glibc working for your basic smoketest...

Rob-

2013-03-29 04:54:09

by H. Peter Anvin

[permalink] [raw]
Subject: Re: Generic syscall ABI support

On 03/28/2013 09:41 PM, Rob Landley wrote:
>
> You don't need a new glibc port, you need a new klibc or musl port.
>
> http://www.openwall.com/lists/musl/2012/07/08/1
>
> Way less work than getting glibc working for your basic smoketest...
>

Good point. Average time to port klibc to a new architecture is about
four hours as long as the person porting knows the calling conventions
and assembly language involved.

-hpa


--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.

2013-03-29 10:05:14

by Ley Foon Tan

[permalink] [raw]
Subject: Re: Generic syscall ABI support

On Thu, 2013-03-28 at 21:53 -0700, H. Peter Anvin wrote:
> On 03/28/2013 09:41 PM, Rob Landley wrote:
> >
> > You don't need a new glibc port, you need a new klibc or musl port.
> >
> > http://www.openwall.com/lists/musl/2012/07/08/1
> >
> > Way less work than getting glibc working for your basic smoketest...
> >
>
> Good point. Average time to port klibc to a new architecture is about
> four hours as long as the person porting knows the calling conventions
> and assembly language involved.
>
> -hpa
>
>
Thanks for the suggestion.
Too bad we don't have in-house expert in klibc and musl port.

Hi HPA,
I knew you are the developer of klibc. Do you have any documentation to
port a new architecture and also how to replace glibc with klibc in
build?

By the way, klibc or musl is easier to port?
Thanks.

Regards
lftan

2013-03-29 10:43:00

by Arnd Bergmann

[permalink] [raw]
Subject: Re: Generic syscall ABI support

On Friday 29 March 2013, Ley Foon Tan wrote:
> >
> Thanks for the suggestion.
> Too bad we don't have in-house expert in klibc and musl port.
>
> Hi HPA,
> I knew you are the developer of klibc. Do you have any documentation to
> port a new architecture and also how to replace glibc with klibc in
> build?
>
> By the way, klibc or musl is easier to port?

I have no experience with musl, but klibc is probably the easiest to
port that you can find. Doing a new port doesn't require any prior
knowledge of klibc itself, the code is so small that any experienced
C programmer can understand it entirely in short time and do a new
port. However, it is also not meant as a general purpose libc or a
glibc replacement, as there is a very limited set of code that can use
it. It's certainly complete enough to test that the ABI itself is
working.

Arnd