The NetBSD Project

CVS log for src/sys/kern/kern_sig.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / kern

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.409 / (download) - annotate - [select for diffs], Sat Feb 10 09:24:18 2024 UTC (2 months ago) by andvar
Branch: MAIN
CVS Tags: HEAD
Changes since 1.408: +3 -3 lines
Diff to previous 1.408 (colored) to selected 1.161 (colored)

s/musn't/mustn't/ in comments.

Revision 1.408 / (download) - annotate - [select for diffs], Thu Oct 5 19:06:30 2023 UTC (6 months, 1 week ago) by ad
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation
Changes since 1.407: +4 -7 lines
Diff to previous 1.407 (colored) to selected 1.161 (colored)

kern_sig.c: remove problematic kernel_lock handling which is unneeded in 2023.

Revision 1.407 / (download) - annotate - [select for diffs], Wed Oct 4 20:42:38 2023 UTC (6 months, 1 week ago) by ad
Branch: MAIN
Changes since 1.406: +4 -2 lines
Diff to previous 1.406 (colored) to selected 1.161 (colored)

Sprinkle a bunch more calls to lwp_need_userret().  There should be no
functional change but it does get rid of a bunch of assumptions about how
mi_userret() works making it easier to adjust in that in the future, and
works as a kind of documentation too.

Revision 1.406 / (download) - annotate - [select for diffs], Wed Oct 4 20:29:18 2023 UTC (6 months, 1 week ago) by ad
Branch: MAIN
Changes since 1.405: +7 -6 lines
Diff to previous 1.405 (colored) to selected 1.161 (colored)

Eliminate l->l_biglocks.  Originally I think it had a use but these days a
local variable will do.

Revision 1.405 / (download) - annotate - [select for diffs], Sun Apr 9 09:18:09 2023 UTC (12 months, 1 week ago) by riastradh
Branch: MAIN
Changes since 1.404: +6 -4 lines
Diff to previous 1.404 (colored) to selected 1.161 (colored)

kern: KASSERT(A && B) -> KASSERT(A); KASSERT(B)

Revision 1.404 / (download) - annotate - [select for diffs], Sat Apr 9 23:38:33 2022 UTC (2 years ago) by riastradh
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Changes since 1.403: +4 -4 lines
Diff to previous 1.403 (colored) to selected 1.161 (colored)

sys: Use membar_release/acquire around reference drop.

This just goes through my recent reference count membar audit and
changes membar_exit to membar_release and membar_enter to
membar_acquire -- this should make everything cheaper on most CPUs
without hurting correctness, because membar_acquire is generally
cheaper than membar_enter.

Revision 1.403 / (download) - annotate - [select for diffs], Sat Mar 12 15:32:32 2022 UTC (2 years, 1 month ago) by riastradh
Branch: MAIN
Changes since 1.402: +4 -2 lines
Diff to previous 1.402 (colored) to selected 1.161 (colored)

sys: Membar audit around reference count releases.

If two threads are using an object that is freed when the reference
count goes to zero, we need to ensure that all memory operations
related to the object happen before freeing the object.

Using an atomic_dec_uint_nv(&refcnt) == 0 ensures that only one
thread takes responsibility for freeing, but it's not enough to
ensure that the other thread's memory operations happen before the
freeing.

Consider:

	  Thread A			  Thread B
	obj->foo = 42;			obj->baz = 73;
	mumble(&obj->bar);		grumble(&obj->quux);
	/* membar_exit(); */		/* membar_exit(); */
	atomic_dec -- not last		atomic_dec -- last
					/* membar_enter(); */
					KASSERT(invariant(obj->foo,
					    obj->bar));
					free_stuff(obj);

The memory barriers ensure that

	obj->foo = 42;
	mumble(&obj->bar);

in thread A happens before

	KASSERT(invariant(obj->foo, obj->bar));
	free_stuff(obj);

in thread B.  Without them, this ordering is not guaranteed.

So in general it is necessary to do

	membar_exit();
	if (atomic_dec_uint_nv(&obj->refcnt) != 0)
		return;
	membar_enter();

