* 32 bit user space compatibility
@ 2014-10-26 12:25 Skidanov, Alexey
2014-10-28 22:34 ` One Thousand Gnomes
0 siblings, 1 reply; 3+ messages in thread
From: Skidanov, Alexey @ 2014-10-26 12:25 UTC (permalink / raw)
To: linux-kernel
Hi,
Running 32 bit user space needs some work to be done with ioctls. I understand that there are two options to implement:
1. Use only fixed size types. Pad IOCTLS params to multiple of 64 bits - simple; don't know if it covers all compatibility issues;
2. 32 bit compatibility layer (through compat_ioctl, just like many drivers in kernel implement) - just a little bit simple code with some translations; really covers all issues;
Which one is preferred by kernel community?
Thanks
Alexey
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: 32 bit user space compatibility
2014-10-26 12:25 32 bit user space compatibility Skidanov, Alexey
@ 2014-10-28 22:34 ` One Thousand Gnomes
2014-11-03 12:46 ` Yann Droneaud
0 siblings, 1 reply; 3+ messages in thread
From: One Thousand Gnomes @ 2014-10-28 22:34 UTC (permalink / raw)
To: Skidanov, Alexey; +Cc: linux-kernel
On Sun, 26 Oct 2014 12:25:08 +0000
"Skidanov, Alexey" <Alexey.Skidanov@amd.com> wrote:
> Hi,
>
> Running 32 bit user space needs some work to be done with ioctls. I understand that there are two options to implement:
> 1. Use only fixed size types. Pad IOCTLS params to multiple of 64 bits - simple; don't know if it covers all compatibility issues;
> 2. 32 bit compatibility layer (through compat_ioctl, just like many drivers in kernel implement) - just a little bit simple code with some translations; really covers all issues;
>
> Which one is preferred by kernel community?
You shouldn't need to pad paramters in most cases as platform alignment
rules are usually sane for 32 and 64bit. #1 is preferred. #2 exists
because 64bit appeared after Linux was designed so it wasn't designed in
from day one.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: 32 bit user space compatibility
2014-10-28 22:34 ` One Thousand Gnomes
@ 2014-11-03 12:46 ` Yann Droneaud
0 siblings, 0 replies; 3+ messages in thread
From: Yann Droneaud @ 2014-11-03 12:46 UTC (permalink / raw)
To: One Thousand Gnomes; +Cc: Skidanov, Alexey, linux-kernel, ydroneaud
Hi,
Le mardi 28 octobre 2014 à 22:34 +0000, One Thousand Gnomes a écrit :
> On Sun, 26 Oct 2014 12:25:08 +0000
> "Skidanov, Alexey" <Alexey.Skidanov@amd.com> wrote:
>
> > Running 32 bit user space needs some work to be done with ioctls. I understand that there are two options to implement:
> > 1. Use only fixed size types. Pad IOCTLS params to multiple of 64 bits - simple; don't know if it covers all compatibility issues;
> > 2. 32 bit compatibility layer (through compat_ioctl, just like many drivers in kernel implement) - just a little bit simple code with some translations; really covers all issues;
> >
> > Which one is preferred by kernel community?
>
> You shouldn't need to pad paramters in most cases as platform alignment
> rules are usually sane for 32 and 64bit.
In most case, except i386 (ia32) vs amd64 (x86_64): u64 are going to be
aligned on 4 bytes boundaries for 32bits ABI and 8 bytes boundaries for
64bits ABI.
I've tried to explained this issue in a lightning talk[1][2] I'd given
at Kernel Recipes[3] this year.
[1] http://opteya.com/talks/2014/kernel-recipes/lightning-talk-kernel-userspace-ABI/
[2] https://gitorious.org/opteya/talk-kernel-userspace-abi
[3] http://kernel.recipes/
Regards.
--
Yann Droneaud
OPTEYA
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-11-03 12:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-26 12:25 32 bit user space compatibility Skidanov, Alexey
2014-10-28 22:34 ` One Thousand Gnomes
2014-11-03 12:46 ` Yann Droneaud
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.