diff options
author | alc <alc@FreeBSD.org> | 2006-08-08 04:01:29 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2006-08-08 04:01:29 +0000 |
commit | ae9a521b0529c447bd5d6355a0690c7b2af3ad5c (patch) | |
tree | 804b07cb9adb495c5a9a32d9b2b62e50a6f12bd0 | |
parent | e6ea7f8e9cea37abfe2f44afd8fe6125d1d59c1c (diff) | |
download | FreeBSD-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.
-rw-r--r-- | sys/amd64/amd64/trap.c | 6 |
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; |