freebsd-nq/sys/kern
Marcel Moolenaar f2c49dd248 Revamp of the syscall path, exception and context handling. The
prime objectives are:
o  Implement a syscall path based on the epc inststruction (see
   sys/ia64/ia64/syscall.s).
o  Revisit the places were we need to save and restore registers
   and define those contexts in terms of the register sets (see
   sys/ia64/include/_regset.h).

Secundairy objectives:
o  Remove the requirement to use contigmalloc for kernel stacks.
o  Better handling of the high FP registers for SMP systems.
o  Switch to the new cpu_switch() and cpu_throw() semantics.
o  Add a good unwinder to reconstruct contexts for the rare
   cases we need to (see sys/contrib/ia64/libuwx)

Many files are affected by this change. Functionally it boils
down to:
o  The EPC syscall doesn't preserve registers it does not need
   to preserve and places the arguments differently on the stack.
   This affects libc and truss.
o  The address of the kernel page directory (kptdir) had to
   be unstaticized for use by the nested TLB fault handler.
   The name has been changed to ia64_kptdir to avoid conflicts.
   The renaming affects libkvm.
o  The trapframe only contains the special registers and the
   scratch registers. For syscalls using the EPC syscall path
   no scratch registers are saved. This affects all places where
   the trapframe is accessed. Most notably the unaligned access
   handler, the signal delivery code and the debugger.
o  Context switching only partly saves the special registers
   and the preserved registers. This affects cpu_switch() and
   triggered the move to the new semantics, which additionally
   affects cpu_throw().
o  The high FP registers are either in the PCB or on some
   CPU. context switching for them is done lazily. This affects
   trap().
o  The mcontext has room for all registers, but not all of them
   have to be defined in all cases. This mostly affects signal
   delivery code now. The *context syscalls are as of yet still
   unimplemented.

Many details went into the removal of the requirement to use
contigmalloc for kernel stacks. The details are mostly CPU
specific and limited to exception_save() and exception_restore().
The few places where we create, destroy or switch stacks were
mostly simplified by not having to construct physical addresses
and additionally saving the virtual addresses for later use.

Besides more efficient context saving and restoring, which of
course yields a noticable speedup, this also fixes the dreaded
SMP bootup problem as a side-effect. The details of which are
still not fully understood.

This change includes all the necessary backward compatibility
code to have it handle older userland binaries that use the
break instruction for syscalls. Support for break-based syscalls
has been pessimized in favor of a clean implementation. Due to
the overall better performance of the kernel, this will still
be notived as an improvement if it's noticed at all.

