| From 7cf9cf9bcbd565845f10c9339decd2ddb0e247b4 Mon Sep 17 00:00:00 2001 |
| From: Peter Zijlstra <peterz@infradead.org> |
| Date: Fri, 27 Aug 2010 11:54:52 +0200 |
| Subject: [PATCH] perf: Use kmap_atomic_direct |
| |
| commit ddeca6231cbdebd0fa0f1bac816f1e1e6eae485b in tip. |
| |
| -rt falls back to regular kmap to provide preemptible kmap_atomic, which |
| is fine, except that the perf PMI does actually run from NMI context. |
| |
| Use the kmap_atomic_direct() API which still provides the old, really |
| atomic kmap functionality regardless of PREEMPT_RT, previously only used |
| for paravirt stuffs. |
| |
| Reported-by: "Sydir, Jerry" <jerry.sydir@intel.com> |
| Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> |
| Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| --- |
| arch/x86/kernel/cpu/perf_event.c | 4 ++-- |
| 1 files changed, 2 insertions(+), 2 deletions(-) |
| |
| diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c |
| index c5e8b53..8a618ad 100644 |
| --- a/arch/x86/kernel/cpu/perf_event.c |
| +++ b/arch/x86/kernel/cpu/perf_event.c |
| @@ -1621,9 +1621,9 @@ copy_from_user_nmi(void *to, const void __user *from, unsigned long n) |
| offset = addr & (PAGE_SIZE - 1); |
| size = min(PAGE_SIZE - offset, n - len); |
| |
| - map = kmap_atomic(page, type); |
| + map = kmap_atomic_direct(page, type); |
| memcpy(to, map+offset, size); |
| - kunmap_atomic(map, type); |
| + kunmap_atomic_direct(map, type); |
| put_page(page); |
| |
| len += size; |
| -- |
| 1.7.0.4 |
| |