Commit Graph

165297 Commits

Author SHA1 Message Date
Konstantin Belousov
24f3dcfe50 Assert that exiting process does not return to usermode.
Reviewed by:	avg, jhb
MFC after:	1 week
2011-10-03 16:58:58 +00:00
Adrian Chadd
79c27adfd5 Fix an unaligned access issue; tidy up OFDM/DS rate decoding from the PLCP.
This fixes a panic on PPC.

Submitted by:	novel
Obtained from:	OpenBSD, sys/dev/ic/bwi.c r1.89
2011-10-03 16:30:18 +00:00
Edward Tomasz Napierala
72a401d918 Fix another bug introduced in r225641, which caused rctl to access certain
fields in 'struct proc' before they got initialized in do_fork().

MFC after:	3 days
2011-10-03 16:23:20 +00:00
Edward Tomasz Napierala
ac6fafe6c2 Fix bug introduced in r225641, which would cause panic if racct_proc_fork()
returned error -- the racct_destroy_locked() would get called twice.

MFC after:	3 days
2011-10-03 15:32:15 +00:00
Nathan Whitehorn
e59e2d8ec7 Farewall, sysinstall! You served us well for many years, but 10.0 is one
digit beyond your time.

Various sysinstall dependencies (e.g. libftpio, libdisk, libodialog, etc.)
will be cleaned up in coming days. Some will take longer than others due to
a few other consumers (tzsetup and sade).
2011-10-03 15:13:09 +00:00
Attilio Rao
8d79dfca55 Add some improvements in the idle table callbacks:
- Replace instances of manual assembly instruction "hlt" call
  with halt() function calling.
- In cpu_idle_mwait() avoid races in check to sched_runnable() using
  the same pattern used in cpu_idle_hlt() with the 'hlt' instruction.
- Add comments explaining the logic behind the pattern used in
  cpu_idle_hlt() and other idle callbacks.

In collabouration with:	jhb, mav
Reviewed by:	adri, kib
MFC after:	3 weeks
2011-10-03 14:23:00 +00:00
Adrian Chadd
f6f6e2c803 Port over the radar pulse decoding code common to the AR5416 and later chipsets.
Obtained from:	Atheros
2011-10-03 12:12:03 +00:00
Marius Strobl
2ab9ab1ffe Actually enable NEW_PCIB by default, missed in r225931. 2011-10-02 23:31:14 +00:00
Marius Strobl
bda8e754a1 Make sparc64 compatible with NEW_PCIB and enable it:
- Implement bus_adjust_resource() methods as far as necessary and in non-PCI
  bridge drivers as far as feasible without rototilling them.
- As NEW_PCIB does a layering violation by activating resources at layers
  above pci(4) without previously bubbling up their allocation there, move
  the assignment of bus tags and handles from the bus_alloc_resource() to
  the bus_activate_resource() methods like at least the other NEW_PCIB
  enabled architectures do. This is somewhat unfortunate as previously
  sparc64 (ab)used resource activation to indicate whether SYS_RES_MEMORY
  resources should be mapped into KVA, which is only necessary if their
  going to be accessed via the pointer returned from rman_get_virtual() but
  not for bus_space(9) as the later always uses physical access on sparc64.
  Besides wasting KVA if we always map in SYS_RES_MEMORY resources, a driver
  also may deliberately not map them in if the firmware already has done so,
  possibly in a special way. So in order to still allow a driver to decide
  whether a SYS_RES_MEMORY resource should be mapped into KVA we let it
  indicate that by calling bus_space_map(9) with BUS_SPACE_MAP_LINEAR as
  actually documented in the bus_space(9) page. This is implemented by
  allocating a separate bus tag per SYS_RES_MEMORY resource and passing the
  resource via the previously unused bus tag cookie so we later on can call
  rman_set_virtual() in sparc64_bus_mem_map(). As a side effect this now
  also allows to actually indicate that a SYS_RES_MEMORY resource should be
  mapped in as cacheable and/or read-only via BUS_SPACE_MAP_CACHEABLE and
  BUS_SPACE_MAP_READONLY respectively.
- Do some minor cleanup like taking advantage of rman_init_from_resource(),
  factor out the common part of bus tag allocation into a newly added
  sparc64_alloc_bus_tag(), hook up some missing newbus methods and replace
  some homegrown versions with the generic counterparts etc.
