diff options
-rw-r--r-- | arch/arm/mm/highmem.c | 3 | ||||
-rw-r--r-- | arch/frv/mm/highmem.c | 3 | ||||
-rw-r--r-- | arch/mips/mm/highmem.c | 3 | ||||
-rw-r--r-- | arch/mn10300/include/asm/highmem.h | 4 | ||||
-rw-r--r-- | arch/powerpc/mm/highmem.c | 4 | ||||
-rw-r--r-- | arch/sparc/mm/highmem.c | 4 | ||||
-rw-r--r-- | arch/tile/mm/highmem.c | 3 | ||||
-rw-r--r-- | arch/x86/mm/highmem_32.c | 3 | ||||
-rw-r--r-- | arch/x86/mm/iomap_32.c | 3 | ||||
-rw-r--r-- | include/linux/highmem.h | 5 |
10 files changed, 26 insertions, 9 deletions
diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c index c00f119babbf..c435fd9e1da9 100644 --- a/arch/arm/mm/highmem.c +++ b/arch/arm/mm/highmem.c | |||
@@ -89,7 +89,7 @@ void __kunmap_atomic(void *kvaddr) | |||
89 | int idx, type; | 89 | int idx, type; |
90 | 90 | ||
91 | if (kvaddr >= (void *)FIXADDR_START) { | 91 | if (kvaddr >= (void *)FIXADDR_START) { |
92 | type = kmap_atomic_idx_pop(); | 92 | type = kmap_atomic_idx(); |
93 | idx = type + KM_TYPE_NR * smp_processor_id(); | 93 | idx = type + KM_TYPE_NR * smp_processor_id(); |
94 | 94 | ||
95 | if (cache_is_vivt()) | 95 | if (cache_is_vivt()) |
@@ -101,6 +101,7 @@ void __kunmap_atomic(void *kvaddr) | |||
101 | #else | 101 | #else |
102 | (void) idx; /* to kill a warning */ | 102 | (void) idx; /* to kill a warning */ |
103 | #endif | 103 | #endif |
104 | kmap_atomic_idx_pop(); | ||
104 | } else if (vaddr >= PKMAP_ADDR(0) && vaddr < PKMAP_ADDR(LAST_PKMAP)) { | 105 | } else if (vaddr >= PKMAP_ADDR(0) && vaddr < PKMAP_ADDR(LAST_PKMAP)) { |
105 | /* this address was obtained through kmap_high_get() */ | 106 | /* this address was obtained through kmap_high_get() */ |
106 | kunmap_high(pte_page(pkmap_page_table[PKMAP_NR(vaddr)])); | 107 | kunmap_high(pte_page(pkmap_page_table[PKMAP_NR(vaddr)])); |
diff --git a/arch/frv/mm/highmem.c b/arch/frv/mm/highmem.c index 61088dcc1594..fd7fcd4c2e33 100644 --- a/arch/frv/mm/highmem.c +++ b/arch/frv/mm/highmem.c | |||
@@ -68,7 +68,7 @@ EXPORT_SYMBOL(__kmap_atomic); | |||
68 | 68 | ||
69 | void __kunmap_atomic(void *kvaddr) | 69 | void __kunmap_atomic(void *kvaddr) |
70 | { | 70 | { |
71 | int type = kmap_atomic_idx_pop(); | 71 | int type = kmap_atomic_idx(); |
72 | switch (type) { | 72 | switch (type) { |
73 | case 0: __kunmap_atomic_primary(4, 6); break; | 73 | case 0: __kunmap_atomic_primary(4, 6); break; |
74 | case 1: __kunmap_atomic_primary(5, 7); break; | 74 | case 1: __kunmap_atomic_primary(5, 7); break; |
@@ -83,6 +83,7 @@ void __kunmap_atomic(void *kvaddr) | |||
83 | default: | 83 | default: |
84 | BUG(); | 84 | BUG(); |
85 | } | 85 | } |
86 | kmap_atomic_idx_pop(); | ||
86 | pagefault_enable(); | 87 | pagefault_enable(); |
87 | } | 88 | } |
88 | EXPORT_SYMBOL(__kunmap_atomic); | 89 | EXPORT_SYMBOL(__kunmap_atomic); |
diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c index 1e69b1fb4b85..3634c7ea06ac 100644 --- a/arch/mips/mm/highmem.c +++ b/arch/mips/mm/highmem.c | |||
@@ -74,7 +74,7 @@ void __kunmap_atomic(void *kvaddr) | |||
74 | return; | 74 | return; |
75 | } | 75 | } |
76 | 76 | ||
77 | type = kmap_atomic_idx_pop(); | 77 | type = kmap_atomic_idx(); |
78 | #ifdef CONFIG_DEBUG_HIGHMEM | 78 | #ifdef CONFIG_DEBUG_HIGHMEM |
79 | { | 79 | { |
80 | int idx = type + KM_TYPE_NR * smp_processor_id(); | 80 | int idx = type + KM_TYPE_NR * smp_processor_id(); |
@@ -89,6 +89,7 @@ void __kunmap_atomic(void *kvaddr) | |||
89 | local_flush_tlb_one(vaddr); | 89 | local_flush_tlb_one(vaddr); |
90 | } | 90 | } |
91 | #endif | 91 | #endif |
92 | kmap_atomic_idx_pop(); | ||
92 | pagefault_enable(); | 93 | pagefault_enable(); |
93 | } | 94 | } |
94 | EXPORT_SYMBOL(__kunmap_atomic); | 95 | EXPORT_SYMBOL(__kunmap_atomic); |
diff --git a/arch/mn10300/include/asm/highmem.h b/arch/mn10300/include/asm/highmem.h index f577ba2268ca..e2155e686451 100644 --- a/arch/mn10300/include/asm/highmem.h +++ b/arch/mn10300/include/asm/highmem.h | |||
@@ -101,7 +101,7 @@ static inline void __kunmap_atomic(unsigned long vaddr) | |||
101 | return; | 101 | return; |
102 | } | 102 | } |
103 | 103 | ||
104 | type = kmap_atomic_idx_pop(); | 104 | type = kmap_atomic_idx(); |
105 | 105 | ||
106 | #if HIGHMEM_DEBUG | 106 | #if HIGHMEM_DEBUG |
107 | { | 107 | { |
@@ -119,6 +119,8 @@ static inline void __kunmap_atomic(unsigned long vaddr) | |||
119 | __flush_tlb_one(vaddr); | 119 | __flush_tlb_one(vaddr); |
120 | } | 120 | } |
121 | #endif | 121 | #endif |
122 | |||
123 | kmap_atomic_idx_pop(); | ||
122 | pagefault_enable(); | 124 | pagefault_enable(); |
123 | } | 125 | } |
124 | #endif /* __KERNEL__ */ | 126 | #endif /* __KERNEL__ */ |
diff --git a/arch/powerpc/mm/highmem.c b/arch/powerpc/mm/highmem.c index b0848b462bbc..e7450bdbe83a 100644 --- a/arch/powerpc/mm/highmem.c +++ b/arch/powerpc/mm/highmem.c | |||
@@ -62,7 +62,7 @@ void __kunmap_atomic(void *kvaddr) | |||
62 | return; | 62 | return; |
63 | } | 63 | } |
64 | 64 | ||
65 | type = kmap_atomic_idx_pop(); | 65 | type = kmap_atomic_idx(); |
66 | 66 | ||
67 | #ifdef CONFIG_DEBUG_HIGHMEM | 67 | #ifdef CONFIG_DEBUG_HIGHMEM |
68 | { | 68 | { |
@@ -79,6 +79,8 @@ void __kunmap_atomic(void *kvaddr) | |||
79 | local_flush_tlb_page(NULL, vaddr); | 79 | local_flush_tlb_page(NULL, vaddr); |
80 | } | 80 | } |
81 | #endif | 81 | #endif |
82 | |||
83 | kmap_atomic_idx_pop(); | ||
82 | pagefault_enable(); | 84 | pagefault_enable(); |
83 | } | 85 | } |
84 | EXPORT_SYMBOL(__kunmap_atomic); | 86 | EXPORT_SYMBOL(__kunmap_atomic); |
diff --git a/arch/sparc/mm/highmem.c b/arch/sparc/mm/highmem.c index 5e50c09b7dce..4730eac0747b 100644 --- a/arch/sparc/mm/highmem.c +++ b/arch/sparc/mm/highmem.c | |||
@@ -75,7 +75,7 @@ void __kunmap_atomic(void *kvaddr) | |||
75 | return; | 75 | return; |
76 | } | 76 | } |
77 | 77 | ||
78 | type = kmap_atomic_idx_pop(); | 78 | type = kmap_atomic_idx(); |
79 | 79 | ||
80 | #ifdef CONFIG_DEBUG_HIGHMEM | 80 | #ifdef CONFIG_DEBUG_HIGHMEM |
81 | { | 81 | { |
@@ -104,6 +104,8 @@ void __kunmap_atomic(void *kvaddr) | |||
104 | #endif | 104 | #endif |
105 | } | 105 | } |
106 | #endif | 106 | #endif |
107 | |||
108 | kmap_atomic_idx_pop(); | ||
107 | pagefault_enable(); | 109 | pagefault_enable(); |
108 | } | 110 | } |
109 | EXPORT_SYMBOL(__kunmap_atomic); | 111 | EXPORT_SYMBOL(__kunmap_atomic); |
diff --git a/arch/tile/mm/highmem.c b/arch/tile/mm/highmem.c index 8ef6595e162c..abb57331cf6e 100644 --- a/arch/tile/mm/highmem.c +++ b/arch/tile/mm/highmem.c | |||
@@ -241,7 +241,7 @@ void __kunmap_atomic(void *kvaddr) | |||
241 | pte_t pteval = *pte; | 241 | pte_t pteval = *pte; |
242 | int idx, type; | 242 | int idx, type; |
243 | 243 | ||
244 | type = kmap_atomic_idx_pop(); | 244 | type = kmap_atomic_idx(); |
245 | idx = type + KM_TYPE_NR*smp_processor_id(); | 245 | idx = type + KM_TYPE_NR*smp_processor_id(); |
246 | 246 | ||
247 | /* | 247 | /* |
@@ -252,6 +252,7 @@ void __kunmap_atomic(void *kvaddr) | |||
252 | BUG_ON(!pte_present(pteval) && !pte_migrating(pteval)); | 252 | BUG_ON(!pte_present(pteval) && !pte_migrating(pteval)); |
253 | kmap_atomic_unregister(pte_page(pteval), vaddr); | 253 | kmap_atomic_unregister(pte_page(pteval), vaddr); |
254 | kpte_clear_flush(pte, vaddr); | 254 | kpte_clear_flush(pte, vaddr); |
255 | kmap_atomic_idx_pop(); | ||
255 | } else { | 256 | } else { |
256 | /* Must be a lowmem page */ | 257 | /* Must be a lowmem page */ |
257 | BUG_ON(vaddr < PAGE_OFFSET); | 258 | BUG_ON(vaddr < PAGE_OFFSET); |
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c index d723e369003c..b49962662101 100644 --- a/arch/x86/mm/highmem_32.c +++ b/arch/x86/mm/highmem_32.c | |||
@@ -74,7 +74,7 @@ void __kunmap_atomic(void *kvaddr) | |||
74 | vaddr <= __fix_to_virt(FIX_KMAP_BEGIN)) { | 74 | vaddr <= __fix_to_virt(FIX_KMAP_BEGIN)) { |
75 | int idx, type; | 75 | int idx, type; |
76 | 76 | ||
77 | type = kmap_atomic_idx_pop(); | 77 | type = kmap_atomic_idx(); |
78 | idx = type + KM_TYPE_NR * smp_processor_id(); | 78 | idx = type + KM_TYPE_NR * smp_processor_id(); |
79 | 79 | ||
80 | #ifdef CONFIG_DEBUG_HIGHMEM | 80 | #ifdef CONFIG_DEBUG_HIGHMEM |
@@ -87,6 +87,7 @@ void __kunmap_atomic(void *kvaddr) | |||
87 | * attributes or becomes a protected page in a hypervisor. | 87 | * attributes or becomes a protected page in a hypervisor. |
88 | */ | 88 | */ |
89 | kpte_clear_flush(kmap_pte-idx, vaddr); | 89 | kpte_clear_flush(kmap_pte-idx, vaddr); |
90 | kmap_atomic_idx_pop(); | ||
90 | } | 91 | } |
91 | #ifdef CONFIG_DEBUG_HIGHMEM | 92 | #ifdef CONFIG_DEBUG_HIGHMEM |
92 | else { | 93 | else { |
diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c index 75a3d7f24a2c..7b179b499fa3 100644 --- a/arch/x86/mm/iomap_32.c +++ b/arch/x86/mm/iomap_32.c | |||
@@ -98,7 +98,7 @@ iounmap_atomic(void __iomem *kvaddr) | |||
98 | vaddr <= __fix_to_virt(FIX_KMAP_BEGIN)) { | 98 | vaddr <= __fix_to_virt(FIX_KMAP_BEGIN)) { |
99 | int idx, type; | 99 | int idx, type; |
100 | 100 | ||
101 | type = kmap_atomic_idx_pop(); | 101 | type = kmap_atomic_idx(); |
102 | idx = type + KM_TYPE_NR * smp_processor_id(); | 102 | idx = type + KM_TYPE_NR * smp_processor_id(); |
103 | 103 | ||
104 | #ifdef CONFIG_DEBUG_HIGHMEM | 104 | #ifdef CONFIG_DEBUG_HIGHMEM |
@@ -111,6 +111,7 @@ iounmap_atomic(void __iomem *kvaddr) | |||
111 | * attributes or becomes a protected page in a hypervisor. | 111 | * attributes or becomes a protected page in a hypervisor. |
112 | */ | 112 | */ |
113 | kpte_clear_flush(kmap_pte-idx, vaddr); | 113 | kpte_clear_flush(kmap_pte-idx, vaddr); |
114 | kmap_atomic_idx_pop(); | ||
114 | } | 115 | } |
115 | 116 | ||
116 | pagefault_enable(); | 117 | pagefault_enable(); |
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 102f76be90da..e9138198e823 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -88,6 +88,11 @@ static inline int kmap_atomic_idx_push(void) | |||
88 | return idx; | 88 | return idx; |
89 | } | 89 | } |
90 | 90 | ||
91 | static inline int kmap_atomic_idx(void) | ||
92 | { | ||
93 | return __get_cpu_var(__kmap_atomic_idx) - 1; | ||
94 | } | ||
95 | |||
91 | static inline int kmap_atomic_idx_pop(void) | 96 | static inline int kmap_atomic_idx_pop(void) |
92 | { | 97 | { |
93 | int idx = --__get_cpu_var(__kmap_atomic_idx); | 98 | int idx = --__get_cpu_var(__kmap_atomic_idx); |