jhb [Wed, 7 Mar 2001 03:09:40 +0000 (03:09 +0000)]
Proc locking. Lock around psignal() and also ensure both an exclusive
proctree lock and the process lock are held when updating p_pptr and
p_oppid. When we are just reaading p_pptr we only need the proc lock and
not a proctree lock as well.
jhb [Wed, 7 Mar 2001 02:59:54 +0000 (02:59 +0000)]
- Proc locking. Most of signal handling is now MP safe and doesn't require
Giant. The only exception is the CANSIGNAL() macro. Unlocking the proc
lock around sendsig() in trapsignal() is also questionable. Note that
the functions sigexit(), psignal(), and issignal() must be called with
the proc lock of the process in question held. postsig() and
trapsignal() should not be called with the proc lock held, but they
also do not require Giant anymore either.
- Remove spl's that are now no longer needed as they are fully replaced.
jhb [Wed, 7 Mar 2001 02:45:15 +0000 (02:45 +0000)]
- Add an extra check in priority_propagation() for UP systems to ensure we
don't end up back at ourselves which would indicate deadlock.
- Add the proc lock to the witness dup_list as we may hold more than one
process lock at a time.
- Don't assert a mutex is owned in _mtx_unlock_sleep() as that is too late.
We do the checks in the macros instead.
jhb [Wed, 7 Mar 2001 02:36:47 +0000 (02:36 +0000)]
- Use _PHOLD and move it before a PROC_UNLOCK to reduce the number of
mutex operations in kthread_create().
- Lock a kthread's proc before changing its parent via proc_reparent().
- Test P_KTHREAD not P_SYSTEM in kthread_suspend() and kthread_resume().
P_SYSTEM just means that the process shouldn't be swapped and is used
for vinum's daemon for example.
- Lock all the signal state used for suspending and resuming kthreads with
the proc lock.
jhb [Wed, 7 Mar 2001 02:30:39 +0000 (02:30 +0000)]
- Lock the forklist with an sx lock.
- Add proc locking to fork1(). Always lock the child procoess (new
process) first when both processes need to be locked at the same
time.
- Remove unneeded spl()'s as the data they protected is now locked.
- Ensure that the proctree is exclusively locked and the new process is
locked when setting up the parent process pointer.
- Lock the check for P_KTHREAD in p_flag in fork_exit().
jhb [Wed, 7 Mar 2001 02:25:13 +0000 (02:25 +0000)]
Check to see if p_fd is NULL before derferencing it in checkdirs(). It's
possible for us to see a process in the early stages of fork before p_fd
has been initialized. Ideally, we wouldn't stick a process on the allproc
list until it was fully created however.
jhb [Wed, 7 Mar 2001 02:22:31 +0000 (02:22 +0000)]
- Call proc_reparent() when handing a process off to init in exit rather
than dinking around in the process lists explicitly.
- Hold both the proctree lock and proc lock of the child process when
reparenting a process via proc_reparent.
- Lock processes while sending them signals.
- Miscellaenous proc locking.
- proc_reparent() now asserts that the child is locked in addition to an
exclusive proctree lock.
jhb [Wed, 7 Mar 2001 02:17:43 +0000 (02:17 +0000)]
- Hold both an exclusive proctree lock and the proc lock when reparenting
a traced process during exit.
- Lock the parent process while sending it SIGCHLD.
jhb [Wed, 7 Mar 2001 02:06:08 +0000 (02:06 +0000)]
- Include <sys/systm.h> for KASSERT().
- Move the _mtx_assert() prototype up to the top of the file with the rest
of the function prototypes.
- Define all the mtx_foo() macros in terms of mtx_foo_flags().
- Add a KASSERT() to check for invalid options in mtx_lock_flags().
- Move the mtx_assert() to ensure a mutex is owned before releasing it
in front of WITNESS_EXIT() in all the mtx_unlock_* macros.
- Change the MPASS* macros to be on #ifdef INVARIANTS, not just #ifdef
MUTEX_DEBUG since most of them check to see that the mutex functions are
called properly. Define MPASS4() in terms of KASSERT() to do this.
- Define MPASS{,[23]} in terms of MPASS4() to simplify things and avoid
code duplication.
jhb [Wed, 7 Mar 2001 01:51:34 +0000 (01:51 +0000)]
- In the locking key for struct proc, generalize the '+' symbol to mean
that write access to a member requires both locks and read access only
requires one of the given locks. Convert instances of '(c+)' to
'(c + k)' as a result.
- Change p_pptr from (e) to (c + e).
- Change p_oppid from (c) to (c + e).
- Change p_args from (b?) to (c + k).
- Move the actual work of STOPEVENT, PHOLD, and PRELE to _STOPEVENT,
_PHOLD, and _PRELE. The new macros do not acquire the proc lock and
simply assert that it is held. The non _ prefixed macros acquire the
proc lock and then call the _ prefixed macros.
- Add a PROC_LOCK_NOSWITCH() macro to be used when releasing the proc lock
while already holding a spin lock (usually sched_lock).
- Add a PROC_LOCK_ASSERT() macro to be used to make assertions about the
proc lock. It takes the usual mtx_assert() macro arguments as its
second argument.
jhb [Tue, 6 Mar 2001 23:13:15 +0000 (23:13 +0000)]
In order to avoid recursing on the backing mutex for sx locks in the
INVARIANTS case, define the actual KASSERT() in _SX_ASSERT_[SX]LOCKED
macros that are used in the sx code itself and convert the
SX_ASSERT_[SX]LOCKED macros to simple wrappers that grab the mutex for the
duration of the check.
des [Tue, 6 Mar 2001 17:48:26 +0000 (17:48 +0000)]
Make the KASSERTs report the correct function names.
Fix two off-by-one errors that would sometimes cause the final length of
the sbuf to include the trailing zero.
rwatson [Tue, 6 Mar 2001 17:28:24 +0000 (17:28 +0000)]
o Introduce filesystem-independent POSIX.1e ACL utility routines to
support implementations of ACLs in file systems. Introduce the
following new functions:
vaccess_acl_posix1e() vaccess() that accepts an ACL
acl_posix1e_mode_to_perm() Convert mode bits to ACL rights
acl_posix1e_mode_to_entry() Build ACL entry from mode/uid/gid
acl_posix1e_perms_to_mode() Generate file mode from ACL
acl_posix1e_check() Syntax verification for ACL
These functions allow a file system to rely on central ACL evaluation
and syntax checking, as well as providing useful utilities to
allow ACL-based file systems to generate mode/owner/etc information
to return via VOP_GETATTR(), and to support file systems that split
their ACL information over their existing inode storage (mode, uid,
gid) and extended ACL into extended attributes (additional users,
groups, ACL mask).
o Add prototypes for exported functions to sys/acl.h, sys/vnode.h
dfr [Tue, 6 Mar 2001 15:00:32 +0000 (15:00 +0000)]
Pick up the environment variable ${NM} if it exists and use that to list
symbols. This allows lorder to be used more easily in a cross-build
environment.
bmilekic [Tue, 6 Mar 2001 06:17:05 +0000 (06:17 +0000)]
- Add sx_descr description member to sx lock structure
- Add sx_xholder member to sx struct which is used for INVARIANTS-enabled
assertions. It indicates the thread that presently owns the xlock.
- Add some assertions to the sx lock code that will detect the fatal
API abuse:
xlock --> xlock
xlock --> slock
which now works thanks to sx_xholder.
Notice that the remaining two problematic cases:
slock --> xlock
slock --> slock (a little less problematic, but still recursion)
will need to be handled by witness eventually, as they are more
involved.
jhb [Tue, 6 Mar 2001 06:06:42 +0000 (06:06 +0000)]
- Rework pmap_map() to take advantage of direct-mapped segments on
supported architectures such as the alpha. This allows us to save
on kernel virtual address space, TLB entries, and (on the ia64) VHPT
entries. pmap_map() now modifies the passed in virtual address on
architectures that do not support direct-mapped segments to point to
the next available virtual address. It also returns the actual
address that the request was mapped to.
- On the IA64 don't use a special zone of PV entries needed for early
calls to pmap_kenter() during pmap_init(). This gets us in trouble
because we end up trying to use the zone allocator before it is
initialized. Instead, with the pmap_map() change, the number of needed
PV entries is small enough that we can get by with a static pool that is
used until pmap_init() is complete.
Submitted by: dfr
Debugging help: peter
Tested by: me
jhb [Tue, 6 Mar 2001 02:59:46 +0000 (02:59 +0000)]
Create clone'd linux processes as stopped processes at first and don't
actually make them runnable until after the emulator layer has had a chance
to perform fixups.
ache [Tue, 6 Mar 2001 00:02:47 +0000 (00:02 +0000)]
Fix longstanding mouse cursor bug: blinking and eating all CPU while near text
cursor.
The reason is: mouse cursor goes into hide/visible loop while text cursor even
not moved.
PR: 25536
Submitted by: David Xu <davidx@viasoft.com.cn>
jhb [Mon, 5 Mar 2001 22:43:39 +0000 (22:43 +0000)]
The SRM console gets the red and blue attributes backwards in the VGA
palette. As a result, the colors on the video console can look rather
weird. For example, sysinstall on the alpha has a read background. We
can work around this partially by remapping the colors used by syscons for
the ANSI color escape sequences. Note that screen savers and anything that
sets the colors explicitly will still get incorrect colors, but programs
such as sysinstall will now use the correct colors. A more correct fix
would be to actually fix the VGA palette on boot by either swapping all
the red and blue attributes or by hardcoding a standard palette and
overwriting the entire palette.
This lets us run programs containing newer (eg bwx) instructions
on older (eg EV5 and less) machines. One win is that we can
now run Acrobat4 on EV4s and EV5s.
assar [Mon, 5 Mar 2001 18:54:27 +0000 (18:54 +0000)]
remove warning of experimental nature of heimdal. it's now the same
version as the one in ports (and the latest at that), except that not
all programs that are in the port get built
dougb [Mon, 5 Mar 2001 10:13:21 +0000 (10:13 +0000)]
* Add two requested features, source'ing of /etc/mergemaster.rc, and
asking the user to actually run the recommended commands related
to installation of files such as aliases or login.conf.
* Return to using grep for CVS $Id comparison. Using ident caused too
many problems for people with local CVS/RCS tags in their stuff.
Attempt to make portability a little easier to maintain in spite of
this change by defining the name of the tag to search for. This
is a slightly different change that solves the problem in the PR.
PR: bin/24564
Submitted by: Tony Finch <dot@dotat.at>