Matthew Dillon [Thu, 9 Sep 2010 00:33:26 +0000 (17:33 -0700)]
kernel - Bring if_alc up to FreeBSD rev 1.16
* Bring in all recent if_alc work from FreeBSD.
Taken-from: FreeBSD
Matthew Dillon [Wed, 8 Sep 2010 22:26:54 +0000 (15:26 -0700)]
wlan - Fix serializer in destroy path, update docs
* Update the README.DRAGONFLY to include tidbits no tsleeps and
firmware loading.
* Fix an issue when a low level driver attempts to destroy a wlan
interface.
Matthew Dillon [Wed, 8 Sep 2010 22:22:14 +0000 (15:22 -0700)]
wlan - Bring iwn back into the fold.
* Note in addition to the usual instructions we also have to release
the wlan_global_serializer across a number of tsleep()s and the
firmware loader.
Joe Talbott [Wed, 8 Sep 2010 17:06:18 +0000 (13:06 -0400)]
wlan - Bring wpi back into the fold.
Joe Talbott [Wed, 8 Sep 2010 17:03:13 +0000 (13:03 -0400)]
wpi - Convert to wlan_global_serializer use.
* Rip out old locking inherited from FreeBSD
* Use wlan_serialize_{enter,exit}() to serialize wlan boundary crossings
per sys/netproto/802_11/README.DRAGONFLY
* Clean up some minor cruft left over from porting.
Matthew Dillon [Wed, 8 Sep 2010 07:20:23 +0000 (00:20 -0700)]
wlan - if_ath driver - Make some adjustments to ath (preliminary)
These adjustments correct some chip races and appear to fix issues
related to running the wlan in AP mode with the atheros driver.
* Fix a bug in ath_txqmove(). This bug was hidden due to a queue
length check in the one place that used the routine but fix it anyway.
* Call stoptxdma() before messing with the beacon linkages rather than
afterwords (ap mode). I'm a bit unclear as to whether the previously
installed beacon should have been allowed to continue to run if no
new beacons are found. For now it isn't.
* Redo the qbusy logic. The old logic had at least 2 chipset/driver
races related to the link field. The new logic makes no assumptions
and only reactivates the txdma if the queue is clearly idle and
we are adding the first (bf) to it. Otherwise leave it to the INT_TX
code to detect where the txdma stopped and restart it at the
appropriate place.
This bit of code needs more work as the INT_TX for tx completion may
be delayed indefinitely (we might need a callout check in there too,
I'm not sure).
* For the moment use MB_WAIT when loading or replentishing the receive ring.
There does not appear to be a proper mechanism to deal with stalls that
might be created if a mbuf fails to allocate.
What we really need here is proper rx ring mbuf replacement logic where
the filled mbuf is NOT removed if no new mbuf can be allocated to take
its place. Using MB_WAIT is a bad hack. It isn't entirely trivial
due to the DMA load and the 32 bit address space restriction.
* Add a few cpu_sfence()s when poking the (bf) link field. This probably
isn't correct.
* Cleanup, add some debugging kprintf()s for a few unexpected conditions
Matthew Dillon [Wed, 8 Sep 2010 07:18:04 +0000 (00:18 -0700)]
wlan - Bug fixes for recent work
* handoff (if in "ap" mode) serializer adjustments.
* interface deletion serializer adjustments.
Matthew Dillon [Wed, 8 Sep 2010 04:40:48 +0000 (21:40 -0700)]
wlan - Disable bgscan by default
* bgscan mode (station scanning while associated) blows up the
Atheros driver (tested w/ AR9280 chipset). Turn it off by default.
Matthew Dillon [Tue, 7 Sep 2010 20:28:36 +0000 (13:28 -0700)]
wlan - cleanup
* Remove some debugging.
Matthew Dillon [Tue, 7 Sep 2010 20:26:53 +0000 (13:26 -0700)]
build - Temporary adjustments for further wlan conversion work
* Remove iwn, ral, wi, and wpi temporarily until they can be converted
like ath was.
Matthew Dillon [Tue, 7 Sep 2010 20:25:40 +0000 (13:25 -0700)]
wlan - Convert low level if_ath driver.
* Ripout old lock API.
* Use the new wlan_serialize_enter/exit and &wlan_global_serializer.
Matthew Dillon [Tue, 7 Sep 2010 20:18:31 +0000 (13:18 -0700)]
wlan - Rip out all wlan locks part 2/2 - cleanup
* Clean up a few snafus and adjust the names for some procedures.
* Flesh out README.DRAGONFLY
Matthew Dillon [Tue, 7 Sep 2010 17:01:17 +0000 (10:01 -0700)]
wlan - Rip out all wlan locks part 2/2
* Add wlan_global_serializer and wlan_*() API calls.
* Use the calls at all border crossings.
* NOTE: callout_stop() may still have deadlock issues if it catches a
callout in-progress.
Matthew Dillon [Tue, 7 Sep 2010 16:00:23 +0000 (09:00 -0700)]
wlan - Rip out all wlan locks part 1/2
* Rip out all the individiual wlan locks
Matthew Dillon [Tue, 7 Sep 2010 15:58:38 +0000 (08:58 -0700)]
kernel - Add LWKT_SERIALIZE_INITIALIZER
* Add an initializer for serializer static/global declarations.
Joe Talbott [Tue, 7 Sep 2010 04:17:00 +0000 (00:17 -0400)]
msdosfs - Fix panic when mounting msdos filesystems.
bread()ing different sizes from the same address requires this
flag before b[q]relse() is called.
Discussed-With: dillon
Joe Talbott [Mon, 6 Sep 2010 21:00:58 +0000 (17:00 -0400)]
ral - Cleanup leftovers from tokenization.
Reported-By: swildner
Samuel J. Greear [Tue, 7 Sep 2010 03:09:25 +0000 (03:09 +0000)]
userland - sysctl - Fix stack overflow
* alloca(3) was being used to allocate space for a call to sysctl(3) that
returned data. This could occasionally be on the order of 50-100MB
(net.inet.tcp.pcblist) resulting in a segfault.
Samuel J. Greear [Tue, 7 Sep 2010 02:10:14 +0000 (02:10 +0000)]
kernel - Expose mpsafe/collision internals of kq token via sysctl
Matthew Dillon [Tue, 7 Sep 2010 01:58:54 +0000 (18:58 -0700)]
installkernel - Fix kernel.old/kernel overwrite
* The kernel was being copied to kernel.old/kernel twice, once normally,
and once (after the new kernel was installed) by the module objcopy.
This left kernel.old/kernel as the new kernel instead of the old kernel.
* Fix by restricting the module copy to .ko files.
Matthew Dillon [Tue, 7 Sep 2010 01:44:03 +0000 (18:44 -0700)]
kernel - Refactor kqueue interlocks
* Make KN_PROCESSING a soft lock flag. When set nobody else can mess
with a particular knote (other than setting certain flags) even if
the originator blocks.
* Interlock major processing with KN_PROCESSING. Registration, event
scan, knote(), deletion, and filter ops.
* Block & restart when conflicts occur. For the knote() hot-path we only
block and restart if the 'hint' is non-zero, otherwise we just flag with
KN_REPROCESS to indicate that reprocessing is required.
* This should fix kqueue races related to blocking operations confusing
the list scan.
* Document the shit out of everything.
Reported-by: Francois Tigeot <ftigeot@wolfpond.org>
Matthew Dillon [Mon, 6 Sep 2010 20:48:21 +0000 (13:48 -0700)]
kernel - Fix panic when X11 intercepts console (III)
* Oops, ripped a little too much out of kputchar(). Put the TOTTY
logic back in for the tprintf()/uprintf()/ttyprintf() cases.
* The console logic remains unchanged for kprintf() (it no longer
attempts to tputchar() to a console tty intercept, instead we have
a thread handle it from the dmesg buffer).
Matthew Dillon [Mon, 6 Sep 2010 20:36:05 +0000 (13:36 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Mon, 6 Sep 2010 20:34:01 +0000 (13:34 -0700)]
kernel - Fix numerous MP issues with sockbuf's and ssb_flags part 1/2
* Use atomic ops for ssb_flags handling
* Use atomic_cmpset_int() to interlock SSB_LOCK with SSB_WANT, and
SSB_WAIT with SSB_WAKEUP.
Note in particular that WAIT/WAKEUP assumes the client side of the
socket is single threaded via an appropriate lock. This needs more
work.
Joe Talbott [Sun, 5 Sep 2010 02:39:53 +0000 (22:39 -0400)]
ral - Convert to use wlan_token.
Tested-by: Johannes Hofmann <Johannes.Hofmann@gmx.de>
Matthew Dillon [Mon, 6 Sep 2010 18:05:19 +0000 (11:05 -0700)]
kernel - Add required kq_token around timer event
* filt_timerexpire() is called from a callout and needs the kq_token.
Matthew Dillon [Mon, 6 Sep 2010 18:04:35 +0000 (11:04 -0700)]
userland - Port TCP-MD5 (RFC 2385) implementation.
Userland portion of he TCP_SIGNATURE port.
Submitted-by: David =?iso-8859-1?Q?B=C9RARD?= <david@nfrance.com>
Ported-from: FreeBSD
Matthew Dillon [Mon, 6 Sep 2010 18:01:49 +0000 (11:01 -0700)]
kernel - Port TCP-MD5 (RFC 2385) implementation.
I have imported FreeBSD commits r125680, r125681 and r183001 into the
DragonFlyBSD code, it works well for both IPv4 and IPv6 BGP sessions.
This adds TCP_SIGNATURE to IPSEC.
For the uninitiated, this is a TCP option which provides for a means of
authenticating TCP sessions which came into being before IPSEC. It is
still relevant today, however, as it is used by many commercial router
vendors, particularly with BGP, and as such has become a requirement for
interconnect at many major Internet points of presence.
Tested with a Cisco 2611XM running IOS 12.3(24), and Quagga 0.99.17
Submitted-by: David =?iso-8859-1?Q?B=C9RARD?= <david@nfrance.com>
Ported-from: FreeBSD
Sascha Wildner [Mon, 6 Sep 2010 12:38:20 +0000 (14:38 +0200)]
arcmsr.4: Add some more cards which are supported by this driver.
Pointed-out-by: Ching <ching2048@areca.com.tw>
Sascha Wildner [Mon, 6 Sep 2010 12:32:43 +0000 (14:32 +0200)]
Add arcmsr(4) to our GENERIC configs and adjust comments a bit.
Sascha Wildner [Sun, 5 Sep 2010 21:49:38 +0000 (23:49 +0200)]
loader(8): Make the init_path setting work again.
Sascha Wildner [Sun, 5 Sep 2010 21:45:09 +0000 (23:45 +0200)]
loader.8: Some more cleanup.
Sascha Wildner [Sun, 5 Sep 2010 21:44:47 +0000 (23:44 +0200)]
Remove /usr/share/examples/bootforth.
Sascha Wildner [Sun, 5 Sep 2010 20:53:38 +0000 (22:53 +0200)]
Remove FICL code from sys/boot and clean up some more.
Sascha Wildner [Sun, 5 Sep 2010 20:23:59 +0000 (22:23 +0200)]
Remove loader.4th.8 and references to it.
Sascha Wildner [Sun, 5 Sep 2010 20:14:17 +0000 (22:14 +0200)]
Hook loader.conf.5 into the build again.
Sascha Wildner [Sun, 5 Sep 2010 20:01:43 +0000 (22:01 +0200)]
loader(8): Add back some loader.conf vars which the old code handled.
These are variables which all correspond to boot(8) options:
Variable Equivalent to
======================================
boot_askname boot -a
boot_cdrom boot -C
boot_ddb boot -d
boot_gdb boot -g
boot_serial boot -h
boot_single boot -s
boot_userconfig boot -c
boot_verbose boot -v
boot_vidcons boot -V
Sascha Wildner [Sun, 5 Sep 2010 19:45:45 +0000 (21:45 +0200)]
loader(8): Put the kenv variables into an array for easier checking.
Also remove the code that unsetenv()'s a variable if its value is empty.
We cannot do this since some variables (boot_ddb, boot_gdb etc.) need no
value.
Matthew Dillon [Sun, 5 Sep 2010 18:14:49 +0000 (11:14 -0700)]
kernel - Fix panic when X11 intercepts console (II)
* There is a secondary issue when the console is runs through a pty or
other device and kqueue is used, the tty_token is not enough.
* Rewrite kputchar() and shift all constty intercepts over to their own
kernel thread. kputchar() will write to the dmesg buffer and will call
cnputc() to write to the real console, and (for tprintf()) it will
output a specified tty. But it will no longer attempt to write to
the console tty via the kprintf() path.
Instead kputchar() simply wakes up the monitoring kernel thread and
the monitoring kernel thread tracks and copies the dmesg buffer to
the constty.
* This completely fixes the constty intercept issue. 'xconsole' now works
perfectly. Nothing can go wrong. Go wrong. Go wrong.
Matthew Dillon [Sun, 5 Sep 2010 16:57:56 +0000 (09:57 -0700)]
kernel - Fix panic when X11 intercepts console
* The kprintf() path was trying to acquire the tty_token. When called
from a hard code section without the token already held this can block
and thus will assert.
* When a console intercept is active we now only print to it if we can
acquire the tty_token non-blocking. And too bad otherwise. The
dmesg log will still get the whole of the output.
* Remove a recursive kprintf() in the clist code.
* Document the return value for lwkt_trytoken().
Reported-by: Johannes Hofmann <johannes.hofmann@gmx.de>
Matthew Dillon [Sun, 5 Sep 2010 04:27:08 +0000 (21:27 -0700)]
kernel - More pty fixes
* Allow the pts to be closed and reopened while the ptc is held open
(xterm issues a revoke + open). This fixes xterm.
* Add a flag to differentiate between a slave not yet initially opened
and a slave which has been closed, so ptc reads and the kqfilter
can properly return EOF (tmux).
* Remove pt_flags2 and fold its flags into pt_flags.
* Create a shim to track ttyunhold()'s for session releases and release
the underlying pts (for screen).
Reported-by: josepht (xterm issue)
Matthew Dillon [Sun, 5 Sep 2010 01:40:50 +0000 (18:40 -0700)]
kernel - Fix direct getpages call to devfs cdev
* This will be used by swapoff to bring pages in via VM objects. devfs
was using getpbuf() when it really needed to be using getpbuf_kva().
Found-via: Ilya Dryomov's swapoff port
Matthew Dillon [Sat, 4 Sep 2010 18:30:55 +0000 (11:30 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sat, 4 Sep 2010 18:28:21 +0000 (11:28 -0700)]
kernel - More tty/pty fixes
* Notify the pty master when the slave closes.
* Fix the zombie state stuff. Clear the zombie state on initial open of
either side, prior to running any modem controls.
* This appears to fix screen and tmux.
Reported-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>, Antonio Huete Jimenez <tuxillo@crater.dragonflybsd.org>
Antonio Huete Jimenez [Sat, 4 Sep 2010 16:17:38 +0000 (18:17 +0200)]
include - Install smbus headers in the system.
This will fix gkrellm build as it was trying to
include smb.h, which wasn't in /usr/include/machine
anymore.
In-collaboration-with: <swildner@>
Antonio Huete Jimenez [Thu, 2 Sep 2010 05:19:01 +0000 (07:19 +0200)]
truss - Take care of a couple segfaults.
Reported-by: Johannes Hofmann <Johannes.Hofmann@gmx.de>
DragonFly-bug: <http://bugs.dragonflybsd.org/issue1610>
Matthew Dillon [Wed, 1 Sep 2010 18:23:53 +0000 (11:23 -0700)]
dloader - Fix *_load variable override issue
* Setting a local variable that is already set wasn't working
due to a programming snafu, so *_load overrides in /boot/loader.conf
were not working properly. Fixed!
Matthew Dillon [Wed, 1 Sep 2010 17:56:16 +0000 (10:56 -0700)]
kernel - Fix multiple tty_token issues related to vt switching and X
* Numerous places where gettoken/reltoken was not matched up
* Of particular note the multi-line macros in fbreg.h did not have
any do/while() protection and were being used in if() macro()
situations which caused massive issues.
Reported-by: Everyone
Matthew Dillon [Wed, 1 Sep 2010 16:07:51 +0000 (09:07 -0700)]
build - Fix kernel / modules install from object dir or module source dir
* Only installkernel from /usr/src was installing the modules in the
right place.
* Add a default KERNEL?= in kmod.mk to try to correct the problem.
Reported-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
Matthew Dillon [Wed, 1 Sep 2010 15:42:00 +0000 (08:42 -0700)]
vkernel - Fix early boot seg-fault
* kprintf() needs 'mycpu' to work now, the vkernel was trying to use it
too early.
Reported-by: Ilya Dryomov
Sascha Wildner [Wed, 1 Sep 2010 10:43:31 +0000 (12:43 +0200)]
Remove formatted spinlock manpages via 'make upgrade', too.
Matthew Dillon [Wed, 1 Sep 2010 07:41:14 +0000 (00:41 -0700)]
boot system and buildkernel - Additional work
* Make boot <directory> work. Note however that dloader does not preload
the kernel+modules so basically all you get here is the kernel and acpi
with the current menu system setup.
The dloader way (for the moment) is:
cd kernel
loadall
boot
* Fix console=<blah>. dloader was not mirroring the variable to the
environment. Also do the same for currdev, loaddev, and bootfile.
(kernelname and module_path were already mirrored).
* Fix non-numeric menus. 'a' (kernel.alt), 'b' (kernel.bak),
and 'R' (reboot).
* Space now halts the countdown.
* Add the boot-without ACPI option back into dloader.menu.
* Move the handling of the kernelname kenv variable out of machine
specific code and into kern/init_main.c
Matthew Dillon [Wed, 1 Sep 2010 06:36:14 +0000 (23:36 -0700)]
kernel - Fix token mismatch in tty code.
* Fix issue when a tty is stopped/started with ^S/^Q related to
recent tokenization work.
Matthew Dillon [Wed, 1 Sep 2010 05:25:33 +0000 (22:25 -0700)]
build - Adjust kern.post.mk warning
* installkernel was blowing away the modules before warning that the
boot was out of date. Warn before blowing away anything (and
abort the installkernel).
Matthew Dillon [Wed, 1 Sep 2010 04:45:12 +0000 (21:45 -0700)]
build - cleanup
* These files were renamed, remove the originals.
Matthew Dillon [Wed, 1 Sep 2010 04:38:56 +0000 (21:38 -0700)]
boot system and buildkernel - Remove the thrice damned forth interpreter
* Remove the forth interpreter from the build. The last straw was when
I tried to fix the module path and 6 hours later still couldn't get
it right.
* Write a C based menu system and loader, replacing what the forth code
used to do. This is about 85% complete (tftp and boot chaining issues
are not handled). This took exactly one day to do, by the way.
* Reformulate installkernel to now create a directory /boot/kernel.blah
and place the kernel and modules inside that directory.
Alex Hornung [Tue, 31 Aug 2010 09:45:59 +0000 (10:45 +0100)]
syscons - more token-related fixes
* Make init_scp explicitly acquiring a token for what it needs.
* Also acquire token for vidsw operation in scinit.
Reported-by: Rumko
Dragonfly-bug: http://bugs.dragonflybsd.org/issue1814
Sascha Wildner [Tue, 31 Aug 2010 08:18:07 +0000 (10:18 +0200)]
iwi(4): Oops. These changes weren't meant to be committed (yet).
Sascha Wildner [Tue, 31 Aug 2010 08:10:24 +0000 (10:10 +0200)]
wpi(4): sc is no longer used for locking (fixes LINT).
YONETANI Tomokazu [Tue, 31 Aug 2010 07:48:23 +0000 (16:48 +0900)]
syscons - sc_set_pixel_mode() returned without releasing tty_token
fixes panic on `vidcontrol MODE_nnn'
Matthew Dillon [Tue, 31 Aug 2010 06:35:26 +0000 (23:35 -0700)]
kernel - Fixup vkernel64 for build
* Add missing declaration.
Matthew Dillon [Tue, 31 Aug 2010 06:24:42 +0000 (23:24 -0700)]
kernel - Fixup for UP build
* Conditionalize td_mpcount accesses for SMP only
Matthew Dillon [Tue, 31 Aug 2010 05:31:49 +0000 (22:31 -0700)]
kernel - Add a workaround for tty_token during low-level boot
* The low level cninit() code dives into dev/video and does a ton
of tty_token acquisitions and releases, and even after the bug
fixes there is still something weird going on in there.
This is a workaround to wrap a master tty_token around the
cninit() code which prevents an early-boot crash if
lwkt_gettoken()'s td_mpcount optimization is turned off.
(the optimization masks the problem).
* Also assert that the mpcount remains correct after the mess
is done initializing, if it is wrong the SMP/AP boot will
blow up on us.
Matthew Dillon [Tue, 31 Aug 2010 05:24:15 +0000 (22:24 -0700)]
kernel - Fix td_xpcount when pushing a preemption
* We have to set xpcount to the sum of the victim thread's mpcount
and xpcount, rather than just its mpcount.
Reported-by: Rumko
Matthew Dillon [Tue, 31 Aug 2010 04:28:09 +0000 (21:28 -0700)]
kernel - Fix missing release of tty_token
* Fix one missing release and one misordered release. These were
causing the low level SMP AP boot to enter with 2 mplock counts
instead of 1.
Matthew Dillon [Tue, 31 Aug 2010 03:56:18 +0000 (20:56 -0700)]
kernel - Fix two mismatched locks in CAM
* cam_periph_alloc() failed to release a lock in one case and had an extra
unlock in another.
* passregister() had an extra unlock
Reported-by: Rumko
Joe Talbott [Tue, 31 Aug 2010 01:28:05 +0000 (21:28 -0400)]
iwi - Convert to wlan_tokens.
Submitted-By: Johannes Hofmann (jh33)
Bug-Id: 1810
Joe Talbott [Mon, 30 Aug 2010 20:29:38 +0000 (16:29 -0400)]
ral - Fix calls to bus_dmamap_load_mbuf_segment() to use BUS_DMA_NOWAIT.
Reported-by: Max Herrgard <herrgard@gmail.com>
Tested-by: Max Herrgard <herrgard@gmail.com>
Joe Talbott [Mon, 30 Aug 2010 20:20:44 +0000 (16:20 -0400)]
ral - Make sure nodes are properly uninitialized and reinitialized.
Adds rt2661_newassoc() which cleans up the ieee80211_node.
Reported-by: Max Herrgard <herrgard@gmail.com>
Tested-by: Max Herrgard <herrgard@gmail.com>
Joe Talbott [Sun, 29 Aug 2010 22:53:34 +0000 (18:53 -0400)]
wpi - Convert to use wlan_token.
Matthew Dillon [Mon, 30 Aug 2010 19:29:06 +0000 (12:29 -0700)]
kernel - Separate inherited mplocks from td_mplocks and fix a gettoken bug
* Separate out td_mpcount into td_xpcount and td_mpcount. td_xpcount
is an inherited mpcount. A preempting thread inherits the mpcount
on the thread being preempted until it switches out to guarantee
that the mplock remains atomic through the preemption (as expected
by the poor thread that got preempted).
* Fix a serious but hard to reproduce bug in lwkt_gettoken(). This
function marks the token reference as being MPSAFE if td_mpcount
is non-zero even when the token is not a MPSAFE token.
However, until this patch td_mpcount also included inherited mpcounts
when one thread preempts another and the inherited mpcounts could
go away if the thread blocks or switches, leaving the token unprotected.
* Fix a less serious bug where a new token reference was being populated
prior to td_toks_stop being incremented, and where an existing token
reference was being depopulated after td_toks_stop is decremented.
Nothing can race us but switch around the index increment/decrement
to protect the slot being operated upon.
* Add a ton of assertions in the interrupt, trap, and syscall paths
To assert that the mplock, number of tokens, and critcount remain
unchanged across driver and other calls.
Matthew Dillon [Mon, 30 Aug 2010 19:27:11 +0000 (12:27 -0700)]
kernel - Correct missing unlock in SCSI pass device
* Correct a missing sim unlock, which matters more now that
the sim lock might not be the mp lock.
Matthew Dillon [Mon, 30 Aug 2010 17:51:53 +0000 (10:51 -0700)]
buildkernel - Order kernel before modules
* Order the kernel before modules so a parallel build builds the kernel
before diving into the modules. This makes incremental building more
convenient.
Venkatesh Srinivas [Mon, 30 Aug 2010 14:16:13 +0000 (07:16 -0700)]
kernel - Enabled bzeront() (MOVNTI) only on SSE2-capable CPUs.
Alex Hornung [Mon, 30 Aug 2010 12:20:49 +0000 (13:20 +0100)]
spinlocks - adjust man pages and *_quick_* routines
* Adjust man pages to reflect the recent changes (removal of shared
spinlocks, renaming of exclusive spinlocks).
* Remove old man page symlinks and adjust new ones.
* Rename the spin_{un,}lock_wr_quick ro spin_{un,}lock_quick.
Alex Hornung [Mon, 30 Aug 2010 11:56:41 +0000 (12:56 +0100)]
cam_xpt - Fix recently introduced typo
* Fix a typo introduced by the previous spinlock commit.
Reported-by: Jonas Trollvik
Alex Hornung [Mon, 30 Aug 2010 10:10:17 +0000 (11:10 +0100)]
spinlocks - Rename API to spin_{try,un,}lock
* Rename the API to spin_trylock, spin_unlock and spin_lock instead of
spin_lock_wr, spin_unlock_wr and spin_trylock_wr now that we only have
exclusive spinlocks.
* 99% of this patch was generated by a semantic coccinelle patch
Alex Hornung [Mon, 30 Aug 2010 08:14:00 +0000 (09:14 +0100)]
syscons MPSAFE - another attempt
* Do another pass on syscons and reduce the number of token
uses significantly.
* syscons now works with a limited number of tokens, acquired almost
only around linesw and vidsw routines, but out of the way of tty_cons.
Alex Hornung [Mon, 30 Aug 2010 06:47:34 +0000 (07:47 +0100)]
coretemp, sensors - Adjust spinlocks
* In kern_sensors, adjust the spinlocks to not be held across the sysctl
interface management.
* In coretemp, adjust illegal spinlock across calls to kern_sensors.
Reported-by: Matt Dillon (dillon@)
Samuel J. Greear [Mon, 30 Aug 2010 08:10:24 +0000 (08:10 +0000)]
kernel - poll(2) no longer supports non-standard FreeBSD extensions
Matthew Dillon [Mon, 30 Aug 2010 07:07:17 +0000 (00:07 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Samuel J. Greear [Mon, 30 Aug 2010 07:05:44 +0000 (07:05 +0000)]
devfs - Do not try printing the name of a null vnode
Matthew Dillon [Mon, 30 Aug 2010 06:25:42 +0000 (23:25 -0700)]
kernel - remove spin_lock_rd() and spin_unlock_rd()
* Remove shared spinlocks entirely. We only have exclusive spinlocks
now.
* Strip out the exclusive/shared contention handling code.
* Slightly rework the initial exponential backoff and test. Do the
atomic swap after the exponential backoff instead of before so
we do not add a superfluous backoff after actually acquiring
the spinlock.
Matthew Dillon [Mon, 30 Aug 2010 06:20:12 +0000 (23:20 -0700)]
kernel - Switch to exclusive spinlocks in the coretemp sensor
* No impact on performance.
* TODO: spinlocks are being held across major kernel calls in the
detach code which is not legal.
Matthew Dillon [Mon, 30 Aug 2010 06:13:59 +0000 (23:13 -0700)]
kernel - Switch to exclusive spinlocks in kern_descrip.c
* This isn't expected to have much of an effect on performance and I want
to get rid of shared spinlocks. If it becomes an issue for descriptor
lookups we could actually move to a spinless lookup/hold model using
defered frees.
Matthew Dillon [Mon, 30 Aug 2010 05:48:02 +0000 (22:48 -0700)]
kernel - Refactor uidinfo a little
* Fix a MP drop race with uidinfo and get rid of the shared spinlock.
Also fix areas where the spinlock was improperly enclosing complex
code.
Matthew Dillon [Mon, 30 Aug 2010 05:22:05 +0000 (22:22 -0700)]
kernel - Refactor plimit a little
* Use only exclusive spinlocks, I will be removing shared spinlocks.
* Refactor the cpu test such that the hot path does not acquire
any spinlocks.
Matthew Dillon [Mon, 30 Aug 2010 05:13:07 +0000 (22:13 -0700)]
kernel - Fix spinlock use in syscons
* Spinlocks cannot be held across complex calls, particularly calls
that might block or switch.
This fixes a spinlock panic during lwkt.tty_mpsafe testing.
Matthew Dillon [Mon, 30 Aug 2010 04:45:24 +0000 (21:45 -0700)]
kernel - remove syscall_mpsafe and trap_mpsafe sysctls
* traps and system calls are always mpsafe, we don't need
these sysctls any more.
Matthew Dillon [Mon, 30 Aug 2010 03:05:44 +0000 (20:05 -0700)]
kernel - kobj code cleanup
* Cleanup remains of KOBJ_STATS
Matthew Dillon [Mon, 30 Aug 2010 02:59:48 +0000 (19:59 -0700)]
kernel - Minor documentation
Matthew Dillon [Mon, 30 Aug 2010 02:58:29 +0000 (19:58 -0700)]
kernel - Possibly fix a bug in aic7xxx
* An attempt to compile -O2 revealed three uninitialized fields
falling through to call that pokes them into the chip. Initialize
the fields.
Matthew Dillon [Mon, 30 Aug 2010 02:32:45 +0000 (19:32 -0700)]
kernel - Compact KOBJOPLOOKUP() kobj method core macro
* Replace the longish KOBJOPLOOKUP() macro with a procedure call
to kobj_lookup_method(). Do all the heavy lifting in the procedure.
Reduces the nominal kernel size by 67K.
Sascha Wildner [Mon, 30 Aug 2010 00:38:15 +0000 (02:38 +0200)]
aicasm: Mark stop() __dead2.
Matthew Dillon [Sun, 29 Aug 2010 22:10:21 +0000 (15:10 -0700)]
kernel - Fix usb keyboard problems with ehci & ddb
* Be sure to save the status of the xfer before reissuing the xfer
in an interrupt pipe callback.
This fixes an issue where ukbd thought the keyboard events from
ehci were illegal because the status of the transfer was always
IN_PROGRESS instead of COMPLETE.
Interrupt pipes reissue their xfers prior to making the callback
in order to ensure that the xfer is not somewhere in no-man's land
if the callback enters the debugger (i.e. ctl-alt-esc).
Matthew Dillon [Sun, 29 Aug 2010 22:09:22 +0000 (15:09 -0700)]
MPSAFE TTY - Cleanup ukbd and atkbd, fix unregistration bug
* Cleanup code, fix unregistration module. Fixes panic on usb keyboard
unplug.
Matthew Dillon [Sun, 29 Aug 2010 20:48:31 +0000 (13:48 -0700)]
kernel - Fix UP build
* Declare panic_cpu_gd whether UP or SMP.
* Properly reinit the spinlock whether UP or SMP
Reported-by: swildner
Matthew Dillon [Sun, 29 Aug 2010 20:45:58 +0000 (13:45 -0700)]
MPSAFE TTY - Refactor the keyboard switch code to make all drivers MPSAFE
* Add a per-kbd lock.
* Replace the keyboard kbd_*() macros with function wrappers which acquire
and release the per-kbd lock on behalf of each keyboard driver. The
wrapper code also understands polled mode and will not acquire/release
locks in polled mode (aka debugger).
* Remove all tokens and locks from the keyboard drivers.
* Do some documenting of non-blocking paths.
Sascha Wildner [Sun, 29 Aug 2010 19:24:09 +0000 (21:24 +0200)]
iscsi_initiator(4): Fix another potential NULL pointer dereference.
so (which is sp->soc) can be NULL here, so add a check before dereferencing
it.
Sascha Wildner [Sun, 29 Aug 2010 19:13:27 +0000 (21:13 +0200)]
iscsi_initiator(4): Fix a potential NULL pointer dereference.
If sp can be NULL (as the rest of the code suggests), we can't use sdebug()
since that prints the string with sp->sid prepended (thereby dereferencing
NULL).
Instead, use debug() and add sp->sid to its string (with a check for NULL).
While here, fix some indentation issues.