summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2006-08-08 04:01:29 +0000
committeralc <alc@FreeBSD.org>2006-08-08 04:01:29 +0000
commitae9a521b0529c447bd5d6355a0690c7b2af3ad5c (patch)
tree804b07cb9adb495c5a9a32d9b2b62e50a6f12bd0 /sys/amd64
parente6ea7f8e9cea37abfe2f44afd8fe6125d1d59c1c (diff)
downloadFreeBSD-src-ae9a521b0529c447bd5d6355a0690c7b2af3ad5c.zip
FreeBSD-src-ae9a521b0529c447bd5d6355a0690c7b2af3ad5c.tar.gz
Pass VM_PROT_EXECUTE to vm_fault() instead of VM_PROT_READ if the page
fault was caused by an instruction fetch.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/trap.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index ebad9a0..1b6488f 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -566,8 +566,14 @@ trap_pfault(frame, usermode)
map = &vm->vm_map;
}
+ /*
+ * PGEX_I is defined only if the execute disable bit capability is
+ * supported and enabled; otherwise, that bit is reserved, i.e., zero.
+ */
if (frame->tf_err & PGEX_W)
ftype = VM_PROT_WRITE;
+ else if (frame->tf_err & PGEX_I)
+ ftype = VM_PROT_EXECUTE;
else
ftype = VM_PROT_READ;
OpenPOWER on IntegriCloud