On Sat, Jul 01, 2017 at 10:44:43AM +0000, Maxime Villard wrote: > Module Name: src > Committed By: maxv > Date: Sat Jul 1 10:44:43 UTC 2017 > > Modified Files: > src/sys/arch/amd64/amd64: locore.S > src/sys/arch/i386/i386: locore.S machdep.c trap.c > > Log Message: > Remove the osyscall call gate on i386, and emulate it. There is a one- > instruction race in it that could panic the kernel.
Looking back at this -- can't we provide a user-readable/executable page and replace the call gate with a normal segment pointing to that page? So that osycall becomes a normal FAR CALL to a kernel provide routine that turns it into a normal system call. That has the advantage of not requiring special case logic in the trap handler and I want to move the direct system call logic out of libc in the near future, which requires the same infrastructure. Joerg