Alan Cox [Mon, 8 Dec 2003 00:47:33 +0000 (00:47 +0000)]
Addendum to revision 1.174: In the case where vm_pager_allocate() is called
to create a vnode-backed object, the vnode lock must be held by the caller.
Warner Losh [Mon, 8 Dec 2003 00:11:22 +0000 (00:11 +0000)]
Copy the old dgb man page to digi.4, plus very minor hacking. Add a
note that says that this man page is sub-optimal. Bruce Mah should be
happier about this, but someone that groks the cards supported by the
digi driver is encouraged to make this man page suck less.
David Xu [Sun, 7 Dec 2003 23:47:15 +0000 (23:47 +0000)]
Lock and unlock sched_lock when walking through thread list, current we
insert kse upcall thread into thread list at mi_switch time, process lock
is not enough.
Alan Cox [Sun, 7 Dec 2003 22:49:25 +0000 (22:49 +0000)]
Don't remove the virtual-to-physical mapping when an sf_buf is freed.
Instead, allow the mapping to persist, but add the sf_buf to a free list.
If a later sendfile(2) or zero-copy send resends the same physical page,
perhaps with the same or different contents, then the mapping overhead is
avoided and the sf_buf is simply removed from the free list.
In other words, the i386 sf_buf implementation now behaves as a cache of
virtual-to-physical translations using an LRU replacement policy on
inactive sf_bufs. This is similar in concept to a part of
http://www.cs.princeton.edu/~yruan/debox/ patch, but much simpler in
implementation. Note: none of this is required on alpha, amd64, or ia64.
They now use their direct virtual-to-physical mapping to avoid any
emphemeral mapping overheads in their sf_buf implementations.
Don Lewis [Sun, 7 Dec 2003 21:53:41 +0000 (21:53 +0000)]
Pass MTX_DEF as the last argument to mtx_init() instead of 0. This
is not a functional change. The code happened to work properly only
because MTX_DEF is defined as 0.
Change the definition of NULL on ia64 (for LP64 compilations) from
an int constant to a long constant. This change improves consistency
in the following two ways:
1. The first 8 arguments are always passed in registers on ia64, which
by virtue of the generated code implicitly widens ints to longs and
allows the use of an 32-bit integral type for 64-bit arguments.
Subsequent arguments are passed onto the memory stack, which does
not exhibit the same behaviour and consequently do not allow this.
In practice this means that variadic functions taking pointers
and given NULL (without cast) work as long as the NULL is passed
in one of the first 8 arguments. A SIGSEGV is more likely the
result if such would be done for stack-based arguments. This is
due to the fact that the upper 4 bytes remain undefined.
2. All 64-bit platforms that FreeBSD supports, with the obvious
exception of ia64, allow 32-bit integral types (specifically NULL)
when 64-bit pointers are expected in variadic functions by way of
how the compiler generates code. As such, code that works correctly
(whether rightfully so or not) on any platform other than ia64, may
fail on ia64.
To more easily allow tweaking of the definition of NULL, this commit
removes the 12 definitions in the various headers and puts it in a
new header that can be included whenever NULL is to be made visible.
This commit fixes GNOME, emacs, xemacs and a whole bunch of ports
that I don't particularly care about at this time...
Simplify the contexts created by the kernel and remove the related
flags. We now create asynchronous contexts or syscall contexts only.
Syscall contexts differ from the minimal ABI dictated contexts by
having the scratch registers saved and restored because that's where
we keep the syscall arguments and syscall return values.
Since this change affects KSE, have it use kse_switchin(2) for the
"new" syscall context.
Make the DIAGNOSTIC code which complains about long {call|time}out(9)
functions less noisy: We printf if a new function took longer than
the previous record holder, or of the previous record holder took
more than twice as long as the current record.
Add kse_switchin(2). This syscall can be used by KSE implementations
to have the kernel switch to a new thread, instead of doing it in
userland. It is in fact needed on ia64 where syscall restarts do not
return to userland first. It's completely handled inside the kernel.
As such, any context created by the kernel as part of an upcall and
caused by some syscall needs to be restored by the kernel.
Finish the transition from libkvm to sysctl that I started a while ago.
The use of libkvm for post-mortem analysis is still supported (though it
could use more testing). We can now remove vmstat's setgid bit.
While I'm here, hack the interrupt listing code to not display interrupts
that haven't occurred unless the -a option was given on the command line,
and document this change.
Peter Wemm [Sun, 7 Dec 2003 09:57:51 +0000 (09:57 +0000)]
rqb_bits[] may be an int64_t (eg: on alpha, and recently on amd64).
Be sure to shift (long)1 << 33 and higher, not (int)1. Otherwise bad
things happen(TM). This is why beast.freebsd.org paniced with ULE.
Tim J. Robbins [Sun, 7 Dec 2003 08:39:29 +0000 (08:39 +0000)]
Add IPv6 support to pppctl by using getaddrinfo() and trying each address
it returns. This allows it to connect to the server side again, which
has been listening on IPv6 addresses exclusively for more than 2 years.
Daniel Eischen [Sun, 7 Dec 2003 06:50:04 +0000 (06:50 +0000)]
Don't call em_stop() from the watchdog since it requires the controller
mutex to be locked. It is redundant since em_init() is called and this
correctly locks the mutex and calls em_stop().
5.2 release candidate since this can cause a panic if the watchdog
expires.
Tim J. Robbins [Sun, 7 Dec 2003 06:33:52 +0000 (06:33 +0000)]
Split multibyte(3) into separate manual pages for each function.
Instead of just deleting it, turn the original page into a general
overview of the multibyte character conversion functions, somewhat
similar to stdio(3).
Warner Losh [Sun, 7 Dec 2003 05:49:21 +0000 (05:49 +0000)]
Make the if_broadcastaddr const. All the drivers in the tree which
violated the constness were corrected before the freeze. This was
suggested by mdodd@, I think, and sam@ and others have signed off on
this if I recall my conversations with them correctly.
Don Lewis [Sun, 7 Dec 2003 05:16:52 +0000 (05:16 +0000)]
Set fs_ronly to the correct value in ffs_reload() when reloading the file
system super block after fsck has repaired the file system. The value of
fs_ronly was getting overwritten, which caused ffs_update() to attempt to
update inode timestamps even though the file system was still mounted
read-only.
This fixes the "giving up on N buffers" error that is triggered by running
fsck on the root file system and then rebooting without mounting the file
system read-write.
Warner Losh [Sun, 7 Dec 2003 04:18:52 +0000 (04:18 +0000)]
The dgb driver is redundant with the digi driver in the tree. It uses
lots of old interfaces, and digi now supports all cards that dgb
supported. The author of the driver says that this is no longer
necessary.
Warner Losh [Sun, 7 Dec 2003 04:05:19 +0000 (04:05 +0000)]
Continue to remove drivers that don't compile and haven't compiled in
a long time: lmc The LAN Media Corp PCI WAN driver based on tulip.
This driver hasn't compiled for 3 years since the PCI compat shims
were removed, and Lan Media appears to have gone out of business.
These cards appear to be rare (a recent search of ebay had no hits).
Should someone wish to revive this driver, submitting patches to make
it compile plus a testing report will bring it back.
Warner Losh [Sun, 7 Dec 2003 03:51:19 +0000 (03:51 +0000)]
First part of the removal of drivers for hardware that isn't relevant
or whose drivers haven't even compiled for years.
The loran hardware was very unique, and only a few copies of it ever
existed. It used the old COMPAT_ISA_DRIVER and when the author was
contacted, he indicated that he had no intention of ever updating this
driver and it was no longer relevant to the FreeBSD world and can be
removed without impact to anybody.
Bruce A. Mah [Sun, 7 Dec 2003 00:06:50 +0000 (00:06 +0000)]
More hardware notes device trimming: Remove devices supported by
ohci(4), uhci(4), ubsa(4), uftdi(4), uvscom(4), fwohci(4), and sbp(4)
in favor of the device lists in their respective manual pages.
Peter Wemm [Sat, 6 Dec 2003 23:24:18 +0000 (23:24 +0000)]
Reconfigure the runq macros to use the 64 bit ffs/bsf routines instead
of doing a loop and taking two 32 bit passes at the runqueue bits. All
the 64 bit platforms should probably do this since there are 64 run queues.
Peter Wemm [Sat, 6 Dec 2003 23:17:18 +0000 (23:17 +0000)]
Kill the ASM versions of the mtx_lock_spin and friends. They were never
used on amd64, and were actually totally broken. They had the wrong
calling conventions. I believe the i386 versions are going away too.
Peter Wemm [Sat, 6 Dec 2003 23:13:22 +0000 (23:13 +0000)]
Revert some amd64 changes that cached curthread and converge back to the
i386 version. The curthread special case in pcpu.h solves my complaint
about the verbose macro expansion in this case. Note that the i386
version still has some OBE comments, I didn't re-add them back again.
Robert Watson [Sat, 6 Dec 2003 21:48:03 +0000 (21:48 +0000)]
Rename mac_create_cred() MAC Framework entry point to mac_copy_cred(),
and the mpo_create_cred() MAC policy entry point to
mpo_copy_cred_label(). This is more consistent with similar entry
points for creation and label copying, as mac_create_cred() was
called from crdup() as opposed to during process creation. For
a number of policies, this removes the requirement for special
handling when copying credential labels, and improves consistency.
Bruce A. Mah [Sat, 6 Dec 2003 20:43:48 +0000 (20:43 +0000)]
Trim some unnecessary text from bt(4) and mly(4) listings, fix typo in
sk(4) listing, trim em(4) devices, trim dgb(4) devices, trim
stl(4)/stli(4) devices, trim uaudio(4) devices.
Alan Cox [Sat, 6 Dec 2003 05:45:32 +0000 (05:45 +0000)]
Fix a deadlock between vm_fault() and vm_mmap(): The expected lock ordering
between vm_map and vnode locks is that vm_map locks are acquired first. In
revision 1.150 mmap(2) was changed to pass a locked vnode into vm_mmap().
This creates a lock-order reversal when vm_mmap() calls one of the vm_map
routines that acquires a vm_map lock. The solution implemented herein is
to release the vnode lock in mmap() before calling vm_mmap() and reacquire
this lock if necessary in vm_mmap().
Approved by: re (scottl)
Reviewed by: jeff, kan, rwatson
Ian Dowse [Fri, 5 Dec 2003 09:36:56 +0000 (09:36 +0000)]
Don't include the file system ID in the output of `mount -v' if it
is all zeros. The kernel now consistently zeroes FSIDs for non-root
users, so there's no point in printing these.
Also fix a number of compiler warnings, including two real bugs:
- a bracket placement bug caused `mount -t ufs localhost:/foo /mnt'
to override the `-t ufs' specification and use mount_nfs.
- an unitialised variable was used instead of _PATH_SYSPATH when
warning that the mount_* program cound not be found.
Submitted by: Rudolf Cejka <cejkar@fit.vutbr.cz> (FSID part)
Approved by: re (scottl)