From 51bb720939567fa381c6a03839b51f9c80bc67ef Mon Sep 17 00:00:00 2001 From: marcel Date: Wed, 21 Oct 2009 18:38:02 +0000 Subject: o Introduce vm_sync_icache() for making the I-cache coherent with the memory or D-cache, depending on the semantics of the platform. vm_sync_icache() is basically a wrapper around pmap_sync_icache(), that translates the vm_map_t argumument to pmap_t. o Introduce pmap_sync_icache() to all PMAP implementation. For powerpc it replaces the pmap_page_executable() function, added to solve the I-cache problem in uiomove_fromphys(). o In proc_rwmem() call vm_sync_icache() when writing to a page that has execute permissions. This assures that when breakpoints are written, the I-cache will be coherent and the process will actually hit the breakpoint. o This also fixes the Book-E PMAP implementation that was missing necessary locking while trying to deal with the I-cache coherency in pmap_enter() (read: mmu_booke_enter_locked). The key property of this change is that the I-cache is made coherent *after* writes have been done. Doing it in the PMAP layer when adding or changing a mapping means that the I-cache is made coherent *before* any writes happen. The difference is key when the I-cache prefetches. --- sys/vm/vm_glue.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sys/vm/vm_glue.c') diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 851c733..8882565 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -309,6 +309,13 @@ vm_imgact_unmap_page(struct sf_buf *sf) vm_page_unlock_queues(); } +void +vm_sync_icache(vm_map_t map, vm_offset_t va, vm_offset_t sz) +{ + + pmap_sync_icache(map->pmap, va, sz); +} + struct kstack_cache_entry { vm_object_t ksobj; struct kstack_cache_entry *next_ks_entry; -- cgit v1.1