njl [Thu, 4 Mar 2004 05:58:50 +0000 (05:58 +0000)]
Fix an off-by-one error and rework our EC space handler. Writing to address
0xFF would fail previously as AE_BAD_PARAMETER. It's unknown if this caused
any actual problems.
njl [Thu, 4 Mar 2004 05:57:41 +0000 (05:57 +0000)]
Part 2 of Project Evil: Pretend to be Windows 2000 for buggy ASL that
always expects to be running on some MS OS. A survey of ASL shows that
this is the 2nd most common expected OS value. (1st is Win98 and we don't
emulate its buggy ACPI support.) Our ACPI support is similar to Win2k,
also. Put this behavior under ACPICA_PEDANTIC so we can get back to our
previous behavior for OSV testing.
njl [Thu, 4 Mar 2004 05:17:52 +0000 (05:17 +0000)]
Don't disable Cx support and throttling on machines with a P_BLK_LEN != 6
even though the spec mandates this. Some have a value of 5 to indicate
throttling + C2 and some have 7 to indicate an extra C3 state. Support
throttling if the value is >= 4, C2 for >= 5, and C3 for >= 6.
njl [Thu, 4 Mar 2004 04:42:59 +0000 (04:42 +0000)]
Add a "quirks" value to disable quirks handling for a given boot.
Also, disable quirks if booting with a custom DSDT. Add a quirk
to disable loading ACPI so known bad systems can be completely
blacklisted.
bms [Thu, 4 Mar 2004 04:42:52 +0000 (04:42 +0000)]
Add a new option to mountd(8), -p <port>. This allows the user to specify
a known port for use in firewall rulesets; otherwise the port is chosen
at run-time by bindresvport().
wpaul [Thu, 4 Mar 2004 00:17:14 +0000 (00:17 +0000)]
Add sanity checks to the ndis_packet and ndis_buffer pool handling
routines to guard against problems caused by (possibly) buggy drivers.
The RealTek 8180 wireless driver calls NdisFreeBuffer() to release
some of its buffers _after_ it's already called NdisFreeBufferPool()
to destroy the pool to which the buffers belong. In our implementation,
this error causes NdisFreeBuffer() to touch stale heap memory.
If you are running a release kernel, and hence have INVARIANTS et al
turned off, it turns out nothing happens. But if you're using a
development kernel config with INVARIANTS on, the malloc()/free()
sanity checks will scribble over the pool memory with 0xdeadc0de
once it's released so that any attempts to touch it will cause a
trap, and indeed this is what happens. It happens that I run 5.2-RELEASE
on my laptop, so when I tested the rtl8180.sys driver, it worked fine
for me, but people trying to run it with development systems checked
out or cvsupped from -current would get a page fault on driver load.
I can't find any reason why the NDISulator would cause the RealTek
driver to do the NdisFreeBufferPool() prematurely, and the same driver
obviously works with Windows -- or at least, it doesn't cause a crash:
the Microsoft documentation for NdisFreeBufferPool() says that failing
to return all buffers to the pool before calling NdisFreeBufferPool()
causes a memory leak.
I've written to my contacts at RealTek asking them to check if this
is indeed a bug in their driver. In the meantime, these new sanity checks
will catch this problem and issue a warning rather than causing a trap.
The trick is to keep a count of outstanding buffers for each buffer pool,
and if the driver tries to call NdisFreeBufferPool() while there are still
buffers outstanding, we mark the pool for deletion and then defer
destroying it until after the last buffer has been reclaimed.
gad [Wed, 3 Mar 2004 22:56:41 +0000 (22:56 +0000)]
[this is just a forced commit to say:] The time_t-specific safety measure
added by the sparc64_installcheck target is mostly from Marcel, although
it includes some adjustments of my own...
gad [Wed, 3 Mar 2004 19:48:52 +0000 (19:48 +0000)]
(that should be: "assuming NO major problems are found", of course...)
Also note that these three files are intended to be short-term aids for
making this specific transition. They will probably disappear after
5.3-release (although the installworld_*k scripts do include some
general-purpose ideas that we might want to consider at a later date).
gad [Wed, 3 Mar 2004 19:36:20 +0000 (19:36 +0000)]
Commit the first set of files for changing time_t on freebsd/sparc64
from a 32-bit value to a 64-bit value. This commit does not actually
change anything. It merely provides instructions, scripts, and a safety
measure in Makefile.inc1 for people who want to make the change.
The real change to 64-bit time_t's on sparc64 is scheduled to happen
on March 10th, assuming that so major problems are found between now
and then by early-adopters.
mtm [Wed, 3 Mar 2004 15:28:44 +0000 (15:28 +0000)]
Some (most?) processes don't cleanup their pid files when
they exit. Sometimes they simply can't (core-dump, for example).
So, when searching for a running program send standard error
output from ps(1) to never-never land.
# This should quite those
# ps: kvm_getprocs: No such user
# errors. Since ports use a duplicate rc.subr(8) you might
# still see this error from ports startup scripts.
mtm [Wed, 3 Mar 2004 15:21:01 +0000 (15:21 +0000)]
From the PR:
Certain MTA configurations mean that the notifications from
virecover keep bouncing; so here's a patch to allow administrators
to turn them off.
PR: conf/54910
Submitted by: bms (with a minor cleanup)
obrien [Wed, 3 Mar 2004 09:33:03 +0000 (09:33 +0000)]
mga_state & r128_state need an inline-limit larger than amd64's default
in order to compile. AMD64's default could be reduced below 8k, if
dev/aic7xxx/aic79xx.c got this same treatment.
obrien [Wed, 3 Mar 2004 08:33:34 +0000 (08:33 +0000)]
Peter prefers it this way, bde might also[*]. I just want to have a chance
of working on amd64 for vmware use.
[*] bde will probably not like either version...
njl [Wed, 3 Mar 2004 03:02:17 +0000 (03:02 +0000)]
Add support for quirks for acpi tables. Key off OEM vendor and revision.
Sort acpi debug values. Change "disable" to "disabled" to match rest of
the kernel. Remove debugging from acpi_toshiba since it was only used for
probe/attach.
ken [Wed, 3 Mar 2004 01:51:24 +0000 (01:51 +0000)]
Fix a couple of camcontrol issues that popped up on sparc64:
- bzero the CCB header in getdevtree() and set the path properly, to
avoid having random garbage in the CCB header.
- if the lun isn't specified in a device specifier, it should default to
0, not whatever random data happens to be in the lun variable.
- move the prototype for getdevtree() out from under #ifndef MINIMALISTIC,
since it is used in both cases.
Submitted by: Marius Strobl <marius@alchemy.franken.de> (mostly)
MFC After: 2 weeks
cperciva [Wed, 3 Mar 2004 00:45:30 +0000 (00:45 +0000)]
Forced commit to note that files have been repocopied from
src/sbin/nologin to src/usr.sbin/nologin in preparation for
moving nologin(8) from /sbin to /usr/sbin.
jkh [Tue, 2 Mar 2004 19:43:51 +0000 (19:43 +0000)]
If handed a file pointer we can't write to, set errno properly to EBADF
in order to get SUSv2 conformant behavior in higher level calls like
fputs() and puts().
rik [Tue, 2 Mar 2004 16:39:40 +0000 (16:39 +0000)]
1. Renames NCT constant to NCTAU. This will help while MFC to 4 branch.
2. Fix compilation and panic while system boot problem after makedev
was changed to unde2dev.
jhb [Tue, 2 Mar 2004 14:58:33 +0000 (14:58 +0000)]
Correct handling of PDROP in msleep() to just skip the mtx_lock() rather
than clear the lock pointer so that sleepq_add() still gets the correct
lock pointer and doesn't bogusly trip an assertion.
mlaier [Tue, 2 Mar 2004 14:37:23 +0000 (14:37 +0000)]
Two minor follow-ups on the MT_TAG removal:
ifp is now passed explicitly to ether_demux; no need to look it up again.
Make mtag a global var in ip_input.
alc [Tue, 2 Mar 2004 08:25:58 +0000 (08:25 +0000)]
Modify contigmalloc1() so that the free page queues lock is not held when
vm_page_free() is called. The problem with holding this lock is that it is
a spin lock and vm_page_free() may attempt the acquisition of a different
default-type lock.
grehan [Tue, 2 Mar 2004 06:49:21 +0000 (06:49 +0000)]
Increase kernel VA from 256Mb to 512Mb by shifting the segment used
for user copyinout down to 12, and keeping segments 13/14 for
kernel VA.
It would be nice to have more available, but segments lower than
this are reserved for either memory or 1:1 mapped device i/o,
and seg 15 is OpenFirmware ROM. Also, the effort to keep OpenFirmware
available for callbacks limits the use of VA-mapped segments.
Fortunately UMA_MD_SMALL_ALLOC takes away a lot of VM pressure.
grehan [Tue, 2 Mar 2004 06:13:09 +0000 (06:13 +0000)]
Kernel changes for libthr (and probably libpthread).
include/ucontext.h
- remove trapframe and switch over to 'generic' description of machine
state. Include version field to help with future modifications.
Include floating point and altivec state, and hopefully align
correctly
powerpc/copyinout.c
- fill out casuptr() sync primitive, required by kern_umtx.c
powerpc/machdep.c
- shifted proc0/thread0/pcpu setup to before cninit, since
syscons -> make_dev -> devlock requires a valid curthread
- implemented get_mcontext/set_mcontext
- recast sendsig/sigreturn to use get/set_mcontext and new
ucontext struct. floating point now saved
- TODO: save/restore altivec state
jhb [Mon, 1 Mar 2004 23:07:58 +0000 (23:07 +0000)]
Check for TDF_SINTR before calling sleepq_abort() as there is a narrow
race in between sleepq_add() and sleepq_catch_signals() in that setting
td_wchan and TDF_SINTR is not atomic to sched_lock but only to the sleepq
lock. This band-aid will stop assertion failures, but there is perhaps a
larger problem with the sleepq_add/sleepq_catch_signals race that I am not
sure how to solve. For the signals case the race is harmless because we
always call cursig() after setting TDF_SINTR. However, KSE doesn't do
anything in sleepq_catch_signals() to check that this race was lost, so I
am unsure if this race is harmful for this specific abort.
rwatson [Mon, 1 Mar 2004 22:37:01 +0000 (22:37 +0000)]
Rename NET_PICKUP_GIANT() to NET_LOCK_GIANT(), and NET_DROP_GIANT()
to NET_UNLOCK_GIANT(). While they are used in similar ways, the
semantics are quite different -- NET_LOCK_GIANT() and NET_UNLOCK_GIANT()
directly wrap mutex lock and unlock operations, whereas drop/pickup
special case the handling of Giant recursion. Add a comment saying
as much.
Add NET_ASSERT_GIANT(), which conditionally asserts Giant based
on the value of debug_mpsafenet.
kensmith [Mon, 1 Mar 2004 21:58:21 +0000 (21:58 +0000)]
Add command line option for chrootdir, all pkg_add(8) operations will be
done inside of chroot(2) to chrootdir. Added to help with sysinstall(8)
support of install to alternate root but possibly useful for setting up
jails, etc.
No objection from: portmgr@
Style(9) abuse due to: entire program violates style(9)
Approved by: rwatson (mentor)