[PATCH] uaccess: Add __copy_from_kernel_inatomic() primitive

From: Ingo Molnar
Date: Fri Apr 10 2015 - 05:22:09 EST

* Ingo Molnar <mingo@xxxxxxxxxx> wrote:

> Yeah, so what I missed here are those nops: placeholders for the
> STAC/CLAC instructions on x86... and this is what Linus mentioned
> about the clac() overhead.
> But this could be solved I think: by adding a
> copy_from_kernel_inatomic() primitive which simply leaves out the
> STAC/CLAC sequence: as these are always guaranteed to be kernel
> addresses, the SMAP fault should not be generated.

So the first step would be to introduce a generic
__copy_from_kernel_inatomic() primitive as attached below.

The next patch will implement efficient __copy_from_kernel_inatomic()
for x86.