kernel - Fix vkernel_trap
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 18 Jan 2010 20:05:17 +0000 (12:05 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 18 Jan 2010 20:05:17 +0000 (12:05 -0800)
commitbb47c0722753e42a01efa8ca923901cbad298cb4
tree039d13172633f6c50388bae6e5711cf26d86ae93
parent1c9602b3f188939350673789fd763f1c4c8251b6
kernel - Fix vkernel_trap

* vkernel_trap restores the trapframe for the original vkernel call to
  vmspace_ctl(), but only the syscall trap code was actually setting
  up the frame for a syscall-return.

  The other calls to vkernel_trap() (signal, page-fault, other traps)
  were not properly adjusting the frame for a syscall-return and it
  is only pure luck that it didn't bite us until now.

* Add a per-platform cpu_vkernel_trap() which does the syscall-return
  fixup at the end.

Reported-by: Antonio Huete Jimenez <tuxillo@quantumachine.net>
sys/platform/pc32/i386/trap.c
sys/platform/pc64/x86_64/trap.c
sys/platform/vkernel/i386/trap.c
sys/sys/systm.h
sys/sys/vkernel.h
sys/vm/vm_vmspace.c