to release a reference, for the `last one out hit the lights' style
of reference counting.  (This is in contrast to the style where one
thread blocks new references and then waits under a lock for existing
ones to drain with a condvar -- no membar needed thanks to mutex(9).)

I searched for atomic_dec to find all these.  Obviously we ought to
have a better abstraction for this because there's so much copypasta.
This is a stop-gap measure to fix actual bugs until we have that.  It
would be nice if an abstraction could gracefully handle the different
styles of reference counting in use -- some years ago I drafted an
API for this, but making it cover everything got a little out of hand
(particularly with struct vnode::v_usecount) and I ended up setting
it aside to work on psref/localcount instead for better scalability.

I got bored of adding #ifdef __HAVE_ATOMIC_AS_MEMBAR everywhere, so I
only put it on things that look performance-critical on 5sec review.
We should really adopt membar_enter_preatomic/membar_exit_postatomic
or something (except they are applicable only to atomic r/m/w, not to
atomic_load/store_*, making the naming annoying) and get rid of all
the ifdefs.

Revision 1.402 / (download) - annotate - [select for diffs], Wed Feb 23 21:54:41 2022 UTC (2 years, 1 month ago) by andvar
Branch: MAIN
Changes since 1.401: +3 -3 lines
Diff to previous 1.401 (colored) to selected 1.161 (colored)

fix various typos in comments, mainly immediatly/immediately/,
as well shared and recently fixed typos in OpenBSD code by Jonathan Grey.

Revision 1.401 / (download) - annotate - [select for diffs], Sat Feb 12 15:51:29 2022 UTC (2 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.400: +4 -4 lines
Diff to previous 1.400 (colored) to selected 1.161 (colored)

Add inline functions to manipulate the klists that link up knotes
via kn_selnext:

- klist_init()
- klist_fini()
- klist_insert()
- klist_remove()

These provide some API insulation from the implementation details of these
lists (but not completely; see vn_knote_attach() and vn_knote_detach()).
Currently just a wrapper around SLIST(9).

This will make it significantly easier to switch kn_selnext linkage
to a different kind of list.

Revision 1.400 / (download) - annotate - [select for diffs], Wed Oct 27 04:45:42 2021 UTC (2 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.399: +9 -6 lines
Diff to previous 1.399 (colored) to selected 1.161 (colored)

- In sendsig() and sigaction1(), don't hard-code signal trampoline
  versions.  Instead, use the version constants from <sys/signal.h>
  and automatically (and correctly) handle cases where multiple versions
  of a particular trampoline flavor exist.  Conditionalize support
  for sigcontext trampolines on __HAVE_STRUCT_SIGCONTEXT.
- aarch64 and amd64 don't use sigcontext natively, but do need to
  support it for 32-bit compatibility; define __HAVE_STRUCT_SIGCONTEXT
  conditionally on _KERNEL.

Revision 1.399 / (download) - annotate - [select for diffs], Sun Sep 26 17:34:19 2021 UTC (2 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.398: +3 -3 lines
Diff to previous 1.398 (colored) to selected 1.161 (colored)

sig_filtops is MPSAFE.

Revision 1.398 / (download) - annotate - [select for diffs], Sun Sep 26 01:16:10 2021 UTC (2 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.397: +3 -3 lines
Diff to previous 1.397 (colored) to selected 1.161 (colored)

Change the kqueue filterops::f_isfd field to filterops::f_flags, and
define a flag FILTEROP_ISFD that has the meaning of the prior f_isfd.
Field and flag name aligned with OpenBSD.

This does not constitute a functional or ABI change, as the field location
and size, and the value placed in that field, are the same as the previous
code, but we're bumping __NetBSD_Version__ so 3rd-party module source code
can adapt, as needed.

NetBSD 9.99.89

Revision 1.397 / (download) - annotate - [select for diffs], Sat Apr 3 11:19:11 2021 UTC (3 years ago) by simonb
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.396: +5 -2 lines
Diff to previous 1.396 (colored) to selected 1.161 (colored)

CTASSERT that NSIG <= 128.  There are many hard-coded assumptions that
there are <= 4 x 32bit signal mask bits.

Revision 1.396 / (download) - annotate - [select for diffs], Mon Jan 11 17:18:51 2021 UTC (3 years, 3 months ago) by skrll
Branch: MAIN
Branch point for: thorpej-cfargs
Changes since 1.395: +11 -11 lines
Diff to previous 1.395 (colored) to selected 1.161 (colored)

Trailing whitespace

Revision 1.395 / (download) - annotate - [select for diffs], Sun Nov 1 18:51:02 2020 UTC (3 years, 5 months ago) by pgoyette
Branch: MAIN
Changes since 1.394: +14 -6 lines
Diff to previous 1.394 (colored) to selected 1.161 (colored)

Separate the compat_netbsd32_coredump from the compat_netbsd32 and
coredump modules, into its own module.

Welcome to 7.99.75 !!!

Revision 1.394 / (download) - annotate - [select for diffs], Fri Oct 30 22:19:00 2020 UTC (3 years, 5 months ago) by christos
Branch: MAIN
Branch point for: thorpej-futex
Changes since 1.393: +6 -6 lines
Diff to previous 1.393 (colored) to selected 1.161 (colored)

fix indentation

Revision 1.393 / (download) - annotate - [select for diffs], Mon Oct 26 17:35:39 2020 UTC (3 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.392: +5 -4 lines
Diff to previous 1.392 (colored) to selected 1.161 (colored)

Depend directly on EXEC_ELF{32,64} to determine which versions of the coredump
code are available.

Revision 1.392 / (download) - annotate - [select for diffs], Tue Oct 20 13:16:26 2020 UTC (3 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.391: +4 -2 lines
Diff to previous 1.391 (colored) to selected 1.161 (colored)

Fix build for _LP64 machines that don't have COMPAT_NETBSD32 (alpha, ia64)

Revision 1.391 / (download) - annotate - [select for diffs], Mon Oct 19 19:33:02 2020 UTC (3 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.390: +25 -7 lines
Diff to previous 1.390 (colored) to selected 1.161 (colored)

Arrange so that no options COREDUMP and no options PTRACE work together.
Thanks to Paul Goyette for testing.

Revision 1.390 / (download) - annotate - [select for diffs], Sat May 23 23:42:43 2020 UTC (3 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.389: +38 -38 lines
Diff to previous 1.389 (colored) to selected 1.161 (colored)

Move proc_lock into the data segment.  It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.

Revision 1.389 / (download) - annotate - [select for diffs], Thu May 14 13:32:15 2020 UTC (3 years, 11 months ago) by kamil
Branch: MAIN
Changes since 1.388: +18 -12 lines
Diff to previous 1.388 (colored) to selected 1.161 (colored)

Introduce new ptrace(2) operations: PT_SET_SIGPASS and PT_GET_SIGPASS

They deliver the logic of bypassing selected signals directly to the
debuggee, without informing the debugger.

This can be used to implement the QPassSignals GDB/LLDB protocol.

This call can be useful to avoid signal races in ATF ptrace tests.

Revision 1.388 / (download) - annotate - [select for diffs], Thu May 7 20:02:34 2020 UTC (3 years, 11 months ago) by kamil
Branch: MAIN
Changes since 1.387: +4 -3 lines
Diff to previous 1.387 (colored) to selected 1.161 (colored)

On debugger attach to a prestarted process don't report SIGTRAP

Introduce PSL_TRACEDCHILD that indicates tracking of birth of a process.
A freshly forked process checks whether it is traced and if so, reports
SIGTRAP + TRAP_CHLD event to a debugger as a result of tracking forks-like
events. There is a time window when a debugger can attach to a newly
created process and receive SIGTRAP + TRAP_CHLD instead of SIGSTOP.

Fixes races in t_ptrace_wait* tests when a test hangs or misbehaves,
especially the ones reported in tracer_sysctl_lookup_without_duplicates.

Revision 1.387 / (download) - annotate - [select for diffs], Mon Apr 6 08:20:05 2020 UTC (4 years ago) by kamil
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh
Changes since 1.386: +4 -4 lines
Diff to previous 1.386 (colored) to selected 1.161 (colored)

Reintroduce struct proc::p_oppid

Relying on p_opptr is not safe as there is a race between:
 - spawner giving a birth to a child process and being killed
 - spawnee accessng p_opptr and reporting TRAP_CHLD

PR kern/54786 by Andreas Gustafsson

Revision 1.386 / (download) - annotate - [select for diffs], Sun Apr 5 20:53:17 2020 UTC (4 years ago) by christos
Branch: MAIN
Changes since 1.385: +15 -2 lines
Diff to previous 1.385 (colored) to selected 1.161 (colored)

- Untangle spawn_return by splitting it up to sub-functions.
- Merge the eventswitch parent notification code which was copied in two
  places (eventswitchchild)
- Fix bugs in the eventswitch parent notification code:
  1. p_slflags should be accessed holding both proc_lock and p->p_lock
  2. p->p_opptr can be NULL if the parent was PSL_CHTRACED and exited.

Fixes random crashes the posix_spawn_kill_spawner unit test which tried
to dereference a NULL pptr.

Revision 1.385 / (download) - annotate - [select for diffs], Thu Mar 26 21:25:26 2020 UTC (4 years ago) by ad
Branch: MAIN
Changes since 1.384: +3 -3 lines
Diff to previous 1.384 (colored) to selected 1.161 (colored)

sigpost(): check for LSZOMB, not l_refcnt == 0.

Revision 1.384 / (download) - annotate - [select for diffs], Sat Feb 1 02:23:23 2020 UTC (4 years, 2 months ago) by riastradh
Branch: MAIN
CVS Tags: is-mlppp-base, is-mlppp, ad-namecache-base3
Changes since 1.383: +3 -3 lines
Diff to previous 1.383 (colored) to selected 1.161 (colored)

Load struct fdfile::ff_file with atomic_load_consume.

Exceptions: when we're only testing whether it's there, not about to
dereference it.

Note: We do not use atomic_store_release to set it because the
preceding mutex_exit should be enough.

(That said, it's not clear the mutex_enter/exit is needed unless
refcnt > 0 already, in which case maybe it would be a win to switch
from the membar implied by mutex_enter to the membar implied by
atomic_store_release -- which I would generally expect to be much
cheaper.  And a little clearer without a long comment.)

Revision 1.383 / (download) - annotate - [select for diffs], Sat Feb 1 02:23:04 2020 UTC (4 years, 2 months ago) by riastradh
Branch: MAIN
Changes since 1.382: +3 -3 lines
Diff to previous 1.382 (colored) to selected 1.161 (colored)

Load struct filedesc::fd_dt with atomic_load_consume.

Exceptions: when fd_refcnt <= 1, or when holding fd_lock.

While here:

- Restore KASSERT(mutex_owned(&fdp->fd_lock)) in fd_unused.
  => This is used only in fd_close and fd_abort, where it holds.
- Move bounds check assertion in fd_putfile to where it matters.
- Store fd_dt with atomic_store_release.
- Move load of fd_dt under lock in knote_fdclose.
- Omit membar_consumer in fdesc_readdir.
  => atomic_load_consume serves the same purpose now.
  => Was needed only on alpha anyway.

Revision 1.382 / (download) - annotate - [select for diffs], Thu Jan 23 10:21:14 2020 UTC (4 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: ad-namecache-base2
Changes since 1.381: +5 -2 lines
Diff to previous 1.381 (colored) to selected 1.161 (colored)

PAX_SEGVGUARD doesn't seem to work properly in testing for me, but at least
make it not cause problems:

- Cover it with exec_lock so the updates are not racy.
- Using fileassoc is silly.  Just hang a pointer off the vnode.

Revision 1.381 / (download) - annotate - [select for diffs], Fri Dec 6 21:36:10 2019 UTC (4 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Changes since 1.380: +3 -2 lines
Diff to previous 1.380 (colored) to selected 1.161 (colored)

Make it possible to call mi_switch() and immediately switch to another CPU.
This seems to take about 3us on my Intel system.  Two changes required:

- Have the caller to mi_switch() be responsible for calling spc_lock().
- Avoid using l->l_cpu in mi_switch().

While here:

- Add a couple of calls to membar_enter()
- Have the idle LWP set itself to LSIDL, to match softint_thread().
- Remove unused return value from mi_switch().

Revision 1.380 / (download) - annotate - [select for diffs], Thu Nov 21 18:17:36 2019 UTC (4 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.379: +7 -5 lines
Diff to previous 1.379 (colored) to selected 1.161 (colored)

- lwp_need_userret(): only do it if ONPROC and !curlwp, and explain why.
- Use signotify() in a couple more places.

Revision 1.379 / (download) - annotate - [select for diffs], Wed Nov 20 19:37:53 2019 UTC (4 years, 4 months ago) by pgoyette
Branch: MAIN
Changes since 1.378: +18 -2 lines
Diff to previous 1.378 (colored) to selected 1.161 (colored)

Move all non-emulation-specific coredump code into the coredump module,
and remove all #ifdef COREDUMP conditional compilation.  Now, the
coredump module is completely separated from the emulation modules, and
they can all be independently loaded and unloaded.

Welcome to 9.99.18 !

Revision 1.378 / (download) - annotate - [select for diffs], Sun Nov 10 14:20:50 2019 UTC (4 years, 5 months ago) by pgoyette
Branch: MAIN
CVS Tags: phil-wifi-20191119
Changes since 1.377: +3 -6 lines
Diff to previous 1.377 (colored) to selected 1.161 (colored)

Convert the coredump_vec modular function pointer to use the new
compat_hook mechanism.

XXX Should be pulled up to -9 despite the kernel <--> module ABI
XXX change.

Revision 1.377 / (download) - annotate - [select for diffs], Sun Nov 10 13:28:06 2019 UTC (4 years, 5 months ago) by pgoyette
Branch: MAIN
Changes since 1.376: +5 -7 lines
Diff to previous 1.376 (colored) to selected 1.161 (colored)

Convert the sendsig_sigcontext_16 function pointer to use the new
compat_hook mechanism.

XXX Despite being a kernel<-->module abi change, this should be
XXX pulled up to -9

Revision 1.376 / (download) - annotate - [select for diffs], Mon Oct 21 17:07:00 2019 UTC (4 years, 5 months ago) by mgorny
Branch: MAIN
Changes since 1.375: +27 -7 lines
Diff to previous 1.375 (colored) to selected 1.161 (colored)

Fix a race condition when handling concurrent LWP signals and add a test

Fix a race condition that caused PT_GET_SIGINFO to return incorrect
information when multiple signals were delivered concurrently
to different LWPs.  Add a regression test that verifies that when 50
threads concurrently use pthread_kill() on themselves, the debugger
receives all signals with correct information.

The kernel uses separate signal queues for each LWP.  However,
the signal context used to implement PT_GET_SIGINFO is stored in 'struct
proc' and therefore common to all LWPs in the process.  Previously,
this member was filled in kpsignal2(), i.e. when the signal was sent.
This meant that if another LWP managed to send another signal
concurrently, the data was overwritten before the process was stopped.

As a result, PT_GET_SIGINFO did not report the correct LWP and signal
(it could even report a different signal than wait()).  This can be
quite reliably reproduced with the number of 20 LWPs, however it can
also occur with 10.

This patch moves setting of signal context to issignal(), just before
the process is actually stopped.  The data is taken from per-LWP
or per-process signal queue.  The added test confirms that the debugger
correctly receives all signals, and PT_GET_SIGINFO reports both correct
LWP and signal number.

Reviewed by kamil.

Revision 1.375 / (download) - annotate - [select for diffs], Wed Oct 16 18:29:49 2019 UTC (4 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.374: +3 -3 lines
Diff to previous 1.374 (colored) to selected 1.161 (colored)

Add and use __FPTRCAST, requested by uwe@

Revision 1.374 / (download) - annotate - [select for diffs], Wed Oct 16 15:27:38 2019 UTC (4 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.373: +3 -3 lines
Diff to previous 1.373 (colored) to selected 1.161 (colored)

Add void * function pointer casts. There are different ways to "fix" those
warnings:
    1. this one: add a void * cast (which I think is the least intrusive)
    2. add pragmas to elide the warning
    3. add intermediate inline conversion functions
    4. change the called function prototypes, adding unused arguments and
       converting some of the pointer arguments to void *.
    5. make the functions varyadic (which defeats the purpose of checking)
    6. pass command line flags to elide the warning
I did try 3 and 4 and I was not pleased with the result (sys_ptrace_common.c)
(3) added too much code and defines, and (4) made the regular use clumsy.

Revision 1.373 / (download) - annotate - [select for diffs], Tue Oct 15 13:59:57 2019 UTC (4 years, 6 months ago) by kamil
Branch: MAIN
Changes since 1.372: +2 -17 lines
Diff to previous 1.372 (colored) to selected 1.161 (colored)

Remove the short-circuit lwp_exit() path from sigswitch()

sigswitch() can be called from exit1() through:

   ttywait()->ttysleep()-> cv_timedwait_sig()->sleepq_block()->issignal()->sigswitch()

lwp_exit() called for the last LWP triggers exit1() and this causes a panic.

The debugger related signals have short-circuit demise paths in
eventswitch() and other functions, before calling sigswitch().

This change restores the original behavior, but there is an open question
whether the kernel crash is a red herring of misbehavior of ttywait().

This should fix PR kern/54618 by David H. Gutteridge

Revision 1.372 / (download) - annotate - [select for diffs], Sun Oct 13 03:50:26 2019 UTC (4 years, 6 months ago) by kamil
Branch: MAIN
Changes since 1.371: +8 -2 lines
Diff to previous 1.371 (colored) to selected 1.161 (colored)

Avoid double lwp_exit() in eventswitch()

For the PTRACE_LWP_EXIT event, the eventswitch() call is triggered from
lwp_exit(). In the case of setting the program status to PS_WEXIT, do not
try to demise in place, by calling lwp_exit() as it causes panic.

In this scenario bail out from the function and resume the lwp_exit()
procedure.

Revision 1.371 / (download) - annotate - [select for diffs], Sun Oct 13 03:19:57 2019 UTC (4 years, 6 months ago) by kamil
Branch: MAIN
Changes since 1.370: +3 -3 lines
Diff to previous 1.370 (colored) to selected 1.161 (colored)

Fix one the the root causes of unreliability of the ptrace(2)ed threads

In case of sigswitchin away in issignal() and continuing the execution on
PT_CONTINUE (or equivalent call), there is a time window when another
thread could cause the process state to be changed to PS_STOPPING.

In the current logic, a thread would receive signal 0 (no-signal) and exit
from issignal(), returning to userland and never finishing the process of
stopping all LWPs. This causes hangs waitpid() waiting for SIGCHLD and
the callout polling for the state of the process in an infinite loop.

Instead of prompting for a returned signal from a debugger, repeat the
issignal() loop, this will cause checking the PS_STOPPING flag again and
sigswitching away in the scenario of stopping the process.

Revision 1.370 / (download) - annotate - [select for diffs], Sun Oct 13 03:10:22 2019 UTC (4 years, 6 months ago) by kamil
Branch: MAIN
Changes since 1.369: +31 -13 lines
Diff to previous 1.369 (colored) to selected 1.161 (colored)

Add sigswitch_unlock_and_switch_away(), extracted from sigswitch()

Use sigswitch_unlock_and_switch_away() whenever there is no need for
sigswitch().

Revision 1.369 / (download) - annotate - [select for diffs], Sat Oct 12 19:57:09 2019 UTC (4 years, 6 months ago) by kamil
Branch: MAIN
Changes since 1.368: +23 -15 lines
Diff to previous 1.368 (colored) to selected 1.161 (colored)

Refactor sigswitch()

Make the function static as it is now local to kern_sig.c.

Rename the 'relock' argument to 'proc_lock_held' as it is more verbose.
This was suggested by mjg@freebsd. While there this flips the users between
true<->false.

Add additional KASSERT(9) calls here to validate whethe proc_lock is used
accordingly.

Revision 1.368 / (download) - annotate - [select for diffs], Sat Oct 12 10:55:23 2019 UTC (4 years, 6 months ago) by kamil
Branch: MAIN
Changes since 1.367: +4 -2 lines
Diff to previous 1.367 (colored) to selected 1.161 (colored)

Remove p_oppid from struct proc

This field is not needed as it duplicated p_opptr that is alread safe to
use, unless proven otherwise.

eventswitch() already contained a check for != initproc (pid1).

Ride ABI bump for 9.99.16.

Revision 1.367 / (download) - annotate - [select for diffs], Tue Oct 8 18:02:46 2019 UTC (4 years, 6 months ago) by kamil
Branch: MAIN
Changes since 1.366: +56 -3 lines
Diff to previous 1.366 (colored) to selected 1.161 (colored)

Enhance reliability of ptrace(2) in a debuggee with multiple LWPs

Stop competing between threads which one emits event signal quicker and
overwriting the signal from another thread.

This fixes missed in action signals.

NetBSD truss can now report reliably all TRAP_SCE/SCX/etc events without
reports of missed ones.

his was one of the reasons why debuggee with multiple threads misbehaved
under a debugger.


This change is v.2 of the previously reverted commit for the same fix.

This version contains recovery path that stopps triggering event SIGTRAP
for a detached debugger.

Revision 1.366 / (download) - annotate - [select for diffs], Thu Oct 3 22:48:44 2019 UTC (4 years, 6 months ago) by kamil
Branch: MAIN
Changes since 1.365: +15 -5 lines
Diff to previous 1.365 (colored) to selected 1.161 (colored)

Separate flag for suspended by _lwp_suspend and suspended by a debugger

Once a thread was stopped with ptrace(2), userland process must not
be able to unstop it deliberately or by an accident.

This was a Windows-style behavior that makes threading tracing fragile.

Revision 1.365 / (download) - annotate - [select for diffs], Mon Sep 30 21:13:33 2019 UTC (4 years, 6 months ago) by kamil
Branch: MAIN
Changes since 1.364: +9 -5 lines
Diff to previous 1.364 (colored) to selected 1.161 (colored)

Move TRAP_CHLD/TRAP_LWP ptrace information from struct proc to siginfo

Storing struct ptrace_state information inside struct proc was vulnerable
to synchronization bugs, as multiple events emitted in the same time were
overwritting other ones.

Cache the original parent process id in p_oppid. Reusing here p_opptr is
in theory prone to slight race codition.

Change the semantics of PT_GET_PROCESS_STATE, reutning EINVAL for calls
prompting for the value in cases when there wasn't registered an
appropriate event.

Add an alternative approach to check the ptrace_state information, directly
from the siginfo_t value returned from PT_GET_SIGINFO. The original
PT_GET_PROCESS_STATE approach is kept for compat with older NetBSD and
OpenBSD. New code is recommended to keep using PT_GET_PROCESS_STATE.

Add a couple of compile-time asserts for assumptions in the code.

No functional change intended in existing ptrace(2) software.

All ATF ptrace(2) and ATF GDB tests pass.

This change improves reliability of the threading ptrace(2) code.

Revision 1.364 / (download) - annotate - [select for diffs], Fri Jun 21 04:28:12 2019 UTC (4 years, 9 months ago) by kamil
Branch: MAIN
CVS Tags: netbsd-9-base
Branch point for: netbsd-9
Changes since 1.363: +0 -32 lines
Diff to previous 1.363 (colored) to selected 1.161 (colored)

Revert previous

There is fallout in gdb that will be investigated before relanding this.

Revision 1.363 / (download) - annotate - [select for diffs], Fri Jun 21 04:02:57 2019 UTC (4 years, 9 months ago) by kamil
Branch: MAIN
Changes since 1.362: +34 -2 lines
Diff to previous 1.362 (colored) to selected 1.161 (colored)

Enhance reliability of ptrace(2) in a debuggee with multiple LWPs

Stop competing between threads which one emits event signal quicker and
overwriting the signal from another thread.

This fixes missed in action signals.

NetBSD truss can now report reliably all TRAP_SCE/SCX/etc events without
reports of missed ones.

This was one of the reasons why debuggee with multiple threads misbehaved
under a debugger.

Revision 1.362 / (download) - annotate - [select for diffs], Fri Jun 21 01:03:51 2019 UTC (4 years, 9 months ago) by kamil
Branch: MAIN
Changes since 1.361: +14 -18 lines
Diff to previous 1.361 (colored) to selected 1.161 (colored)

Eliminate PS_NOTIFYSTOP remnants from the kernel

This flag used to be useful in /proc (BSD4.4-style) debugging semantics.
Traced child events were notified without signaling the parent.

This property was removed in NetBSD-8.0 and had no users.

This change simplifies the signal code, removing dead branches.

NFCI

Revision 1.361 / (download) - annotate - [select for diffs], Tue Jun 18 23:53:55 2019 UTC (4 years, 9 months ago) by kamil
Branch: MAIN
Changes since 1.360: +8 -5 lines
Diff to previous 1.360 (colored) to selected 1.161 (colored)

Add support for KTR logs of SIGTRAP for TRAP_CHILD events

Previously it was disabled due to vfork(2) synchronization issues.
These problems are now gone.

While there, set l_vforkwaiting to false in posix_spawn. This is not very
needed but it does not make harm to keep it initialized explicitly.

Revision 1.360 / (download) - annotate - [select for diffs], Thu Jun 13 00:07:19 2019 UTC (4 years, 10 months ago) by kamil
Branch: MAIN
Changes since 1.359: +3 -3 lines
Diff to previous 1.359 (colored) to selected 1.161 (colored)

Correct inversed condition for dying process in sigswitch()

If a process is exiting and it was not asked to relock proc_lock, do not
free the mutex as it causes panic. This bug is a timing bug as the faulty
condition is not deterministic and fires only somtimes, but is quickly
triggerable when executed in an infinite loop.

Detected and reported with LLDB test-suite by <mgorny>

Revision 1.359 / (download) - annotate - [select for diffs], Tue Jun 4 11:54:03 2019 UTC (4 years, 10 months ago) by kamil
Branch: MAIN
CVS Tags: phil-wifi-20190609
Changes since 1.358: +55 -2 lines
Diff to previous 1.358 (colored) to selected 1.161 (colored)

Stop trying to inform debugger about events from an exiting child

Do not emit signals to parent for if a process is demising:

 - fork/vfork/similar
 - lwp created/exited
 - exec
 - syscall entry/exit

With these changes Go applications can be traced without a clash under
a debugger, at least without deadlocking always. The culprit reason was
an attempt to inform a debugger in the middle of exit1() call about
a dying LWP. Go applications perform exit(2) without collecting threads
first. Verified with GDB and picotrace-based utilities like sigtracer.

PR kern/53120
PR port-arm/51677
PR bin/54060
PR bin/49662
PR kern/52548

Revision 1.358 / (download) - annotate - [select for diffs], Mon May 6 08:05:03 2019 UTC (4 years, 11 months ago) by kamil
Branch: MAIN
Changes since 1.357: +28 -11 lines
Diff to previous 1.357 (colored) to selected 1.161 (colored)

Ship with syscall information with SIGTRAP TRAP_SCE/TRAP_SCX for tracers

Expand siginfo_t (struct size not changed) to new values for
SIGTRAP TRAP_SCE/TRAP_SCX events.

 - si_sysnum  -- syscall number (int)
 - si_retval  -- return value (2 x int)
 - si_error   -- error code (int)
 - si_args    -- syscall arguments (8 x uint64_t)

TRAP_SCE delivers si_sysnum and si_args.

TRAP_SCX delivers si_sysnum, si_retval, si_error and si_args.

Users: debuggers (like GDB) and syscall tracers (like strace, truss).

This MI interface is similar to the Linux kernel proposal of
PTRACE_GET_SYSCALL_INFO by the strace developer team.

Revision 1.357 / (download) - annotate - [select for diffs], Fri May 3 22:34:21 2019 UTC (4 years, 11 months ago) by kamil
Branch: MAIN
Changes since 1.356: +69 -22 lines
Diff to previous 1.356 (colored) to selected 1.161 (colored)

Register KTR events for debugger related signals

Register signals for:

 - crashes (FPE, SEGV, FPE, ILL, BUS)
 - LWP events
 - CHLD (FORK/VFORK/VFORK_DONE) events -- temporarily disabled
 - EXEC events

While there refactor related functions in order to simplify the code.

Add missing comment documentation for recently added kernel functions.

Revision 1.356 / (download) - annotate - [select for diffs], Thu May 2 22:23:49 2019 UTC (4 years, 11 months ago) by kamil
Branch: MAIN
Changes since 1.355: +12 -4 lines
Diff to previous 1.355 (colored) to selected 1.161 (colored)

Introduce fixes for ptrace(2)

Stop disabling LWP create and exit events for PT_SYSCALL tracing.
PT_SYSCALL disabled EXEC reporting for legacy reasons, there is no need
to repeat it for LWP and CHLD events.

Pass full siginfo from trapsignal events (SEGV, BUS, ILL, TRAP, FPE).
This adds missing information about signals like fault address.

Set ps_lwp always.

Before passing siginfo to userland through p_sigctx.ps_info, make sure
that it was zeroed for unused bytes. LWP and CHLD events do not set si_addr
and si_trap, these pieces of information are passed for crashes (like
software breakpoint).

LLDB crash reporting works now correctly:

(lldb) r
Process 552 launched: '/tmp/a.out' (x86_64)
Process 552 stopped
* thread #1, stop reason = signal SIGSEGV: invalid address (fault address: 0x123456)

Revision 1.355 / (download) - annotate - [select for diffs], Wed May 1 21:52:35 2019 UTC (4 years, 11 months ago) by kamil
Branch: MAIN
Changes since 1.354: +3 -2 lines
Diff to previous 1.354 (colored) to selected 1.161 (colored)

Assert that debugger event is triggered only for userland LWP

All passing ATF ptrace(2) tests still pass.

Revision 1.354 / (download) - annotate - [select for diffs], Wed May 1 18:01:54 2019 UTC (4 years, 11 months ago) by kamil
Branch: MAIN
Changes since 1.353: +11 -2 lines
Diff to previous 1.353 (colored) to selected 1.161 (colored)

Correct handling of corner cases in fork1(9) code under a debugger

Correct detaching and SIGKILLing forker and vforker in the middle of its
operation.

Revision 1.353 / (download) - annotate - [select for diffs], Wed May 1 17:21:55 2019 UTC (4 years, 11 months ago) by kamil
Branch: MAIN
Changes since 1.352: +22 -7 lines
Diff to previous 1.352 (colored) to selected 1.161 (colored)

Add eventswitch() in signal code

Route all crash and debugger related signal through eventswitch(), that
calls sigswitch() with preprocessed arguments.

This code avoids code duplication and allows to introduce changes that
will affect all callers of sigswitch() in debugger-related events.

No functional change intended.

Revision 1.352 / (download) - annotate - [select for diffs], Wed Apr 3 08:34:33 2019 UTC (5 years ago) by kamil
Branch: MAIN
CVS Tags: isaki-audio2-base, isaki-audio2
Changes since 1.351: +5 -16 lines
Diff to previous 1.351 (colored) to selected 1.161 (colored)

Remove support for early SIGTRAP (fork related) signals in kpsignal2()

This function is no longer used to handle early SIGTRAP signals for
fork-related events for ptrace(2).

Revision 1.351 / (download) - annotate - [select for diffs], Fri Mar 8 23:32:30 2019 UTC (5 years, 1 month ago) by kamil
Branch: MAIN
Changes since 1.350: +19 -5 lines
Diff to previous 1.350 (colored) to selected 1.161 (colored)

Stop resetting signal context on a trap signal under a debugger

In case of a crash signal, notify debugger immediately passing the signal
regardless of signal masking/ignoring.

While there pass signals emitted by a debugger to debuggee. Debugger calls
proc_unstop() that sets p_stat to SACTIVE and this signal wasn't passed
to tracee.

This scenario appeared to be triggered in recently added crash signal ATF
ptrace(2) tests.

Revision 1.350 / (download) - annotate - [select for diffs], Thu Nov 29 10:27:36 2018 UTC (5 years, 4 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226
Changes since 1.349: +10 -3 lines
Diff to previous 1.349 (colored) to selected 1.161 (colored)

Fix kernel info leak, 4 bytes of padding at the end of struct sigaction.

	+ Possible info leak: [len=32, leaked=4]
	| #0 0xffffffff80baf327 in kleak_copyout
	| #1 0xffffffff80bd9ca8 in sys___sigaction_sigtramp
	| #2 0xffffffff80259c42 in syscall

Revision 1.349 / (download) - annotate - [select for diffs], Mon May 28 14:07:37 2018 UTC (5 years, 10 months ago) by kamil
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625
Branch point for: phil-wifi
Changes since 1.348: +2 -13 lines
Diff to previous 1.348 (colored) to selected 1.161 (colored)

Revert previous

There is a regression not covered by tests.

Revision 1.348 / (download) - annotate - [select for diffs], Mon May 28 13:12:54 2018 UTC (5 years, 10 months ago) by kamil
Branch: MAIN
Changes since 1.347: +15 -4 lines
Diff to previous 1.347 (colored) to selected 1.161 (colored)

Enhance the signal routing of a trapsignal under a debugger

Stop resetting signal masks for crash signals under a debugger.

If we set a trap (either software or hardware one) in the code, we don't
want to see reset of signal handlers in a traced child as a knock-on effect
in the original code.

Maintain the vfork(2) + ptrace(2) special case functional.

No regressions are observed in ATF ptrace(2) and kernel/t_trapsignal tests.

Sponsored by <The NetBSD Foundation>

Revision 1.347 / (download) - annotate - [select for diffs], Sun May 20 04:00:35 2018 UTC (5 years, 10 months ago) by kamil
Branch: MAIN
CVS Tags: pgoyette-compat-0521
Changes since 1.346: +3 -3 lines
Diff to previous 1.346 (colored) to selected 1.161 (colored)

Make stopsigmask a non-static symbol now as it's used in ptrace(2) code

This is a missing part of the previous commit.

While there fix a typo in a newly added comment in the ptrace(2) code.

Sponsored by <The NetBSD Foundation>

Revision 1.346 / (download) - annotate - [select for diffs], Sat May 19 05:01:42 2018 UTC (5 years, 10 months ago) by kamil
Branch: MAIN
Changes since 1.345: +5 -3 lines
Diff to previous 1.345 (colored) to selected 1.161 (colored)

Stop masking raise(SIGSTOP) in a vfork(2)ed child that called PT_TRACE_ME.

Sponsored by <The NetBSD Foundation>

Revision 1.345 / (download) - annotate - [select for diffs], Sat May 19 02:42:58 2018 UTC (5 years, 10 months ago) by kamil
Branch: MAIN
Changes since 1.344: +8 -4 lines
Diff to previous 1.344 (colored) to selected 1.161 (colored)

Stop masking SIGSTOP in a vfork(2)ed child

Keep the traditional BSD behavior masking SIGTSTP, SIGTTIN and SIGTTOU in
a vfork(2)ed child before exec(3)/exit(3). This is useful in shells and
prevents deadlocking, when a parent cannot unstop the sleeping child.

Change the behavior for SIGSTOP. This signal is by design not maskable and
this property shall be obeyed without exceptions. The STOP behavior is
expected in the context of debuggers and useful in standalone programs.

It is still possible to stop a vfork(2)ed child, however it requires
proc.curproc.stopfork=1, but it is not a flexible solution.

FreeBSD and OpenBSD keep masking SIGSTOP in a vfork(2)ed child.
Linux does not mask stop signals in the same scenarios.

This fixes ATF test: t_vfork:raise2.
No known regressions reported in the existing ATF tests.

Discussed with <kre>

Sponsored by <The NetBSD Foundation>

Revision 1.344 / (download) - annotate - [select for diffs], Wed May 16 00:42:15 2018 UTC (5 years, 11 months ago) by kamil
Branch: MAIN
Changes since 1.343: +5 -5 lines
Diff to previous 1.343 (colored) to selected 1.161 (colored)

Correct handling of: vfork(2) + PT_TRACE_ME + raise(2)

Follow the FreeBSD approach of not routing signals to the parent that is
a became tracer after calling PT_TRACE_ME by the vfork(2)ed child (before
exec(3)/exit(3)).

Now if a child calls raise(3), the signal is processed directly to this
child.

Add new ATF ptrace(2) tests:
 - traceme_vfork_raise1 (SIGKILL)
 - traceme_vfork_raise2 (SIGSTOP) // temporarily disabled
 - traceme_vfork_raise3 (SIGABRT)
 - traceme_vfork_raise4 (SIGHUP)
 - traceme_vfork_raise5 (SIGCONT)

The FreeBSD implementation introduces P_PPTRACE for this special case.
Right know keep opencoding check of this case in the kernel. It might be
refactored in future.

The Linux kernel does not follow this approach and causes dead locking of
the processes (parent and child).

Defer handling SIGSTOP into future.

This is an intermediate step towards correct handling of fork(2) and
vfork(2) in the context of ptrace(2).

All new tests pass.
There are no regressions in existing ATF ptrace(2) tests.

Sponsored by <The NetBSD Foundation>

Revision 1.343 / (download) - annotate - [select for diffs], Sun May 6 13:40:51 2018 UTC (5 years, 11 months ago) by kamil
Branch: MAIN
Changes since 1.342: +4 -6 lines
Diff to previous 1.342 (colored) to selected 1.161 (colored)

Remove an element from struct emul: e_tracesig

e_tracesig used to be implemented for Darwin compat. Nowadays the Darwin
compatiblity layer is gone and there are no other users.

This functionality isn't used where it shall be used in the existing
codebase.

If we want to emulate debugging interfaces in compat layers we would need
to implement that from scratch anyway. We would need to be bug compatible
with other OSes too.

Proposed on tech-kern@.

Welcome to NetBSD 8.99.16!

Sponsored by <The NetBSD Foundation>

Revision 1.342 / (download) - annotate - [select for diffs], Tue May 1 16:37:23 2018 UTC (5 years, 11 months ago) by kamil
Branch: MAIN
CVS Tags: pgoyette-compat-0502
Changes since 1.341: +15 -14 lines
Diff to previous 1.341 (colored) to selected 1.161 (colored)

Implement PTRACE_VFORK

Add support for tracing vfork(2) events in the context of ptrace(2).

This API covers other frontends to fork1(9) like posix_spawn(2) or clone(2),
if they cause parent to wait for exec(2) or exit(2) of the child.

Changes:
 - Add new argument to sigswitch() determining whether we need to acquire
   the proc_lock or whether it's already held.
 - Refactor fork1(9) for fork(2) and vfork(2)-like events.
   Call sigswitch() from fork(1) for forking or vforking parent, instead of
   emitting kpsignal(9). We need to emit the signal and suspend the parent,
   returning to user and relock proc_lock.
 - Add missing prototype for proc_stop_done() in kern_sig.c.
 - Make sigswitch a public function accessible from other kernel code
   including <sys/signalvar.h>.
 - Remove an entry about unimplemented PTRACE_VFORK in the ptrace(2) man page.
 - Permin PTRACE_VFORK in the ptrace(2) frontend for userland.
 - Remove expected failure for unimplemented PTRACE_VFORK tests in the ATF
   ptrace(2) test-suite.
 - Relax signal routing constraints under a debugger for a vfork(2)ed child.
   This intended to protect from signaling a parent of a vfork(2)ed child that
   called PT_TRACE_ME, but wrongly misrouted other signals in vfork(2)
   use-cases.

Add XXX comments about still existing problems and future enhancements:
 - correct vfork(2) + PT_TRACE_ME handling.
 - fork1(2) handling of scenarios when a process is collected in valid but
   rare cases.

All ATF ptrace(2) fork[1-8] and vfork[1-8] tests pass.

Fix PR kern/51630 by Kamil Rytarowski (myself).

Sponsored by <The NetBSD Foundation>

Revision 1.341 / (download) - annotate - [select for diffs], Tue May 1 13:48:38 2018 UTC (5 years, 11 months ago) by kamil
Branch: MAIN
Changes since 1.340: +37 -13 lines
Diff to previous 1.340 (colored) to selected 1.161 (colored)

Improve the proc_stoptrace() function

proc_stoptrace() is dedicated for emitting a syscall trap for a debugger,
either on entry or exit of the system function routine.

Changes:
 - Change an if() branch of an invalid condition of being traced by
   initproc (PID1) to KASSERT(9).
 - Assert that the current process has set appropriate flags (PSL_TRACED
   and PSL_SYSCALL).
 - Use ktrpoint(KTR_PSIG) and ktrpsig()/e_ktrpsig() in order to register
   the emitted signal for the ktrace(1) event debugging.

Example of the new output from kdump(1) for the syscall debugger traps,
containing SIGTRAP notification with TRAP_SCE and TRAP_SCX (around
the getpid(2) call).

$ kdump /tmp/1.dat.qemu |grep 663
   588      1 t_ptrace_waitpid RET   fork 663/0x297
   663      1 t_ptrace_waitpid EMUL  "netbsd"
   663      1 t_ptrace_waitpid RET   fork 0
   663      1 t_ptrace_waitpid CALL  ptrace(PT_TRACE_ME,0,0,0)
   663      1 t_ptrace_waitpid RET   ptrace 0
   663      1 t_ptrace_waitpid CALL  _lwp_self
   663      1 t_ptrace_waitpid RET   _lwp_self 1
   663      1 t_ptrace_waitpid CALL  _lwp_kill(1,0x11)
   663      1 t_ptrace_waitpid RET   _lwp_kill 0
   588      1 t_ptrace_waitpid RET   __wait450 663/0x297
   663      1 t_ptrace_waitpid CALL  getpid
   588      1 t_ptrace_waitpid RET   __wait450 663/0x297
   663      1 t_ptrace_waitpid PSIG  SIGTRAP SIG_DFL: code=TRAP_SCE, addr=0x0, trap=0)
   663      1 t_ptrace_waitpid RET   getpid 663/0x297, 588/0x24c
   588      1 t_ptrace_waitpid RET   __wait450 663/0x297
   663      1 t_ptrace_waitpid PSIG  SIGTRAP SIG_DFL: code=TRAP_SCX, addr=0x0, trap=0)
   663      1 t_ptrace_waitpid CALL  exit(5)
   588      1 t_ptrace_waitpid RET   __wait450 663/0x297

Sponsored by <The NetBSD Foundation>

Revision 1.340 / (download) - annotate - [select for diffs], Tue Apr 24 18:34:46 2018 UTC (5 years, 11 months ago) by kamil
Branch: MAIN
Changes since 1.339: +14 -16 lines
Diff to previous 1.339 (colored) to selected 1.161 (colored)

Remove unused code branch in the signal code

Remove the ppsig argument from proc_stop_done() and from sigswitch().

This functionality was used in now gone filesystem tracing feature (/proc).
It prevented emitting signal child signals to a debugging program, namely
with the SIGCHLD signal.

The modern solution to perform tracing without signals in a debugger is
to spawn a debugging server and outsource the tracing functionality to it.
This is done in software like gdb-server, lldb-server etc.

No functional change intended.

Sponsored by <The NetBSD Foundation>

Revision 1.339 / (download) - annotate - [select for diffs], Thu Dec 7 19:49:43 2017 UTC (6 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-compat-base, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: pgoyette-compat
Changes since 1.338: +29 -25 lines
Diff to previous 1.338 (colored) to selected 1.161 (colored)

- Reset ignored or masked traps to avoid infinite loops
- If sigpost fails don't add an SDT_PROBE
ok (and author) chuq

Revision 1.338 / (download) - annotate - [select for diffs], Wed Oct 25 08:12:39 2017 UTC (6 years, 5 months ago) by maya
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202
Changes since 1.337: +6 -3 lines
Diff to previous 1.337 (colored) to selected 1.161 (colored)

Use C99 initializer for filterops

Mostly done with spatch with touchups for indentation

@@
expression a;
identifier b,c,d;
identifier p;
@@
const struct filterops p =
- 	{ a, b, c, d
+ 	{
+ 	.f_isfd = a,
+ 	.f_attach = b,
+ 	.f_detach = c,
+ 	.f_event = d,
};

Revision 1.337 / (download) - annotate - [select for diffs], Mon Aug 28 00:46:07 2017 UTC (6 years, 7 months ago) by kamil
Branch: MAIN
Changes since 1.336: +3 -4 lines
Diff to previous 1.336 (colored) to selected 1.161 (colored)

Remove the filesystem tracing feature

This is a legacy interface from 4.4BSD, and it was
introduced to overcome shortcomings of ptrace(2) at that time, which are
no longer relevant (performance). Today /proc/#/ctl offers a narrow
subset of ptrace(2) commands and is not applicable for modern
applications use beyond simplistic tracing scenarios.

This removal will simplify kernel internals. Users will still be able to
use all the other /proc files.

This change won't affect other procfs files neither Linux compat
features within mount_procfs(8). /proc/#/ctl isn't available on Linux.

Remove:
 - /proc/#/ctl from mount_procfs(8)
 - P_FSTRACE note from the documentation of ps(1)
 - /proc/#/ctl and filesystem tracing documentation from mount_procfs(8)
 - KAUTH_REQ_PROCESS_PROCFS_CTL documentation from kauth(9)
 - source code file miscfs/procfs/procfs_ctl.c
 - PFSctl and procfs_doctl() from sys/miscfs/procfs/procfs.h
 - KAUTH_REQ_PROCESS_PROCFS_CTL from sys/sys/kauth.h
 - PSL_FSTRACE (0x00010000) from sys/sys/proc.h
 - P_FSTRACE (0x00010000) from sys/sys/sysctl.h

Reduce code complexity after removal of this functionality.

Update TODO.ptrace accordingly: remove two entries about /proc tracing.

Do not keep legacy notes as comments in the headers about removed
PSL_FSTRACE / P_FSTRACE, as this interface had little number of users
(close or equal to zero).

Proposed on tech-kern@.

All filesystem tracing utility users are encouraged to switch to ptrace(2).

Sponsored by <The NetBSD Foundation>

Revision 1.336 / (download) - annotate - [select for diffs], Fri Apr 21 15:10:35 2017 UTC (6 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base, matt-nb8-mediatek-base, matt-nb8-mediatek, bouyer-socketcan-base1
Branch point for: netbsd-8
Changes since 1.335: +4 -8 lines
Diff to previous 1.335 (colored) to selected 1.161 (colored)

- Propagate the signal mask from the ucontext_t to the newly created thread
  as specified by _lwp_create(2)
- Reset the signal stack for threads created with _lwp_create(2)

Revision 1.335 / (download) - annotate - [select for diffs], Fri Mar 31 08:47:04 2017 UTC (7 years ago) by martin
Branch: MAIN
CVS Tags: jdolecek-ncq-base, jdolecek-ncq
Changes since 1.334: +16 -5 lines
Diff to previous 1.334 (colored) to selected 1.161 (colored)

PR kern/52117: move stop code for debuged children after fork into MI code.
XXX we might want to revisit this when handling the same event for vfork
better.

Revision 1.334 / (download) - annotate - [select for diffs], Fri Mar 24 17:40:44 2017 UTC (7 years ago) by christos
Branch: MAIN
Changes since 1.333: +28 -5 lines
Diff to previous 1.333 (colored) to selected 1.161 (colored)

Instead of copying parts of sigswitch to process_stoptrace, use it directly.
Rename process_stoptrace -> proc_stoptrace and put it in kern_sig.c so we
don't need to expose any more functions from it.

Revision 1.333 / (download) - annotate - [select for diffs], Thu Mar 23 21:59:55 2017 UTC (7 years ago) by christos
Branch: MAIN
Changes since 1.332: +6 -10 lines
Diff to previous 1.332 (colored) to selected 1.161 (colored)

kern/5201{2,8,9}: Fix PT_SYSCALL stopping.
1. Supply the siginfo we expect TRAP_SC{E,X} to process_stoptrace() and set it.
2. Change the second argument of proc_stop from notify, to now meaning that
   we want to stop right now. Wait in process_stoptrace until that has happened.
3. While here, fix the locking order in process_stoptrace().

Revision 1.332 / (download) - annotate - [select for diffs], Fri Jan 6 22:53:17 2017 UTC (7 years, 3 months ago) by kamil
Branch: MAIN
CVS Tags: pgoyette-localcount-20170320, pgoyette-localcount-20170107, nick-nhusb-base-20170204, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.331: +17 -9 lines
Diff to previous 1.331 (colored) to selected 1.161 (colored)

Introduce new ptrace(2) interface: PT_SET_SIGINFO and PT_GET_SIGINFO

This interface is designed to read signal information emited to tracee and
fake this signal with new value.

This functionality is required to distinguish types of events that occured
in the tracee and intercepted by a debugger.

These accessors introduce a new structure type ptrace_siginfo:
/*
 * Signal Information structure
 */
typedef struct ptrace_siginfo {
       siginfo_t       psi_siginfo;    /* signal information structure */
       lwpid_t         psi_lwpid;      /* destination LWP of the signal
                                        * value 0 means the whole process
                                        * (route signal to all LWPs) */
} ptrace_siginfo_t;

Include <sys/siginfo.h> in <sys/ptrace.h> in order to not break existing
software due to unknown symbol siginfo_t.

This interface has been proposed to the tech-kern@ mailing list.

Sponsored by <The NetBSD Foundation>

Revision 1.331 / (download) - annotate - [select for diffs], Sun Dec 4 16:40:43 2016 UTC (7 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20161204
Changes since 1.330: +7 -6 lines
Diff to previous 1.330 (colored) to selected 1.161 (colored)

PR/51685: Kamil Rytarowski: Fill sigcontext info in kpsignal2 so that the
debugger/core-dump signal info gets filled in in all code paths (including
the lwp_kill one).

Revision 1.330 / (download) - annotate - [select for diffs], Tue Sep 13 07:39:45 2016 UTC (7 years, 7 months ago) by martin
Branch: MAIN
CVS Tags: pgoyette-localcount-20161104, nick-nhusb-base-20161004, localcount-20160914
Changes since 1.329: +15 -5 lines
Diff to previous 1.329 (colored) to selected 1.161 (colored)

Allow emulations to override the creation of ktrace records for posting
signals. In compat_netbsd32 use this to write the 32bit version of
the records, so a 32bit userland kdump is happy.

Revision 1.329 / (download) - annotate - [select for diffs], Sun Aug 21 15:24:17 2016 UTC (7 years, 7 months ago) by hannken
Branch: MAIN
Changes since 1.328: +4 -4 lines
Diff to previous 1.328 (colored) to selected 1.161 (colored)

siggetinfo: use TAILQ_FOREACH_SAFE as the element gets removed from the list.

Revision 1.328 / (download) - annotate - [select for diffs], Thu Aug 4 06:43:43 2016 UTC (7 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-20160806
Changes since 1.327: +48 -28 lines
Diff to previous 1.327 (colored) to selected 1.161 (colored)

Realtime signal support from GSoC 2016, Charles Cui.

Revision 1.327 / (download) - annotate - [select for diffs], Thu Apr 28 00:37:39 2016 UTC (7 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20160726, nick-nhusb-base-20160907, nick-nhusb-base-20160529
Branch point for: pgoyette-localcount
Changes since 1.326: +3 -4 lines
Diff to previous 1.326 (colored) to selected 1.161 (colored)

Simplify

Revision 1.326 / (download) - annotate - [select for diffs], Wed Apr 27 21:15:40 2016 UTC (7 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.325: +5 -2 lines
Diff to previous 1.325 (colored) to selected 1.161 (colored)

We need a flag for WCONTINUED so that we can reset it... Fixes bash issue.

Revision 1.325 / (download) - annotate - [select for diffs], Wed Apr 6 03:11:31 2016 UTC (8 years ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20160422
Changes since 1.324: +6 -3 lines
Diff to previous 1.324 (colored) to selected 1.161 (colored)

don't create ktrace records if we were not asked.

Revision 1.324 / (download) - annotate - [select for diffs], Wed Apr 6 00:48:30 2016 UTC (8 years ago) by christos
Branch: MAIN
Changes since 1.323: +9 -5 lines
Diff to previous 1.323 (colored) to selected 1.161 (colored)

Add parent notification on SIGCONT as required by waitid(2)/wait6(2)

Revision 1.323 / (download) - annotate - [select for diffs], Mon Apr 4 23:07:06 2016 UTC (8 years ago) by christos
Branch: MAIN
Changes since 1.322: +7 -6 lines
Diff to previous 1.322 (colored) to selected 1.161 (colored)

no need to pass the coredump flag to exit1() since it is set and known
in one place.

Revision 1.322 / (download) - annotate - [select for diffs], Mon Apr 4 20:47:57 2016 UTC (8 years ago) by christos
Branch: MAIN
Changes since 1.321: +16 -16 lines
Diff to previous 1.321 (colored) to selected 1.161 (colored)

Split p_xstat (composite wait(2) status code, or signal number depending
on context) into:
1. p_xexit:		exit code
2. p_xsig:		signal number
3. p_sflag & WCOREFLAG	bit to indicated that the process core-dumped.

Fix the documentation of the flag bits in <sys/proc.h>

Revision 1.321 / (download) - annotate - [select for diffs], Tue Oct 13 07:00:59 2015 UTC (8 years, 6 months ago) by pgoyette
Branch: MAIN
CVS Tags: nick-nhusb-base-20160319, nick-nhusb-base-20151226
Changes since 1.320: +6 -7 lines
Diff to previous 1.320 (colored) to selected 1.161 (colored)

When delivering a signal, it's possible that the process's state in
p_stat is SACTIVE yet p_sflag is PS_STOPPING (while waiting for other
lwp's to stop).  In that case, we don't want to adjust the parent's
p_nstopchild count.

Found by Robert Elz.

XXX Pullups to: NetBSD-7, -6{,-0,-1}, and -5{,-0,-1,-2}

Revision 1.320 / (download) - annotate - [select for diffs], Fri Oct 2 16:54:15 2015 UTC (8 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.319: +30 -32 lines
Diff to previous 1.319 (colored) to selected 1.161 (colored)

Change SDT (Statically Defined Tracing) probes to use link sets so that it
is easier to add probes. (From FreeBSD)

Revision 1.319 / (download) - annotate - [select for diffs], Fri Nov 22 21:04:11 2013 UTC (10 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base, netbsd-7-base, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1
Branch point for: nick-nhusb, netbsd-7-0, netbsd-7
Changes since 1.318: +13 -15 lines
Diff to previous 1.318 (colored) to selected 1.161 (colored)

convert vmem, signals, powerhooks from CIRCLEQ -> TAILQ.

Revision 1.318 / (download) - annotate - [select for diffs], Sun Jun 9 01:13:47 2013 UTC (10 years, 10 months ago) by riz
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Branch point for: rmind-smpnet
Changes since 1.317: +6 -6 lines
Diff to previous 1.317 (colored) to selected 1.161 (colored)

Add another field to the SDT_PROBE_DEFINE macro, so our DTrace probes
can named the same as those on other platforms.

For example, proc:::exec-success, not proc:::exec_success.

Implementation follows the same basic principle as FreeBSD's; add
another field to the SDT_PROBE_DEFINE macro which is the name
as exposed to userland.

Revision 1.317 / (download) - annotate - [select for diffs], Sun Feb 19 21:06:53 2012 UTC (12 years, 1 month ago) by rmind
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, khorben-n900, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base10, agc-symver-base, agc-symver
Branch point for: tls-maxphys
Changes since 1.316: +19 -203 lines
Diff to previous 1.316 (colored) to selected 1.161 (colored)

Remove COMPAT_SA / KERN_SA.  Welcome to 6.99.3!
Approved by core@.

Revision 1.316 / (download) - annotate - [select for diffs], Fri Sep 16 22:07:17 2011 UTC (12 years, 7 months ago) by reinoud
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache, netbsd-6-1, netbsd-6-0, netbsd-6, jmcneill-usbmp
Changes since 1.315: +3 -3 lines
Diff to previous 1.315 (colored) to selected 1.161 (colored)

Fix sigactsunshare() to do what the manpage and the commit tells it to do!
I.e. unshare a process its sigacts by creating a new one BUT maintaining all
signal state.

The old code would CLEAR all the signal state. It used to work only due to the
fact that sigactunshare() is only used in execsigs() and the fact that
SIG_DFL was NULL.

Revision 1.315 / (download) - annotate - [select for diffs], Sun Sep 4 23:03:00 2011 UTC (12 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.314: +4 -3 lines
Diff to previous 1.314 (colored) to selected 1.161 (colored)

don't delete signal from the debugger.

Revision 1.314 / (download) - annotate - [select for diffs], Sun Sep 4 13:09:12 2011 UTC (12 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.313: +44 -32 lines
Diff to previous 1.313 (colored) to selected 1.161 (colored)

Split sigget into sigget() and siggetinfo(). When a signal comes from the
debugger (l->l_sigpendset == NULL), using siggetinfo() try to fetch the
siginfo information from l->l_sigpend and then from p->p_sigpend if it
was not found. This allows us to pass siginfo information for traps from
the debugger.

Revision 1.313 / (download) - annotate - [select for diffs], Sat Sep 3 19:33:40 2011 UTC (12 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.312: +15 -5 lines
Diff to previous 1.312 (colored) to selected 1.161 (colored)

PR/45327: Jared McNeill: ptrace: siginfo doesn't work with traced processes
When saving the signal in p->p_xstat, clear it from the pending mask, but
don't remove it from the siginfo queue, so that next time the debugger
delivers it, the original information is found.
When posting a signal from the debugger l->l_sigpendset is not set, so we
use the process pending signal and add it back to the process pending set.

Revision 1.312 / (download) - annotate - [select for diffs], Wed Aug 31 22:43:19 2011 UTC (12 years, 7 months ago) by rmind
Branch: MAIN
Changes since 1.311: +5 -8 lines
Diff to previous 1.311 (colored) to selected 1.161 (colored)

sigispending: simplify a little.

Revision 1.311 / (download) - annotate - [select for diffs], Wed Aug 31 16:05:44 2011 UTC (12 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.310: +9 -9 lines
Diff to previous 1.310 (colored) to selected 1.161 (colored)

Make sigispending() return the signal that is pending, or 0. Fix the comment
that said that it returns true or false (it returned EINTR or 0 before).
Perhaps we should rename the function now?

Revision 1.310 / (download) - annotate - [select for diffs], Wed Jul 27 13:45:49 2011 UTC (12 years, 8 months ago) by uebayasi
Branch: MAIN
Changes since 1.309: +2 -3 lines
Diff to previous 1.309 (colored) to selected 1.161 (colored)

Include uvm/uvm_extern.h only once.

Revision 1.309 / (download) - annotate - [select for diffs], Tue Jul 26 13:33:43 2011 UTC (12 years, 8 months ago) by yamt
Branch: MAIN
Changes since 1.308: +3 -3 lines
Diff to previous 1.308 (colored) to selected 1.161 (colored)

sigpost: don't interfere coredump.  PR/45032

Revision 1.308 / (download) - annotate - [select for diffs], Wed Apr 27 00:38:37 2011 UTC (12 years, 11 months ago) by rmind
Branch: MAIN
CVS Tags: rmind-uvmplock-nbase, rmind-uvmplock-base, cherry-xenmp-base, cherry-xenmp
Changes since 1.307: +20 -9 lines
Diff to previous 1.307 (colored) to selected 1.161 (colored)

Make stopsigmask static, sprinkle __cacheline_aligned and __read_mostly.

Revision 1.307 / (download) - annotate - [select for diffs], Mon Jan 17 07:13:31 2011 UTC (13 years, 3 months ago) by uebayasi
Branch: MAIN
CVS Tags: bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Changes since 1.306: +3 -3 lines
Diff to previous 1.306 (colored) to selected 1.161 (colored)

Include internal definitions (uvm/uvm.h) only where necessary.

Revision 1.306 / (download) - annotate - [select for diffs], Thu Jul 1 02:38:30 2010 UTC (13 years, 9 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, matt-mips64-premerge-20101231, jruoho-x86intr-base
Branch point for: jruoho-x86intr
Changes since 1.305: +3 -3 lines
Diff to previous 1.305 (colored) to selected 1.161 (colored)

Remove pfind() and pgfind(), fix locking in various broken uses of these.
Rename real routines to proc_find() and pgrp_find(), remove PFIND_* flags
and have consistent behaviour.  Provide proc_find_raw() for special cases.
Fix memory leak in sysctl_proc_corename().

COMPAT_LINUX: rework ptrace() locking, minimise differences between
different versions per-arch.

Note: while this change adds some formal cosmetics for COMPAT_DARWIN and
COMPAT_IRIX - locking there is utterly broken (for ages).

Fixes PR/43176.

Revision 1.305 / (download) - annotate - [select for diffs], Tue Apr 6 13:50:22 2010 UTC (14 years ago) by christos
Branch: MAIN
CVS Tags: uebayasi-xip-base1
Changes since 1.304: +5 -4 lines
Diff to previous 1.304 (colored) to selected 1.161 (colored)

PR/43128: Paul Koning: Threads support in ptrace() is insufficient for gdb to
debug threaded live apps: Add an optional lwpid in PT_STEP and PT_CONTINUE to
indicate which lwp to operate on, and implement the glue required to make it
work.

Revision 1.304 / (download) - annotate - [select for diffs], Wed Mar 3 00:47:31 2010 UTC (14 years, 1 month ago) by yamt
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9
Branch point for: rmind-uvmplock
Changes since 1.303: +3 -5 lines
Diff to previous 1.303 (colored) to selected 1.161 (colored)

remove redundant checks of PK_MARKER.

Revision 1.303 / (download) - annotate - [select for diffs], Mon Mar 1 21:10:17 2010 UTC (14 years, 1 month ago) by darran
Branch: MAIN
Changes since 1.302: +33 -2 lines
Diff to previous 1.302 (colored) to selected 1.161 (colored)

DTrace: Add an SDT (Statically Defined Tracing) provider framework, and
implement most of the proc provider.  Adds proc:::create, exec,
exec_success, exec_faillure, signal_send, signal_discard, signal_handle,
lwp_create, lwp_start, lwp_exit.

Revision 1.302 / (download) - annotate - [select for diffs], Wed Dec 30 23:31:56 2009 UTC (14 years, 3 months ago) by rmind
Branch: MAIN
CVS Tags: uebayasi-xip-base
Branch point for: uebayasi-xip
Changes since 1.301: +17 -21 lines
Diff to previous 1.301 (colored) to selected 1.161 (colored)

sigactsunshare(): set reference count in a case of new sigacts allocation.
Bug (e.g. memory leak) can happen when using clone(2) call.

Revision 1.301 / (download) - annotate - [select for diffs], Sun Dec 20 04:49:09 2009 UTC (14 years, 3 months ago) by rmind
Branch: MAIN
Changes since 1.300: +81 -88 lines
Diff to previous 1.300 (colored) to selected 1.161 (colored)

signal(9) code: add some comments, improve/fix wrong ones.  While here, kill
trailing whitespaces, wrap long lines, etc.  No functional changes intended.

Revision 1.300 / (download) - annotate - [select for diffs], Sat Nov 14 19:06:54 2009 UTC (14 years, 5 months ago) by rmind
Branch: MAIN
CVS Tags: matt-premerge-20091211
Changes since 1.299: +14 -11 lines
Diff to previous 1.299 (colored) to selected 1.161 (colored)

kpsignal2: do not make the signal pending twice when tracing the process,
also update a comment and add an assert.  Fixes PR/42309 by Nicolas Joly.

Revision 1.299 / (download) - annotate - [select for diffs], Fri Oct 2 23:24:15 2009 UTC (14 years, 6 months ago) by elad
Branch: MAIN
CVS Tags: jym-xensuspend-nbase
Changes since 1.298: +28 -2 lines
Diff to previous 1.298 (colored) to selected 1.161 (colored)

Put signal delivery policy back in the subsystem.

Revision 1.298 / (download) - annotate - [select for diffs], Sun May 24 21:41:26 2009 UTC (14 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, jymxensuspend-base
Changes since 1.297: +6 -4 lines
Diff to previous 1.297 (colored) to selected 1.161 (colored)

More changes to improve kern_descrip.c.

- Avoid atomics in more places.
- Remove the per-descriptor mutex, and just use filedesc_t::fd_lock.
  It was only being used to synchronize close, and in any case we needed
  to take fd_lock to free the descriptor slot.
- Optimize certain paths for the <NDFDFILE case.
- Sprinkle more comments and assertions.
- Cache more stuff in filedesc_t.
- Fix numerous minor bugs spotted along the way.
- Restructure how the open files array is maintained, for clarity and so
  that we can eliminate the membar_consumer() call in fd_getfile().  This is
  mostly syntactic sugar; the main functional change is that fd_nfiles now
  lives alongside the open file array.

Some measurements with libmicro:

- simple file syscalls are like close() are between 1 to 10% faster.
- some nice improvements, e.g. poll(1000) which is ~50% faster.

Revision 1.297 / (download) - annotate - [select for diffs], Sun Mar 29 05:02:46 2009 UTC (15 years ago) by rmind
Branch: MAIN
CVS Tags: yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base, jym-xensuspend-base
Changes since 1.296: +38 -36 lines
Diff to previous 1.296 (colored) to selected 1.161 (colored)

kpsignal2: do not start process (when it is stopped) for all termination
signals (i.e. SA_KILL), just if SIGKILL (or SIGCONT).  Improve comments.

Make some functions static, remove unused sigrealloc() prototype.

Fixes PR/39814.  Similar patch reviewed by <ad>.

Revision 1.296 / (download) - annotate - [select for diffs], Fri Mar 27 10:58:38 2009 UTC (15 years ago) by drochner
Branch: MAIN
Changes since 1.295: +5 -9 lines
Diff to previous 1.295 (colored) to selected 1.161 (colored)

In sigput(), save the siginfo no matter whether SA_SIGINFO is set or not.
There are also sigtimedwait(2) et al. to catch signals without invoking
a signal handler. Fixes PR kern/41076 by Matteo Beccati (the first
test case, where the signal is sent before sigwaitinfo(2) gets called).

Revision 1.295 / (download) - annotate - [select for diffs], Thu Jan 22 14:38:35 2009 UTC (15 years, 2 months ago) by yamt
Branch: MAIN
CVS Tags: nick-hppapmap-base2
Branch point for: jym-xensuspend
Changes since 1.294: +2 -3 lines
Diff to previous 1.294 (colored) to selected 1.161 (colored)

malloc -> kmem_alloc

Revision 1.294 / (download) - annotate - [select for diffs], Sat Dec 13 20:49:49 2008 UTC (15 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: mjf-devfs2-base
Changes since 1.293: +2 -5 lines
Diff to previous 1.293 (colored) to selected 1.161 (colored)

Fix a comment.

Revision 1.293 / (download) - annotate - [select for diffs], Sat Dec 13 20:43:38 2008 UTC (15 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.292: +24 -27 lines
Diff to previous 1.292 (colored) to selected 1.161 (colored)

PR kern/36183 problem with ptrace and multithreaded processes

Fix the famous "gdb + threads = panic" problem.
Also, fix another revivesa merge botch.

Revision 1.292 / (download) - annotate - [select for diffs], Sat Dec 13 18:55:01 2008 UTC (15 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.291: +6 -6 lines
Diff to previous 1.291 (colored) to selected 1.161 (colored)

sigchecktrace: process SIGKILL before everything else.

Revision 1.291 / (download) - annotate - [select for diffs], Tue Nov 25 15:05:38 2008 UTC (15 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Changes since 1.290: +3 -2 lines
Diff to previous 1.290 (colored) to selected 1.161 (colored)

vax uses v3 trampoline.

Revision 1.290 / (download) - annotate - [select for diffs], Wed Nov 19 18:36:07 2008 UTC (15 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.289: +42 -3 lines
Diff to previous 1.289 (colored) to selected 1.161 (colored)

Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime

Revision 1.289 / (download) - annotate - [select for diffs], Fri Oct 24 18:07:36 2008 UTC (15 years, 5 months ago) by wrstuden
Branch: MAIN
CVS Tags: netbsd-5-base, netbsd-5-0-RC1, matt-mips64-base2
Branch point for: nick-hppapmap, netbsd-5
Changes since 1.288: +23 -12 lines
Diff to previous 1.288 (colored) to selected 1.161 (colored)

toall signals really are toall. The fact we're sa doesn't matter.
They are start/stop signals, and need to impact more than just
blessed lwps.

Revision 1.288 / (download) - annotate - [select for diffs], Wed Oct 15 06:51:20 2008 UTC (15 years, 6 months ago) by wrstuden
Branch: MAIN
CVS Tags: haad-dm-base1
Changes since 1.287: +172 -20 lines
Diff to previous 1.287 (colored) to selected 1.161 (colored)

Merge wrstuden-revivesa into HEAD.

Revision 1.287 / (download) - annotate - [select for diffs], Fri Sep 12 21:33:39 2008 UTC (15 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3
Changes since 1.286: +12 -16 lines
Diff to previous 1.286 (colored) to selected 1.161 (colored)

- remove dup code
- make sure that sigput always initializes ksi
- initialize si_code with SI_NOINFO instead of lying (SI_USER)
- if a process is being ktraced, make siginfo available
- always pass the available siginfo to ktrace, even if it has SI_NOINFO

Revision 1.286 / (download) - annotate - [select for diffs], Wed Jun 25 11:05:46 2008 UTC (15 years, 9 months ago) by ad
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-2, simonb-wapbl-nbase, simonb-wapbl-base
Branch point for: haad-dm
Changes since 1.285: +15 -12 lines
Diff to previous 1.285 (colored) to selected 1.161 (colored)

Use pool_cache.

Revision 1.285 / (download) - annotate - [select for diffs], Mon Jun 16 09:51:14 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base4, wrstuden-revivesa-base-1, wrstuden-revivesa-base
Changes since 1.284: +5 -5 lines
Diff to previous 1.284 (colored) to selected 1.161 (colored)

- PPWAIT is need only be locked by proc_lock, so move it to proc::p_lflag.
- Remove a few needless lock acquires from exec/fork/exit.
- Sprinkle branch hints.

No functional change.

Revision 1.284 / (download) - annotate - [select for diffs], Mon May 19 17:06:02 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base3, hpcarm-cleanup-nbase
Branch point for: simonb-wapbl
Changes since 1.283: +2 -5 lines
Diff to previous 1.283 (colored) to selected 1.161 (colored)

Reduce ifdefs due to MULTIPROCESSOR slightly.

Revision 1.283 / (download) - annotate - [select for diffs], Tue Apr 29 15:55:24 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base2, yamt-nfs-mp-base2
Branch point for: wrstuden-revivesa
Changes since 1.282: +4 -3 lines
Diff to previous 1.282 (colored) to selected 1.161 (colored)

Ignore processes with PK_MARKER set.

Revision 1.282 / (download) - annotate - [select for diffs], Tue Apr 29 15:51:23 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.281: +4 -2 lines
Diff to previous 1.281 (colored) to selected 1.161 (colored)

Ignore processes with PK_MARKER set.

Revision 1.281 / (download) - annotate - [select for diffs], Tue Apr 29 14:04:06 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.280: +14 -9 lines
Diff to previous 1.280 (colored) to selected 1.161 (colored)

Fix a race condition that could cause a deadlock between two threads in
the same process simultaneously trying to dump core. Fixes PR kern/37704.

Revision 1.280 / (download) - annotate - [select for diffs], Mon Apr 28 20:24:03 2008 UTC (15 years, 11 months ago) by martin
Branch: MAIN
Changes since 1.279: +2 -9 lines
Diff to previous 1.279 (colored) to selected 1.161 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.279 / (download) - annotate - [select for diffs], Fri Apr 25 11:24:11 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base
Branch point for: yamt-nfs-mp
Changes since 1.278: +12 -21 lines
Diff to previous 1.278 (colored) to selected 1.161 (colored)

Use pool_cache+atomics for sigacts.

Revision 1.278 / (download) - annotate - [select for diffs], Fri Apr 25 00:07:24 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.277: +2 -13 lines
Diff to previous 1.277 (colored) to selected 1.161 (colored)

Remove unneeded kernel_lock/splvm stuff.

Revision 1.277 / (download) - annotate - [select for diffs], Thu Apr 24 18:39:24 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.276: +71 -78 lines
Diff to previous 1.276 (colored) to selected 1.161 (colored)

Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.

Revision 1.276 / (download) - annotate - [select for diffs], Thu Apr 24 15:35:29 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.275: +35 -31 lines
Diff to previous 1.275 (colored) to selected 1.161 (colored)

Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
  be sent from a hardware interrupt handler. Signal activity must be
  deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
  and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.

Revision 1.275 / (download) - annotate - [select for diffs], Thu Mar 27 19:06:52 2008 UTC (16 years ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base
Branch point for: yamt-pf42
Changes since 1.274: +4 -4 lines
Diff to previous 1.274 (colored) to selected 1.161 (colored)

Make rusage collection per-LWP and collate in the appropriate places.
cloned threads need a little bit more work but the locking needs to
be fixed first.

Revision 1.274 / (download) - annotate - [select for diffs], Fri Mar 21 21:55:00 2008 UTC (16 years ago) by ad
Branch: MAIN
CVS Tags: yamt-lazymbuf-base15, yamt-lazymbuf-base14, ad-socklock-base1
Changes since 1.273: +13 -9 lines
Diff to previous 1.273 (colored) to selected 1.161 (colored)

Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.

Revision 1.273 / (download) - annotate - [select for diffs], Sat Mar 8 07:56:53 2008 UTC (16 years, 1 month ago) by yamt
Branch: MAIN
CVS Tags: matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base
Changes since 1.272: +3 -19 lines
Diff to previous 1.272 (colored) to selected 1.161 (colored)

kpsignal2: enqueue SA_STOP signals and let issignal handle it rather
than trying to stop the process by ourselves.  this fixes SIGTSTP masking.
ok'ed by Andrew Doran.  PR/37603, PR/38060.

Revision 1.272 / (download) - annotate - [select for diffs], Wed Feb 20 11:48:46 2008 UTC (16 years, 1 month ago) by yamt
Branch: MAIN
CVS Tags: nick-net80211-sync-base, nick-net80211-sync, hpcarm-cleanup-base
Branch point for: mjf-devfs2, keiichi-mipv6
Changes since 1.271: +64 -81 lines
Diff to previous 1.271 (colored) to selected 1.161 (colored)

reduce code duplication.  no functional changes are intended.

Revision 1.271 / (download) - annotate - [select for diffs], Tue Feb 19 16:16:06 2008 UTC (16 years, 1 month ago) by yamt
Branch: MAIN
Changes since 1.270: +1 -1 lines
Diff to previous 1.270 (colored) to selected 1.161 (colored)

L_PENDSIG -> LW_PENDSIG in a comment.

Revision 1.270 / (download) - annotate - [select for diffs], Tue Feb 19 12:24:34 2008 UTC (16 years, 2 months ago) by yamt
Branch: MAIN
Changes since 1.269: +3 -3 lines
Diff to previous 1.269 (colored) to selected 1.161 (colored)

constify

Revision 1.269 / (download) - annotate - [select for diffs], Tue Feb 19 12:22:44 2008 UTC (16 years, 2 months ago) by yamt
Branch: MAIN
Changes since 1.268: +2 -2 lines
Diff to previous 1.268 (colored) to selected 1.161 (colored)

update a comment.  (L_PENDSIG -> LW_PENDSIG)

Revision 1.268 / (download) - annotate - [select for diffs], Tue Feb 19 12:20:02 2008 UTC (16 years, 2 months ago) by yamt
Branch: MAIN
Changes since 1.267: +4 -4 lines
Diff to previous 1.267 (colored) to selected 1.161 (colored)

sigpause -> sigsuspend in comments.

Revision 1.267 / (download) - annotate - [select for diffs], Tue Feb 5 13:33:35 2008 UTC (16 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: mjf-devfs-base
Changes since 1.266: +6 -2 lines
Diff to previous 1.266 (colored) to selected 1.161 (colored)

Lock p->p_klist.

Revision 1.266 / (download) - annotate - [select for diffs], Thu Jan 31 00:50:32 2008 UTC (16 years, 2 months ago) by rmind
Branch: MAIN
Changes since 1.265: +6 -4 lines
Diff to previous 1.265 (colored) to selected 1.161 (colored)

sigpost: convert to the new, inverted priorities.
From <drochner>.

Revision 1.265 / (download) - annotate - [select for diffs], Thu Jan 24 13:57:52 2008 UTC (16 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.264: +3 -3 lines
Diff to previous 1.264 (colored) to selected 1.161 (colored)

Mark some callouts/workqueues/kthreads MPSAFE.

Revision 1.264 / (download) - annotate - [select for diffs], Wed Jan 23 17:52:32 2008 UTC (16 years, 2 months ago) by elad
Branch: MAIN
CVS Tags: bouyer-xeni386-nbase
Changes since 1.263: +6 -6 lines
Diff to previous 1.263 (colored) to selected 1.161 (colored)

Forgot to commit this in latest commit, spotted by hannken@.

Adapt to "CAN" removal...

Revision 1.263 / (download) - annotate - [select for diffs], Wed Dec 26 22:11:51 2007 UTC (16 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: matt-armv6-base, bouyer-xeni386-base
Changes since 1.262: +3 -3 lines
Diff to previous 1.262 (colored) to selected 1.161 (colored)

Add PaX ASLR (Address Space Layout Randomization) [from elad and myself]

For regular (non PIE) executables randomization is enabled for:
    1. The data segment
    2. The stack

For PIE executables(*) randomization is enabled for:
    1. The program itself
    2. All shared libraries
    3. The data segment
    4. The stack

(*) To generate a PIE executable:
    - compile everything with -fPIC
    - link with -shared-libgcc -Wl,-pie

This feature is experimental, and might change. To use selectively add
    options PAX_ASLR=0
in your kernel.

Currently we are using 12 bits for the stack, program, and data segment and
16 or 24 bits for mmap, depending on __LP64__.

Revision 1.262 / (download) - annotate - [select for diffs], Wed Dec 5 07:06:53 2007 UTC (16 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, vmlocking2-base3, vmlocking2-base2, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, jmcneill-pm-base, cube-autoconf-base, cube-autoconf
Branch point for: bouyer-xeni386
Changes since 1.261: +6 -4 lines
Diff to previous 1.261 (colored) to selected 1.161 (colored)

Match the docs: MUTEX_DRIVER/SPIN are now only for porting code written
for Solaris.

Revision 1.261 / (download) - annotate - [select for diffs], Mon Dec 3 20:26:25 2007 UTC (16 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: vmlocking2-base1
Branch point for: vmlocking2
Changes since 1.260: +4 -2 lines
Diff to previous 1.260 (colored) to selected 1.161 (colored)

Soft interrupts can now take proclist_lock, so there is no need to
double-lock alllwp or allproc.

Revision 1.260 / (download) - annotate - [select for diffs], Fri Nov 30 23:05:44 2007 UTC (16 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: vmlocking-nbase
Changes since 1.259: +8 -8 lines
Diff to previous 1.259 (colored) to selected 1.161 (colored)

Use membar_*().

Revision 1.259 / (download) - annotate - [select for diffs], Tue Nov 27 01:27:30 2007 UTC (16 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.258: +29 -36 lines
Diff to previous 1.258 (colored) to selected 1.161 (colored)

Tidy up the sigacts locking a bit: sigacts can be shared between
multiple processes.

Revision 1.258 / (download) - annotate - [select for diffs], Fri Oct 19 12:16:43 2007 UTC (16 years, 6 months ago) by ad
Branch: MAIN
CVS Tags: jmcneill-base, bouyer-xenamd64-base2, bouyer-xenamd64-base
Branch point for: mjf-devfs
Changes since 1.257: +3 -3 lines
Diff to previous 1.257 (colored) to selected 1.161 (colored)

machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h

Revision 1.257 / (download) - annotate - [select for diffs], Wed Oct 3 13:21:22 2007 UTC (16 years, 6 months ago) by ad
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, vmlocking-base
Branch point for: bouyer-xenamd64
Changes since 1.256: +6 -6 lines
Diff to previous 1.256 (colored) to selected 1.161 (colored)

Protect ksiginfo_pool with splvm to be on the safe side.

Revision 1.256 / (download) - annotate - [select for diffs], Fri Aug 17 17:25:14 2007 UTC (16 years, 8 months ago) by ad
Branch: MAIN
CVS Tags: yamt-x86pmap-base, nick-csl-alignment-base5
Branch point for: yamt-x86pmap, matt-armv6
Changes since 1.255: +3 -5 lines
Diff to previous 1.255 (colored) to selected 1.161 (colored)

Fix a couple of comments.

Revision 1.255 / (download) - annotate - [select for diffs], Wed Aug 15 12:07:33 2007 UTC (16 years, 8 months ago) by ad
Branch: MAIN
Changes since 1.254: +6 -12 lines
Diff to previous 1.254 (colored) to selected 1.161 (colored)

Changes to make ktrace LKM friendly and reduce ifdef KTRACE. Proposed
on tech-kern.

Revision 1.254 / (download) - annotate - [select for diffs], Mon Jul 9 21:10:53 2007 UTC (16 years, 9 months ago) by ad
Branch: MAIN
CVS Tags: nick-csl-alignment-base, mjf-ufs-trans-base, matt-mips64-base, matt-mips64, hpcarm-cleanup
Branch point for: nick-csl-alignment, jmcneill-pm
Changes since 1.253: +4 -4 lines
Diff to previous 1.253 (colored) to selected 1.161 (colored)

Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements

Revision 1.253 / (download) - annotate - [select for diffs], Thu May 17 14:51:40 2007 UTC (16 years, 11 months ago) by yamt
Branch: MAIN
Changes since 1.252: +3 -3 lines
Diff to previous 1.252 (colored) to selected 1.161 (colored)

merge yamt-idlelwp branch.  asked by core@.  some ports still needs work.

from doc/BRANCHES:

	idle lwp, and some changes depending on it.

	1. separate context switching and thread scheduling.
	   (cf. gmcgarry_ctxsw)
	2. implement idle lwp.
	3. clean up related MD/MI interfaces.
	4. make scheduler(s) modular.

Revision 1.252 / (download) - annotate - [select for diffs], Mon Mar 12 18:18:33 2007 UTC (17 years, 1 month ago) by ad
Branch: MAIN
CVS Tags: yamt-idlelwp-base8, thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup
Branch point for: mjf-ufs-trans
Changes since 1.251: +7 -5 lines
Diff to previous 1.251 (colored) to selected 1.161 (colored)

Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.

Revision 1.251 / (download) - annotate - [select for diffs], Fri Mar 9 14:11:25 2007 UTC (17 years, 1 month ago) by ad
Branch: MAIN
Branch point for: vmlocking
Changes since 1.250: +2 -2 lines
Diff to previous 1.250 (colored) to selected 1.161 (colored)

- Make the proclist_lock a mutex. The write:read ratio is unfavourable,
  and mutexes are cheaper use than RW locks.
- LOCK_ASSERT -> KASSERT in some places.
- Hold proclist_lock/kernel_lock longer in a couple of places.

Revision 1.250 / (download) - annotate - [select for diffs], Mon Mar 5 20:29:14 2007 UTC (17 years, 1 month ago) by ad
Branch: MAIN
Changes since 1.249: +42 -37 lines
Diff to previous 1.249 (colored) to selected 1.161 (colored)

- proc_unstop: adjust p_nrlwps correctly. Should fix PR kern/35657.
- LOCK_ASSERT -> KASSERT
- Update a couple of comments.

Revision 1.249 / (download) - annotate - [select for diffs], Thu Feb 22 06:34:44 2007 UTC (17 years, 1 month ago) by thorpej
Branch: MAIN
CVS Tags: ad-audiomp-base, ad-audiomp
Changes since 1.248: +9 -9 lines
Diff to previous 1.248 (colored) to selected 1.161 (colored)

TRUE -> true, FALSE -> false

Revision 1.248 / (download) - annotate - [select for diffs], Wed Feb 21 23:48:14 2007 UTC (17 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.247: +5 -5 lines
Diff to previous 1.247 (colored) to selected 1.161 (colored)

Pick up some additional files that were missed before due to conflicts
with newlock2 merge:

Replace the Mach-derived boolean_t type with the C99 bool type.  A
future commit will replace use of TRUE and FALSE with true and false.

Revision 1.247 / (download) - annotate - [select for diffs], Tue Feb 20 17:47:03 2007 UTC (17 years, 1 month ago) by ad
Branch: MAIN
Changes since 1.246: +9 -2 lines
Diff to previous 1.246 (colored) to selected 1.161 (colored)

When sending signals, only boost the priority of the receiving LWP if
the process is being killed.

Revision 1.246 / (download) - annotate - [select for diffs], Sat Feb 17 22:31:43 2007 UTC (17 years, 2 months ago) by pavel
Branch: MAIN
Changes since 1.245: +18 -18 lines
Diff to previous 1.245 (colored) to selected 1.161 (colored)

Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.

Revision 1.245 / (download) - annotate - [select for diffs], Fri Feb 16 00:35:20 2007 UTC (17 years, 2 months ago) by ad
Branch: MAIN
Branch point for: yamt-idlelwp
Changes since 1.244: +7 -4 lines
Diff to previous 1.244 (colored) to selected 1.161 (colored)

sigswitch(): don't blat the kernel_lock count that sleepq_block() saved
earlier.

Revision 1.244 / (download) - annotate - [select for diffs], Thu Feb 15 15:10:44 2007 UTC (17 years, 2 months ago) by yamt
Branch: MAIN
Changes since 1.243: +3 -3 lines
Diff to previous 1.243 (colored) to selected 1.161 (colored)

sigswitch: fix a deadlock.

Revision 1.243 / (download) - annotate - [select for diffs], Fri Feb 9 21:55:31 2007 UTC (17 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: post-newlock2-merge
Changes since 1.242: +1529 -1952 lines
Diff to previous 1.242 (colored) to selected 1.161 (colored)

Merge newlock2 to head.

Revision 1.242 / (download) - annotate - [select for diffs], Wed Jan 10 07:58:27 2007 UTC (17 years, 3 months ago) by enami
Branch: MAIN
CVS Tags: newlock2-nbase, newlock2-base
Changes since 1.241: +10 -8 lines
Diff to previous 1.241 (colored) to selected 1.161 (colored)

Plug another memory leak in __sigtimedwait1() which is introduced
by rev. 1.208: free `waitset' and ksiginfo on success.

