summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_process.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2009-10-21 18:38:02 +0000
committermarcel <marcel@FreeBSD.org>2009-10-21 18:38:02 +0000
commit51bb720939567fa381c6a03839b51f9c80bc67ef (patch)
tree9665f89431ede73407ae0ad11ebcc8198166085e /sys/kern/sys_process.c
parent5598d561ce3ef08a3a8c5d518ca09e28883ff050 (diff)
downloadFreeBSD-src-51bb720939567fa381c6a03839b51f9c80bc67ef.zip
FreeBSD-src-51bb720939567fa381c6a03839b51f9c80bc67ef.tar.gz
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.
Diffstat (limited to 'sys/kern/sys_process.c')
-rw-r--r--sys/kern/sys_process.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index b8803af..88a5b89 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -327,6 +327,10 @@ proc_rwmem(struct proc *p, struct uio *uio)
*/
error = uiomove_fromphys(&m, page_offset, len, uio);
+ /* Make the I-cache coherent for breakpoints. */
+ if (!error && writing && (out_prot & VM_PROT_EXECUTE))
+ vm_sync_icache(map, uva, len);
+
/*
* Release the page.
*/
OpenPOWER on IntegriCloud