diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2008-01-30 07:34:07 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:34:07 -0500 |
commit | d7c8f21a8cad0228c7c5ce2bb6dbd95d1ee49d13 (patch) | |
tree | d1e305bec62022a0bec82a3499a372c2c7c40583 /drivers | |
parent | d1028a154c65d7fadd1b2d0276c077014d401ec7 (diff) |
x86: cpa: move flush to cpa
The set_memory_* and set_pages_* family of API's currently requires the
callers to do a global tlb flush after the function call; forgetting this is
a very nasty deathtrap. This patch moves the global tlb flush into
each of the callers
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/agp/ali-agp.c | 2 | ||||
-rw-r--r-- | drivers/char/agp/i460-agp.c | 2 | ||||
-rw-r--r-- | drivers/char/agp/intel-agp.c | 5 | ||||
-rw-r--r-- | drivers/video/vermilion/vermilion.c | 6 |
4 files changed, 0 insertions, 15 deletions
diff --git a/drivers/char/agp/ali-agp.c b/drivers/char/agp/ali-agp.c index aa5ddb716ffb..1ffb381130c3 100644 --- a/drivers/char/agp/ali-agp.c +++ b/drivers/char/agp/ali-agp.c | |||
@@ -145,7 +145,6 @@ static void *m1541_alloc_page(struct agp_bridge_data *bridge) | |||
145 | void *addr = agp_generic_alloc_page(agp_bridge); | 145 | void *addr = agp_generic_alloc_page(agp_bridge); |
146 | u32 temp; | 146 | u32 temp; |
147 | 147 | ||
148 | global_flush_tlb(); | ||
149 | if (!addr) | 148 | if (!addr) |
150 | return NULL; | 149 | return NULL; |
151 | 150 | ||
@@ -162,7 +161,6 @@ static void ali_destroy_page(void * addr, int flags) | |||
162 | if (flags & AGP_PAGE_DESTROY_UNMAP) { | 161 | if (flags & AGP_PAGE_DESTROY_UNMAP) { |
163 | global_cache_flush(); /* is this really needed? --hch */ | 162 | global_cache_flush(); /* is this really needed? --hch */ |
164 | agp_generic_destroy_page(addr, flags); | 163 | agp_generic_destroy_page(addr, flags); |
165 | global_flush_tlb(); | ||
166 | } else | 164 | } else |
167 | agp_generic_destroy_page(addr, flags); | 165 | agp_generic_destroy_page(addr, flags); |
168 | } | 166 | } |
diff --git a/drivers/char/agp/i460-agp.c b/drivers/char/agp/i460-agp.c index e72a83e2bad5..76f581c85a7d 100644 --- a/drivers/char/agp/i460-agp.c +++ b/drivers/char/agp/i460-agp.c | |||
@@ -527,7 +527,6 @@ static void *i460_alloc_page (struct agp_bridge_data *bridge) | |||
527 | 527 | ||
528 | if (I460_IO_PAGE_SHIFT <= PAGE_SHIFT) { | 528 | if (I460_IO_PAGE_SHIFT <= PAGE_SHIFT) { |
529 | page = agp_generic_alloc_page(agp_bridge); | 529 | page = agp_generic_alloc_page(agp_bridge); |
530 | global_flush_tlb(); | ||
531 | } else | 530 | } else |
532 | /* Returning NULL would cause problems */ | 531 | /* Returning NULL would cause problems */ |
533 | /* AK: really dubious code. */ | 532 | /* AK: really dubious code. */ |
@@ -539,7 +538,6 @@ static void i460_destroy_page (void *page, int flags) | |||
539 | { | 538 | { |
540 | if (I460_IO_PAGE_SHIFT <= PAGE_SHIFT) { | 539 | if (I460_IO_PAGE_SHIFT <= PAGE_SHIFT) { |
541 | agp_generic_destroy_page(page, flags); | 540 | agp_generic_destroy_page(page, flags); |
542 | global_flush_tlb(); | ||
543 | } | 541 | } |
544 | } | 542 | } |
545 | 543 | ||
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index c03a7143928f..189efb6ef970 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
@@ -212,11 +212,9 @@ static void *i8xx_alloc_pages(void) | |||
212 | 212 | ||
213 | if (set_pages_uc(page, 4) < 0) { | 213 | if (set_pages_uc(page, 4) < 0) { |
214 | set_pages_wb(page, 4); | 214 | set_pages_wb(page, 4); |
215 | global_flush_tlb(); | ||
216 | __free_pages(page, 2); | 215 | __free_pages(page, 2); |
217 | return NULL; | 216 | return NULL; |
218 | } | 217 | } |
219 | global_flush_tlb(); | ||
220 | get_page(page); | 218 | get_page(page); |
221 | atomic_inc(&agp_bridge->current_memory_agp); | 219 | atomic_inc(&agp_bridge->current_memory_agp); |
222 | return page_address(page); | 220 | return page_address(page); |
@@ -231,7 +229,6 @@ static void i8xx_destroy_pages(void *addr) | |||
231 | 229 | ||
232 | page = virt_to_page(addr); | 230 | page = virt_to_page(addr); |
233 | set_pages_wb(page, 4); | 231 | set_pages_wb(page, 4); |
234 | global_flush_tlb(); | ||
235 | put_page(page); | 232 | put_page(page); |
236 | __free_pages(page, 2); | 233 | __free_pages(page, 2); |
237 | atomic_dec(&agp_bridge->current_memory_agp); | 234 | atomic_dec(&agp_bridge->current_memory_agp); |
@@ -341,7 +338,6 @@ static struct agp_memory *alloc_agpphysmem_i8xx(size_t pg_count, int type) | |||
341 | 338 | ||
342 | switch (pg_count) { | 339 | switch (pg_count) { |
343 | case 1: addr = agp_bridge->driver->agp_alloc_page(agp_bridge); | 340 | case 1: addr = agp_bridge->driver->agp_alloc_page(agp_bridge); |
344 | global_flush_tlb(); | ||
345 | break; | 341 | break; |
346 | case 4: | 342 | case 4: |
347 | /* kludge to get 4 physical pages for ARGB cursor */ | 343 | /* kludge to get 4 physical pages for ARGB cursor */ |
@@ -404,7 +400,6 @@ static void intel_i810_free_by_type(struct agp_memory *curr) | |||
404 | else { | 400 | else { |
405 | agp_bridge->driver->agp_destroy_page(gart_to_virt(curr->memory[0]), | 401 | agp_bridge->driver->agp_destroy_page(gart_to_virt(curr->memory[0]), |
406 | AGP_PAGE_DESTROY_UNMAP); | 402 | AGP_PAGE_DESTROY_UNMAP); |
407 | global_flush_tlb(); | ||
408 | agp_bridge->driver->agp_destroy_page(gart_to_virt(curr->memory[0]), | 403 | agp_bridge->driver->agp_destroy_page(gart_to_virt(curr->memory[0]), |
409 | AGP_PAGE_DESTROY_FREE); | 404 | AGP_PAGE_DESTROY_FREE); |
410 | } | 405 | } |
diff --git a/drivers/video/vermilion/vermilion.c b/drivers/video/vermilion/vermilion.c index fb72778dee48..1c656667b937 100644 --- a/drivers/video/vermilion/vermilion.c +++ b/drivers/video/vermilion/vermilion.c | |||
@@ -124,13 +124,8 @@ static int vmlfb_alloc_vram_area(struct vram_area *va, unsigned max_order, | |||
124 | /* | 124 | /* |
125 | * Change caching policy of the linear kernel map to avoid | 125 | * Change caching policy of the linear kernel map to avoid |
126 | * mapping type conflicts with user-space mappings. | 126 | * mapping type conflicts with user-space mappings. |
127 | * The first global_flush_tlb() is really only there to do a global | ||
128 | * wbinvd(). | ||
129 | */ | 127 | */ |
130 | |||
131 | global_flush_tlb(); | ||
132 | set_pages_uc(virt_to_page(va->logical), va->size >> PAGE_SHIFT); | 128 | set_pages_uc(virt_to_page(va->logical), va->size >> PAGE_SHIFT); |
133 | global_flush_tlb(); | ||
134 | 129 | ||
135 | printk(KERN_DEBUG MODULE_NAME | 130 | printk(KERN_DEBUG MODULE_NAME |
136 | ": Allocated %ld bytes vram area at 0x%08lx\n", | 131 | ": Allocated %ld bytes vram area at 0x%08lx\n", |
@@ -156,7 +151,6 @@ static void vmlfb_free_vram_area(struct vram_area *va) | |||
156 | 151 | ||
157 | set_pages_wb(virt_to_page(va->logical), | 152 | set_pages_wb(virt_to_page(va->logical), |
158 | va->size >> PAGE_SHIFT); | 153 | va->size >> PAGE_SHIFT); |
159 | global_flush_tlb(); | ||
160 | 154 | ||
161 | /* | 155 | /* |
162 | * Decrease the usage count on the pages we've used | 156 | * Decrease the usage count on the pages we've used |