Revision 1.241 / (download) - annotate - [select for diffs], Wed Jan 10 07:53:26 2007 UTC (17 years, 3 months ago) by enami
Branch: MAIN
Changes since 1.240: +13 -11 lines
Diff to previous 1.240 (colored) to selected 1.161 (colored)

Plug memory leak in __sigtimedwait1(): make sure to free `waitset'
on error return path.

Revision 1.240 / (download) - annotate - [select for diffs], Wed Nov 22 02:02:51 2006 UTC (17 years, 4 months ago) by elad
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, netbsd-4-base
Branch point for: netbsd-4
Changes since 1.239: +10 -2 lines
Diff to previous 1.239 (colored) to selected 1.161 (colored)

Initial implementation of PaX Segvguard (this is still work-in-progress,
it's just to get it out of my local tree).

Revision 1.239 / (download) - annotate - [select for diffs], Wed Nov 8 20:18:33 2006 UTC (17 years, 5 months ago) by drochner
Branch: MAIN
Changes since 1.238: +9 -6 lines
Diff to previous 1.238 (colored) to selected 1.161 (colored)

-SUS says that a successful call to setcontext(2) does not return. This
 implies that _UC_CPU must be set in the context passed. Check for this
 and return EINVAL if not; this gives a cheap test for corrupted
 ucontexts eg on a signal handler stack which would go unnoticed otherwise.
-Don't ckeck for NULL ucontext pointers explicitely. This is an error,
 except in the swapcontext() case where it can be easily caught in
 userland.

Revision 1.238 / (download) - annotate - [select for diffs], Fri Nov 3 19:46:03 2006 UTC (17 years, 5 months ago) by ad
Branch: MAIN
Changes since 1.237: +6 -2 lines
Diff to previous 1.237 (colored) to selected 1.161 (colored)

- issignal(): acquire the kernel lock before inspecting signal state
- lwp_exit2(): don't drop the kernel lock until after doing wakeup()

Revision 1.237 / (download) - annotate - [select for diffs], Fri Nov 3 12:18:41 2006 UTC (17 years, 5 months ago) by yamt
Branch: MAIN
Changes since 1.236: +31 -9 lines
Diff to previous 1.236 (colored) to selected 1.161 (colored)

fix deadlocks due to ksiginfo_pool spl problems.

Revision 1.236 / (download) - annotate - [select for diffs], Fri Nov 3 11:41:07 2006 UTC (17 years, 5 months ago) by yamt
Branch: MAIN
Changes since 1.235: +2 -2 lines
Diff to previous 1.235 (colored) to selected 1.161 (colored)

make siginfo_pool and ksiginfo_pool static.

Revision 1.235 / (download) - annotate - [select for diffs], Wed Nov 1 10:17:58 2006 UTC (17 years, 5 months ago) by yamt
Branch: MAIN
Changes since 1.234: +15 -15 lines
Diff to previous 1.234 (colored) to selected 1.161 (colored)

remove some __unused from function parameters.

Revision 1.234 / (download) - annotate - [select for diffs], Wed Nov 1 09:46:14 2006 UTC (17 years, 5 months ago) by yamt
Branch: MAIN
Changes since 1.233: +31 -59 lines
Diff to previous 1.233 (colored) to selected 1.161 (colored)

kill signal "dolock" hacks.

related to PR/32962 and PR/34895.  reviewed by matthew green.

Revision 1.233 / (download) - annotate - [select for diffs], Wed Nov 1 09:33:45 2006 UTC (17 years, 5 months ago) by yamt
Branch: MAIN
Changes since 1.232: +4 -6 lines
Diff to previous 1.232 (colored) to selected 1.161 (colored)

kill sched_psignal.
related to PR/32962 and PR/34895.  reviewed by matthew green.

Revision 1.232 / (download) - annotate - [select for diffs], Sat Oct 28 08:09:31 2006 UTC (17 years, 5 months ago) by mrg
Branch: MAIN
Changes since 1.231: +17 -10 lines
Diff to previous 1.231 (colored) to selected 1.161 (colored)

avoid allocating from ksiginfo_pool when we know we aren't going to
use it.  idea partly from yamt.  assert SCHED_ASSERT_UNLOCKED() in
all the places we call ksiginfo_queue() without a ksiginfo.

fixes recent panics detected by LOCKDEBUG.

Revision 1.231 / (download) - annotate - [select for diffs], Sun Oct 22 20:48:45 2006 UTC (17 years, 5 months ago) by mrg
Branch: MAIN
Changes since 1.230: +41 -18 lines
Diff to previous 1.230 (colored) to selected 1.161 (colored)

avoid a problem in kpsignal2() holding sched_lock while wanting to call
pool_get().  pre-allocate the ksiginfo_t before taking sched_lock and
use it if necessary, or freeing it if it is unused.

rename ksiginfo_{get,put}() to ksiginfo_{dequeue,queue}() (idea from chuq.)


this fixes PR#32962.  thanks to christos, chuq and go for help/ideas.

Revision 1.230 / (download) - annotate - [select for diffs], Thu Oct 12 01:32:17 2006 UTC (17 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2
Changes since 1.229: +17 -17 lines
Diff to previous 1.229 (colored) to selected 1.161 (colored)

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386

Revision 1.229 / (download) - annotate - [select for diffs], Wed Oct 4 23:10:42 2006 UTC (17 years, 6 months ago) by dogcow
Branch: MAIN
Changes since 1.228: +5 -4 lines
Diff to previous 1.228 (colored) to selected 1.161 (colored)

add braces for if-else statement, in the event that SCHED_ASSERT_LOCKED is an
empty statement; shuts gcc up about 'empty statement in if-else'.

Revision 1.228 / (download) - annotate - [select for diffs], Sat Sep 2 06:29:13 2006 UTC (17 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, rpaulo-netinet-merge-pcb-base
Branch point for: yamt-splraiseipl, newlock2
Changes since 1.227: +6 -3 lines
Diff to previous 1.227 (colored) to selected 1.161 (colored)

- fix initializer
- comment out unused code

Revision 1.227 / (download) - annotate - [select for diffs], Fri Sep 1 21:04:45 2006 UTC (17 years, 7 months ago) by matt
Branch: MAIN
Changes since 1.226: +7 -2 lines
Diff to previous 1.226 (colored) to selected 1.161 (colored)

Regen.  (add __weak_alias(sys_ptrace, sys_nosys) when PTRACE is off)

Revision 1.226 / (download) - annotate - [select for diffs], Wed Aug 30 13:55:03 2006 UTC (17 years, 7 months ago) by cube
Branch: MAIN
Changes since 1.225: +10 -3 lines
Diff to previous 1.225 (colored) to selected 1.161 (colored)

Let those compile under "no options COREDUMP".

Revision 1.225 / (download) - annotate - [select for diffs], Tue Aug 29 23:34:48 2006 UTC (17 years, 7 months ago) by matt
Branch: MAIN
Changes since 1.224: +9 -2 lines
Diff to previous 1.224 (colored) to selected 1.161 (colored)

Make PTRACE and COREDUMP optional.  Make the default (status quo) by putting
them in conf/std.

Revision 1.224 / (download) - annotate - [select for diffs], Sun Jul 23 22:06:11 2006 UTC (17 years, 8 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pdpolicy-base7, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.223: +18 -19 lines
Diff to previous 1.223 (colored) to selected 1.161 (colored)

Use the LWP cached credentials where sane.

Revision 1.223 / (download) - annotate - [select for diffs], Tue Jun 13 13:56:50 2006 UTC (17 years, 10 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-pdpolicy-base6, gdamore-uart-base, gdamore-uart, chap-midi-nbase, chap-midi-base
Changes since 1.222: +16 -17 lines
Diff to previous 1.222 (colored) to selected 1.161 (colored)

remove unnecessary arguments from kauth_authorize_process.
ie. make it similar to the one found in apple TN.

Revision 1.222 / (download) - annotate - [select for diffs], Sun Jun 11 07:32:18 2006 UTC (17 years, 10 months ago) by rjs
Branch: MAIN
Changes since 1.221: +3 -2 lines
Diff to previous 1.221 (colored) to selected 1.161 (colored)

Add includes of opt_multiprocessor.h and opt_lockdebug.h where missing.

Revision 1.221 / (download) - annotate - [select for diffs], Wed Jun 7 22:33:40 2006 UTC (17 years, 10 months ago) by kardel
Branch: MAIN
Changes since 1.220: +14 -21 lines
Diff to previous 1.220 (colored) to selected 1.161 (colored)

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html

Revision 1.220 / (download) - annotate - [select for diffs], Sun May 14 21:15:11 2006 UTC (17 years, 11 months ago) by elad
Branch: MAIN
CVS Tags: yamt-pdpolicy-base5, simonb-timecounters-base
Branch point for: chap-midi
Changes since 1.219: +22 -25 lines
Diff to previous 1.219 (colored) to selected 1.161 (colored)

integrate kauth.

Revision 1.219 / (download) - annotate - [select for diffs], Wed May 10 21:53:17 2006 UTC (17 years, 11 months ago) by mrg
Branch: MAIN
CVS Tags: elad-kernelauth-base
Changes since 1.218: +4 -2 lines
Diff to previous 1.218 (colored) to selected 1.161 (colored)

quell GCC 4.1 uninitialised variable warnings.

XXX: we should audit the tree for which old ones are no longer needed
after getting the older compilers out of the tree..

Revision 1.218 / (download) - annotate - [select for diffs], Sun Mar 12 18:36:58 2006 UTC (18 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: yamt-pdpolicy-base4, yamt-pdpolicy-base3, yamt-pdpolicy-base2, peter-altq-base
Branch point for: peter-altq
Changes since 1.217: +13 -19 lines
Diff to previous 1.217 (colored) to selected 1.161 (colored)

KNF: brace and parenthesis usage

Revision 1.217 / (download) - annotate - [select for diffs], Mon Mar 6 21:53:29 2006 UTC (18 years, 1 month ago) by matt
Branch: MAIN
Branch point for: elad-kernelauth
Changes since 1.216: +8 -3 lines
Diff to previous 1.216 (colored) to selected 1.161 (colored)

Add a diagnostic printf if a write fails during a coredump.

Revision 1.216 / (download) - annotate - [select for diffs], Sun Mar 5 07:21:38 2006 UTC (18 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: yamt-pdpolicy-base
Branch point for: yamt-pdpolicy
Changes since 1.215: +3 -4 lines
Diff to previous 1.215 (colored) to selected 1.161 (colored)

implement PT_SYSCALL

Revision 1.215 / (download) - annotate - [select for diffs], Sat Feb 4 12:09:50 2006 UTC (18 years, 2 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5
Changes since 1.214: +27 -14 lines
Diff to previous 1.214 (colored) to selected 1.161 (colored)

for some random places, use PNBUF_GET/PUT rather than
	- on-stack buffer
	- malloc(MAXPATHLEN)

Revision 1.214 / (download) - annotate - [select for diffs], Thu Feb 2 17:48:51 2006 UTC (18 years, 2 months ago) by elad
Branch: MAIN
Branch point for: simonb-timecounters
Changes since 1.213: +16 -4 lines
Diff to previous 1.213 (colored) to selected 1.161 (colored)

implement a security.setid_core node as discussed on tech-kern@ and
tech-security@.

Revision 1.213 / (download) - annotate - [select for diffs], Sat Dec 24 19:12:23 2005 UTC (18 years, 3 months ago) by perry
Branch: MAIN
Branch point for: yamt-uio_vmspace, rpaulo-netinet-merge-pcb
Changes since 1.212: +4 -4 lines
Diff to previous 1.212 (colored) to selected 1.161 (colored)

Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.

Revision 1.212 / (download) - annotate - [select for diffs], Sun Dec 11 12:24:29 2005 UTC (18 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.211: +14 -14 lines
Diff to previous 1.211 (colored) to selected 1.161 (colored)

merge ktrace-lwp.

Revision 1.211 / (download) - annotate - [select for diffs], Sat Nov 12 02:27:48 2005 UTC (18 years, 5 months ago) by chs
Branch: MAIN
CVS Tags: yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, ktrace-lwp-base
Changes since 1.210: +3 -14 lines
Diff to previous 1.210 (colored) to selected 1.161 (colored)

in kpsignal2(), do not try to wake up a cached LWP for SA processes
in the case where we're sending SIGKILL but all LWPs are not signalable.
some LWP will wake up soon enough to process the signal, and there may
not be any LWPs in the cache to wake up anyway.  fixes PR 28886 and PR 26771.
also, add a missing "break" pointed out by yamt.

Revision 1.210 / (download) - annotate - [select for diffs], Sun Oct 23 00:09:14 2005 UTC (18 years, 5 months ago) by cube
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-vop-base2, thorpej-vnode-attr-base, thorpej-vnode-attr
Changes since 1.209: +3 -3 lines
Diff to previous 1.209 (colored) to selected 1.161 (colored)

Implement a few changes needed to properly resolve PR#30924, as
discussed in the PR.

- introduce sys/timevar.h to hold kernel-specific stuff relevant to
  sys/time.h.  Ideally, timevar.h would contain all (or almost) of the
  #ifdef _KERNEL part of time.h, but that's a pretty big and tedious
  change to make.  For now, it will contain only the prototypes I
  introduced when working on COMPAT_NETBSD32.

- split copyinout_t into copyin_t and copyout_t, it makes prototypes more
  explicit about the meaning of a given argument.  Suggested by yamt@.

- move copyinout_t definition in sys/time.h to systm.h as copyin_t and
  copyout_t

- make everything uses the new types and include the proper headers at
  the proper places.

Revision 1.209 / (download) - annotate - [select for diffs], Sun Oct 2 17:51:27 2005 UTC (18 years, 6 months ago) by chs
Branch: MAIN
CVS Tags: yamt-vop-base
Branch point for: yamt-vop
Changes since 1.208: +19 -5 lines
Diff to previous 1.208 (colored) to selected 1.161 (colored)

avoid calling into the pool code while holding sched_lock
since both pool_get() and pool_put() can call wakeup().
instead, allocate the struct sadata_upcall before taking
sched_lock in mi_switch() and free it after releasing sched_lock.

clean up some modularity warts by adding a callback to
struct sadata_upcall for freeing sa_arg.

Revision 1.208 / (download) - annotate - [select for diffs], Sat Jul 23 22:02:13 2005 UTC (18 years, 8 months ago) by cube
Branch: MAIN
Changes since 1.207: +13 -5 lines
Diff to previous 1.207 (colored) to selected 1.161 (colored)

Introduce __sigtimedwait1 which will help adding COMPAT_NETBSD32 support
for __sigtimedwait(2).

Revision 1.207 / (download) - annotate - [select for diffs], Fri Jun 10 05:10:13 2005 UTC (18 years, 10 months ago) by matt
Branch: MAIN
Branch point for: yamt-lazymbuf
Changes since 1.206: +33 -3 lines
Diff to previous 1.206 (colored) to selected 1.161 (colored)

Rework the coredump code to have no explicit knownledge of how coredump
i/o is done.  Instead, pass an opaque cookie which is then passed to a
new routine, coredump_write, which does the actual i/o.  This allows the
method of doing i/o to change without affecting any future MD code.
Also, make netbsd32_core.c [re]use core_netbsd.c (in a similar manner that
core_elf64.c uses core_elf32.c) and eliminate that code duplication.
cpu_coredump{,32} is now called twice, first with a NULL iocookie to fill
the core structure and a second to actually write md parts of the coredump.
All i/o is nolonger random access and is suitable for shipping over a stream.

Revision 1.206 / (download) - annotate - [select for diffs], Sun May 29 22:24:15 2005 UTC (18 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.205: +4 -4 lines
Diff to previous 1.205 (colored) to selected 1.161 (colored)

- add const.
- remove unnecessary casts.
- add __UNCONST casts and mark them with XXXUNCONST as necessary.

Revision 1.205 / (download) - annotate - [select for diffs], Sat Apr 9 16:07:52 2005 UTC (19 years ago) by christos
Branch: MAIN
CVS Tags: kent-audio2-base
Changes since 1.204: +9 -3 lines
Diff to previous 1.204 (colored) to selected 1.161 (colored)

Reset SIGCHLD handler if it is ignored, and clear the P_CLDSIGIGN bit. It
does not make sense to inherit this across execs. From FreeBSD.

Revision 1.204 / (download) - annotate - [select for diffs], Fri Apr 1 11:59:37 2005 UTC (19 years ago) by yamt
Branch: MAIN
Changes since 1.203: +7 -6 lines
Diff to previous 1.203 (colored) to selected 1.161 (colored)

merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
  save some resources like pv_entry.  also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.

Revision 1.203 / (download) - annotate - [select for diffs], Wed Mar 30 17:07:51 2005 UTC (19 years ago) by christos
Branch: MAIN
Changes since 1.202: +14 -2 lines
Diff to previous 1.202 (colored) to selected 1.161 (colored)

PR/19837: Stephen Ma: signal(SIGCHLD, SIG_IGN) should not create zombies.

Revision 1.202 / (download) - annotate - [select for diffs], Sat Feb 26 21:34:55 2005 UTC (19 years, 1 month ago) by perry
Branch: MAIN
CVS Tags: yamt-km-base4, yamt-km-base3, netbsd-3-base
Branch point for: netbsd-3
Changes since 1.201: +41 -41 lines
Diff to previous 1.201 (colored) to selected 1.161 (colored)

nuke trailing whitespace

Revision 1.201 / (download) - annotate - [select for diffs], Sun Jan 9 19:22:55 2005 UTC (19 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: yamt-km-base2, yamt-km-base, kent-audio1-beforemerge
Branch point for: yamt-km, kent-audio2
Changes since 1.200: +10 -10 lines
Diff to previous 1.200 (colored) to selected 1.161 (colored)

Allow PT_DUMPCORE to specify the core filename.

Revision 1.200 / (download) - annotate - [select for diffs], Thu Jan 6 19:26:41 2005 UTC (19 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.199: +8 -5 lines
Diff to previous 1.199 (colored) to selected 1.161 (colored)

If sa_upcall() fails (which is always going to be due to resource exhaustion),
do not leak siginfo structures.

Note that in the cases of trap signals and timer events, losing this
information could be very bad; right now it will cause us to spin until the
process is SIGKILLed.

"Needs work."

Revision 1.199 / (download) - annotate - [select for diffs], Fri Oct 1 16:30:55 2004 UTC (19 years, 6 months ago) by yamt
Branch: MAIN
CVS Tags: kent-audio1-base, kent-audio1
Changes since 1.198: +3 -3 lines
Diff to previous 1.198 (colored) to selected 1.161 (colored)

introduce a function, proclist_foreach_call, to iterate all procs on
a proclist and call the specified function for each of them.
primarily to fix a procfs locking problem, but i think that it's useful for
others as well.

while i'm here, introduce PROCLIST_FOREACH macro, which is similar to
LIST_FOREACH but skips marker entries which are used by proclist_foreach_call.

Revision 1.198 / (download) - annotate - [select for diffs], Tue Sep 28 08:59:20 2004 UTC (19 years, 6 months ago) by jdolecek
Branch: MAIN
Changes since 1.197: +43 -53 lines
Diff to previous 1.197 (colored) to selected 1.161 (colored)

adjust the change of rev. 1.190 so that trap signals not matching
the reset condition are processed properly; this fixes PR#26687 by
Jan Schaumann

many thanks to Mark Davies, who tracked the offending change down
and helped test patches

while here, g/c unused sigtrapmask and rearrange some code to pre-r1.190 form
for better readability

Revision 1.197 / (download) - annotate - [select for diffs], Tue Jun 8 19:35:30 2004 UTC (19 years, 10 months ago) by he
Branch: MAIN
Changes since 1.196: +5 -3 lines
Diff to previous 1.196 (colored) to selected 1.161 (colored)

PAGE_SIZE is apparently not a constant on the sparc port, so don't
use it in a static initializer.  Instead, initialize in signal_init().

Revision 1.196 / (download) - annotate - [select for diffs], Fri Jun 4 12:23:50 2004 UTC (19 years, 10 months ago) by skrll
Branch: MAIN
Changes since 1.195: +32 -4 lines
Diff to previous 1.195 (colored) to selected 1.161 (colored)

Allow for struct sigacts being greater than PAGE_SIZE on sun2.  sun2
-current kernels now work again.

Reviewed by Matt Thomas. Thanks.

Revision 1.195 / (download) - annotate - [select for diffs], Tue May 4 21:25:47 2004 UTC (19 years, 11 months ago) by pk
Branch: MAIN
Changes since 1.194: +3 -5 lines
Diff to previous 1.194 (colored) to selected 1.161 (colored)

Change sigactsfree() to take a `struct sigacts' pointer, to fit the needs
of exit1 (its only client).

