diff options
author | Roland McGrath <roland@gnu.org> | 2002-04-23 17:26:57 +0000 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2009-06-17 23:31:41 +0200 |
commit | 81ea15166f717f6bbecbb388582a1f4c35e884d9 (patch) | |
tree | 0826d322bba7b807668cb09f5cbcbdad747ea975 | |
parent | 4c02ba9306fb92968287cf974a857f02cd8a6882 (diff) |
2002-04-23 Roland McGrath <roland@frob.com>
* i386/i386/trap.c (user_trap): Change assert that user fault address
is below LINEAR_MIN_KERNEL_ADDRESS to allow for USER_GS:0 access too.
Reported by Jeroen Dekkers <jeroen@dekkers.cx>.
-rw-r--r-- | i386/i386/trap.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/i386/i386/trap.c b/i386/i386/trap.c index 653d66e7..c18adb05 100644 --- a/i386/i386/trap.c +++ b/i386/i386/trap.c @@ -51,6 +51,14 @@ #include <i386/io_emulate.h> +#if MULTIPROCESSOR +# include <i386/mp_desc.h> +# define user_thread_register \ + (mp_desc_table[cpu_number()]->user_thread_register) +#else +extern natural_t user_thread_register; +#endif + #include <oskit/gdb.h> #include <oskit/x86/pc/base_console.h> /* enable_gdb */ #include <oskit/x86/physmem.h> @@ -468,7 +476,11 @@ int user_trap(regs) printf("user page fault at linear address %08x\n", subcode); trap_dump (regs); #endif - assert(subcode < LINEAR_MIN_KERNEL_ADDRESS); + if (subcode >= LINEAR_MIN_KERNEL_ADDRESS) + /* This must be an access through the USER_GS segment. */ + assert (trunc_page(subcode) == + kvtolin(trunc_page(&user_thread_register))); + (void) vm_fault(thread->task->map, trunc_page((vm_offset_t)subcode), (regs->err & T_PF_WRITE) |