Re: Compat 32-bit syscall entry from 64-bit task!?

From: Linus Torvalds
Date: Wed Jan 25 2012 - 22:47:38 EST


On Wed, Jan 25, 2012 at 5:09 PM, Denys Vlasenko
<vda.linux@xxxxxxxxxxxxxx> wrote:
>
> Please look at strace source, get_scno() function, where
> it reads syscall no and parameters. Let's see....
> - POWERPC: has 32-bit and 64-bit mode
> - X86_64: has 32-bit and 64-bit mode
> - IA64: has i386-compat mode
> - ARM: has more than one ABI
> - SPARC: has 32-bit and 64-bit mode
>
> Do you want to re-invent a different arch-specific way to report
> syscall type for each of these arches?

I think an arch-specific one is better than trying to make some
generic one that is messy.

As you say, many architectures have multiple system call ABIs.

But they tend to be very *different* issues. They can be about
multiple ABI's, as you mention, and even when they *look* similar
(32-bit vs 64-bit ABI's) they are actually totally different issues.

On x86, the real issue is not so much "32-bit vs 64-bit" as "multiple
system call entry models", where a 64-bit process can use the system
call entry for a 32-bit one. That is not true on POWER, for example,
and trying to make it out to be the same issue only muddles the point,
and confuses things. It really is NOT AT ALL the same issue, even if
you can make it "look" like the same issue by calling it a 32-bit vs
64-bit thing.

So for POWER, it really is about the mode of the CPU/process. For x86,
it really isn't. Trying to equate the two is *wrong*.

I seriously think it's better to be architecture-specific than to be
that kind of totally confused, and try to "consolidate" the issue,
when they are actually two totally different issues.

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