Revision 1.194 / (download) - annotate - [select for diffs], Sun Apr 25 16:42:41 2004 UTC (19 years, 11 months ago) by simonb
Branch: MAIN
Changes since 1.193: +8 -11 lines
Diff to previous 1.193 (colored) to selected 1.161 (colored)

Initialise (most) pools from a link set instead of explicit calls
to pool_init.  Untouched pools are ones that either in arch-specific
code, or aren't initialiased during initial system startup.

 Convert struct session, ucred and lockf to pools.

Revision 1.193 / (download) - annotate - [select for diffs], Sat Apr 3 19:46:10 2004 UTC (20 years ago) by matt
Branch: MAIN
Changes since 1.192: +7 -0 lines
Diff to previous 1.192 (colored) to selected 1.161 (colored)

When a process is being traced (debugged) and a catchable signal arrives,
make sure to save its ksiginfo_t for eventual delivery.  This makes debugging
SA_SIGINFO signal handlers work.

Revision 1.192 / (download) - annotate - [select for diffs], Sat Apr 3 19:43:08 2004 UTC (20 years ago) by matt
Branch: MAIN
Changes since 1.191: +11 -6 lines
Diff to previous 1.191 (colored) to selected 1.161 (colored)

Add the notion of an "empty" ksiginfo_t (one where on signo is filled in).
Add an initializer for them: KSI_INIT_EMPTY
Add a predicate for them: KSI_EMPTY_P
Don't bother storing empty ksiginfo_t's since they have no information.
Change uses of KSI_INIT to KSI_INIT_EMPTY where no other information other
than the signo is being filled in.

