Re: [RFC PATCH 1/9] uaccess: Make copy_from_user_nmi() globallyavailable

From: Peter Zijlstra
Date: Wed Oct 13 2010 - 03:16:38 EST


On Wed, 2010-10-13 at 07:06 +0200, Frederic Weisbecker wrote:
> In order to support user stack dump safely in perf samples from
> generic code, export copy_from_user_nmi() from x86 and make it
> generally available. For most archs it will map to
> copy_from_user_inatomic, but for x86 we need to take care of
> not faulting from NMIs.
>
> Since perf is the first user for now, let the overriden x86
> implementation in the perf source file.

It might make sense to call it copy_from_user_gup() because that's
bascially what it does, it doesn't rely on NMI context anymore, its just
NMI-safe.

Its a best effort software page table walk, and with the stacked
kmap_atomic bits Andrew took it should work from any context.


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