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)
jhb [Wed, 1 Dec 2004 21:05:02 +0000 (21:05 +0000)]
- Do a better job of handling any Dependent Functions (aka DPFs) that appear
in the _PRS or _CRS of link devices. If faced with multiple DPFs in a
_PRS, we just use the first one. We assume that if _CRS has DPF tags they
only contain a single set since multiple DPFs wouldn't make any sense. In
practice, the only DPFs I've seen so far for link devices are that the one
IRQ resource is surrounded by a DPF tag pair for no apparent reason, and
this should handle that case fine now.
- Only allocate link structures for IRQ resources for link devices rather
than allocating a link structure for every resource.
jhb [Wed, 1 Dec 2004 18:03:18 +0000 (18:03 +0000)]
Don't allow ISO images to be made that try to use boot.flp to boot as the
boot.flp in 5.3 and later is not self-contained and thus not suitable for
CD booting. /boot/cdboot is now the only way to boot the install CDs.
davidxu [Wed, 1 Dec 2004 13:50:04 +0000 (13:50 +0000)]
If a thread is resumed by thr_wake, it should return 0, especially it
should not return ERESTART after it caught a signal, otherwise
thr_wake() call will be lost, also a timeout wait should not be
restarted. Final, using wakeup not wakeup_one to be safeness.
nik [Wed, 1 Dec 2004 12:12:12 +0000 (12:12 +0000)]
The following code sets up two connected TCP sockets that send data to each
other until the window is closed. Then one of the sockets is closed, which
will generate a RST once the TCP at the other socket does a window probe.
All versions of FreeBSD prior to 11/26/2004 will ignore this RST into a 0
window, causing the connection (and application) to hang indefinitely.
On patched versions of FreeBSD (and other operating systems), the RST
will be accepted and the program will exit in a few seconds.
scottl [Wed, 1 Dec 2004 07:17:57 +0000 (07:17 +0000)]
Fix a bunch of stack leaks. These were theoretically harmless, except that
they would leave enough elements on the stack that if you escaped to the
loader prompt and then typed 'setenv', it would pull in all of the leaked
junk and cause an exception in the environment. There still seems to be
3 leaked elements, but they don't appear to be coming from this file.
Fix for a race between lookup and readdirplus, that causes
a deadlock (with NFS exclusive vnode locks enabled). Lookup
grabs the parent's lock and wants to lock child. Readdirplus
locks the child and wants to lock parent (for loading the attrs
for ".."). The fix is to not load the attrs for ".." in
readdirplus.
Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
Reviewed by: rwatson
Clean all dirty pages (dirtied by mmap'ed writes) in nfs_close().
This closes a major hole in close-to-open consistency support.
Added a new sysctl so that this can be disabled for single NFS
client applications with very large amounts of mmap'ed IO (for
performance).
Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
Reviewed by: rwatson
marcel [Wed, 1 Dec 2004 06:40:35 +0000 (06:40 +0000)]
Change gdb_cpu_setreg() to not take the value to which to set the
specified register, but a pointer to the in-memory representation of
that value. The reason for this is twofold:
1. Not all registers can be represented by a register_t. In particular
FP registers fall in that category. Passing the new register value
by reference instead of by value makes this point moot.
2. When we receive a G or P packet, both are for writing a register,
the packet will have the register value in target-byte order and
in the memory representation (modulo the fact that bytes are sent
as 2 printable hexadecimal numbers of course). We only need to
decode the packet to have a pointer to the register value.
This change fixes the bug of extracting the register value of the P
packet as a hexadecimal number instead of as a bit array. The quick
(and dirty) fix to bswap the register value in gdb_cpu_setreg() as
it has been added on i386 and amd64 can therefore be removed and has
in fact been that.
obrien [Wed, 1 Dec 2004 04:34:08 +0000 (04:34 +0000)]
Fix "Lock ACPI PCI link not exclusively locked
@sys/dev/acpica/acpi_pci_link.c:153" panic by backing out rev 1.37 in the SMP
case. It appears that on a dual-proc machine the assertions in the rev 1.37
commit log hold true.
mlaier [Tue, 30 Nov 2004 22:38:37 +0000 (22:38 +0000)]
Implement the check I was talking about in the previous message already.
Introduce domain_init_status to keep track of the init status of the domains
list (surprise). 0 = uninitialized, 1 = initialized/unpopulated, 2 =
initialized/done. Higher values can be used to support late addition of
domains which right now "works", but is potential dangerous. I choose to
only give a warning when doing so.
Use domain_init_status with if_attachdomain[1]() to ensure that we have a
complete domains list when we init the if_afdata array. Store the current
value of domain_init_status in if_afdata_initialized. This way we can update
if_afdata after a new protocol has been added (once that is allowed).
Submitted by: se (with changes)
Reviewed by: julian, glebius, se
PR: kern/73321 (partly)
mlaier [Tue, 30 Nov 2004 22:28:50 +0000 (22:28 +0000)]
Move ng_socket and ng_btsocket initialization to SI_SUB_PROTO_DOMAIN as they
call net_add_domain(). Calling this function too early (or late) breaks
assertations about the global domains list.
Actually it should be forbidden to call net_add_domain() outside of
SI_SUB_PROTO_DOMAIN completely as there are many places where we traverse
the domains list unprotected, but for now we allow late calls (mostly to
support netgraph). In order to really fix this we have to lock the domains
list in all places or find another way to ensure that we can safely walk the
list while another thread might be adding a new domain.
Spotted by: se
Reviewed by: julian, glebius
PR: kern/73321 (partly)
njl [Tue, 30 Nov 2004 17:48:10 +0000 (17:48 +0000)]
Don't bother locking in attach(). At boot time, we're single-threaded
anyway and for some reason, witness seems confused about what's already
locked and triggers a false panic.
harti [Tue, 30 Nov 2004 15:35:51 +0000 (15:35 +0000)]
Constify the array of predefined shells. It turns out that we need two
versions of the structure definition for this: one with const char
pointers, because otherwise gcc won't let us initialize the fields with
constant strings, and one without the const, because we need to work
with the structure.
harti [Tue, 30 Nov 2004 15:33:18 +0000 (15:33 +0000)]
Chmod the shell testscript to be executable if it isn't already. According
to the CVS-Meisters x-mode just happens to work, but is not guaranteed to
do so. Try to be on the safe side.
davidxu [Tue, 30 Nov 2004 12:02:53 +0000 (12:02 +0000)]
1. use per-chain mutex instead of global mutex to reduce
lock collision.
2. Fix two race conditions. One is between _umtx_unlock and signal,
also a thread was marked TDF_UMTXWAKEUP by _umtx_unlock, it is
possible a signal delivered to the thread will cause msleep
returns EINTR, and the thread breaks out of loop, this causes
umtx ownership is not transfered to the thread. Another is in
_umtx_unlock itself, when the function sets the umtx to
UMTX_UNOWNED state, a new thread can come in and lock the umtx,
also the function tries to set contested bit flag, but it will
fail. Although the function will wake a blocked thread, if that
thread breaks out of loop by signal, no contested bit will be set.
scottl [Tue, 30 Nov 2004 11:35:30 +0000 (11:35 +0000)]
Instead of just not defining a bunch of words when TESTMAIN is set, provide
stubs that at least handle the stack correctly. This makes it much easier to
experiment with loader scripts from userland.
harti [Tue, 30 Nov 2004 10:35:04 +0000 (10:35 +0000)]
Change a couple of the primitve list functions to be macros. This changes
the semantic of Lst_Datum which formerly returned NULL when the argument
node was NULL. There was only one place in the source that relied on this
so change that place.
imp [Tue, 30 Nov 2004 09:40:11 +0000 (09:40 +0000)]
Add observations of the Linux98 and Grub/98 boot loaders. These
observations lead me to believe that the convetion for pc98 boot
loaders is to have a jump unstruction, followed by a string, followed
by code. The jump usually doesn't have a nop after it and usually the
string is NUL terminated, but Grub/98 breaks both of these rules.
# I looked for, but failed to find the Minux boot blocks for PC-9801 port.
imp [Tue, 30 Nov 2004 08:00:14 +0000 (08:00 +0000)]
Reject tasting of this provider if the sector size isn't a multiple of
512. If I had an audio cdrom in my cd player when I booted my system,
I'd get a panic from geom because you can't read 8192 bytes from an
audio cdrom.
Remove XXX comment about IPL1 and replace it with some information
from my soon to be published web page on the pc98 disk layout. The
IPL1 test was the result of an observation of a disk with FreeBSD's
boot0 program. It was testing part of an area what appears to be
reserved for a boot loader name, which comes after a jump over this
area. I don't yet know if it is required to be any specific jump
instruction, or if the destination has to be location 11. [1]
[1] FreeBSD Press No. 13, page 115, poorly translated by myself. The
picture there shows offset 8 as the destination of the jump, but
FreeBSD's boot0 program has three padding NULs after the IPL1 name and
uses a 16-bit 'jmp' instruction.
njl [Tue, 30 Nov 2004 06:55:43 +0000 (06:55 +0000)]
Make sure the link array is big enough to hold both _CRS and _PRS
resource lists. It used to be sized based only on _CRS, hence _PRS could
perform an out-of-bounds access if it was larger (i.e., when there are
dependent functions). Add asserts to detect this case. Note, this is
only a temporary fix and I believe _PRS and _CRS should have separate
arrays.
Also, fix a typo where the wrong irq was being check for the APIC case.
peter [Tue, 30 Nov 2004 00:55:49 +0000 (00:55 +0000)]
Update the gdb register extraction support to use the pcb wherever
possible, like on i386. Registers are handled differently for caller
vs callee saved registers.
peter [Mon, 29 Nov 2004 23:25:56 +0000 (23:25 +0000)]
Take advantage of the shutdown processing being wired to the BSP and
eliminate the evil cpu_reset_proxy code now that it will never be
activated. i386 should pick this up as well.
ps [Mon, 29 Nov 2004 23:10:59 +0000 (23:10 +0000)]
If soreceive() is called from a socket callback, there's no reason
to do a window update to the peer (thru an ACK) from soreceive()
itself. TCP will do that upon return from the socket callback.
Sending a window update from soreceive() results in a lock reversal.
Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
Reviewed by: rwatson
ps [Mon, 29 Nov 2004 23:09:07 +0000 (23:09 +0000)]
Make soreceive(MSG_DONTWAIT) nonblocking. If MSG_DONTWAIT is passed into
soreceive(), then pass in M_DONTWAIT to m_copym(). Also fix up error
handling for the case where m_copym() returns failure.
Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
Reviewed by: rwatson
ps [Mon, 29 Nov 2004 22:58:32 +0000 (22:58 +0000)]
When upgrading the shared lock to an exclusive lock, if we discover
that the exclusive lock is already held, then we call panic. Don't
clobber internal lock state before panic'ing. This change improves
debugging if this case were to happen.
Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
Reviewed by: rwatson
brian [Mon, 29 Nov 2004 17:11:15 +0000 (17:11 +0000)]
Send NAS-IP-Address as well as NAS-Identifier
Add ``disable NAS-IP-Address'' and ``disable NAS-Identifier'' options to
support pre-rfc2865 RADIUS servers.
This pushes our enable/disable items over the 32 bit limit, so reoganise
things to allow a bunch more options.
Go to version 3.4.1 so that any compatability problems can be identified.
scottl [Mon, 29 Nov 2004 14:49:27 +0000 (14:49 +0000)]
Don't flag alignment constraints as a reason for bouncing. This fixes the
trigger for other misbehaviour in the sym driver that was causing freezes at
boot. Thanks to phk@ for reporting and testing this.