Re: [PATCH] Add prctl to change endian of a task

From: Anton Blanchard
Date: Mon Apr 03 2006 - 18:39:58 EST



Hi,

> Abuse is a possible problem but you can deal with that. If you don't
> inherit endian changes then the problem doesn't occur. If you must
> inherit them then drop the inheritance when an suid/sgid exec occurs as
> we do with some other properties.

Yeah dropping it on exec makes sense to me.

> Can you explain however why you can't do this simply by using a binary
> magic number in the executable to indicate which endian it is, or do you
> really need to flip it ?

The aim is not to implement little endian binaries but to assist
running portions of code in little endian mode. The thought is we could
hook up qemu to it and avoid having to byteswap.

While ppc has byteswap integer loads it does not have byteswap floating
point loads and a byteswap involves loading into the integer unit,
performing the byteswap, storing to a temporary location and loading
into the floating point unit. Rather slow.

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