Skip to contentSkip to conversation

Generic syscall ABI support

DISCUSSION Ley Foon Tan 4 participants 11 messages Mar 28, 2013 – Mar 29, 2013 Generic include/asm header files

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 6 lines · Ley Foon Tan

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

Quoted 8 lines

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

maintainer
#2 lore raw
Quoted 9 lines · H. Peter Anvin
Quoted 4 lines · Ley Foon Tan

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

#3 lore raw
Quoted 11 lines · Arnd Bergmann

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

maintainer
#4 lore raw
Quoted 2 lines · Ley Foon Tan

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

#5 lore raw
Quoted 9 lines · Arnd Bergmann
Quoted 2 lines · Ley Foon Tan

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

maintainer
#6 lore raw
Quoted 10 lines · Ley Foon Tan
Quoted 6 lines · Arnd Bergmann
Quoted 2 lines · Ley Foon Tan

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

#7 lore raw
Quoted 13 lines · Arnd Bergmann
Quoted 3 lines · Ley Foon Tan
Quoted 2 lines · Arnd Bergmann
Quoted 1 line · Ley Foon Tan

We will working on generic ABI for kernel and Glibc. This might

take

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

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?

Quoted 6 lines

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

#8 lore raw
Quoted 7 lines · Rob Landley

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

Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.
#9 lore raw
Quoted 6 lines · H. Peter Anvin
Quoted 5 lines · Rob Landley

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

Quoted 10 lines
Quoted 2 lines

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

maintainer
#10 lore raw
Quoted 10 lines · Ley Foon Tan
Quoted 1 line

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