- While at it, let apb_attach() (which can't use the generic NEW_PCIB code
  as APB bridges just don't have the base and limit registers implemented)
  regarding the config space registers cached in pcib_softc and the SYSCTL
  reporting nodes set up.
2011-10-02 23:22:38 +00:00
Glen Barber
6ec3cd078c Correct a typo that was introduced in 225912
Submitted by:		Valentin Nechayev (netch % netch!kiev!ua), arundel
MFC after:		1 week
With-MFC:		225908
2011-10-02 16:05:19 +00:00
Adrian Chadd
f20aaceeb4 Remove an unused variable. 2011-10-02 14:10:25 +00:00
Adrian Chadd
62f62f4f4a Various interrupt handling and RX interrupt mitigation fixes.
* The AR_ISR_RAC interrupt processing method has a subtle bug in all
  the MAC revisions (including pre-11n NICs) until AR9300v2.
  If you're unlucky, the clear phase clears an update to one of the
  secondary registers, which includes TX status.

  This shows up as a "watchdog timeout" if you're doing very low levels
  of TX traffic. If you're doing a lot of non-11n TX traffic, you'll
  end up receiving a TX interrupt from some later traffic anyway.

  But when TX'ing 11n aggregation session traffic (which -HEAD isn't yet
  doing), you may find that you're only able to TX one frame (due to
  BAW restrictions) and this may end up hitting this race condition.

  The only solution is to not use RAC and instead use AR_ISR and the
  AR_ISR_Sx registers. The bit in AR_ISR which represents the secondary
  registers are not cleared; only the AR_ISR_Sx bits are. This way
  any updates which occur between the read and subsequent write will
  stay asserted and (correctly) trigger a subsequent interrupt.

  I've tested this on the AR5416, AR9160, AR9280. I will soon test
  the AR9285 and AR9287.

* The AR_ISR TX and RX bits (and all others!) are set regardless of
  whether the contents of the AR_IMR register. So if RX mitigation is
  enabled, RXOK is going to be set in AR_ISR and it would normally set
  HAL_INT_RX.

  Fix the code to not set HAL_INT_RX when RXOK is set and RX mitigation
  is compiled in. That way the RX path isn't prematurely called.

  I would see:

  * An interrupt would come in (eg a beacon, or TX completion) where
    RXOK was set but RXINTM/RXMINT wasn't;
  * ath_rx_proc() be called - completing RX frames;
  * RXINTM/RXMINT would then fire;
  * ath_rx_proc() would then be called again but find no frames in the
    queue.

  This fixes the RX mitigation behaviour to not overly call ath_rx_proc().

* Start to flesh out more correct timer interrupt handling - it isn't
  kite/merlin specific. It's actually based on whether autosleep support
  is enabled or not.

This is sourced from my 11n TX branch and has been tested for a few weeks.

Finally, the interrupt handling change should likely be implemented
for AR5210, AR5211 and AR5212.
2011-10-02 14:08:56 +00:00
Adrian Chadd
7e132ca3e3 Document exactly what the RX interrupt mitigation timers do. 2011-10-02 13:51:26 +00:00
Adrian Chadd
75350906bc For now (ie: until autosleep support is fully fleshed out), always clear
all of the RX status fields when initialising a new RX descriptor.
2011-10-02 13:47:03 +00:00
Adrian Chadd
9bf15204ae Disable TX interrupt mitigation just for the time being.
There are some timing concerns which I've yet to fully map out.
In any case, there's an existing software driven mitigation method
for TX interrupts and when TX'ing 11n frames, the whole frame itself
generates an interrupt rather then the subframes.
2011-10-02 13:43:06 +00:00
Adrian Chadd
23401900d3 Fix a panic in the wifi stack when a software beacon miss occurs in the wrong state.
The ieee80211_swbmiss() callout is not called with the ic lock held, so it's
quite possible the scheduler will run the callout during a state change.

This patch:

* changes the swbmiss callout to be locked by the ic lock
* enforces the ic lock being held across the beacon vap functions
  by grabbing it inside beacon_miss() and beacon_swmiss().

This ensures that the ic lock is held (and thus the VAP state
stays constant) during beacon miss and software miss processing.
Since the callout is removed whilst the ic lock is held, it also
ensures that the ic lock can't be called during a state change
or exhibit any race conditions seen above.

Both Edgar and Joel report that this patch fixes the crash and
doesn't introduce new issues.

Reported by:	Edgar Martinez <emartinez@kbcnetworks.com>
Reported by:	Joel Dahl <joel@vnode.se>
Reported by:	emaste
2011-10-02 02:42:31 +00:00
Glen Barber
2d455a01bd Tweaks to ps(1):
- there's no reason the semantics of the -x flag are being explained in
  the -a flag description
- be more precise regarding the relation between the -a flag and the
  security.bsd.see_other_uids sysctl