Revision 1.191 / (download) - annotate - [select for diffs], Sat Apr 3 19:38:04 2004 UTC (20 years ago) by matt
Branch: MAIN
Changes since 1.190: +8 -8 lines
Diff to previous 1.190 (colored) to selected 1.161 (colored)

Replace memset's of ksiginfo_t with KSI_INIT (which is the proper way to
initialize ksiginfo_t structures).

Revision 1.190 / (download) - annotate - [select for diffs], Thu Apr 1 16:56:44 2004 UTC (20 years ago) by matt
Branch: MAIN
Changes since 1.189: +47 -22 lines
Diff to previous 1.189 (colored) to selected 1.161 (colored)

If a signal is the result of trap, only invoke a supplied handler if it's
not blocked.  Otherwise (it if it blocked or the hanlder is set to SIG_IGN)
reset the signal back to its default settings so that a coredump can be
generated.

Revision 1.189 / (download) - annotate - [select for diffs], Fri Mar 26 17:13:37 2004 UTC (20 years ago) by drochner
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.188: +2 -26 lines
Diff to previous 1.188 (colored) to selected 1.161 (colored)

all ports define __HAVE_SIGINFO now, so remove the CPP conditionals

Revision 1.188 / (download) - annotate - [select for diffs], Sun Mar 21 18:41:38 2004 UTC (20 years, 1 month ago) by cl
Branch: MAIN
Changes since 1.187: +14 -2 lines
Diff to previous 1.187 (colored) to selected 1.161 (colored)

On MP, exit postsig() when another LWP has already handled the signal while
this LWP was waiting for the kernel lock.

Fixes PR kern/24829

Revision 1.187 / (download) - annotate - [select for diffs], Sun Mar 14 01:08:47 2004 UTC (20 years, 1 month ago) by cl
Branch: MAIN
Changes since 1.186: +68 -48 lines
Diff to previous 1.186 (colored) to selected 1.161 (colored)

add kernel part of concurrency support for SA on MP systems
- move per VP data into struct sadata_vp referenced from l->l_savp
  * VP id
  * lock on VP data
  * LWP on VP
  * recently blocked LWP on VP
  * queue of LWPs woken which ran on this VP before sleep
  * faultaddr
  * LWP cache for upcalls
  * upcall queue
- add current concurrency and requested concurrency variables
- make process exit run LWP on all VPs
- make signal delivery consider all VPs
- make timer events consider all VPs
- add sa_newsavp to allocate new sadata_vp structure
- add sa_increaseconcurrency to prepare new VP
- make sys_sa_setconcurrency request new VP or wakeup idle VP
- make sa_yield lower current concurrency
- set sa_cpu = VP id in upcalls
- maintain cached LWPs per VP

