phk [Sun, 5 Dec 2004 22:41:02 +0000 (22:41 +0000)]
VFS_STATFS(mp, ...) is mostly called with &mp->mnt_stat, but a few cases
doesn't. Most of the implementations have grown weeds for this so they
copy some fields from mnt_stat if the passed argument isn't that.
Fix this the cleaner way: Always call the implementation on mnt_stat
and copy that in toto to the VFS_STATFS argument if different.
marcel [Sun, 5 Dec 2004 22:30:28 +0000 (22:30 +0000)]
Fix null-pointer indirect function calls introduced in the previous
commit. In the new world order, the transitive closure on the vector
operations is not precomputed. As such, it's unsafe to actually use
any of the function pointers in an indirect function call. They can
be null, and we need to use the default vector in that case.
This is mostly a quick fix for the four function pointers that are
ed explicitly. A more generic or scalable solution is likely to see
the light of day.
rwatson [Sun, 5 Dec 2004 22:08:37 +0000 (22:08 +0000)]
Pass the inpcb reference into ip_getmoptions() rather than just the
inp->inp_moptions pointer, so that ip_getmoptions() can perform
necessary locking when doing non-atomic reads.
Lock the inpcb by default to copy any data to local variables, then
unlock before performing sooptcopyout().
alc [Sun, 5 Dec 2004 21:48:11 +0000 (21:48 +0000)]
Correct a sanity check in vnode_pager_generic_putpages(). The cast used
to implement the sanity check should have been changed when we converted
the implementation of vm_pindex_t from 32 to 64 bits. (Thus, RELENG_4 is
not affected.) The consequence of this error would be a legimate write to
an extremely large file being treated as an errant attempt to write meta-
data.
rwatson [Sun, 5 Dec 2004 19:11:09 +0000 (19:11 +0000)]
Start working through inpcb locking for ip_ctloutput() by cleaning up
modifications to the inpcb IP options mbuf:
- Lock the inpcb before passing it into ip_pcbopts() in order to prevent
simulatenous reads and read-modify-writes that could result in races.
- Pass the inpcb reference into ip_pcbopts() instead of the option chain
pointer in the inpcb.
- Assert the inpcb lock in ip_pcbots.
- Convert one or two uses of a pointer as a boolean or an integer
comparison to a comparison with NULL for readability.
glebius [Sun, 5 Dec 2004 14:30:38 +0000 (14:30 +0000)]
- Use uint16_t to pass argument for NGM_NETFLOW_IFINFO, bump cookie.
- Always check that index number passed from userland
is <= NG_NETFLOW_MAXIFACES. [1]
- Increase NG_NETFLOW_MAXIFACES up to 512. [2]
Noticed by: Roman Palagin [1]
Requested by: Yuri Y. Bushmelev [2]
MFC after: 1 week
rwatson [Sun, 5 Dec 2004 13:27:30 +0000 (13:27 +0000)]
Acquire socket receive buffer mutex before appending and then waking up
a receive socket in DDP. This reduces the number of mutex operations
required to deliver to a socket by two, and is the model used in other
protocols.
dhartmei [Sun, 5 Dec 2004 12:15:43 +0000 (12:15 +0000)]
IPv6 packets can contain headers (like options) before the TCP/UDP/ICMP6
header. pf finds the first TCP/UDP/ICMP6 header to filter by traversing
the header chain. In the case where headers are skipped, the protocol
checksum verification used the wrong length (included the skipped headers),
leading to incorrectly mismatching checksums. Such IPv6 packets with
headers were silently dropped.
rse [Sun, 5 Dec 2004 09:51:48 +0000 (09:51 +0000)]
Use "ifconfig -l" instead of "list_network_interfaces all" in
ifnet_rename() to support situations where rc.conf's $network_interfaces
variable is set to an explicit list of network interfaces (instead of
the default "auto").
Using "list_network_interfaces all" resulted in using
$network_interfaces for both interface _renaming_ and interface
_configuration_ which obviously cannot work either before (if the
new name is in $network_interfaces) or after (if the old name is in
$network_interfaces) renaming the interface.
imp [Sun, 5 Dec 2004 07:55:30 +0000 (07:55 +0000)]
Start to add GIANT_REQUIRED; macros in places where giant is required
and that I've verified things seem to basically work. I was able to
boot and hot plug usb devices. Please let me know if this causes
problems for anybody.
The push down of giant has proceeded to the point that this will start
to matter more and more.
marcel [Sun, 5 Dec 2004 06:59:01 +0000 (06:59 +0000)]
Source changes to allow building a cross-debugger. Move solib.c and
solib-svr4.c to the MD makefiles because they are native files for
alpha and sparc64, but target files for amd64, i386 and ia64.
Note that kgdb(1) does not yet build as a cross-debugger due to
libkvm.
marcel [Sun, 5 Dec 2004 06:02:21 +0000 (06:02 +0000)]
o Don't limit GPT as a rank 2 provider. Allow it to be connected
anywhere in the DAG. This includes configurations that are not
allowed by the EFI specification.
o Reject a GPT partition table if it's not preceeded by a PMBR.
There's no need to preserve the MBR partitioning anymore as GPT
is mature and with the first bullet extending the applicability
of GPT, it's better to be a bit more strict.
njl [Sun, 5 Dec 2004 01:35:18 +0000 (01:35 +0000)]
Grab Giant around calls to DEVICE_SUSPEND/RESUME in acpi_SetSleepState().
If we are resuming non-MPSAFE drivers, they need Giant held for them.
This may fix some obscure suspend/resume problems. It has fixed keyrate
setting problems that were triggered by cardbus (MPSAFE) changing the
ordering for syscons resume (non-MPSAFE). Also, add some asserts that
Giant is held in our suspend/resume and shutdown methods.
kris [Sat, 4 Dec 2004 23:30:36 +0000 (23:30 +0000)]
Add more frequently-used locale directories. This is in preparation
for cleanup of pkg-plist files with respect to handling of the share/locale
subdirectories.
pjd [Sat, 4 Dec 2004 21:20:59 +0000 (21:20 +0000)]
When initializing device, set d_softc and d_no fields for all components,
because we know it then and we need it when inserting a component which
wasn't destroyed while device was running.
Reported by: Michael Handler <handler@grendel.net>
MFC after: 1 week
marius [Sat, 4 Dec 2004 14:03:45 +0000 (14:03 +0000)]
Catch up with the new device name of sab(4). The entries for tty[a,b]
can't be removed as ofw_console(4) and zs(4) use them so one has to
live with some complaints about non-existent devices at boot time and
remove the respective entries locally for now.
mdodd [Fri, 3 Dec 2004 18:21:30 +0000 (18:21 +0000)]
- Move chip ID code into separate function.
- Initialize sc->pcn_type during ATTACH as softc contents may not surivive
from PROBE.
- Print out chip-id to assist with ongoing pcn(4) debugging efforts.
rse [Fri, 3 Dec 2004 14:10:04 +0000 (14:10 +0000)]
Fix description: the argument to setcontext(3) must have been previously
initialized "by a call to getcontext(3) or makecontext(3)" and not "by a
call to setcontext(3) or makecontext(3)".
harti [Fri, 3 Dec 2004 08:02:52 +0000 (08:02 +0000)]
Change the algorithm that matches the builtin shells from the name keyword
of the .SHELL target. Formerly it used to select the shell with the
longest common trailing substring, so that bash would select sh, but pocsh
would select csh. Now an exact match is required so that specifying bash
without also giving a path and the other keywords will give an error.
njl [Fri, 3 Dec 2004 08:01:09 +0000 (08:01 +0000)]
Enable the relaxed behavior for op regions and other workarounds for
non-standard BIOSen. We used to implement this in local patches but
now that ACPI-CA has merged/re-implemented most of our fixes, they were
no longer needed and we just needed to turn this knob on. Also, remove
an unnecessary cast.
harti [Thu, 2 Dec 2004 17:00:58 +0000 (17:00 +0000)]
Make the tests runnable on a read-only src. To do this you must make sure
that you create one of the object directories make knows (see make(1)).
This uses the -C flag, so add a test that checks that make actually accepts
-C. Also fix the test that selects csh via the .SHELL target to work for
tcsh users too.
This commit renames shell_test to shell_test.sh. There is no history
to preserve so go without a repo-copy.
maxim [Thu, 2 Dec 2004 13:12:43 +0000 (13:12 +0000)]
o Terminate an endless loop sh -T goes into in dowait() around waitproc().
XXX from Tor: "The shell can also go into a similar loop if the child was
killed by signal 127, since the shell would believe the child to have
only stopped (WIFSTOPPED() macro returns nonzero value). Disallowing
signals 127 and 128 will fix that problem." See kern/19402 for details.
obrien [Thu, 2 Dec 2004 09:38:34 +0000 (09:38 +0000)]
Specifically use the 32-bit version of fuword/suword since that's what
we really want vs. the size changing 'long' (i386 vs. AMD64).
This fixes the problem with DRM with Radeon's on AMD64.
njl [Thu, 2 Dec 2004 08:07:12 +0000 (08:07 +0000)]
Turn ACPI and PCI devices off or to a lower power state in suspend and
back on again in resume. Override the default of D3 with the value the
BIOS specifies in _SxD, if present. Skip serial devices (PNP05xx) since
they seem to hang when set to D3 and may require special driver support.
Also, skip non-type 0 PCI devices (i.e., bridges) since our we don't yet
save/restore their config space and that seems to be necessary.
If this gives you trouble with suspend/resume, you can disable the new
ACPI and PCI power behavior separately with these tunables & sysctls:
debug.acpi.do_powerstate
hw.pci.do_powerstate
alc [Thu, 2 Dec 2004 04:06:40 +0000 (04:06 +0000)]
For efficiency eliminate the call to pmap_pte() from pmap_protect()'s and
pmap_remove()'s inner loop. Instead, call pmap_pde_to_pte(), a new
function, prior to the inner loop.
marks [Thu, 2 Dec 2004 00:05:02 +0000 (00:05 +0000)]
Local change: Supporting code not yet available, use previous behavior
instead for the time being. Intel should fix this.
Note that if this commit is correct, it is made on the vendor branch.
We expect the Intel folks to fix it, and we don't want to unnecessarily
take files off the vendor branch.
peter [Wed, 1 Dec 2004 23:23:14 +0000 (23:23 +0000)]
Do not leave build droppings in /usr/src for usr.sbin/pcvt/keycap and
usr.bin/lex/lib for the 32 bit libraries on amd64. Add an explicit
obj for these two directories that are built in for the "libraries" target.
phk [Wed, 1 Dec 2004 23:16:38 +0000 (23:16 +0000)]
Back when VOP_* was introduced, we did not have new-style struct
initializations but we did have lofty goals and big ideals.
Adjust to more contemporary circumstances and gain type checking.
Replace the entire vop_t frobbing thing with properly typed
structures. The only casualty is that we can not add a new
VOP_ method with a loadable module. History has not given
us reason to belive this would ever be feasible in the the
first place.
Eliminate in toto VOCALL(), vop_t, VNODEOP_SET() etc.
Give coda correct prototypes and function definitions for
all vop_()s.
Generate a bit more data from the vnode_if.src file: a
struct vop_vector and protype typedefs for all vop methods.
Add a new vop_bypass() and make vop_default be a pointer
to another struct vop_vector.
Remove a lot of vfs_init since vop_vector is ready to use
from the compiler.
Cast various vop_mumble() to void * with uppercase name,
for instance VOP_PANIC, VOP_NULL etc.
Implement VCALL() by making vdesc_offset the offsetof() the
relevant function pointer in vop_vector. This is disgusting
but since the code is generated by a script comparatively
safe. The alternative for nullfs etc. would be much worse.
Fix up all vnode method vectors to remove casts so they
become typesafe. (The bulk of this is generated by scripts)