diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-06-15 10:46:05 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-15 11:20:03 -0400 |
commit | 0990b1c65729012a63e0eeca93aaaafea4e9a064 (patch) | |
tree | 316801609bc0e7b0f8e2497d770ea9731c3ba620 /arch | |
parent | e2eae0f5605b90a0838608043c21050b08b6dd95 (diff) |
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: Peter 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: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/kmap_types.h | 11 | ||||
-rw-r--r-- | arch/x86/include/asm/pgtable_32.h | 5 |
2 files changed, 10 insertions, 6 deletions
diff --git a/arch/x86/include/asm/kmap_types.h b/arch/x86/include/asm/kmap_types.h index ff00a44b7d0..f8661384619 100644 --- a/arch/x86/include/asm/kmap_types.h +++ b/arch/x86/include/asm/kmap_types.h | |||
@@ -19,11 +19,12 @@ D(7) KM_PTE0, | |||
19 | D(8) KM_PTE1, | 19 | D(8) KM_PTE1, |
20 | D(9) KM_IRQ0, | 20 | D(9) KM_IRQ0, |
21 | D(10) KM_IRQ1, | 21 | D(10) KM_IRQ1, |
22 | D(11) KM_SOFTIRQ0, | 22 | D(11) KM_IRQ_PTE, |
23 | D(12) KM_SOFTIRQ1, | 23 | D(12) KM_SOFTIRQ0, |
24 | D(13) KM_NMI, | 24 | D(13) KM_SOFTIRQ1, |
25 | D(14) KM_NMI_PTE, | 25 | D(14) KM_NMI, |
26 | D(15) KM_TYPE_NR | 26 | D(15) KM_NMI_PTE, |
27 | D(16) KM_TYPE_NR | ||
27 | }; | 28 | }; |
28 | 29 | ||
29 | #undef D | 30 | #undef D |
diff --git a/arch/x86/include/asm/pgtable_32.h b/arch/x86/include/asm/pgtable_32.h index 85464971bca..01fd9461d32 100644 --- a/arch/x86/include/asm/pgtable_32.h +++ b/arch/x86/include/asm/pgtable_32.h | |||
@@ -49,7 +49,10 @@ extern void set_pmd_pfn(unsigned long, unsigned long, pgprot_t); | |||
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | #if defined(CONFIG_HIGHPTE) | 51 | #if defined(CONFIG_HIGHPTE) |
52 | #define __KM_PTE (in_nmi() ? KM_NMI_PTE : KM_PTE0) | 52 | #define __KM_PTE \ |
53 | (in_nmi() ? KM_NMI_PTE : \ | ||
54 | in_irq() ? KM_IRQ_PTE : \ | ||
55 | KM_PTE0) | ||
53 | #define pte_offset_map(dir, address) \ | 56 | #define pte_offset_map(dir, address) \ |
54 | ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)), __KM_PTE) + \ | 57 | ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)), __KM_PTE) + \ |
55 | pte_index((address))) | 58 | pte_index((address))) |