csjp [Fri, 30 Dec 2005 20:10:21 +0000 (20:10 +0000)]
mkstemp(3) and friends use a combination of base 10 digits, along
with upper and lower case letters from the English alphabet. Change
the number of possible file names mktemp will return from 26**6
to (10+26+26)**6 instead. This keeps things consistent with mkstemp(3)
imp [Fri, 30 Dec 2005 19:28:26 +0000 (19:28 +0000)]
Expose pci_add_resources to the outside world, add a 'force' flag to
force allocation of unallocated BARs (cardbus uses this to preallocate
everything). Add a prefetchmask to allow for busses that get prefetch
hints to set them. Addjust pci_add_map and pci_ata_maps to take a new
force flag which pci_add_resources will pass in. Implement 'force' in
pci_add_map. Write new value of allocated resource into the bar, if
the allocation succeeded (we should have done this before, but with
the new force the bug was very obvious).
rwatson [Fri, 30 Dec 2005 17:27:26 +0000 (17:27 +0000)]
When printing SSID's in ifconfig(8)'s scan mode, set the width of the
ssid field to 32 characters instead of 14, as long SSID's are quite
common and hard to type in if you can't read them.
ceri [Fri, 30 Dec 2005 13:16:15 +0000 (13:16 +0000)]
inetd(8) requires that /etc/netconfig be present, and contain entries
for each of udp and tcp (and their IPv6 equivalents when INET6 is
enabled). Note that dependency here.
PR: docs/90435
Submitted by: Dmitry Kazarov <kazarov at mcm dot ru>
Pointed out by: Daniel Gerzo <danger at rulez dot sk>
MFC after: 8 days
pjd [Fri, 30 Dec 2005 11:45:07 +0000 (11:45 +0000)]
Improve memguard a bit:
- Provide tunable vm.memguard.desc, so one can specify memory type without
changing the code and recompiling the kernel.
- Allow to use memguard for kernel modules by providing sysctl
vm.memguard.desc, which can be changed to short description of memory
type before module is loaded.
- Move as much memguard code as possible to memguard.c.
- Add sysctl node vm.memguard. and move memguard-specific sysctl there.
- Add malloc_desc2type() function for finding memory type based on its
short description (ks_shortdesc field).
- Memory type can be changed (via vm.memguard.desc sysctl) only if it
doesn't exist (will be loaded later) or when no memory is allocated yet.
If there is allocated memory for the given memory type, return EBUSY.
- Implement two ways of memory types comparsion and make safer/slower the
default.
rse [Fri, 30 Dec 2005 09:16:23 +0000 (09:16 +0000)]
1. Add missing semicolon between "warn" and "return" to make sure
the line continuation backslash doesn't cause "warn" to print "return".
2. Group "warn" and "return" together as the "return 1" should be
performed only if the "kldload nfsclient" also failed (and not
already if the "vfs.nfs" sysctl(8) check failed).
ariff [Fri, 30 Dec 2005 07:33:28 +0000 (07:33 +0000)]
Disable frantic DMA update within few SNDCTL_DSP_* ioctl.
This should reduce huge playback / recording latency for
applications that try to act smarter and manage their own
buffering (XMMS, Skype, etc.).
Note to Skype + via8xxx users: Remove previous hackish
"hint.pcm.<unit>.via_dxs_disabled" from kernel hint and see
whether this changes cure all those annoying sound issues.
ariff [Fri, 30 Dec 2005 07:33:01 +0000 (07:33 +0000)]
Underruns counting logic should be based on bufhard free space
and must be done after sndbuf_feed(), or any attempt to fill
up bufhard. This should fix false underruns counter.
sam [Fri, 30 Dec 2005 00:40:36 +0000 (00:40 +0000)]
correct checking for turbo channels: rev 1.24 fixed static turbo channels
but broke handling of the turboG channel; since we aren't ready to revamp
the channel list just check for turboA channels for now so channel 6 is
considered in auto mode
imp [Thu, 29 Dec 2005 23:38:45 +0000 (23:38 +0000)]
Simplify the opening of the resources for cardbus cards. Before we'd
try very hard to be perfect. However, these attempts broke down when
there were large numbers of resources. We'd not be able to map them all.
Instead, accept that we might pass more range to thse subbus than
might be optimal be able to compute. However, there's little harm in
this and it allows us to pass greater resources through.
# it has been suggested that we allocate a fixed amount of resources
# on attach and give it out upon request. This might not be a bad idea...
pjd [Thu, 29 Dec 2005 22:52:09 +0000 (22:52 +0000)]
Print a warning when we miss vinactive() call, because of race in vget().
The race is very real, but conditions needed for triggering it are rather
hard to meet now.
When gjournal will be committed (where it is quite easy to trigger) we need
to fix it.
jhb [Thu, 29 Dec 2005 20:57:45 +0000 (20:57 +0000)]
Add a new function msleep_spin() which is a slightly stripped down version
of msleep(). msleep_spin() doesn't support changing the priority of the
thread while it is asleep nor does it support interruptible sleeps (PCATCH)
or the PDROP flag. It does support timeouts however. It differs from
msleep() in that the passed in mutex is a spin mutex. This means one can
use msleep_spin() and wakeup() with a spin mutex similar to msleep() and
wakeup() with a regular mutex. Note that the spin mutex in question needs
to come before sched_lock and the sleepq locks in lock order.
jhb [Thu, 29 Dec 2005 20:53:01 +0000 (20:53 +0000)]
Fix a deadlock I introduced with the recently added printf to warn about
spin locks that are not in the static order list. It is not safe to call
printf while holding the witness spin mutex since the console drivers that
back printf may need to use their own spin locks which would try to talk
to witness when they were locked. Given this, it is possible for one
CPU to lock a console driver lock (such as sio) which then tries to lock
the witness lock while another CPU is doing the printf while holding the
witness lock. Fix this by moving the printf outside of the witness lock.
All other printf's in witness are already correct.
ceri [Thu, 29 Dec 2005 19:25:17 +0000 (19:25 +0000)]
An i386 machine with 32MB of RAM requires a 700MB disk for auto-layout to
succeed, whilst an i386 with 256MB of RAM requires more. Up the amount
of disk hinted at as a minimum requisite for auto-layout.
netchild [Thu, 29 Dec 2005 18:35:28 +0000 (18:35 +0000)]
Sync the type (and size, compare mousestatus_t in /usr/include/sys/mouse.h)
of a variable according to the usage (after increasing the number of max
buttons this may matter).
netchild [Thu, 29 Dec 2005 18:11:11 +0000 (18:11 +0000)]
Fix some kind of "off by one"-error: the min or max sample rate the
device is able to reproduce should be usable too instead of failing
in such a case.
PR: 89269
Submitted by: Don L. Belcher <don@siad.net>
jhb [Thu, 29 Dec 2005 18:00:42 +0000 (18:00 +0000)]
Increment kobj_lookup_misses on a miss rather than decrementing it.
Otherwise, the miss count is actually -kobj_lookup_misses. Mostly a
pedantic change as KOBJ_STATS isn't on by default.
dfr [Thu, 29 Dec 2005 14:40:22 +0000 (14:40 +0000)]
Add a new extensible GSS-API layer which can support GSS-API plugins,
similar the the Solaris implementation. Repackage the krb5 GSS mechanism
as a plugin library for the new implementation. This also includes a
comprehensive set of manpages for the GSS-API functions with text mostly
taken from the RFC.
Reviewed by: Love Hörnquist Åstrand <lha@it.su.se>, ru (build system), des (openssh parts)
rse [Thu, 29 Dec 2005 13:39:46 +0000 (13:39 +0000)]
Fix semantics in the documentation of the "jail_socket_unixiproute_only"
variable ("YES" vs. "NO") and be more precise and intuitive on what is
actually allowed/restricted by this variable ("UNIX/IP/route sockets"
vs. "TCP/IP protocols").
thompsa [Thu, 29 Dec 2005 09:39:15 +0000 (09:39 +0000)]
When pfil(9) is enabled the bridge only considers ETHERTYPE_ARP, ETHERTYPE_IP and
ETHERTYPE_IPV6 frames. Change this to be a sysctl knob so that is able to still
bridge non-IP packets if desired.
Also return early if all pfil_* sysctls are turned off, the user obviously does
not want to filter on the bridge.
kbyanc [Wed, 28 Dec 2005 20:36:55 +0000 (20:36 +0000)]
Add support for printing IPSEC protocol stats if the kernel was compiled
with FAST_IPSEC rather than the KAME IPSEC stack.
Note that the output of "netstat -s -p ipsec" differs depending on which
stack is compiled into the kernel since they each keep different stats.
This delta also adds the "esp", "ah", and "ipcomp" protocol stats, which
are also available when the kernel is compiled with the FAST_IPSEC stack
(e.g. "netstat -s -p esp").
Submitted by: Matt Titus <titus at nttmcl dot com>
MFC after: 3 days
netchild [Wed, 28 Dec 2005 17:57:36 +0000 (17:57 +0000)]
Fix the order of the stereo channels (left <-> right).
From the PR:
---snip---
I think I have found the change which reversed the channels.
Revision 1.44 of emu10k1.c, which added Audigy support, has the line
I don't have Audigy, so I'm not sure if the problem affects Audigy cards
too. The order of the channels can't be tested by just altering mixer
settings. Here's a small program to test if the channels are reversed on
your sound card:
You should hear a sound on the left channel followed by a sound on the
right channel. If you hear a sound on the right channel first, the
channels are reversed.
---snip---
Owners of an audigy card should verify if it DTRT and report back.
rwatson [Wed, 28 Dec 2005 12:42:12 +0000 (12:42 +0000)]
Add 'juggle', a simple IPC micro-benchmark that uses various IPC types to
perform varying number of small IPC operations. It runs using a single
process and one thread, a single process and two threads, and using
multiple processes. Critical to its performance measure are the cost and
frequency of context switches, locking overhead, and threading
performance. The benchmark generates .csv output appropriate for reading
into a spreadsheet to generate summary statistics and perform statistical
tests easily.
glebius [Wed, 28 Dec 2005 10:15:01 +0000 (10:15 +0000)]
When in rev. 1.47 cardbus_alloc_resources() function was moved from
cardbus_cis.c to this file, some code was not merged and thus resource
list entries were invalid. They didn't have a resources attached to
them.
However, the problem was masked for some time later, because newer
resources list entries were added to the head of the list, and
resource_list_find() always returned the first matching resource list
entry. Usually the underlying driver allocated a valid resource and
added it to the head of the list, and invalid one wasn't used.
In rev. 1.174 of subr_bus.c the sorting of resource list entries was
reversed demasking the problem in cardbus_alloc_resources().
This commit fixes the problem returning back some code from
cardbus_cis.c, pre-1.49 revisions.
scottl [Wed, 28 Dec 2005 08:14:35 +0000 (08:14 +0000)]
Fix a serious regression from the busdma conversion. Check to make sure
that we don't overrun the tx descriptor ring before actually trying to
overrun it.
yongari [Wed, 28 Dec 2005 02:57:19 +0000 (02:57 +0000)]
Bring big-endian architecture support for ti(4).
. remove unnecessay header files after Scott's bus_dma(9) commit.
. remove global variable tis which was introduced at the time of
zero_copy(9) changes. The variable tis was not used at all. The
same applyes to ti_links in softc so axe it.
. deregister variables.
. axe ti_vhandle and switch to use explicit register access for
accessing NIC local memory. Creates three variants of ti_mem to
read/write NIC local memory(ti_mem_read, ti_mem_write) and clearing
NIC local memory(ti_mem_zero). This greatly enhances code
readability and have ti(4) drop using shared memory scheme for
Tigon 1. As Tigon 1 switched to use explicit register access for Tx,
axe ti_tx_ring_nic/ti_cmd_ring in softc.(Tigon 2 used to host ring
scheme which means there is no need to access NIC local memory via
register access for Tx and NIC would DMA the modified Tx rings into
its local memory.) [1]
. introduce new macro TI_EVENT_*/TI_CMD_* to handle NIC envent/command.
Instead of using bit fields assginment for accessing the event, use
shift operations to set/get it. [1]
. add additional check for valid DMA tags in ti_free_dmamaps().
. add missing bus_dmamap_sync/bus_dmamap_unload in ti_free_*_ring_*.
. fix locking nits(MTX_RECURSE mutex) and make ti(4) MPSAFE.
. change data type of ti_rdata_phys to bus_addr_t and don't blindly
cast to uint32_t.
. rearrange detach path and make ti(4) survive during device detach.
. for Tigon 1, use explicit register access for checking Tx descriptors
in ti_encap()/ti_txeof(). [1]
. properly call bus_dmamap_sync(9) for updating statistics.
. remove extra semicolon in ti_encap()
. rewrite loading MAC address to work on strict-alignment architectures.
. move TI_RD_OFF macro to if_tireg.h
. axe ETHER_ALIGN as it's already defined in <net/ethernet.h>.
. make macros immuine from expansion by adding parenthesis and do-while.
. remove alpha specific hack as vtophys(9) is no longer used in ti(4)
after Scott's bus_dma(9) fix.
pjd [Wed, 28 Dec 2005 01:53:13 +0000 (01:53 +0000)]
In realloc(9), determine size of the original block based on
UMA_SLAB_MALLOC flag.
In some circumstances (I observed it when I was doing a lot of reallocs)
UMA_SLAB_MALLOC can be set even if us_keg != NULL.
If this is the case we have wonderful, silent data corruption, because less
data is copied to the newly allocated region than should be.
I'm not sure when this bug was introduced, it could be there undetected
for years now, as we don't have a lot of realloc(9) consumers and it was
hard to reproduce it...
...but what I know for sure, is that I don't want to know who introduce
the bug:) It took me two/three days to track it down (of course most of
the time I was looking for the bug in my own code).
pjd [Tue, 27 Dec 2005 23:23:47 +0000 (23:23 +0000)]
Fix watch address truncation. The address was truncated when it was passed to
amd64_set_watch() as 'unsigned int' and 'unsigned int' is 32bit long on amd64.
Even with that fix hardware watchpoint don't work for me on amd64, ie. when
I set the watchpoint and write a byte there, nothing happens.