Approved by: re@ (jhb)
2003-05-16 21:26:42 +00:00
..
bus_if.m Give print_child a default method. 2003-03-25 04:32:52 +00:00
clock_if.m
device_if.m
genassym.sh
imgact_aout.c
imgact_elf32.c
imgact_elf64.c
imgact_elf.c
imgact_gzip.c
imgact_shell.c
inflate.c
init_main.c - Merge struct procsig with struct sigacts. 2003-05-13 20:36:02 +00:00
init_sysent.c Regen. 2003-04-09 02:57:29 +00:00
kern_acct.c Instead of recording the Unix time in a process when it starts, record the 2003-05-01 16:59:23 +00:00
kern_acl.c
kern_alq.c
kern_clock.c Deprecate machine/limits.h in favor of new sys/limits.h. 2003-04-29 13:36:06 +00:00
kern_condvar.c - Merge struct procsig with struct sigacts. 2003-05-13 20:36:02 +00:00
kern_conf.c Since dynamic allocation of device major numbers so far have not 2003-04-13 15:27:49 +00:00
kern_context.c Add an argument to get_mcontext() which specified whether the 2003-04-25 01:50:30 +00:00
kern_descrip.c VOP_PATHCONF() requires a vnode lock; this patch adds locking to 2003-05-15 21:13:08 +00:00
kern_environment.c
kern_event.c Fix race between a process registering a NOTE_EXIT EVFILT_PROC event and 2003-04-12 01:57:04 +00:00
kern_exec.c - Merge struct procsig with struct sigacts. 2003-05-13 20:36:02 +00:00
kern_exit.c - Merge struct procsig with struct sigacts. 2003-05-13 20:36:02 +00:00
kern_fork.c - Merge struct procsig with struct sigacts. 2003-05-13 20:36:02 +00:00
kern_idle.c Move the flag that indicates an idle thread from the KSE to the thread. 2003-05-02 00:33:12 +00:00
kern_intr.c Move the flag that indicates an idle thread from the KSE to the thread. 2003-05-02 00:33:12 +00:00
kern_jail.c style(9) 2003-04-28 18:32:19 +00:00
kern_kse.c Revamp of the syscall path, exception and context handling. The 2003-05-16 21:26:42 +00:00
kern_kthread.c - Merge struct procsig with struct sigacts. 2003-05-13 20:36:02 +00:00
kern_ktr.c Move the flag that indicates an idle thread from the KSE to the thread. 2003-05-02 00:33:12 +00:00
kern_ktrace.c - Push down Giant around vnode operations in ktrace(). 2003-04-25 19:59:35 +00:00
kern_linker.c FreeBSD 5.0 has stopped shipping /modules 2.5 years ago. Catch 2003-03-03 22:53:35 +00:00
kern_lock.c Use the KTR_LOCK mask for logging events via KTR in lockmgr() rather 2003-03-11 20:00:37 +00:00
kern_lockf.c Deprecate machine/limits.h in favor of new sys/limits.h. 2003-04-29 13:36:06 +00:00
kern_mac.c Rename MAC_MAX_POLICIES to MAC_MAX_SLOTS, since the variables and 2003-05-08 19:49:42 +00:00
kern_malloc.c Don't pass NULL pointer to memset if we are compiled with DIAGNOSTIC 2003-05-12 05:09:56 +00:00
kern_mib.c Fix some easy, global, lint warnings. In most cases, this means 2003-04-30 12:57:40 +00:00
kern_module.c
kern_mtxpool.c
kern_mutex.c Use TD_IS_RUNNING() instead of thread_running() in the adaptive mutex 2003-04-17 22:28:58 +00:00
kern_ntptime.c
kern_physio.c Don't reinitialize fields that are already initialized by getpbuf(). 2003-04-05 23:02:58 +00:00
kern_poll.c Update netisr handling; Each SWI now registers its queue, and all queue 2003-03-04 23:19:55 +00:00
kern_proc.c - Merge struct procsig with struct sigacts. 2003-05-13 20:36:02 +00:00
kern_prot.c Remove Giant from the setuid(), seteuid(), setgid(), setegid(), 2003-05-01 21:21:42 +00:00
kern_resource.c Remove Giant from [gs]etpriority(). 2003-04-23 18:48:55 +00:00
kern_sema.c
kern_shutdown.c Lock the sched_lock while setting TDF_INPANIC. 2003-04-17 22:29:23 +00:00
kern_sig.c Fix long standing bug that prevents the PT_CONTINUE, PT_KILL and 2003-05-16 01:34:23 +00:00
kern_subr.c Tweak the clearing of TDF_DEADLKTREAT so that we only bother grabbing the 2003-05-05 21:27:29 +00:00
kern_switch.c Commit a partial lazy thread switch mechanism for i386. it isn't as lazy 2003-04-02 23:53:30 +00:00
kern_sx.c
kern_synch.c Revamp of the syscall path, exception and context handling. The 2003-05-16 21:26:42 +00:00
kern_syscalls.c
kern_sysctl.c Use a shorter and less redundant name for the sysctl tree lock. 2003-03-11 20:01:51 +00:00
kern_tc.c Including <sys/stdint.h> is (almost?) universally only to be able to use 2003-03-18 08:45:25 +00:00
kern_thr.c Revamp of the syscall path, exception and context handling. The 2003-05-16 21:26:42 +00:00
kern_thread.c Revamp of the syscall path, exception and context handling. The 2003-05-16 21:26:42 +00:00
kern_time.c In setitimer(2), if the it_value of the new itimer value is clear, then 2003-05-13 19:21:46 +00:00
kern_timeout.c
kern_umtx.c - Make casuptr return the old value of the location we're trying to update, 2003-04-02 08:02:27 +00:00
kern_uuid.c
kern_xxx.c
ksched.c
link_elf_obj.c Bail out if there were not two loadable sections. Add XXX comment about 2003-05-12 15:08:10 +00:00
link_elf.c Bail out if there were not two loadable sections. Add XXX comment about 2003-05-12 15:08:10 +00:00
linker_if.m
Make.tags.inc Finish driving a stake through the heart of netns and the associated 2003-03-05 19:24:24 +00:00
Makefile Finish driving a stake through the heart of netns and the associated 2003-03-05 19:24:24 +00:00
makesyscalls.sh - Include umtx.h in files generated by makesyscalls.sh 2003-04-01 01:12:24 +00:00
md4c.c
md5c.c Use le32dec() instead of le32toh() because we are not guaranteed to have 2003-05-05 07:22:35 +00:00
p1003_1b.c
posix4_mib.c
sched_4bsd.c Fix some easy, global, lint warnings. In most cases, this means 2003-04-30 12:57:40 +00:00
sched_ule.c Fix typo in last commit 2003-05-02 06:18:55 +00:00
subr_acl_posix1e.c
subr_autoconf.c
subr_blist.c
subr_bus.c Fix some easy, global, lint warnings. In most cases, this means 2003-04-30 12:57:40 +00:00
subr_clist.c
subr_clock.c
subr_devstat.c Unbreak vinum, iostat and systat on sparc64 by changing the devstat 2003-04-17 15:06:28 +00:00
subr_disk.c Don't include <sys/disklabel.h> 2003-04-16 20:57:35 +00:00
subr_eventhandler.c Rework the eventhandler locking for hopefully the last time. The scheme 2003-03-11 20:17:00 +00:00
subr_hints.c
subr_kobj.c
subr_log.c Gigacommit to improve device-driver source compatibility between 2003-03-03 12:15:54 +00:00
subr_mbuf.c Make the mb_alloc low-watermark sysctl-tunable read-only and make 2003-05-15 19:05:28 +00:00
subr_mchain.c
subr_module.c
subr_param.c
subr_pcpu.c
subr_power.c
subr_prf.c Don't assume that p_session hasn't changed out from under us after unlocking 2003-04-17 22:30:43 +00:00
subr_prof.c remove old and inaccurate XXX comment. 2003-05-02 01:02:20 +00:00
subr_rman.c
subr_rtc.c
subr_sbuf.c
subr_scanf.c Deprecate machine/limits.h in favor of new sys/limits.h. 2003-04-29 13:36:06 +00:00
subr_smp.c Move the _oncpu entry from the KSE to the thread. 2003-04-10 17:35:44 +00:00
subr_taskqueue.c Introduce a new taskqueue that runs completely free of Giant, and in 2003-02-26 03:15:42 +00:00
subr_trap.c - Merge struct procsig with struct sigacts. 2003-05-13 20:36:02 +00:00
subr_turnstile.c Use TD_IS_RUNNING() instead of thread_running() in the adaptive mutex 2003-04-17 22:28:58 +00:00
subr_witness.c Move the _oncpu entry from the KSE to the thread. 2003-04-10 17:35:44 +00:00
subr_xxx.c - Add vm_paddr_t, a physical address type. This is required for systems 2003-03-25 00:07:06 +00:00
sys_generic.c Deprecate machine/limits.h in favor of new sys/limits.h. 2003-04-29 13:36:06 +00:00
sys_pipe.c Need to hold the same SMP lock for (knote) list traversal as for 2003-04-02 15:24:50 +00:00
sys_process.c Push down Giant around calls to proc_rwmem() in kern_ptrace. kern_ptrace() 2003-04-25 20:02:16 +00:00
sys_socket.c Remove duplicate includes. 2003-02-20 03:26:11 +00:00
syscalls.c Regen. 2003-04-09 02:57:29 +00:00
syscalls.master o In struct prison, add an allprison linked list of prisons (protected 2003-04-09 02:55:18 +00:00
sysv_ipc.c
sysv_msg.c
sysv_sem.c Replace the at_fork, at_exec, and at_exit functions with the slightly more 2003-03-24 21:15:35 +00:00
sysv_shm.c Change the semantics of sysv shm emulation to take a additional 2003-05-05 09:22:58 +00:00
tty_compat.c
tty_conf.c
tty_cons.c Don't call make_dev() before we are ready for it. 2003-03-09 20:42:49 +00:00
tty_pty.c - Merge struct procsig with struct sigacts. 2003-05-13 20:36:02 +00:00
tty_subr.c
tty_tty.c Gigacommit to improve device-driver source compatibility between 2003-03-03 12:15:54 +00:00
tty.c p_sigignore moved into struct sigacts. move one which was missed. 2003-05-14 00:03:55 +00:00
uipc_accf.c
uipc_cow.c The data in an sf_buf should not be modified by the mbuf system. Mark 2003-04-11 07:02:36 +00:00
uipc_domain.c Fix a spelling error. 2003-03-07 22:47:32 +00:00
uipc_jumbo.c Lock the jumbo_vm_object when performing vm_page_alloc(). 2003-04-19 19:13:25 +00:00
uipc_mbuf2.c Move MAC label storage for mbufs into m_tags from the m_pkthdr structure, 2003-04-14 20:39:06 +00:00
uipc_mbuf.c Add another MBUF_STRESS_TEST feature, m_defragrandomfailures. 2003-04-15 02:14:43 +00:00
uipc_proto.c
uipc_sem.c Replace the at_fork, at_exec, and at_exit functions with the slightly more 2003-03-24 21:15:35 +00:00
uipc_sockbuf.c Fix some easy, global, lint warnings. In most cases, this means 2003-04-30 12:57:40 +00:00
uipc_socket2.c Fix some easy, global, lint warnings. In most cases, this means 2003-04-30 12:57:40 +00:00
uipc_socket.c Deprecate machine/limits.h in favor of new sys/limits.h. 2003-04-29 13:36:06 +00:00
uipc_syscalls.c Split sendit into two parts. The first part, still called sendit, that 2003-05-05 20:33:38 +00:00
uipc_usrreq.c s/discriptors/descriptors/ 2003-03-23 19:41:34 +00:00
vfs_acl.c
vfs_aio.c Deprecate machine/limits.h in favor of new sys/limits.h. 2003-04-29 13:36:06 +00:00
vfs_bio.c Finish the vm_object locking for this file, including holding the vm_object 2003-04-28 05:40:45 +00:00
vfs_cache.c Backout the getcwd changes, a more comprehensive effort will be needed. 2003-03-20 10:40:45 +00:00
vfs_cluster.c - Lock the vm_object when performing vm_object_pip_add(). 2003-04-20 07:29:50 +00:00
vfs_default.c Lock the vm_object when performing vm_pager_deallocate(). 2003-05-06 02:45:28 +00:00
vfs_export.c
vfs_extattr.c Deprecate machine/limits.h in favor of new sys/limits.h. 2003-04-29 13:36:06 +00:00
vfs_init.c
vfs_lookup.c
vfs_mount.c Free mount credentials (mnt_cred) when freeing the mount struct 2003-04-24 08:16:06 +00:00
vfs_subr.c Detect that a vnode has been reclaimed while vflush() was waiting to lock 2003-05-16 19:46:51 +00:00
vfs_syscalls.c Deprecate machine/limits.h in favor of new sys/limits.h. 2003-04-29 13:36:06 +00:00
vfs_vnops.c Deprecate machine/limits.h in favor of new sys/limits.h. 2003-04-29 13:36:06 +00:00
vnode_if.src