summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/aim/uio_machdep.c
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2006-12-05 04:01:52 +0000
committergrehan <grehan@FreeBSD.org>2006-12-05 04:01:52 +0000
commit8d87f5baaa75c2a2b7056fbb972938279cee88f7 (patch)
tree3403144535091ef5fcdb4c1243c91d984e07d700 /sys/powerpc/aim/uio_machdep.c
parent4fdcb8965edb8a590b44f829b781bf01588c1b1e (diff)
downloadFreeBSD-src-8d87f5baaa75c2a2b7056fbb972938279cee88f7.zip
FreeBSD-src-8d87f5baaa75c2a2b7056fbb972938279cee88f7.tar.gz
Fix gdb issue where the i-cache was not being updated when a breakpoint
was written into a user's address space. The fix is to modify uiomove_fromphys to sync the icache when an executable user-space page is written into. Alan Cox suggested that there should probably be a higher-level interface to this in the ptrace code, but agreed that this is an OK short-term solution. Files changed: pmap.h - declaration of pmap_page_executable() pmap_dispatch.c - pass through the page_executable call to the mmu object mmu_oea.c - implement the page_executable method by examining the PTE_EXEC field in the vm_page_t uio_machdep.c - in uiomove_fromphys(), if the op was a UIO_WRITE to user-space, and if the page is executable, sync the icache since this is at the least a breakpoint-write from gdb. Reported by: marcel Tested by: marcel, grehan on g3+g4 Discussed with: alc MFC after: 2 weeks
Diffstat (limited to 'sys/powerpc/aim/uio_machdep.c')
-rw-r--r--sys/powerpc/aim/uio_machdep.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/powerpc/aim/uio_machdep.c b/sys/powerpc/aim/uio_machdep.c
index bd2f1b4..a52f729 100644
--- a/sys/powerpc/aim/uio_machdep.c
+++ b/sys/powerpc/aim/uio_machdep.c
@@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm.h>
#include <vm/vm_page.h>
+#include <machine/cpu.h>
#include <machine/vmparam.h>
/*
@@ -92,10 +93,13 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio)
uio_yield();
if (uio->uio_rw == UIO_READ)
error = copyout(cp, iov->iov_base, cnt);
- else
+ else
error = copyin(iov->iov_base, cp, cnt);
if (error)
goto out;
+ if (uio->uio_rw == UIO_WRITE &&
+ pmap_page_executable(ma[offset >> PAGE_SHIFT]))
+ __syncicache(cp, cnt);
break;
case UIO_SYSSPACE:
if (uio->uio_rw == UIO_READ)
OpenPOWER on IntegriCloud