| From 311347f3adeaf9c32ac0a7b00ceaf345d0c58aa9 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> |
| |
| diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c |
| index 8c1c070..1f409ef 100644 |
| --- a/arch/x86/kernel/cpu/perf_event.c |
| +++ b/arch/x86/kernel/cpu/perf_event.c |
| @@ -2378,9 +2378,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.1.1 |
| |