- describe the format of the -t flag's argument
- 'con' no longer is a possible entry in the 'TT' column
- explain that the 'TT' column refers to pseudo-terminals via mere numbers
- add a hint in the 'tt' keyword description that a keyword 'tty' exists,
  which will give the full terminal pathname

Submitted by:		arundel (via docs@) (original)
MFC after:		1 week
With-MFC:		225908
2011-10-01 23:47:37 +00:00
Glen Barber
6401543842 Reorder default ps(1) output according to reality.
Submitted by:	arundel (via docs@)
MFC after:	1 week
2011-10-01 20:56:58 +00:00
Hajimu UMEMOTO
35954bbaba Shut up warnings with Cyrus SASL 2.1.25.
Spotted by:	ache
Tested by:	ache
2011-10-01 18:20:10 +00:00
Marius Strobl
1866626239 Remove obsolete macros. 2011-10-01 13:33:14 +00:00
Marius Strobl
6319597402 Nuke SUN4U #ifdef's which with the demise of sun4v no longer serve any
purpose.
2011-10-01 13:16:01 +00:00
Marius Strobl
1ef3f048e0 Also allocate space for the PIL counters. Given that no machine actually
uses IV_MAX interrupt vectors this wasn't a problem in practice though.
2011-10-01 13:11:29 +00:00
Ed Schouten
33f3f40866 Reimplement ctermid().
Even though POSIX allows us to return simply /dev/tty as a pathname
identifying the controlling terminal of the running process, it is nicer
if this function were actually useful, by returning the actual pathname
of the controlling terminal.

Implement ctermid() by using the kern.devname sysctl to resolve the
actual name of /dev/tty. Don't use devname(3), since it may return bogus
strings like #C:0x123.
2011-10-01 12:19:48 +00:00
Konstantin Belousov
8e9a54ee46 The sigwait(3) function shall not return EINTR, according to the
POSIX/SUSvN. The sigwait(2) syscall does return EINTR, and libc.so.7
contains the wrapper sigwait(3) which hides EINTR from callers.  The
EINTR return is used by libthr to handle required cancellation point
in the sigwait(3).

To help the binaries linked against pre-libc.so.7, i.e. RELENG_6 and
earlier, to have right ABI for sigwait(3), transform EINTR return from
sigwait(2) into ERESTART.

Discussed with:	davidxu
MFC after:	1 week
2011-10-01 10:18:55 +00:00
Ed Schouten
05806a06c5 Correct column with for device numbers made in previous change.
The device number should be displayed using only five columns -- not eight.
2011-10-01 09:16:07 +00:00
Adrian Chadd
13a2f4943a Disable using wait in cpu_idle() until a better solution to timer and
interrupt handling can be implemented.
2011-10-01 05:56:25 +00:00
Marius Strobl
64020d8477 Re-reading the Schizo errata suggests that it's actually tolerable to
also use the streaming buffer of pre version 5/revision 2.3 hardware as
long as we stay away from context flushes (which iommu(4) so far doesn't
take advantage of). OpenSolaris does the same.
2011-10-01 00:31:30 +00:00
Marius Strobl
0224e43d7c - Add protective parentheses to macros as far as possible.
- Move {r,w,}mb() to the top of this file where they live on most of the
  other architectures.
2011-10-01 00:22:24 +00:00
Marius Strobl
fafda37b15 In total store which we use for running the kernel and all of the userland
atomic operations behave as if the were followed by a memory barrier so
there's no need to include ones in the acquire variants of atomic(9).
Removing these results a small performance improvement, specifically this
is sufficient to compensate the performance loss seen in the worldstone
benchmark seen when using SCHED_ULE instead of SCHED_4BSD.
This change is inspired by Linux even more radically doing the equivalent
thing some time ago.
Thanks go to Peter Jeremy for additional testing.
2011-10-01 00:11:03 +00:00
Marius Strobl
9a91e2aa2e Add a comment about why contrary to what once would think running all of
userland with total store order actually is appropriate.
2011-09-30 20:23:18 +00:00
Marius Strobl
ade68e910d Use the extended integer condition code when comparing 64-bit values. Given
that ATOMIC_INC_LONG currently is unused this happened to not be fatal.
2011-09-30 20:13:51 +00:00
Marius Strobl
6fd7e2b7c6 - Right-justify backslashes as suggested by style(9).
- Rename ATOMIC_INC_ULONG to ATOMIC_INC_LONG in order to be consistent with
  the names of the other macros in this file an adjust accordingly.
