提交 0990b1c6 编写于 作者: P Peter Zijlstra 提交者: Ingo Molnar

x86: Add NMI types for kmap_atomic, fix

I just realized this has a kmap_atomic bug in...

The below would fix it - but it's complicating this code
some more.

Alternatively I would have to introduce something like
pte_offset_map_irq() which would make the irq/nmi detection and leave
the regular code paths alone, however that would mean either duplicating
the gup_fast() pagewalk or passing down a pte function pointer, which
would only duplicate the gup_pte_range() bit, neither is really
attractive ...
Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
CC: Nick Piggin <npiggin@suse.de>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 e2eae0f5
...@@ -19,11 +19,12 @@ D(7) KM_PTE0, ...@@ -19,11 +19,12 @@ D(7) KM_PTE0,
D(8) KM_PTE1, D(8) KM_PTE1,
D(9) KM_IRQ0, D(9) KM_IRQ0,
D(10) KM_IRQ1, D(10) KM_IRQ1,
D(11) KM_SOFTIRQ0, D(11) KM_IRQ_PTE,
D(12) KM_SOFTIRQ1, D(12) KM_SOFTIRQ0,
D(13) KM_NMI, D(13) KM_SOFTIRQ1,
D(14) KM_NMI_PTE, D(14) KM_NMI,
D(15) KM_TYPE_NR D(15) KM_NMI_PTE,
D(16) KM_TYPE_NR
}; };
#undef D #undef D
......
...@@ -49,7 +49,10 @@ extern void set_pmd_pfn(unsigned long, unsigned long, pgprot_t); ...@@ -49,7 +49,10 @@ extern void set_pmd_pfn(unsigned long, unsigned long, pgprot_t);
#endif #endif
#if defined(CONFIG_HIGHPTE) #if defined(CONFIG_HIGHPTE)
#define __KM_PTE (in_nmi() ? KM_NMI_PTE : KM_PTE0) #define __KM_PTE \
(in_nmi() ? KM_NMI_PTE : \
in_irq() ? KM_IRQ_PTE : \
KM_PTE0)
#define pte_offset_map(dir, address) \ #define pte_offset_map(dir, address) \
((pte_t *)kmap_atomic_pte(pmd_page(*(dir)), __KM_PTE) + \ ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)), __KM_PTE) + \
pte_index((address))) pte_index((address)))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册