summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2011-08-28 23:30:43 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2011-08-28 23:30:43 +0200
commitf9d15f9c64abf8f3096e82a4a20133152423d305 (patch)
tree204cf6d0f36d4c5a8ba9c17d399f4908447c29e2
parente1299fa9fd5d4a001a640d438c4d3603f028fae9 (diff)
Skip kernel WP check on i486 and above
* i386/i386/i386asm.sym (machine_slot.sub_type): Define. * i386/i386/locore.S (copyout_retry): Skip if machine_slot[0].cpu_type > 3.
-rw-r--r--i386/i386/i386asm.sym2
-rw-r--r--i386/i386/locore.S5
2 files changed, 5 insertions, 2 deletions
diff --git a/i386/i386/i386asm.sym b/i386/i386/i386asm.sym
index b1670e8b..39dbcaf9 100644
--- a/i386/i386/i386asm.sym
+++ b/i386/i386/i386asm.sym
@@ -86,6 +86,8 @@ offset i386_interrupt_state i efl
offset i386_tss tss esp0
offset i386_tss tss ss0
+offset machine_slot sub_type cpu_type
+
expr I386_PGBYTES NBPG
expr VM_MIN_ADDRESS
expr VM_MAX_ADDRESS
diff --git a/i386/i386/locore.S b/i386/i386/locore.S
index 77ca05b7..29c77918 100644
--- a/i386/i386/locore.S
+++ b/i386/i386/locore.S
@@ -1290,11 +1290,12 @@ Entry(copyoutmsg)
/*
* Check whether user address space is writable
- * before writing to it - hardware is broken.
- * XXX only have to do this on 386's.
+ * before writing to it - i386 hardware is broken.
*/
copyout_retry:
#if !defined(MACH_HYP) && !PAE
+ cmpl $3,machine_slot+SUB_TYPE_CPU_TYPE
+ ja 0f /* Skip on i486 and above */
movl %cr3,%ecx /* point to page directory */
movl %edi,%eax /* get page directory bits */
shrl $(PDESHIFT),%eax /* from user address */