2011-09-30 20:06:23 +00:00
Bjoern A. Zeeb
d7ae37140a Fix an obvious bug from r186196 shadowing a variable, not correctly
appending the new mbuf to the chain reference but possibly causing an mbuf
nextpkt loop leading to a memory used after handoff (or having been freed)
and leaking an mbuf here.

Reviewed by:	rwatson, brooks
MFC after:	3 days
2011-09-30 18:20:16 +00:00
Adrian Chadd
0e56140a1b Fix a corner case in the HAL debugging changes, where ah was NULL.
Although I tried to fix this earlier by introducing HALDEBUG_G(), it
turns out there seem to be other cases where the pointer value is still
NULL.

* Fix DO_HALDEBUG() and the HALDEBUG macro to check whether ah is NULL
  before deferencing it
* Remove HALDEBUG_G() as it's no longer needed

This is hopefully a merge candidate for 9.0-RELEASE as enabling
debugging at startup could result in a kernel panic.
2011-09-30 05:17:57 +00:00
Kevin Lo
d11bbab85d Remove pointless semicolons after label 2011-09-30 04:55:23 +00:00
Dimitry Andric
324d7156d7 Revive the LLVM and Clang license files, which were removed in my
too-thorough cleanup of unused files, in r213695.  Also make sure these
get installed under /usr/share/doc.

Submitted by:	rwatson, brooks
Pointy hat to:	dim
MFC after:	3 days
2011-09-29 18:12:40 +00:00
Andrey V. Elsukov
a6a646124b Add Oxford Semiconductor OXPCIe952 (0x1c38) 1 port serial card.
PR:		kern/160895
Submitted by:	Konstantin V. Krotov
MFC after:	1 week
2011-09-29 15:43:02 +00:00
Alexander Motin
2aae05baee Add header missed in r225875.
MFC after:	3 days
2011-09-29 15:12:58 +00:00
Alexander Motin
9081a9b2c3 Handle the race in cpu_idle() when due to the critical section CPU could get
into sleep after receiving interrupt, delaying interrupt thread execution
indefinitely until the next interrupt arrive.

Reviewed by:	nwhitehorn
MFC after:	3 days
2011-09-29 14:19:34 +00:00
Alexander Motin
5f8ad41c0d - Add special support for the MFI_CMD ioctl with MFI_CMD_STP command, used
by present MegaCLI version. It has some special meaning for the first s/g
list entry, while the main s/g list begins from the the second entry, and
those lists should remain separate after loading to the busdma map.
 - Fix bug in 32bit ioctl compatibility shims when s/g list consists of
more then on element.

Sponsored by:	iXsystems, inc.
MFC after:	3 days
2011-09-29 08:37:53 +00:00
Edward Tomasz Napierala
1d1143ec27 Make ps(1) automatically size its column widths. 2011-09-29 06:31:42 +00:00
Warren Block
762f55cd5f Fix a confusing sentence. [1]
Other wording tweaks.

Reviewed by:	imp [1]
Approved by:	gjb
2011-09-29 03:37:42 +00:00
Glen Barber
cc13988649 Whitespace cleanup in build(7).
MFC after:	1 week
Need-MFC:	225858
2011-09-29 02:57:08 +00:00
Glen Barber
170c2788cb Document, and provide an example for, PORTS_MODULES in build(7).
PR:		161017
Submitted by:	gcooper
MFC after:	1 week
2011-09-29 02:52:33 +00:00
Glen Barber
ef87c4dcd5 Fix a few grammar and mdoc nits in script.1
PR:		161088
Submitted by:	Ben Kaduk ( kaduk % mit ! edu )
MFC after:	1 week
Need-MFC:	225809
2011-09-29 02:29:32 +00:00
Konstantin Belousov
17514c1bd9 Style nit.
Submitted by:	jhb
MFC after:	2 weeks
2011-09-29 00:44:34 +00:00
Eitan Adler
963527148e - I am not the oldest committer alive (yet)
Approved by:	bapt (mentor)
2011-09-28 21:42:13 +00:00
Eitan Adler
a2f4ffd69c - fix whitespace issue in calendar
- add a n after \

Submitted by:	brueffer
Approved by:	bapt (mentor)
2011-09-28 20:46:52 +00:00
Dag-Erling Smørgrav
c177b01465 Belatedly regenerate after application of the HPN patch. 2011-09-28 20:42:22 +00:00
Xin LI
89b1da1ba2 Test if the interface is afif in dhcpif() and syncdhcpif(), as
done in ipv6_autoconfif.

Reviewed by:	hrs (freebsd-rc@)
MFC after:	1 week
2011-09-28 19:01:15 +00:00