From 5e50de7e2e9dfb16594352263a435b418d0d2556 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sat, 11 Oct 2008 18:12:10 +0000 Subject: [PATCH] Don't disable interrupts in flush_tmap() and map_iospace_chunk(), just pin the thread to the current CPU. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27975 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/arch/x86/arch_vm_translation_map.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/system/kernel/arch/x86/arch_vm_translation_map.cpp b/src/system/kernel/arch/x86/arch_vm_translation_map.cpp index 06f638ddca..731f03274d 100644 --- a/src/system/kernel/arch/x86/arch_vm_translation_map.cpp +++ b/src/system/kernel/arch/x86/arch_vm_translation_map.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -648,12 +649,11 @@ clear_flags_tmap(vm_translation_map *map, addr_t va, uint32 flags) static void flush_tmap(vm_translation_map *map) { - cpu_status state; - if (map->arch_data->num_invalidate_pages <= 0) return; - state = disable_interrupts(); + struct thread* thread = thread_get_current_thread(); + thread_pin_to_current_cpu(thread); if (map->arch_data->num_invalidate_pages > PAGE_INVALIDATE_CACHE_SIZE) { // invalidate all pages @@ -701,7 +701,7 @@ flush_tmap(vm_translation_map *map) } map->arch_data->num_invalidate_pages = 0; - restore_interrupts(state); + thread_unpin_from_current_cpu(thread); } @@ -711,7 +711,6 @@ map_iospace_chunk(addr_t va, addr_t pa) int i; page_table_entry *pt; addr_t ppn; - int state; pa &= ~(B_PAGE_SIZE - 1); // make sure it's page aligned va &= ~(B_PAGE_SIZE - 1); // make sure it's page aligned @@ -729,12 +728,13 @@ map_iospace_chunk(addr_t va, addr_t pa) pt[i].global = 1; } - state = disable_interrupts(); + struct thread* thread = thread_get_current_thread(); + thread_pin_to_current_cpu(thread); arch_cpu_invalidate_TLB_range(va, va + (IOSPACE_CHUNK_SIZE - B_PAGE_SIZE)); smp_send_broadcast_ici(SMP_MSG_INVALIDATE_PAGE_RANGE, va, va + (IOSPACE_CHUNK_SIZE - B_PAGE_SIZE), 0, NULL, SMP_MSG_FLAG_SYNC); - restore_interrupts(state); + thread_unpin_from_current_cpu(thread); return B_OK; }