32-bit syscalls from 64-bit process on x86-64?

From: Jeremy Fitzhardinge
Date: Thu Dec 02 2004 - 17:56:47 EST


Hi Andi,

Is it possible for a 64-bit process to invoke the 32-bit syscall
compatibility layer? I'm thinking this might be useful for Valgrind,
since if it is running on an x86-64 host, it can take advantage of
having more registers and a larger address space to do a better
emulation of plain ia32. But this is only practical if I can reuse the
kernel's 32-bit emulation layer, since duplicating it in Valgrind would
be silly (particularly ioctls).

>From a quick look at the code, it seems to me that int 0x80 might still
work in 64-bit mode, but connect to 32-bit syscalls. Is that right? If
not, could it be made to be right? Alternatively, something like adding
a constant offset to the syscall numbers would work for me (ie, 0-N are
64-bit syscalls, 0x10000-N are 32-bit). Hm, no, it looks like int 0x80
just calls normal 64-bit syscalls...

And does the 32-bit layer keep any private state? For example, if I
modify the signal state with 32-syscalls in one place, and 64-bit
syscalls elsewhere, will that cause a problem or inconsistencies?

Thanks,
J

-
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/