Revision 1.186 / (download) - annotate - [select for diffs], Thu Mar 11 22:34:26 2004 UTC (20 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.185: +10 -5 lines
Diff to previous 1.185 (colored) to selected 1.161 (colored)

PR/24750: Frank Kardel: panic when process is signalled during
proc initialization.

Revision 1.185 / (download) - annotate - [select for diffs], Thu Mar 4 00:05:58 2004 UTC (20 years, 1 month ago) by matt
Branch: MAIN
Changes since 1.184: +14 -6 lines
Diff to previous 1.184 (colored) to selected 1.161 (colored)

Look at _UC_STACK to decide whether the process' SS_ONSTACK state needs to
be updated.  (This is needed to be compatible with how pre-SIGINFO signals
operated.  If you siglongjmp out of a signal handler, the SS_ONSTACK state
needs to be cleared.  This commit restores that functionality).

Revision 1.184 / (download) - annotate - [select for diffs], Wed Dec 24 22:53:59 2003 UTC (20 years, 3 months ago) by manu
Branch: MAIN
Changes since 1.183: +9 -9 lines
Diff to previous 1.183 (colored) to selected 1.161 (colored)

Move the sigfilter hook to a more adequate location, and rename it to better
fit what it does.

The softsignal feature is used in Darwin to trace processes. When the
traced process gets a signal, this raises an exception. The debugger will
receive the exception message, use ptrace with PT_THUPDATE to pass the
signal to the child or discard it, and then it will send a reply to the
exception message, to resume the child.

With the hook at the beginnng of kpsignal2, we are in the context of the
signal sender, which can be the kill(1) command, for instance. We cannot
afford to sleep until the debugger tells us if the signal should be
delivered or not.

Therefore, the hook to generate the Mach exception must be in the traced
process context. That was we can sleep awaiting for the debugger opinion
about the signal, this is not a problem. The hook is hence located into
issignal, at the place where normally SIGCHILD is sent to the debugger,
whereas the traced process is stopped. If the hook returns 0, we bypass
thoses operations, the Mach exception mecanism will take care of notifying
the debugger (through a Mach exception), and stop the faulting thread.

Revision 1.183 / (download) - annotate - [select for diffs], Sat Dec 20 19:01:30 2003 UTC (20 years, 4 months ago) by fvdl
Branch: MAIN
Changes since 1.182: +8 -2 lines
Diff to previous 1.182 (colored) to selected 1.161 (colored)

Put back Emmanuel's sigfilter hooks, as decided by Core.

Revision 1.182 / (download) - annotate - [select for diffs], Fri Dec 5 21:12:43 2003 UTC (20 years, 4 months ago) by jdolecek
Branch: MAIN
Changes since 1.181: +0 -6 lines
Diff to previous 1.181 (colored) to selected 1.161 (colored)

back the sigfilter emulation hook change off

Revision 1.181 / (download) - annotate - [select for diffs], Wed Dec 3 20:24:51 2003 UTC (20 years, 4 months ago) by manu
Branch: MAIN
Changes since 1.180: +8 -2 lines
Diff to previous 1.180 (colored) to selected 1.161 (colored)

Add a sigfilter emulation hook. It is used at the beginning of kpsignal2()
so that a specific emulation has the oportunity to filter out some signals.

if sigfilter returns 0, then no signal is sent by kpsignal2().

There is another place where signals can be generated: trapsignal. Since this
function is already an emulation hook, no call to the sigfilter hook was
introduced in trapsignal.

This is needed to emulate the softsignal feature in COMPAT_DARWIN (signals
sent as Mach exception messages)

Revision 1.180 / (download) - annotate - [select for diffs], Thu Nov 27 23:16:47 2003 UTC (20 years, 4 months ago) by manu
Branch: MAIN
Changes since 1.179: +8 -7 lines
Diff to previous 1.179 (colored) to selected 1.161 (colored)

Make the wakeup optionnal in proc_stop, so that it is possible to stop a
process without waking up its parent.

Revision 1.179 / (download) - annotate - [select for diffs], Mon Nov 17 19:21:56 2003 UTC (20 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.178: +3 -4 lines
Diff to previous 1.178 (colored) to selected 1.161 (colored)

expose proc_stop; needed by mach/darwin emulation

Revision 1.178 / (download) - annotate - [select for diffs], Wed Nov 12 21:07:38 2003 UTC (20 years, 5 months ago) by dsl
Branch: MAIN
Changes since 1.177: +8 -3 lines
Diff to previous 1.177 (colored) to selected 1.161 (colored)

- Count number of zombies and stopped children and requeue them at the top
  of the sibling list so that find_stopped_child can be optimised to avoid
  traversing the entire sibling list - helps when a process has a lot of
  children.
- Modify locking in pfind() and pgfind() to that the caller can rely on the
  result being valid, allow caller to request that zombies be findable.
- Rename pfind() to p_find() to ensure we break binary compatibility.
- Remove svr4_pfind since p_find willnow do the job.
- Modify some of the SMP locking of the proc lists - signals are still stuffed.

Welcome to 1.6ZF

Revision 1.177 / (download) - annotate - [select for diffs], Mon Nov 3 22:34:51 2003 UTC (20 years, 5 months ago) by cl
Branch: MAIN
Changes since 1.176: +5 -4 lines
Diff to previous 1.176 (colored) to selected 1.161 (colored)

Reimplement VP donation such that multiple unblocked upcalls can be
combined.  Also prepare for adding VP repossession later.

- kern_sa.c: sa_yield/sa_switch: detect if there are pending unblocked
  upcalls.
- kern_sa.c: sa_unblock_userret/sa_setwoken: queue LWPs about to invoke
  an unblocked upcall on the sa_wokenq.  put queued LWPs in a state where
  they can be put in the cache.  notify LWP on the VP about pending
  upcalls.
- kern_sa.c: sa_upcall_userret: check sa_wokenq for pending upcalls,
  generate unblocked upcalls with multiple event sas
- kern_sa.c: sa_vp_repossess/sa_vp_donate: g/c, restore original
  sa_vp_repossess

Revision 1.176 / (download) - annotate - [select for diffs], Sun Nov 2 16:30:55 2003 UTC (20 years, 5 months ago) by cl
Branch: MAIN
Changes since 1.175: +110 -113 lines
Diff to previous 1.175 (colored) to selected 1.161 (colored)

perform indention change left out of previous commit

Revision 1.175 / (download) - annotate - [select for diffs], Sun Nov 2 16:26:10 2003 UTC (20 years, 5 months ago) by cl
Branch: MAIN
Changes since 1.174: +99 -57 lines
Diff to previous 1.174 (colored) to selected 1.161 (colored)

Cleanup signal delivery for SA processes:
General idea:  only consider the LWP on the VP for signal delivery, all
other LWPs are either asleep or running from waking up until repossessing
the VP.

- in kern_sig.c:kpsignal2: handle all states the LWP on the VP can be in
- in kern_sig.c:proc_stop: only try to stop the LWP on the VP.  All other
  LWPs will suspend in sa_vp_repossess() until the VP-LWP donates the VP.
  Restore original behaviour (before SA-specific hacks were added) for
  non-SA processes.
- in kern_sig.c:proc_unstop: only return the LWP on the VP
- handle sa_yield as case 0 in sa_switch instead of clearing L_SA, add an
  L_SA_YIELD flag
- replace sa_idle by L_SA_IDLE flag since it was either NULL or == sa_vp

Also don't output itimerfire overrun warning if the process is already
exiting.
Also g/c sa_woken because it's not used.
Also g/c some #if 0 code.

Revision 1.174 / (download) - annotate - [select for diffs], Sat Nov 1 17:59:57 2003 UTC (20 years, 5 months ago) by jdolecek
Branch: MAIN
Changes since 1.173: +3 -4 lines
Diff to previous 1.173 (colored) to selected 1.161 (colored)

add a macro to copy ksiginfo_t, and use it in kern_sig.c:ksiginfo_put()

change suggested by Christian Limpach

Revision 1.173 / (download) - annotate - [select for diffs], Sat Nov 1 07:44:14 2003 UTC (20 years, 5 months ago) by jdolecek
Branch: MAIN
Changes since 1.172: +16 -10 lines
Diff to previous 1.172 (colored) to selected 1.161 (colored)

in sigtimedwait(), use malloc(9)ed (and thus wired) memory for the waitset
we pass via sigctx, so that it guaranteed that the memory wouldn't be
paged out at the time the signal arrives

potential problem pointed out by YAMAMOTO Takashi

Revision 1.172 / (download) - annotate - [select for diffs], Thu Oct 30 16:32:58 2003 UTC (20 years, 5 months ago) by jdolecek
Branch: MAIN
Changes since 1.171: +4 -6 lines
Diff to previous 1.171 (colored) to selected 1.161 (colored)

ksiginfo_put(): only copy what's needed of ksiginfo_t, to slightly optimize
the operation, and improve code readability at the same time

Revision 1.171 / (download) - annotate - [select for diffs], Sat Oct 25 16:50:37 2003 UTC (20 years, 5 months ago) by jdolecek
Branch: MAIN
Changes since 1.170: +57 -48 lines
Diff to previous 1.170 (colored) to selected 1.161 (colored)

modify sigtimedwait(2) to return full siginfo if available, and pass the wait
set using a pointer, to save couple bytes in struct sigctx

also fix fallout from recent lwp_wakeup() change, where we failed to properly
detect if tsleep() returned as result of lwp_wakeup() or signal outside
our wait set; could have caused problems for threaded apps using sigwait(2)
et.al.

Revision 1.170 / (download) - annotate - [select for diffs], Sat Oct 25 09:06:51 2003 UTC (20 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.169: +3 -3 lines
Diff to previous 1.169 (colored) to selected 1.161 (colored)

fix uninitialized variable

Revision 1.169 / (download) - annotate - [select for diffs], Wed Oct 15 11:28:59 2003 UTC (20 years, 6 months ago) by hannken
Branch: MAIN
Changes since 1.168: +15 -2 lines
Diff to previous 1.168 (colored) to selected 1.161 (colored)

Add the gating of system calls that cause modifications to the underlying
file system.
The function vfs_write_suspend stops all new write operations to a file
system, allows any file system modifying system calls already in progress
to complete, then sync's the file system to disk and returns. The
function vfs_write_resume allows the suspended write operations to
complete.

From FreeBSD with slight modifications.

Approved by: Frank van der Linden <fvdl@netbsd.org>

Revision 1.168 / (download) - annotate - [select for diffs], Sun Oct 12 20:09:50 2003 UTC (20 years, 6 months ago) by pk
Branch: MAIN
Changes since 1.167: +12 -5 lines
Diff to previous 1.167 (colored) to selected 1.161 (colored)

ksiginfo_get/exit hook: protect queue operations with splsoftclock() (noted
by Christos).

Revision 1.167 / (download) - annotate - [select for diffs], Sun Oct 12 14:32:05 2003 UTC (20 years, 6 months ago) by pk
Branch: MAIN
Changes since 1.166: +8 -5 lines
Diff to previous 1.166 (colored) to selected 1.161 (colored)

ksiginfo_put: protect queue operation with splsoftclock(), since it can
be called from timer interrupts.

Revision 1.166 / (download) - annotate - [select for diffs], Wed Oct 8 00:28:42 2003 UTC (20 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.165: +9 -6 lines
Diff to previous 1.165 (colored) to selected 1.161 (colored)

* Shuffle some data structures so, and add a flags word to ksiginfo_t.
  Right now the only flag is used to indicate if a ksiginfo_t is a
  result of a trap.  Add a predicate macro to test for this flag.
* Add initialization macros for ksiginfo_t's.
* Add accssor macro for ksi_trap.  Expands to 0 if the ksiginfo_t was
  not the result of a trap.  This matches the sigcontext trapcode semantics.
* In kpsendsig(), use KSI_TRAP_P() to select the lwp that gets the signal.
  Inspired by Matthias Drochner's fix to kpsendsig(), but correctly handles
  the case of non-trap-generated signals that have a > 0 si_code.

This patch fixes a signal delivery problem with threaded programs noted by
Matthias Drochner on tech-kern.

As discussed on tech-kern.  Reviewed and OK's by Christos.

Revision 1.165 / (download) - annotate - [select for diffs], Tue Oct 7 00:23:17 2003 UTC (20 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.164: +9 -6 lines
Diff to previous 1.164 (colored) to selected 1.161 (colored)

Whitespace nits.

Revision 1.164 / (download) - annotate - [select for diffs], Sat Oct 4 03:45:49 2003 UTC (20 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.163: +3 -3 lines
Diff to previous 1.163 (colored) to selected 1.161 (colored)

Don't look for file descriptor matches when a process is exiting. From
Andrey Petrov.

Revision 1.163 / (download) - annotate - [select for diffs], Fri Oct 3 17:51:13 2003 UTC (20 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.162: +9 -4 lines
Diff to previous 1.162 (colored) to selected 1.161 (colored)

Fix problem with signal trampoline version checking that did not take into
account that emulations usually use version 0 and provide their own in kernel
trampolines.

Revision 1.162 / (download) - annotate - [select for diffs], Sat Sep 27 00:57:45 2003 UTC (20 years, 6 months ago) by matt
Branch: MAIN
Changes since 1.161: +7 -7 lines
Diff to previous 1.161 (colored)

Deal with signal trampoline being const.

Revision 1.161 / (download) - annotate - [selected], Fri Sep 26 22:14:19 2003 UTC (20 years, 6 months ago) by matt
Branch: MAIN
Changes since 1.160: +5 -2 lines
Diff to previous 1.160 (colored)

Add a machine-dependent SIGTRAMP_VALID macro which is used to test whether
a trampoline version is valid or not.

Revision 1.160 / (download) - annotate - [select for diffs], Thu Sep 25 21:59:18 2003 UTC (20 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.159: +34 -29 lines
Diff to previous 1.159 (colored) to selected 1.161 (colored)

constify sendsig/trapsignal

Revision 1.159 / (download) - annotate - [select for diffs], Tue Sep 23 17:59:48 2003 UTC (20 years, 6 months ago) by nathanw
Branch: MAIN
Changes since 1.158: +3 -3 lines
Diff to previous 1.158 (colored) to selected 1.161 (colored)

When the syscall was made a compat syscall and the function name
changed to compat_16_sys___sigaction14, the name of the _args
structure chaged as well.

Revision 1.158 / (download) - annotate - [select for diffs], Tue Sep 23 14:34:07 2003 UTC (20 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.157: +6 -3 lines
Diff to previous 1.157 (colored) to selected 1.161 (colored)

__sigaction14 should have been COMPAT_16 a while ago. GC it now.

Revision 1.157 / (download) - annotate - [select for diffs], Fri Sep 19 22:51:31 2003 UTC (20 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.156: +23 -8 lines
Diff to previous 1.156 (colored) to selected 1.161 (colored)

- support for siginfo_t in ktrace
- make sure allocation for ksiginfo_t worked

Revision 1.156 / (download) - annotate - [select for diffs], Tue Sep 16 15:59:28 2003 UTC (20 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.155: +3 -3 lines
Diff to previous 1.155 (colored) to selected 1.161 (colored)

fix typo (ktr -> ksi)

Revision 1.155 / (download) - annotate - [select for diffs], Tue Sep 16 12:07:11 2003 UTC (20 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.154: +51 -72 lines
Diff to previous 1.154 (colored) to selected 1.161 (colored)

- convert to circleq
- add simple lock for the list
- make get function remove the item from the list
- eliminate superfluous functions
thanks to enami and matt for the feedback.

Revision 1.154 / (download) - annotate - [select for diffs], Sun Sep 14 23:45:53 2003 UTC (20 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.153: +3 -3 lines
Diff to previous 1.153 (colored) to selected 1.161 (colored)

remove variable name from prototype.

Revision 1.153 / (download) - annotate - [select for diffs], Sun Sep 14 17:39:03 2003 UTC (20 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.152: +8 -4 lines
Diff to previous 1.152 (colored) to selected 1.161 (colored)

- don't trash the linked list pointers in the ksiginfo_t reuse case
  [thanks enami]
- fix uninitialized variable in the exit hook.
  [thanks yamt]

Revision 1.152 / (download) - annotate - [select for diffs], Sun Sep 14 06:59:14 2003 UTC (20 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.151: +144 -26 lines
Diff to previous 1.151 (colored) to selected 1.161 (colored)

handle siginfo for deferred signals. Allocate a ksiginfo pool, and store
the information there.
TODO:
1. since timer stuff gets called from an interrupt context, we could
   preallocate ksiginfo_t's from the pool, so we don't need a kmem
   pool.
2. probably the sa signal delivery syscall can be changed to take
   a ksiginfo_t so we can use only one pool.
3. maybe when we add realtime signal support, add a resource limit
   on the number of ksiginfo_t's a process can allocate.

Revision 1.151 / (download) - annotate - [select for diffs], Sat Sep 13 15:32:41 2003 UTC (20 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.150: +26 -6 lines
Diff to previous 1.150 (colored) to selected 1.161 (colored)

provide siginfo_t in for SIGCHLD

Revision 1.150 / (download) - annotate - [select for diffs], Thu Sep 11 01:32:09 2003 UTC (20 years, 7 months ago) by cl
Branch: MAIN
Changes since 1.149: +6 -5 lines
Diff to previous 1.149 (colored) to selected 1.161 (colored)

KNF and use f instead of s to temporarily save l_flag

Revision 1.149 / (download) - annotate - [select for diffs], Wed Sep 10 16:41:26 2003 UTC (20 years, 7 months ago) by kleink
Branch: MAIN
Changes since 1.148: +7 -2 lines
Diff to previous 1.148 (colored) to selected 1.161 (colored)

sigaction1(): if SA_SIGINFO is set but not supported, fail early.
As discussed with Christos.

Revision 1.148 / (download) - annotate - [select for diffs], Sat Sep 6 22:03:09 2003 UTC (20 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.147: +110 -37 lines
Diff to previous 1.147 (colored) to selected 1.161 (colored)

SA_SIGINFO changes.

Revision 1.147 / (download) - annotate - [select for diffs], Mon Aug 11 21:18:19 2003 UTC (20 years, 8 months ago) by fvdl
Branch: MAIN
Changes since 1.146: +5 -5 lines
Diff to previous 1.146 (colored) to selected 1.161 (colored)

SA fixes from Stephan Uphoff. Quoting him:

The patch below (hopefully) improves some signaling problems
found by Nathan.

It also contains some cleanup of the sa_upcall_userret() function
removing any sleep calls using PCATCH.

Unblocked threads now only use an upcall stack after they
acquire the virtual CPU.
This prevents unblocked threads from stealing all available
upcall stacks.


Tested by Nick Hudson.

Revision 1.146 / (download) - annotate - [select for diffs], Thu Aug 7 16:31:48 2003 UTC (20 years, 8 months ago) by agc
Branch: MAIN
Changes since 1.145: +3 -7 lines
Diff to previous 1.145 (colored) to selected 1.161 (colored)

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.

Revision 1.145 / (download) - annotate - [select for diffs], Mon Jul 21 22:57:46 2003 UTC (20 years, 9 months ago) by nathanw
Branch: MAIN
Changes since 1.144: +3 -15 lines
Diff to previous 1.144 (colored) to selected 1.161 (colored)

Whitespace.

Revision 1.144 / (download) - annotate - [select for diffs], Thu Jul 17 18:16:58 2003 UTC (20 years, 9 months ago) by fvdl
Branch: MAIN
Changes since 1.143: +61 -9 lines
Diff to previous 1.143 (colored) to selected 1.161 (colored)

Changes from Stephan Uphoff to patch problems with LWPs blocking when they
shouldn't, and MP.

Revision 1.143 / (download) - annotate - [select for diffs], Sun Jun 29 22:31:22 2003 UTC (20 years, 9 months ago) by fvdl
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.142: +7 -7 lines
Diff to previous 1.142 (colored) to selected 1.161 (colored)

Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.

Revision 1.142 / (download) - annotate - [select for diffs], Sat Jun 28 14:21:54 2003 UTC (20 years, 9 months ago) by darrenr
Branch: MAIN
Changes since 1.141: +9 -9 lines
Diff to previous 1.141 (colored) to selected 1.161 (colored)

Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V

Revision 1.141 / (download) - annotate - [select for diffs], Tue May 20 17:42:51 2003 UTC (20 years, 11 months ago) by nathanw
Branch: MAIN
Changes since 1.140: +4 -2 lines
Diff to previous 1.140 (colored) to selected 1.161 (colored)

Track the LWP ID of a synchronous (trap) signal, and report it in core dumps.

Revision 1.140 / (download) - annotate - [select for diffs], Wed Apr 23 21:32:10 2003 UTC (20 years, 11 months ago) by nathanw
Branch: MAIN
Changes since 1.139: +18 -9 lines
Diff to previous 1.139 (colored) to selected 1.161 (colored)

Patch from Nick Hudson to clean up a couple of cases in proc_unstop(),
as well as improving the comments a bit. Addresses PR kern/20159.

Revision 1.139 / (download) - annotate - [select for diffs], Tue Apr 15 12:11:25 2003 UTC (21 years ago) by skrll
Branch: MAIN
Changes since 1.138: +3 -4 lines
Diff to previous 1.138 (colored) to selected 1.161 (colored)

ANSIfy proc_unstop

Revision 1.138 / (download) - annotate - [select for diffs], Sat Mar 29 22:48:39 2003 UTC (21 years ago) by wiz
Branch: MAIN
Changes since 1.137: +3 -3 lines
Diff to previous 1.137 (colored) to selected 1.161 (colored)

Consistently spell occurrence with two rs.

Revision 1.137 / (download) - annotate - [select for diffs], Thu Mar 6 15:31:14 2003 UTC (21 years, 1 month ago) by darrenr
Branch: MAIN
Changes since 1.136: +4 -3 lines
Diff to previous 1.136 (colored) to selected 1.161 (colored)

When unblocking threads, do not call setrunnable() on the thread we will
be returning because the code path that calls is will very likely call
setrunnable() again on the returned thread, leading to a panic because
the thread returned is already at LSRUN.  This fixes a problem where netbsd
would panic when using gdb (5.3) on a process with multiple lwp's like this:
% gdb program
(gdb) run
^C
(gdb) quit

Revision 1.136 / (download) - annotate - [select for diffs], Mon Feb 17 23:45:00 2003 UTC (21 years, 2 months ago) by nathanw
Branch: MAIN
Changes since 1.135: +9 -5 lines
Diff to previous 1.135 (colored) to selected 1.161 (colored)

Clear L_SA from all LWPs in sigexit() to prevent any upcalls or
sa_switch() invocations while exiting. Test P_SA instead of L_SA, out
of paranoia. Avoids a possible remrunqueue panic reported by Havard
Eidnes.

Release the kernel lock before calling the userret function to exit in
sigexit(). Problem noted by Paul Kranenburg.

Revision 1.135 / (download) - annotate - [select for diffs], Sat Feb 15 20:54:39 2003 UTC (21 years, 2 months ago) by jdolecek
Branch: MAIN
Changes since 1.134: +179 -2 lines
Diff to previous 1.134 (colored) to selected 1.161 (colored)

add __sigtimedwait(2) - wait for specified set of signals, with optional
timeout
the semantics of 'timeout' parameter differ to POSIX for the syscall
(not const, may be modified by kernel if interrupted from the wait) -
libc will provide appropriate wrapper

since sigwaitinfo(2) will be implemented as wrapper around sigtimedwait()
too, remove it's reserved slot and move sigqueue slot 'up', freeing
slot #246

Revision 1.134 / (download) - annotate - [select for diffs], Sat Feb 15 18:10:16 2003 UTC (21 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.133: +4 -3 lines
Diff to previous 1.133 (colored) to selected 1.161 (colored)

Fix support of 15 and 16 character lognames.
Warn if the logname is changed within a session - usually a missing setsid.
(approved by christos)

Revision 1.133 / (download) - annotate - [select for diffs], Fri Feb 7 21:43:18 2003 UTC (21 years, 2 months ago) by nathanw
Branch: MAIN
Changes since 1.132: +32 -33 lines
Diff to previous 1.132 (colored) to selected 1.161 (colored)

Two fixes:

 * Change the semantics of proc_unstop() slightly, so that it is
   responsible for making all stopped LWPs runnable, instead of
   all-but-one. Return value is a LWP that can be interrupted if doing
   so is necessary to take a signal. Adjust callers of proc_stop() to
   the new, simpler semantics.

 * When a non-continue signal is delivered to a stopped process and
   there is a LWP sleeping interruptably, call setrunnable() (by way
   of the 'out:' target in psignal1) instead of calling unsleep() so
   that it becomes LSSTOP in issignal() and continuable by
   proc_unstop(). Addresses PR kern/19990 by Martin Husemann, with
   suggestions from enami tsugutomo.

Revision 1.132 / (download) - annotate - [select for diffs], Fri Feb 7 09:02:14 2003 UTC (21 years, 2 months ago) by jdolecek
Branch: MAIN
Changes since 1.131: +15 -15 lines
Diff to previous 1.131 (colored) to selected 1.161 (colored)

use LIST_FOREACH() macro in proc_stop()/proc_unstop()
rewrite contents of the loop in proc_unstop to be a bit more easily
comprehensible

Revision 1.131 / (download) - annotate - [select for diffs], Mon Feb 3 22:56:23 2003 UTC (21 years, 2 months ago) by jdolecek
Branch: MAIN
Changes since 1.130: +5 -6 lines
Diff to previous 1.130 (colored) to selected 1.161 (colored)

use LIST_FOREACH() for iteration over p_lwps
when panniccing with 'Invalid process state', print the state too

Revision 1.130 / (download) - annotate - [select for diffs], Sat Jan 18 10:06:29 2003 UTC (21 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.129: +481 -160 lines
Diff to previous 1.129 (colored) to selected 1.161 (colored)

Merge the nathanw_sa branch.

Revision 1.129 / (download) - annotate - [select for diffs], Fri Dec 6 22:44:49 2002 UTC (21 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: nathanw_sa_before_merge, nathanw_sa_base, gmcgarry_ucred_base, gmcgarry_ctxsw_base, gmcgarry_ctxsw, fvdl_fs64_base
Branch point for: gmcgarry_ucred
Changes since 1.128: +3 -3 lines
Diff to previous 1.128 (colored) to selected 1.161 (colored)

s/NOSYMLINK/O_NOFOLLOW/

Revision 1.128 / (download) - annotate - [select for diffs], Thu Nov 28 21:00:27 2002 UTC (21 years, 4 months ago) by jdolecek
Branch: MAIN
Changes since 1.127: +4 -2 lines
Diff to previous 1.127 (colored) to selected 1.161 (colored)

issignal(): put apparently long-forgotten (at least since 4.4BSD)
debug printf inside #ifdef DEBUG_ISSIGNAL

This adresses kern/16760 by Love.

Revision 1.127 / (download) - annotate - [select for diffs], Sun Nov 24 11:37:55 2002 UTC (21 years, 4 months ago) by scw
Branch: MAIN
Changes since 1.126: +4 -4 lines
Diff to previous 1.126 (colored) to selected 1.161 (colored)

Quell uninitialised variable warnings.

Revision 1.126 / (download) - annotate - [select for diffs], Wed Oct 23 09:14:20 2002 UTC (21 years, 5 months ago) by jdolecek
Branch: MAIN
CVS Tags: kqueue-aftermerge
Changes since 1.125: +51 -2 lines
Diff to previous 1.125 (colored) to selected 1.161 (colored)

merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe

Revision 1.125 / (download) - annotate - [select for diffs], Sun Sep 22 05:36:48 2002 UTC (21 years, 6 months ago) by gmcgarry
Branch: MAIN
CVS Tags: kqueue-beforemerge, kqueue-base
Changes since 1.124: +2 -2 lines
Diff to previous 1.124 (colored) to selected 1.161 (colored)

Separate the scheduler from the context switching code.

This is done by adding an extra argument to mi_switch() and
cpu_switch() which specifies the new process.  If NULL is passed,
then the new function chooseproc() is invoked to wait for a new
process to appear on the run queue.

Also provides an opportunity for optimisations if "switching to self".

Also added are C versions of the setrunqueue() and remrunqueue()
low-level primitives if __HAVE_MD_RUNQUEUE is not defined by MD code.

All these changes are contingent upon the __HAVE_CHOOSEPROC flag being
defined by MD code to indicate that cpu_switch() supports the changes.

Revision 1.124 / (download) - annotate - [select for diffs], Wed Sep 4 01:32:35 2002 UTC (21 years, 7 months ago) by matt
Branch: MAIN
Changes since 1.123: +5 -8 lines
Diff to previous 1.123 (colored) to selected 1.161 (colored)

Use the queue macros from <sys/queue.h> instead of referring to the queue
members directly.  Use *_FOREACH whenever possible.

Revision 1.123 / (download) - annotate - [select for diffs], Sun Aug 25 21:47:50 2002 UTC (21 years, 7 months ago) by thorpej
Branch: MAIN
CVS Tags: gehenna-devsw-base
Changes since 1.122: +4 -3 lines
Diff to previous 1.122 (colored) to selected 1.161 (colored)

Fix signed/unsigned conditional expression warning from GCC 3.3.

Revision 1.122 / (download) - annotate - [select for diffs], Sun Jul 28 22:18:51 2002 UTC (21 years, 8 months ago) by manu
Branch: MAIN
Changes since 1.121: +3 -4 lines
Diff to previous 1.121 (colored) to selected 1.161 (colored)

Make killproc really public, and while we are there, constify.

Revision 1.121 / (download) - annotate - [select for diffs], Thu Jul 4 23:32:14 2002 UTC (21 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.120: +52 -7 lines
Diff to previous 1.120 (colored) to selected 1.161 (colored)

Add kernel support for having userland provide the signal trampoline:

* struct sigacts gets a new sigact_sigdesc structure, which has the
  sigaction and the trampoline/version.  Version 0 means "legacy kernel
  provided trampoline".  Other versions are coordinated with machine-
  dependent code in libc.
* sigaction1() grows two more arguments -- the trampoline pointer and
  the trampoline version.
* A new __sigaction_sigtramp() system call is provided to register a
  trampoline along with a signal handler.
* The handler is no longer passed to sensig() functions.  Instead,
  sendsig() looks up the handler by peeking in the sigacts for the
  process getting the signal (since it has to look in there for the
  trampoline anyway).
* Native sendsig() functions now select the appropriate trampoline and
  its arguments based on the trampoline version in the sigacts.

Changes to libc to use the new facility will be checked in later.  Kernel
version not bumped; we will ride the 1.6C bump made recently.

Revision 1.120 / (download) - annotate - [select for diffs], Fri Mar 8 20:48:40 2002 UTC (22 years, 1 month ago) by thorpej
Branch: MAIN
CVS Tags: newlock-base, newlock, netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6, eeh-devprop-base, eeh-devprop
Branch point for: gehenna-devsw
Changes since 1.119: +3 -3 lines
Diff to previous 1.119 (colored) to selected 1.161 (colored)

Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.

Revision 1.119 / (download) - annotate - [select for diffs], Tue Dec 18 15:51:52 2001 UTC (22 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: ifpoll-base
Changes since 1.118: +21 -8 lines
Diff to previous 1.118 (colored) to selected 1.161 (colored)

PR/14795: Christos Zoulas: Fix locking problem on MP systems where
ltsleep() is calling CURSIG() which can call issignal() and issignal()
could not deal with being called from a locked context. This happens
when a process receives SIGTTIN, and issignal() calls psignal() to
post SIGCHLD to the parent.

XXX: It is really messy to have issignal() handle the job control
functionality and the whole signal interlocking protocol needs to
be re-designed. For now this fix (provided by enami) does the trick.
I've been running with this fix for weeks, and atatat has stress-tested
the kernel running ~30 make kernels...

Revision 1.118 / (download) - annotate - [select for diffs], Sat Dec 8 00:35:31 2001 UTC (22 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.117: +5 -41 lines
Diff to previous 1.117 (colored) to selected 1.161 (colored)

Make the coredump routine exec-format/emulation specific.  Split
out traditional NetBSD coredump routines into core_netbsd.c and
netbsd32_core.c (for COMPAT_NETBSD32).

Revision 1.117 / (download) - annotate - [select for diffs], Wed Dec 5 07:32:24 2001 UTC (22 years, 4 months ago) by enami
Branch: MAIN
Changes since 1.116: +4 -4 lines
Diff to previous 1.116 (colored) to selected 1.161 (colored)

Implement sigismasked() correctly.  KNF while I'm here.

Revision 1.116 / (download) - annotate - [select for diffs], Mon Nov 12 15:25:15 2001 UTC (22 years, 5 months ago) by lukem
Branch: MAIN
CVS Tags: thorpej-mips-cache-base
Changes since 1.115: +4 -1 lines
Diff to previous 1.115 (colored) to selected 1.161 (colored)

add RCSIDs

Revision 1.115 / (download) - annotate - [select for diffs], Wed Jul 18 05:34:58 2001 UTC (22 years, 9 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-devvp-base3, thorpej-devvp-base2, thorpej-devvp-base, thorpej-devvp, pre-chs-ubcperf, post-chs-ubcperf
Branch point for: thorpej-mips-cache
Changes since 1.114: +4 -1 lines
Diff to previous 1.114 (colored) to selected 1.161 (colored)

Unshare signal actions on exec.
From Matthew Orgass <darkstar@pgh.net>.

Revision 1.114 / (download) - annotate - [select for diffs], Wed Jun 13 16:06:28 2001 UTC (22 years, 10 months ago) by nathanw
Branch: MAIN
Branch point for: kqueue
Changes since 1.113: +6 -9 lines
Diff to previous 1.113 (colored) to selected 1.161 (colored)

The trace_req() function is a no-op; garbage collect it.

Revision 1.113 / (download) - annotate - [select for diffs], Wed Jun 6 21:37:19 2001 UTC (22 years, 10 months ago) by mrg
Branch: MAIN
Changes since 1.112: +5 -65 lines
Diff to previous 1.112 (colored) to selected 1.161 (colored)

in coredump() remove the COMPAT_NETBSD32 #ifdef, and replace it with a hook.
move coredump32() into compat/netbsd32.

Revision 1.112 / (download) - annotate - [select for diffs], Mon Feb 26 21:58:30 2001 UTC (23 years, 1 month ago) by lukem
Branch: MAIN
CVS Tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Branch point for: nathanw_sa
Changes since 1.111: +168 -201 lines
Diff to previous 1.111 (colored) to selected 1.161 (colored)

convert to ANSI KNF

Revision 1.111 / (download) - annotate - [select for diffs], Fri Feb 23 22:01:50 2001 UTC (23 years, 1 month ago) by nathanw
Branch: MAIN
Changes since 1.110: +21 -65 lines
Diff to previous 1.110 (colored) to selected 1.161 (colored)

All of our ports have reasonable cpu_coredump()'s that set
core.c_midmag. Garbage collect the "traditional dump" code that
handled the core.c_midmag == 0 case.

Revision 1.110 / (download) - annotate - [select for diffs], Sun Jan 14 22:31:58 2001 UTC (23 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.109: +27 -5 lines
Diff to previous 1.109 (colored) to selected 1.161 (colored)

Whenever ps_sigcheck is set to true, signotify() the process, and
wrap this all up in a CHECKSIGS() macro.  Also, in psignal1(),
signotify() SRUN and SIDL processes if __HAVE_AST_PERPROC is defined.

Per discussion w/ mycroft.

Revision 1.109 / (download) - annotate - [select for diffs], Fri Dec 22 22:59:00 2000 UTC (23 years, 3 months ago) by jdolecek
Branch: MAIN
Changes since 1.108: +143 -147 lines
Diff to previous 1.108 (colored) to selected 1.161 (colored)

split off thread specific stuff from struct sigacts to struct sigctx, leaving
    only signal handler array sharable between threads
move other random signal stuff from struct proc to struct sigctx

This addresses kern/10981 by Matthew Orgass.

Revision 1.108 / (download) - annotate - [select for diffs], Sun Nov 5 15:37:09 2000 UTC (23 years, 5 months ago) by jdolecek
Branch: MAIN
Changes since 1.107: +13 -1 lines
Diff to previous 1.107 (colored) to selected 1.161 (colored)

add new function sigismasked(), which checks whether passed signal
is ignored or masked by the process, and use it appropriately
instead of directly checking p->p_sigmask and p->p_sigignore

Revision 1.107 / (download) - annotate - [select for diffs], Sat Sep 23 00:48:29 2000 UTC (23 years, 6 months ago) by enami
Branch: MAIN
Changes since 1.106: +14 -20 lines
Diff to previous 1.106 (colored) to selected 1.161 (colored)

Pathname of length 1023 (MAXPATHLEN - 1) should be valid as corename.

Revision 1.106 / (download) - annotate - [select for diffs], Tue Aug 22 17:28:29 2000 UTC (23 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.105: +6 -1 lines
Diff to previous 1.105 (colored) to selected 1.161 (colored)

Define the MI parts of the "big kernel lock" perimeter.  From
Bill Sommerfeld.

Revision 1.105 / (download) - annotate - [select for diffs], Mon Aug 21 02:09:33 2000 UTC (23 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.104: +6 -6 lines
Diff to previous 1.104 (colored) to selected 1.161 (colored)

splhigh() -> splsched()

Revision 1.104 / (download) - annotate - [select for diffs], Sun Aug 20 21:50:11 2000 UTC (23 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.103: +53 -26 lines
Diff to previous 1.103 (colored) to selected 1.161 (colored)

Add a lock around the scheduler, and use it as necessary, including
in the non-MULTIPROCESSOR case (LOCKDEBUG requires it).  Scheduler
lock is held upon entry to mi_switch() and cpu_switch(), and
cpu_switch() releases the lock before returning.

Largely from Bill Sommerfeld, with some minor bug fixes and
machine-dependent code hacking from me.

Revision 1.103 / (download) - annotate - [select for diffs], Thu Jul 27 14:01:57 2000 UTC (23 years, 8 months ago) by mrg
Branch: MAIN
Changes since 1.102: +3 -3 lines
Diff to previous 1.102 (colored) to selected 1.161 (colored)

fix LP64 warnings.

Revision 1.102 / (download) - annotate - [select for diffs], Sat Jul 8 18:10:25 2000 UTC (23 years, 9 months ago) by sommerfeld
Branch: MAIN
Changes since 1.101: +18 -14 lines
Diff to previous 1.101 (colored) to selected 1.161 (colored)

Format paranoia.

Revision 1.101 / (download) - annotate - [select for diffs], Tue Jun 27 17:41:25 2000 UTC (23 years, 9 months ago) by mrg
Branch: MAIN
Changes since 1.100: +1 -2 lines
Diff to previous 1.100 (colored) to selected 1.161 (colored)

remove include of <vm/vm.h>

Revision 1.100 / (download) - annotate - [select for diffs], Sat May 27 00:40:46 2000 UTC (23 years, 10 months ago) by sommerfeld
Branch: MAIN
CVS Tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, minoura-xpg4dl-base, minoura-xpg4dl
Branch point for: netbsd-1-5
Changes since 1.99: +15 -14 lines
Diff to previous 1.99 (colored) to selected 1.161 (colored)

Reduce use of curproc in several places:

 - Change ktrace interface to pass in the current process, rather than
p->p_tracep, since the various ktr* function need curproc anyway.

 - Add curproc as a parameter to mi_switch() since all callers had it
handy anyway.

 - Add a second proc argument for inferior() since callers all had
curproc handy.

Also, miscellaneous cleanups in ktrace:

 - ktrace now always uses file-based, rather than vnode-based I/O
(simplifies, increases type safety); eliminate KTRFLAG_FD & KTRFAC_FD.
Do non-blocking I/O, and yield a finite number of times when receiving
EWOULDBLOCK before giving up.

 - move code duplicated between sys_fktrace and sys_ktrace into ktrace_common.

 - simplify interface to ktrwrite()

Revision 1.99 / (download) - annotate - [select for diffs], Fri May 26 00:36:52 2000 UTC (23 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.98: +9 -5 lines
Diff to previous 1.98 (colored) to selected 1.161 (colored)

Introduce a new process state distinct from SRUN called SONPROC
which indicates that the process is actually running on a
processor.  Test against SONPROC as appropriate rather than
combinations of SRUN and curproc.  Update all context switch code
to properly set SONPROC when the process becomes the current
process on the CPU.

Revision 1.98 / (download) - annotate - [select for diffs], Thu Mar 30 09:27:12 2000 UTC (24 years ago) by augustss
Branch: MAIN
Changes since 1.97: +44 -44 lines
Diff to previous 1.97 (colored) to selected 1.161 (colored)

Get rid of register declarations.

Revision 1.97 / (download) - annotate - [select for diffs], Tue Feb 8 04:13:51 2000 UTC (24 years, 2 months ago) by fair
Branch: MAIN
CVS Tags: chs-ubc2-newbase
Changes since 1.96: +2 -2 lines
Diff to previous 1.96 (colored) to selected 1.161 (colored)

remove kern_logsigexit being "on" for DIAGNOSTIC

Revision 1.96 / (download) - annotate - [select for diffs], Sun Feb 6 07:29:56 2000 UTC (24 years, 2 months ago) by fair
Branch: MAIN
Changes since 1.95: +27 -2 lines
Diff to previous 1.95 (colored) to selected 1.161 (colored)

Add kernel logging of processes which exit on signals which can
cause a core to drop, and whether the core dropped, or, if it did
not, why not (i.e. error number). Logs process ID, name, signal that
hit it, and whether the core dump was successful.

logging only happens if kern_logsigexit is non-zero, and it can be
changed by the new sysctl(3) value KERN_LOGSIGEXIT. The name of this
sysctl and its function are taken from FreeBSD, at the suggestion
of Greg Woods in PR 6224. Default behavior is zero for a normal
kernel, and one for a kernel compiled with DIAGNOSTIC.

Revision 1.95 / (download) - annotate - [select for diffs], Thu Dec 30 16:00:23 1999 UTC (24 years, 3 months ago) by eeh
Branch: MAIN
Changes since 1.94: +89 -3 lines
Diff to previous 1.94 (colored) to selected 1.161 (colored)

Dump cores for 32-bit processes.

Revision 1.94 / (download) - annotate - [select for diffs], Tue Sep 28 14:47:03 1999 UTC (24 years, 6 months ago) by bouyer
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, fvdl-softdep-base, fvdl-softdep, comdex-fall-1999-base, comdex-fall-1999
Branch point for: thorpej_scsipi
Changes since 1.93: +55 -8 lines
Diff to previous 1.93 (colored) to selected 1.161 (colored)

Remplace kern.shortcorename sysctl with a more flexible sheme,
core filename format, which allow to change the name of the core dump,
and to relocate it in a directory. Credits to Bill Sommerfeld for giving me
the idea :)
The default core filename format can be changed by options DEFCORENAME and/or
kern.defcorename
Create a new sysctl tree, proc, which holds per-process values (for now
the corename format, and resources limits). Process is designed by its pid
at the second level name. These values are inherited on fork, and the corename
fomat is reset to defcorename on suid/sgid exec.
Create a p_sugid() function, to take appropriate actions on suid/sgid
exec (for now set the P_SUGID flag and reset the per-proc corename).
Adjust dosetrlimit() to allow changing limits of one proc by another, with
credential controls.

Revision 1.93 / (download) - annotate - [select for diffs], Tue Aug 31 12:30:35 1999 UTC (24 years, 7 months ago) by bouyer
Branch: MAIN
Changes since 1.92: +4 -3 lines
Diff to previous 1.92 (colored) to selected 1.161 (colored)

Add a new flag, used by vn_open() which prevent symlinks from being followed
at open time. Use this to prevent coredump to follow symlinks when the
kernel opens/creates the file.

Revision 1.92 / (download) - annotate - [select for diffs], Sun Jul 25 06:30:34 1999 UTC (24 years, 8 months ago) by thorpej
Branch: MAIN
CVS Tags: chs-ubc2-base
Changes since 1.91: +2 -2 lines
Diff to previous 1.91 (colored) to selected 1.161 (colored)

Turn the proclist lock into a read/write spinlock.  Update proclist locking
calls to reflect this.  Also, block statclock rather than softclock during
in the proclist locking functions, to address a problem reported on
current-users by Sean Doran.

Revision 1.91 / (download) - annotate - [select for diffs], Thu Jul 22 21:08:31 1999 UTC (24 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.90: +5 -3 lines
Diff to previous 1.90 (colored) to selected 1.161 (colored)

Add a read/write lock to the proclists and PID hash table.  Use the
write lock when doing PID allocation, and during the process exit path.
Use a read lock every where else, including within schedcpu() (interrupt
context).  Note that holding the write lock implies blocking schedcpu()
from running (blocks softclock).

PID allocation is now MP-safe.

Note this actually fixes a bug on single processor systems that was probably
extremely difficult to tickle; it was possible that schedcpu() would run
off a bad pointer if the right clock interrupt happened to come in the
middle of a LIST_INSERT_HEAD() or LIST_REMOVE() to/from allproc.

Revision 1.90 / (download) - annotate - [select for diffs], Thu Jul 22 18:13:37 1999 UTC (24 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.89: +3 -3 lines
Diff to previous 1.89 (colored) to selected 1.161 (colored)

Rework the process exit path, in preparation for making process exit
and PID allocation MP-safe.  A new process state is added: SDEAD.  This
state indicates that a process is dead, but not yet a zombie (has not
yet been processed by the process reaper).

SDEAD processes exist on both the zombproc list (via p_list) and deadproc
(via p_hash; the proc has been removed from the pidhash earlier in the exit
path).  When the reaper deals with a process, it changes the state to
SZOMB, so that wait4 can process it.

Add a P_ZOMBIE() macro, which treats a proc in SZOMB or SDEAD as a zombie,
and update various parts of the kernel to reflect the new state.

Revision 1.89 / (download) - annotate - [select for diffs], Fri Apr 30 21:23:49 1999 UTC (24 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.88: +82 -1 lines
Diff to previous 1.88 (colored) to selected 1.161 (colored)

Pull signal actions out of struct user, make them a separate proc
substructure, and allow them to be shared.

Required for clone(2).

Revision 1.88 / (download) - annotate - [select for diffs], Fri Apr 30 18:43:00 1999 UTC (24 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.87: +2 -2 lines
Diff to previous 1.87 (colored) to selected 1.161 (colored)

Break cdir/rdir/cmask info out of struct filedesc, and put it in a new
substructure, `cwdinfo'.  Implement optional sharing of this substructure.

This is required for clone(2).

Revision 1.87 / (download) - annotate - [select for diffs], Wed Mar 24 05:51:23 1999 UTC (25 years ago) by mrg
Branch: MAIN
CVS Tags: netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH001, kame_14_19990705, kame_14_19990628, kame_141_19991130, kame
Branch point for: netbsd-1-4, chs-ubc2
Changes since 1.86: +2 -9 lines
Diff to previous 1.86 (colored) to selected 1.161 (colored)

completely remove Mach VM support.  all that is left is the all the
header files as UVM still uses (most of) these.

Revision 1.86 / (download) - annotate - [select for diffs], Sat Feb 13 15:25:51 1999 UTC (25 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.85: +4 -3 lines
Diff to previous 1.85 (colored) to selected 1.161 (colored)

Don't forget to lower the spl in the error case of sigprocmask

Revision 1.85 / (download) - annotate - [select for diffs], Fri Nov 13 17:23:52 1998 UTC (25 years, 5 months ago) by mycroft
Branch: MAIN
CVS Tags: kenh-if-detach-base, kenh-if-detach
Changes since 1.84: +3 -3 lines
Diff to previous 1.84 (colored) to selected 1.161 (colored)

Er, NSIG is one *more* than the number of signals.

Revision 1.84 / (download) - annotate - [select for diffs], Fri Nov 13 17:12:54 1998 UTC (25 years, 5 months ago) by mycroft
Branch: MAIN
Changes since 1.83: +3 -3 lines
Diff to previous 1.83 (colored) to selected 1.161 (colored)

Oops; signal numbers are 1..NSIG, not 0..NSIG-1.

Revision 1.83 / (download) - annotate - [select for diffs], Sat Oct 3 14:29:03 1998 UTC (25 years, 6 months ago) by drochner
Branch: MAIN
CVS Tags: chs-ubc-base, chs-ubc
Changes since 1.82: +3 -1 lines
Diff to previous 1.82 (colored) to selected 1.161 (colored)

Make contsigmask, stopsigmask, sigcantmask kernel private.

Revision 1.82 / (download) - annotate - [select for diffs], Sat Sep 19 02:00:52 1998 UTC (25 years, 7 months ago) by enami
Branch: MAIN
Changes since 1.81: +2 -2 lines
Diff to previous 1.81 (colored) to selected 1.161 (colored)

make this file compile again; the variable points signal action being
set is `nsa' and there is no variable `sa'.

Revision 1.81 / (download) - annotate - [select for diffs], Fri Sep 18 18:48:23 1998 UTC (25 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.80: +14 -1 lines
Diff to previous 1.80 (colored) to selected 1.161 (colored)

Add NOCLDWAIT (from FreeBSD)

Revision 1.80 / (download) - annotate - [select for diffs], Fri Sep 11 13:25:20 1998 UTC (25 years, 7 months ago) by pk
Branch: MAIN
Changes since 1.79: +6 -3 lines
Diff to previous 1.79 (colored) to selected 1.161 (colored)

Check that the `current directory' is still mounted before dropping core in it.

Revision 1.79 / (download) - annotate - [select for diffs], Fri Sep 11 12:50:10 1998 UTC (25 years, 7 months ago) by mycroft
Branch: MAIN
Changes since 1.78: +366 -241 lines
Diff to previous 1.78 (colored) to selected 1.161 (colored)

Substantial signal handling changes:
* Increase the size of sigset_t to accomodate 128 signals -- adding new
  versions of sys_setprocmask(), sys_sigaction(), sys_sigpending() and
  sys_sigsuspend() to handle the changed arguments.
* Abstract the guts of sys_sigaltstack(), sys_setprocmask(), sys_sigaction(),
  sys_sigpending() and sys_sigsuspend() into separate functions, and call them
  from all the emulations rather than hard-coding everything.  (Avoids uses
  the stackgap crap for these system calls.)
* Add a new flag (p_checksig) to indicate that a process may have signals
  pending and userret() needs to do the full (slow) check.
* Eliminate SAS_ALTSTACK; it's exactly the inverse of SS_DISABLE.
* Correct emulation bugs with restoring SS_ONSTACK.
* Make the signal mask in the sigcontext always use the emulated mask format.
* Store signals internally in sigaction structures, rather than maintaining a
  bunch of little sigsets for each SA_* bit.
* Keep track of where we put the signal trampoline, rather than figuring it out
  in *_sendsig().
* Issue a warning when a non-emulated sigaction bit is observed.
* Add missing emulated signals, and a native SIGPWR (currently not used).
* Implement the `not reset when caught' semantics for relevant signals.

Note: Only code touched by the i386 port has been modified.  Other ports and
emulations need to be updated.

Revision 1.78 / (download) - annotate - [select for diffs], Tue Aug 4 04:03:14 1998 UTC (25 years, 8 months ago) by perry
Branch: MAIN
Changes since 1.77: +2 -2 lines
Diff to previous 1.77 (colored) to selected 1.161 (colored)

Abolition of bcopy, ovbcopy, bcmp, and bzero, phase one.
  bcopy(x, y, z) ->  memcpy(y, x, z)
ovbcopy(x, y, z) -> memmove(y, x, z)
   bcmp(x, y, z) ->  memcmp(x, y, z)
  bzero(x, y)    ->  memset(x, 0, y)

Revision 1.77 / (download) - annotate - [select for diffs], Fri Jul 31 22:50:50 1998 UTC (25 years, 8 months ago) by perry
Branch: MAIN
Changes since 1.76: +5 -5 lines
Diff to previous 1.76 (colored) to selected 1.161 (colored)

fix sizeofs so they comply with the KNF style guide. yes, it is pedantic.

Revision 1.76 / (download) - annotate - [select for diffs], Tue Jul 28 18:17:34 1998 UTC (25 years, 8 months ago) by thorpej
Branch: MAIN
CVS Tags: eeh-paddr_t-base
Branch point for: eeh-paddr_t
Changes since 1.75: +4 -4 lines
Diff to previous 1.75 (colored) to selected 1.161 (colored)

Don't cast the null residual pointer passed to vn_rdwr().

Revision 1.75 / (download) - annotate - [select for diffs], Sun Jun 28 21:34:58 1998 UTC (25 years, 9 months ago) by nathanw
Branch: MAIN
Changes since 1.74: +8 -4 lines
Diff to previous 1.74 (colored) to selected 1.161 (colored)

Implement short corefile name support, controlled by options SHORTCORENAME
and sysctl kern.shortcorename.

Closes PR kern/5191.

Revision 1.74 / (download) - annotate - [select for diffs], Thu Jun 25 23:41:20 1998 UTC (25 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.73: +2 -1 lines
Diff to previous 1.73 (colored) to selected 1.161 (colored)

defopt COMPAT_SUNOS

Revision 1.73 / (download) - annotate - [select for diffs], Thu Jun 25 21:17:16 1998 UTC (25 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.72: +2 -1 lines
Diff to previous 1.72 (colored) to selected 1.161 (colored)

defopt KTRACE

Revision 1.72 / (download) - annotate - [select for diffs], Thu May 7 00:45:16 1998 UTC (25 years, 11 months ago) by enami
Branch: MAIN
Changes since 1.71: +3 -18 lines
Diff to previous 1.71 (colored) to selected 1.161 (colored)

Backout previous issignal() change so that gdb can trace a process
which has subprocess again; the lite2 change conflicts our local change.

Revision 1.71 / (download) - annotate - [select for diffs], Sun Mar 1 02:22:30 1998 UTC (26 years, 1 month ago) by fvdl
Branch: MAIN
Changes since 1.70: +23 -5 lines
Diff to previous 1.70 (colored) to selected 1.161 (colored)

Merge with Lite2 + local changes

Revision 1.70 / (download) - annotate - [select for diffs], Tue Feb 10 14:09:41 1998 UTC (26 years, 2 months ago) by mrg
Branch: MAIN
Changes since 1.69: +3 -1 lines
Diff to previous 1.69 (colored) to selected 1.161 (colored)

- add defopt's for UVM, UVMHIST and PMAP_NEW.
- remove unnecessary UVMHIST_DECL's.

Revision 1.69 / (download) - annotate - [select for diffs], Thu Feb 5 07:59:54 1998 UTC (26 years, 2 months ago) by mrg
Branch: MAIN
Changes since 1.68: +9 -1 lines
Diff to previous 1.68 (colored) to selected 1.161 (colored)

initial import of the new virtual memory system, UVM, into -current.

UVM was written by chuck cranor <chuck@maria.wustl.edu>, with some
minor portions derived from the old Mach code.  i provided some help
getting swap and paging working, and other bug fixes/ideas.  chuck
silvers <chuq@chuq.com> also provided some other fixes.

this is the rest of the MI portion changes.

this will be KNF'd shortly.  :-)

Revision 1.68 / (download) - annotate - [select for diffs], Sat Nov 29 18:38:24 1997 UTC (26 years, 4 months ago) by kleink
Branch: MAIN
Changes since 1.67: +2 -2 lines
Diff to previous 1.67 (colored) to selected 1.161 (colored)

Modify the recent sigaltstack() interface change to use the __RENAME() scheme;
add __sigaltstack14().

Revision 1.67 / (download) - annotate - [select for diffs], Thu Oct 16 02:45:39 1997 UTC (26 years, 6 months ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH002, netbsd-1-3-PATCH001, netbsd-1-3-BETA
Branch point for: netbsd-1-3
Changes since 1.66: +10 -1 lines
Diff to previous 1.66 (colored) to selected 1.161 (colored)

Disable an effectively no-op reference to u_kproc, with an explanation of what
should be done with it eventually.

Revision 1.66 / (download) - annotate - [select for diffs], Mon Apr 28 04:49:28 1997 UTC (26 years, 11 months ago) by mycroft
Branch: MAIN
CVS Tags: thorpej-signal-base, marc-pcmcia-bp, marc-pcmcia-base, marc-pcmcia, bouyer-scsipi
Branch point for: thorpej-signal
Changes since 1.65: +3 -2 lines
Diff to previous 1.65 (colored) to selected 1.161 (colored)

Reinstate P_FSTRACE, with different semantics:
* Never send a SIGCHLD to the parent if P_FSTRACE is set.
* Do not permit mixing ptrace(2) and procfs; only permit using the one that
  was attached.

Revision 1.65 / (download) - annotate - [select for diffs], Mon Apr 28 02:51:43 1997 UTC (26 years, 11 months ago) by mycroft
Branch: MAIN
Changes since 1.64: +5 -18 lines
Diff to previous 1.64 (colored) to selected 1.161 (colored)

Remove remnants of P_FSTRACE, which is no longer used.

Revision 1.64 / (download) - annotate - [select for diffs], Mon Apr 28 02:36:05 1997 UTC (26 years, 11 months ago) by mycroft
Branch: MAIN
Changes since 1.63: +2 -2 lines
Diff to previous 1.63 (colored) to selected 1.161 (colored)

When stopping a process being traced through procfs, wake up the *parent* (in
case it happens to be doing a WAIT.

Revision 1.63 / (download) - annotate - [select for diffs], Wed Apr 23 18:59:56 1997 UTC (26 years, 11 months ago) by mycroft
Branch: MAIN
Changes since 1.62: +1 -5 lines
Diff to previous 1.62 (colored) to selected 1.161 (colored)

Nuke the old COMPAT_09 truncation of UIDs, GIDs, process and process group IDs.

Revision 1.62 / (download) - annotate - [select for diffs], Thu Apr 3 21:08:27 1997 UTC (27 years ago) by kleink
Branch: MAIN
Changes since 1.61: +2 -3 lines
Diff to previous 1.61 (colored) to selected 1.161 (colored)

Changed killpg1() to 'succeed' even if a process group consists of
SZOMB processes only; the POSIX.1 definition of a background process
group implies that kill(2)ing such a process group must succeed.

Revision 1.61 / (download) - annotate - [select for diffs], Thu Mar 27 07:52:25 1997 UTC (27 years ago) by mikel
Branch: MAIN
Changes since 1.60: +2 -2 lines
Diff to previous 1.60 (colored) to selected 1.161 (colored)

allow examination of SIGKILL and SIGSTOP signal handlers (but still
  disallow changes); from Klaus Klein in PR standards/3398.

Revision 1.60 / (download) - annotate - [select for diffs], Sun Dec 22 10:21:10 1996 UTC (27 years, 4 months ago) by cgd
Branch: MAIN
CVS Tags: thorpej-setroot, mrg-vm-swap, is-newarp-before-merge, is-newarp-base, is-newarp
Changes since 1.59: +8 -10 lines
Diff to previous 1.59 (colored) to selected 1.161 (colored)

* catch up with system call argument type fixups/const poisoning.
* Fix arguments to various copyin()/copyout() invocations, to avoid
  gratuitous casts.
* Some KNF formatting fixes

Revision 1.59 / (download) - annotate - [select for diffs], Wed Oct 23 23:13:19 1996 UTC (27 years, 5 months ago) by cgd
Branch: MAIN
Changes since 1.58: +22 -4 lines
Diff to previous 1.58 (colored) to selected 1.161 (colored)

make coredump() use more sensible error returns (even though they're
not used by anything, for now), and implement MNT_NOCOREDUMP by checking
whether or not MNT_NOCOREDUMP is set on the file system where the dump
would land (i.e. the file system of the process's current working
directory), and disallowing the core dump if it's set.

Revision 1.58 / (download) - annotate - [select for diffs], Fri Oct 18 08:39:34 1996 UTC (27 years, 6 months ago) by mrg
Branch: MAIN
Changes since 1.57: +3 -7 lines
Diff to previous 1.57 (colored) to selected 1.161 (colored)

in coredump(), check the SUGID bit rather than testing various parts
of the cred structures.  this prevents a previously set[gu]id process
from generating a core file.

Revision 1.57 / (download) - annotate - [select for diffs], Sun Oct 13 02:32:34 1996 UTC (27 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.56: +4 -4 lines
Diff to previous 1.56 (colored) to selected 1.161 (colored)

backout previous kprintf change

Revision 1.56 / (download) - annotate - [select for diffs], Thu Oct 10 22:46:18 1996 UTC (27 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.55: +4 -4 lines
Diff to previous 1.55 (colored) to selected 1.161 (colored)

printf -> kprintf, sprintf -> ksprintf

Revision 1.55 / (download) - annotate - [select for diffs], Sun Sep 1 01:56:10 1996 UTC (27 years, 7 months ago) by mycroft
Branch: MAIN
Changes since 1.54: +5 -2 lines
Diff to previous 1.54 (colored) to selected 1.161 (colored)

Don't core dump if ruid != euid or rgid != egid.

Revision 1.54 / (download) - annotate - [select for diffs], Mon Apr 22 01:38:32 1996 UTC (28 years ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-BETA
Branch point for: netbsd-1-2
Changes since 1.53: +1 -2 lines
Diff to previous 1.53 (colored) to selected 1.161 (colored)

remove include of <sys/cpu.h>

Revision 1.53 / (download) - annotate - [select for diffs], Fri Feb 9 18:59:47 1996 UTC (28 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.52: +3 -3 lines
Diff to previous 1.52 (colored) to selected 1.161 (colored)

More proto fixes

Revision 1.52 / (download) - annotate - [select for diffs], Sun Feb 4 02:16:10 1996 UTC (28 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.51: +22 -9 lines
Diff to previous 1.51 (colored) to selected 1.161 (colored)

First pass at prototyping

Revision 1.51 / (download) - annotate - [select for diffs], Thu Jan 4 22:23:14 1996 UTC (28 years, 3 months ago) by jtc
Branch: MAIN
Changes since 1.50: +2 -2 lines
Diff to previous 1.50 (colored) to selected 1.161 (colored)

Changed name of sigaltstack's ss_base field to ss_sp to match XPG4.2 and
traditional usage.

Revision 1.50 / (download) - annotate - [select for diffs], Sat Oct 7 06:28:25 1995 UTC (28 years, 6 months ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Changes since 1.49: +15 -15 lines
Diff to previous 1.49 (colored) to selected 1.161 (colored)

Prefix names of system call implementation functions with `sys_'.

Revision 1.49 / (download) - annotate - [select for diffs], Fri Oct 6 16:12:05 1995 UTC (28 years, 6 months ago) by mycroft
Branch: MAIN
Changes since 1.48: +2 -3 lines
Diff to previous 1.48 (colored) to selected 1.161 (colored)

Write core dumps with mode 0600.

Revision 1.48 / (download) - annotate - [select for diffs], Tue Sep 19 21:45:05 1995 UTC (28 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.47: +26 -21 lines
Diff to previous 1.47 (colored) to selected 1.161 (colored)

Make system calls conform to a standard prototype and bring those
prototypes into scope.

Revision 1.47 / (download) - annotate - [select for diffs], Mon Aug 14 06:07:55 1995 UTC (28 years, 8 months ago) by mycroft
Branch: MAIN
Changes since 1.46: +3 -1 lines
Diff to previous 1.46 (colored) to selected 1.161 (colored)

When resetting a signal, change ps_sigact, just to be sure.

Revision 1.46 / (download) - annotate - [select for diffs], Mon Aug 14 01:47:03 1995 UTC (28 years, 8 months ago) by mycroft
Branch: MAIN
Changes since 1.45: +3 -3 lines
Diff to previous 1.45 (colored) to selected 1.161 (colored)

Fix typos.

Revision 1.45 / (download) - annotate - [select for diffs], Sun Aug 13 22:53:59 1995 UTC (28 years, 8 months ago) by mycroft
Branch: MAIN
Changes since 1.44: +40 -17 lines
Diff to previous 1.44 (colored) to selected 1.161 (colored)

Implement SA_RESETHAND and SA_NODEFER.
Only return SA_NOCLDSTOP in the sigaction struct for SIGCHLD.
Rename ss_flags bits.

Revision 1.44 / (download) - annotate - [select for diffs], Mon Jul 24 03:18:42 1995 UTC (28 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.43: +17 -17 lines
Diff to previous 1.43 (colored) to selected 1.161 (colored)

Don't toss out tty stop signals if we're being traced.

Revision 1.43 / (download) - annotate - [select for diffs], Sat Jun 24 20:34:05 1995 UTC (28 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.42: +1 -155 lines
Diff to previous 1.42 (colored) to selected 1.161 (colored)

Extracted all of the compat_xxx routines, and created a library [libcompat]
for them. There are a few #ifdef COMPAT_XX remaining, but they are not easy
or worth eliminating (yet).

Revision 1.42 / (download) - annotate - [select for diffs], Thu Jun 8 23:51:01 1995 UTC (28 years, 10 months ago) by mycroft
Branch: MAIN
Changes since 1.41: +22 -19 lines
Diff to previous 1.41 (colored) to selected 1.161 (colored)

Fix various signal handling bugs:
* If we got a stopping signal while already stopped with the same signal,
the second signal would sometimes (but not always) be ignored.
* Signals delivered by the debugger always pretended to be stopping
signals.
* PT_ATTACH still didn't quite work right.

Revision 1.41 / (download) - annotate - [select for diffs], Sat Apr 22 19:42:57 1995 UTC (29 years ago) by christos
Branch: MAIN
Changes since 1.40: +16 -9 lines
Diff to previous 1.40 (colored) to selected 1.161 (colored)

- new copyargs routine.
- use emul_xxx
- deprecate nsysent; use constant SYS_MAXSYSCALL instead.
- deprecate ep_setup
- call sendsig and setregs indirectly.

Revision 1.40 / (download) - annotate - [select for diffs], Wed Mar 8 01:20:23 1995 UTC (29 years, 1 month ago) by cgd
Branch: MAIN
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored) to selected 1.161 (colored)

need COMPAT_OSF1 for some things

Revision 1.39 / (download) - annotate - [select for diffs], Fri Feb 3 11:35:57 1995 UTC (29 years, 2 months ago) by mycroft
Branch: MAIN
Changes since 1.38: +3 -10 lines
Diff to previous 1.38 (colored) to selected 1.161 (colored)

Make attach/detach more safe.

Revision 1.38 / (download) - annotate - [select for diffs], Wed Dec 14 19:07:12 1994 UTC (29 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.37: +2 -2 lines
Diff to previous 1.37 (colored) to selected 1.161 (colored)

Remove extra arg to vn_open().

Revision 1.37 / (download) - annotate - [select for diffs], Tue Dec 13 21:52:37 1994 UTC (29 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.36: +2 -2 lines
Diff to previous 1.36 (colored) to selected 1.161 (colored)

LEASE_CHECK -> VOP_LEASE

Revision 1.36 / (download) - annotate - [select for diffs], Wed Dec 7 21:31:11 1994 UTC (29 years, 4 months ago) by cgd
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored) to selected 1.161 (colored)

make nosys() return ENOSYS, based on user requests and discussions with
mkm.  it still always signals.

Revision 1.35 / (download) - annotate - [select for diffs], Mon Nov 14 06:01:20 1994 UTC (29 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored) to selected 1.161 (colored)

added extra argument in vn_open and VOP_OPEN to allow cloning devices

Revision 1.34 / (download) - annotate - [select for diffs], Sun Nov 6 20:39:50 1994 UTC (29 years, 5 months ago) by mycroft
Branch: MAIN
Changes since 1.33: +9 -9 lines
Diff to previous 1.33 (colored) to selected 1.161 (colored)

Trivial changes to make the code more consistent.

Revision 1.33 / (download) - annotate - [select for diffs], Sun Oct 30 19:15:46 1994 UTC (29 years, 5 months ago) by cgd
Branch: MAIN
Changes since 1.32: +7 -6 lines
Diff to previous 1.32 (colored) to selected 1.161 (colored)

cleanliness, type sizes, casts.

Revision 1.32 / (download) - annotate - [select for diffs], Thu Oct 20 04:22:56 1994 UTC (29 years, 6 months ago) by cgd
Branch: MAIN
Changes since 1.31: +102 -107 lines
Diff to previous 1.31 (colored) to selected 1.161 (colored)

update for new syscall args description mechanism

Revision 1.31 / (download) - annotate - [select for diffs], Tue Aug 30 03:05:42 1994 UTC (29 years, 7 months ago) by mycroft
Branch: MAIN
Changes since 1.30: +4 -4 lines
Diff to previous 1.30 (colored) to selected 1.161 (colored)

Convert process, file, and namei lists and hash tables to use queue.h.

Revision 1.30 / (download) - annotate - [select for diffs], Tue Aug 23 22:07:42 1994 UTC (29 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.29: +3 -3 lines
Diff to previous 1.29 (colored) to selected 1.161 (colored)

replace "ctob(UPAGES)" and "UPAGES * NBPG" with "USPACE"

Revision 1.29 / (download) - annotate - [select for diffs], Wed Jun 29 06:32:41 1994 UTC (29 years, 9 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-1-0-base, netbsd-1-0-RELEASE, netbsd-1-0-PATCH1, netbsd-1-0-PATCH06, netbsd-1-0-PATCH05, netbsd-1-0-PATCH04, netbsd-1-0-PATCH03, netbsd-1-0-PATCH02, netbsd-1-0-PATCH0, netbsd-1-0
Changes since 1.28: +1263 -1 lines
Diff to previous 1.28 (colored) to selected 1.161 (colored)

New RCS ID's, take two.  they're more aesthecially pleasant, and use 'NetBSD'

Revision 1.28 / (download) - annotate - [select for diffs], Wed Jun 8 11:28:42 1994 UTC (29 years, 10 months ago) by mycroft
Branch: MAIN
Changes since 1.27: +1 -1 lines
Diff to previous 1.27 (colored) to selected 1.161 (colored)

Update to 4.4-Lite fs code.

Revision 1.27 / (download) - annotate - [select for diffs], Wed May 25 10:57:39 1994 UTC (29 years, 10 months ago) by pk
Branch: MAIN
Changes since 1.26: +1 -1 lines
Diff to previous 1.26 (colored) to selected 1.161 (colored)

New style core dumps.

Revision 1.26 / (download) - annotate - [select for diffs], Fri May 20 07:18:37 1994 UTC (29 years, 11 months ago) by cgd
Branch: MAIN
Changes since 1.25: +1 -1 lines
Diff to previous 1.25 (colored) to selected 1.161 (colored)

kill a notdef

Revision 1.25 / (download) - annotate - [select for diffs], Thu May 19 08:13:32 1994 UTC (29 years, 11 months ago) by cgd
Branch: MAIN
Changes since 1.24: +1 -1 lines
Diff to previous 1.24 (colored) to selected 1.161 (colored)

update to 4.4-Lite, with some local changes

Revision 1.24 / (download) - annotate - [select for diffs], Wed May 18 05:12:40 1994 UTC (29 years, 11 months ago) by cgd
Branch: MAIN
Changes since 1.23: +1 -1 lines
Diff to previous 1.23 (colored) to selected 1.161 (colored)

mostly-machine-indepedent switch, and changes to match.  also, hack init_main

Revision 1.23 / (download) - annotate - [select for diffs], Tue May 17 08:46:35 1994 UTC (29 years, 11 months ago) by cgd
Branch: MAIN
Changes since 1.22: +1 -1 lines
Diff to previous 1.22 (colored) to selected 1.161 (colored)

osigstack is COMPAT_HPUX, too

Revision 1.22 / (download) - annotate - [select for diffs], Mon May 9 07:40:05 1994 UTC (29 years, 11 months ago) by cgd
Branch: MAIN
Changes since 1.21: +1 -1 lines
Diff to previous 1.21 (colored) to selected 1.161 (colored)

compat_09 stuff for pid_t's

Revision 1.21 / (download) - annotate - [select for diffs], Sat May 7 01:01:29 1994 UTC (29 years, 11 months ago) by cgd
Branch: MAIN
Changes since 1.20: +1 -1 lines
Diff to previous 1.20 (colored) to selected 1.161 (colored)

signal stack changes; overall upgrade

Revision 1.20 / (download) - annotate - [select for diffs], Thu May 5 05:38:17 1994 UTC (29 years, 11 months ago) by cgd
Branch: MAIN
Changes since 1.19: +1 -1 lines
Diff to previous 1.19 (colored) to selected 1.161 (colored)

lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around.  kill some unnecessary type and macro
definitions.  standardize clock handling.  More changes than you'd want.

Revision 1.19 / (download) - annotate - [select for diffs], Wed May 4 04:02:55 1994 UTC (29 years, 11 months ago) by mycroft
Branch: MAIN
Changes since 1.18: +1 -1 lines
Diff to previous 1.18 (colored) to selected 1.161 (colored)

HPUXCOMPAT -> COMPAT_HPUX

Revision 1.18 / (download) - annotate - [select for diffs], Wed May 4 03:41:58 1994 UTC (29 years, 11 months ago) by cgd
Branch: MAIN
Changes since 1.17: +1 -1 lines
Diff to previous 1.17 (colored) to selected 1.161 (colored)

Rename a lot of process flags.

Revision 1.17 / (download) - annotate - [select for diffs], Fri Apr 29 04:41:32 1994 UTC (29 years, 11 months ago) by cgd
Branch: MAIN
Changes since 1.16: +1 -1 lines
Diff to previous 1.16 (colored) to selected 1.161 (colored)

kill syscall name aliases. no user-visible changes

Revision 1.16 / (download) - annotate - [select for diffs], Fri Apr 22 22:33:59 1994 UTC (30 years ago) by pk
Branch: MAIN
Changes since 1.15: +1 -1 lines
Diff to previous 1.15 (colored) to selected 1.161 (colored)

Clear trampoline bits in execsigs().

Revision 1.15 / (download) - annotate - [select for diffs], Tue Apr 19 20:50:30 1994 UTC (30 years ago) by pk
Branch: MAIN
Changes since 1.14: +1 -1 lines
Diff to previous 1.14 (colored) to selected 1.161 (colored)

I suppose a SIGKILL or SIGTERM should make a process go about its
business fast. But the previous situation would allow
"sigblock(sigmask(SIGTERM)); kill(SIGTERM)" to thwart priority policies.

Revision 1.14 / (download) - annotate - [select for diffs], Sat Mar 19 18:38:33 1994 UTC (30 years, 1 month ago) by glass
Branch: MAIN
Changes since 1.13: +1 -1 lines
Diff to previous 1.13 (colored) to selected 1.161 (colored)

bad comment.  fix from vdlinden@fwi.uva.nl (Frank van der Linden)

Revision 1.13 / (download) - annotate - [select for diffs], Sun Jan 23 05:56:29 1994 UTC (30 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.12: +1 -1 lines
Diff to previous 1.12 (colored) to selected 1.161 (colored)

pull in COMPAT_SUNOS stuff from magnum

Revision 1.12 / (download) - annotate - [select for diffs], Thu Jan 20 21:22:49 1994 UTC (30 years, 3 months ago) by ws
Branch: MAIN
Changes since 1.11: +1 -1 lines
Diff to previous 1.11 (colored) to selected 1.161 (colored)

Make procfs really work for debugging.
Implement not & notepg files in procfs.

Revision 1.11 / (download) - annotate - [select for diffs], Sat Dec 18 04:21:07 1993 UTC (30 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.10: +1 -1 lines
Diff to previous 1.10 (colored) to selected 1.161 (colored)

Canonicalize all #includes.

Revision 1.10 / (download) - annotate - [select for diffs], Sat Dec 4 07:11:11 1993 UTC (30 years, 4 months ago) by cgd
Branch: MAIN
Changes since 1.9: +1 -1 lines
Diff to previous 1.9 (colored) to selected 1.161 (colored)

use progname.core for core dump names

Revision 1.9 / (download) - annotate - [select for diffs], Wed Sep 15 22:30:38 1993 UTC (30 years, 7 months ago) by cgd
Branch: MAIN
CVS Tags: magnum-base
Changes since 1.8: +1 -1 lines
Diff to previous 1.8 (colored) to selected 1.161 (colored)

make allproc be volatile, and cast things accordingly.
suggested by torek, because CSRG had problems with reordering
of assignments to allproc leading to strange panics from kernels
compiled with gcc2...

Revision 1.8 / (download) - annotate - [select for diffs], Thu Sep 9 22:04:02 1993 UTC (30 years, 7 months ago) by phil
Branch: MAIN
Changes since 1.7: +1 -1 lines
Diff to previous 1.7 (colored) to selected 1.161 (colored)

These changes are due to a mismatch with user functions prototyped as
func(short) and the fact the the kernel uses full ints.  This caused
problems on the pc532 port.  These fixes take the good 16 bits passed
by the user program and converts them into the correct form for the
kernel.

Revision 1.7 / (download) - annotate - [select for diffs], Sat Aug 7 05:16:38 1993 UTC (30 years, 8 months ago) by cgd
Branch: MAIN
Branch point for: magnum
Changes since 1.6: +1 -1 lines
Diff to previous 1.6 (colored) to selected 1.161 (colored)

the swtch() calls here should not need to be splclock() protected,
and certainly don't need to be bracketed by splclock()/splnone(),
the latter of which is a jolitz invention.

Revision 1.6 / (download) - annotate - [select for diffs], Sat Jul 17 15:24:33 1993 UTC (30 years, 9 months ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-0-9-base, netbsd-0-9-ALPHA2, netbsd-0-9-ALPHA
Branch point for: netbsd-0-9
Changes since 1.5: +1 -1 lines
Diff to previous 1.5 (colored) to selected 1.161 (colored)

Finish moving struct definitions outside of function declarations.

Revision 1.5 / (download) - annotate - [select for diffs], Wed Jul 7 08:12:33 1993 UTC (30 years, 9 months ago) by cgd
Branch: MAIN
Changes since 1.4: +1 -1 lines
Diff to previous 1.4 (colored) to selected 1.161 (colored)

revert code base back to net/2.  in particular,
fix jolitz's trapsignal() change (it's only supposed to work on curproc)
and add a panic if called w/something other than curproc, and also
fix a relic of his crappy exec implementation

Revision 1.4 / (download) - annotate - [select for diffs], Sun Jul 4 23:30:37 1993 UTC (30 years, 9 months ago) by cgd
Branch: MAIN
Changes since 1.3: +1 -1 lines
Diff to previous 1.3 (colored) to selected 1.161 (colored)

change exit() to kexit(), so prototypes are "safe" with stdio.h, etc.

Revision 1.3 / (download) - annotate - [select for diffs], Sun Jun 27 06:01:44 1993 UTC (30 years, 9 months ago) by andrew
Branch: MAIN
Changes since 1.2: +1 -1 lines
Diff to previous 1.2 (colored) to selected 1.161 (colored)

ANSIfications - removed all implicit function return types and argument
definitions.  Ensured that all files include "systm.h" to gain access to
general prototypes.  Casts where necessary.

Revision 1.2 / (download) - annotate - [select for diffs], Thu May 20 02:54:38 1993 UTC (30 years, 11 months ago) by cgd
Branch: MAIN
Changes since 1.1: +1 -1 lines
Diff to previous 1.1 (colored) to selected 1.161 (colored)

add $Id$ strings, and clean up file headers where necessary

Revision 1.1 / (download) - annotate - [select for diffs], Sun Mar 21 09:45:37 1993 UTC (31 years, 1 month ago) by cgd
Branch: MAIN
Diff to selected 1.161 (colored)

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>