SYSENTER/SYSCALL support

. add cpufeature detection of both
	. use it for both ipc and kernelcall traps, using a register
	  for call number
	. SYSENTER/SYSCALL does not save any context, therefore userland
	  has to save it
	. to accomodate multiple kernel entry/exit types, the entry
	  type is recorded in the process struct. hitherto all types
	  were interrupt (soft int, exception, hard int); now SYSENTER/SYSCALL
	  is new, with the difference that context is not fully restored
	  from proc struct when running the process again. this can't be
	  done as some information is missing.
	. complication: cases in which the kernel has to fully change
	  process context (i.e. sigreturn). in that case the exit type
	  is changed from SYSENTER/SYSEXIT to soft-int (i.e. iret) and
	  context is fully restored from the proc struct. this does mean
	  the PC and SP must change, as the sysenter/sysexit userland code
	  will otherwise try to restore its own context. this is true in the
	  sigreturn case.
	. override all usage by setting libc_ipc=1
This commit is contained in:
Ben Gras
2012-06-10 17:50:17 +00:00
parent 629829e69c
commit 2d72cbec41
38 changed files with 643 additions and 79 deletions

View File

@@ -49,7 +49,7 @@ int do_sigreturn(struct proc * caller, message * m_ptr)
#endif
/* Restore the registers. */
memcpy(&rp->p_reg, &sc.sc_regs, sizeof(sigregs));
arch_proc_setcontext(rp, &sc.sc_regs, 1);
#if defined(__i386__)
if(sc.sc_flags & MF_FPU_INITIALIZED)
{
@@ -60,8 +60,6 @@ int do_sigreturn(struct proc * caller, message * m_ptr)
}
#endif
rp->p_misc_flags |= MF_CONTEXT_SET;
return(OK);
}
#endif /* USE_SIGRETURN */

View File

@@ -174,6 +174,9 @@ int do_vmctl(struct proc * caller, message * m_ptr)
/* VM says: forget about old mappings we have cached. */
mem_clear_mapcache();
return OK;
case VMCTL_BOOTINHIBIT_CLEAR:
RTS_UNSET(p, RTS_BOOTINHIBIT);
return OK;
}
/* Try architecture-specific vmctls. */