Re: [BUG] perf: arch_perf_out_copy_user default

From: Will Deacon
Date: Wed Oct 30 2013 - 18:32:38 EST


Hi Peter,

On Wed, Oct 30, 2013 at 08:16:22PM +0000, Peter Zijlstra wrote:
> On Wed, Oct 30, 2013 at 08:50:28PM +0100, Frederic Weisbecker wrote:
> >
> > Would it make sense to rather make copy_from_user_nmi() to use a return value
> > pattern that is closer to those of the existing copy_from_user_*() ?
>
> Yeah we can do that I suppose; copy_form_user_nmi() actually uses
> __copy_from_user_inatomic() since about a week.
>
> Something like so I suppose.. please check, I'm in fail mode.
>
> It looks like DEFINE_OUTPUT_COPY() functions already returned the bytes
> not copied, and all its users appear to indeed expect that.
>
> ---
> arch/x86/kernel/cpu/perf_event.c | 4 ++--
> arch/x86/kernel/cpu/perf_event_intel_ds.c | 2 +-
> arch/x86/kernel/cpu/perf_event_intel_lbr.c | 2 +-
> arch/x86/lib/usercopy.c | 2 +-
> arch/x86/oprofile/backtrace.c | 4 ++--
> kernel/events/internal.h | 35 ++++++++++++++++++++++--------
> 6 files changed, 33 insertions(+), 16 deletions(-)

The core changes look good to me, and I've tested that this still produces
callchain information for ARM. It's odd that this worked so well before...

Acked-by: Will Deacon <will.deacon@xxxxxxx>

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