Subject: Re: linux-next: add utrace tree

From: Linus Torvalds <[email-masked]>
Date: Sat, 30 Jan 2010 09:59:28 -0800 (PST)

On Sat, 30 Jan 2010, Steven Rostedt wrote:
> 
> The kernel is limited to what instructions it can perform, no floating
> point for example (of course there are some exceptions).

Actually, the reason the kernel is limited to not performing floating 
point instructions is that teh kernel doesn't own the floating point 
register set - it's too big to save/restore, so the kernel leaves it 
alone.

But for emulating an instruction from user space, it would be perfectly 
fine to do an FP instruction in kernel space, since we're explicitly doing 
it on behalf of user space, and with user space owning it.

Of course, that would require that we _only_ touch the registers that user 
space wants us to touch, which is likely impossible in practice for 
anything but an execute-out-of-line model.

> But generally, the instructions in the kernel should be easier to 
> emulate than in userspace.

Yeah, we control the kernel instructions better, and we know what the 
environment is. For example, we never have to worry about vm86 mode or 
segments when we fix up kernel instructions, but user space can do 
anything, of course.

			Linus