]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoFix issues with zeroing and fetching the counters, on x86 and ppc64.
Konstantin Belousov [Mon, 1 Jul 2013 02:48:27 +0000 (02:48 +0000)]
Fix issues with zeroing and fetching the counters, on x86 and ppc64.
Issues were noted by Bruce Evans and are present on all architectures.

On i386, a counter fetch should use atomic read of 64bit value,
otherwise carry from the increment on other CPU could be lost for the
given fetch, making error of 2^32.  If 64bit read (cmpxchg8b) is not
available on the machine, it cannot be SMP and it is enough to disable
preemption around read to avoid the split read.

On x86 the counter increment is not atomic on purpose, which makes it
possible for the store of the incremented result to override just
zeroed per-cpu slot.  The effect would be a counter going off by
arbitrary value after zeroing.  Perform the counter zeroing on the
same processor which does the increments, making the operations
mutually exclusive.  On i386, same as for the fetching, if the
cmpxchg8b is not available, machine is not SMP and we disable
preemption for zeroing.

PowerPC64 is treated the same as amd64.

For other architectures, the changes made to allow the compilation to
succeed, without fixing the issues with zeroing or fetching.  It
should be possible to handle them by using the 64bit loads and stores
atomic WRT preemption (assuming the architectures also converted from
using critical sections to proper asm).  If architecture does not
provide the facility, using global (spin) mutex would be non-optimal
but working solution.

Noted by:  bde
Sponsored by: The FreeBSD Foundation

11 years agoAdd INET6.
Rui Paulo [Sun, 30 Jun 2013 23:29:24 +0000 (23:29 +0000)]
Add INET6.

11 years agoEnable kernel-specific code for FreeBSD also on other systems that use
Robert Millan [Sun, 30 Jun 2013 23:14:55 +0000 (23:14 +0000)]
Enable kernel-specific code for FreeBSD also on other systems that use
the kernel of FreeBSD.

Reviewed by: pjd

11 years agoWhen decoding SLEB128, make sure sign extension is performed for
Kai Wang [Sun, 30 Jun 2013 21:06:47 +0000 (21:06 +0000)]
When decoding SLEB128, make sure sign extension is performed for
64-bit integers.

MFC after: 3 days

11 years agolibc: Access _sigintr more efficiently.
Jilles Tjoelker [Sun, 30 Jun 2013 20:51:15 +0000 (20:51 +0000)]
libc: Access _sigintr more efficiently.

The variable _sigintr is not exported via the version script; therefore,
tell the compiler that no indirection (to allow interposition) is needed.

11 years agokillall: add -q flag to suppress error message when no processes are matched
Mateusz Guzik [Sun, 30 Jun 2013 20:27:31 +0000 (20:27 +0000)]
killall: add -q flag to suppress error message when no processes are matched

Man-page text provided by wblock.

PR: bin/30542
Submitted by: Tony Finch <dot@dotat.at> (original version)
MFC after: 1 week

11 years agoReplace some spaces to tab.
Aleksandr Rybalko [Sun, 30 Jun 2013 19:53:52 +0000 (19:53 +0000)]
Replace some spaces to tab.

11 years agoAdd "ether" and "link" to ifconfig_alias{es,N}.
Hiroki Sato [Sun, 30 Jun 2013 19:52:45 +0000 (19:52 +0000)]
Add "ether" and "link" to ifconfig_alias{es,N}.

11 years agoDecrypt magic numbers - define names for fields of Generic Timer's CNTKCTL reg.
Aleksandr Rybalko [Sun, 30 Jun 2013 19:52:41 +0000 (19:52 +0000)]
Decrypt magic numbers - define names for fields of Generic Timer's CNTKCTL reg.

Submitted by: Ruslan Bukin <br@bsdpad.com>

11 years agoIn generic_bs_map(), use kmem_alloc_nofault() instead of kmem_alloc(), as we
Olivier Houchard [Sun, 30 Jun 2013 19:36:17 +0000 (19:36 +0000)]
In generic_bs_map(), use kmem_alloc_nofault() instead of kmem_alloc(), as we
only need virtual addresses.

Submitted by: alc

11 years agoGrammar tweaks for locking.9
Benjamin Kaduk [Sun, 30 Jun 2013 19:33:07 +0000 (19:33 +0000)]
Grammar tweaks for locking.9

Reviewed by: jhb
Approved by: hrs (mentor)

11 years agoacct: create a special plimit object and set it for exiting processes
Mateusz Guzik [Sun, 30 Jun 2013 19:08:06 +0000 (19:08 +0000)]
acct: create a special plimit object and set it for exiting processes
instead of allocating new one each time

All limits are set to RLIM_INFINITY which sould be ok (even though we
care only about RLIMT_FSIZE in this case).

MFC after: 1 week

11 years agoCorrect some grammar.
Jens Schweikhardt [Sun, 30 Jun 2013 17:59:40 +0000 (17:59 +0000)]
Correct some grammar.

11 years agoUse && rather than ; when success of previous job matters.
Simon J. Gerraty [Sun, 30 Jun 2013 15:00:07 +0000 (15:00 +0000)]
Use && rather than ; when success of previous job matters.

11 years agoacct: reduce code duplication by using acct_disable as cleanup for
Mateusz Guzik [Sun, 30 Jun 2013 13:17:37 +0000 (13:17 +0000)]
acct: reduce code duplication by using acct_disable as cleanup for
failed kproc_create

MFC after: 1 week

11 years agotruss: recognize O_DIRECTORY, O_EXEC, O_TTY_INIT and O_CLOEXEC
Mateusz Guzik [Sun, 30 Jun 2013 13:14:46 +0000 (13:14 +0000)]
truss: recognize O_DIRECTORY, O_EXEC, O_TTY_INIT and O_CLOEXEC

MFC after: 3 days

11 years agoMake atomic_fetch_add() and atomic_fetch_sub() work for pointers with GCC 4.2.
Ed Schouten [Sun, 30 Jun 2013 10:38:20 +0000 (10:38 +0000)]
Make atomic_fetch_add() and atomic_fetch_sub() work for pointers with GCC 4.2.

According to the standard, atomic_fetch_*() has to behave identical to
regular arithmetic. This means that for pointer types, we have to apply
the stride when doing addition/subtraction.

The GCC documentation seems to imply this is done for __sync_*() as
well. Unfortunately, both tests and Googling seems to reveal this is not
really the case. Fix this by performing the multiplication with the
stride manually.

11 years agoConvert this piece of code to use C11 atomics.
Ed Schouten [Sun, 30 Jun 2013 08:59:33 +0000 (08:59 +0000)]
Convert this piece of code to use C11 atomics.

As mentioned before, we should at least aim to have one piece of code in
both user space and kernel space that uses C11 atomics, to get some
coverage. This piece of code can be migrated trivially, so it's a good
candidate.

11 years agoMake various fixes to <stdatomic.h>.
Ed Schouten [Sun, 30 Jun 2013 08:54:41 +0000 (08:54 +0000)]
Make various fixes to <stdatomic.h>.

- According to the standard, memory_order is a type. Use a typedef.

- atomic_*_fence() and atomic_flag_*() are described by the standard as
  functions. Use inline functions to implement them.

- Only expose the atomic_*_explicit() functions in kernel space. We
  should not use the short-hand functions, as they will always use
  memory_order_seq_cst.

11 years agoFix gssapi/gssapi_krb5.h after Heimdal 1.5.1 import.
Hiroki Sato [Sun, 30 Jun 2013 07:46:22 +0000 (07:46 +0000)]
Fix gssapi/gssapi_krb5.h after Heimdal 1.5.1 import.

Reviewed by: dfr

11 years agoDo not display a warning message in a jail without AF_INET6 support.
Hiroki Sato [Sun, 30 Jun 2013 07:37:31 +0000 (07:37 +0000)]
Do not display a warning message in a jail without AF_INET6 support.

MFC after: 3 days

11 years agoFix a typo.
Rui Paulo [Sun, 30 Jun 2013 06:05:32 +0000 (06:05 +0000)]
Fix a typo.

11 years agoFix the RSSI calculation.
Rui Paulo [Sun, 30 Jun 2013 06:04:00 +0000 (06:04 +0000)]
Fix the RSSI calculation.

11 years agoFix triggering false watchdog timeout as done in bce(4) when
Pyun YongHyeon [Sun, 30 Jun 2013 05:56:13 +0000 (05:56 +0000)]
Fix triggering false watchdog timeout as done in bce(4) when
controller is in PAUSE state.

11 years agoFix the ni_txrate calculation.
Rui Paulo [Sun, 30 Jun 2013 05:25:24 +0000 (05:25 +0000)]
Fix the ni_txrate calculation.

11 years agoFix triggering false watchdog timeout when controller is in PAUSE
Pyun YongHyeon [Sun, 30 Jun 2013 05:12:18 +0000 (05:12 +0000)]
Fix triggering false watchdog timeout when controller is in PAUSE
state.  Previously it used to check if controller has sent a
PAUSE frame to the remote peer.

Reported by: David Imhoff via Brad Smith <brad@OpenBSD.org>
Submitted by: davidch (initial version)
Reviewed by: davidch, David Imhoff <dimhoff_devel@xs4all.nl>

11 years agoFix a reference count bug in urtwn_ra_init().
Rui Paulo [Sun, 30 Jun 2013 05:10:33 +0000 (05:10 +0000)]
Fix a reference count bug in urtwn_ra_init().

11 years agoAdding myself to the calendar!
Hiren Panchasara [Sun, 30 Jun 2013 01:20:59 +0000 (01:20 +0000)]
Adding myself to the calendar!

Approved by: sbruno (mentor)

11 years agoFixing incorrect id for Intel Centrino Wireless-N 130.
Hiren Panchasara [Sun, 30 Jun 2013 01:05:24 +0000 (01:05 +0000)]
Fixing incorrect id for Intel Centrino Wireless-N 130.

PR:             kern/180094
Submitted by:   Cedric <cg@cgross.info>
Approved by:    sbruno (mentor)
MFC after:      3 weeks

11 years agoext2fs: Use the complete random() range in i_gen.
Pedro F. Giffuni [Sun, 30 Jun 2013 00:42:51 +0000 (00:42 +0000)]
ext2fs: Use the complete random() range in i_gen.

i_gen is unsigned in ext2fs so we can handle the complete
32 bits.

MFC after: 1 week

11 years agoArndale Board (by Insignal) kernel config file.
Aleksandr Rybalko [Sat, 29 Jun 2013 23:58:16 +0000 (23:58 +0000)]
Arndale Board (by Insignal) kernel config file.
More info on the Wiki page https://wiki.freebsd.org/FreeBSD/arm/ArndaleBoard

Submitted by: Ruslan Bukin <br@bsdpad.com>
Reviewed by: gonzo

11 years ago- Fix IMAPx registers values calculation
Oleksandr Tymoshenko [Sat, 29 Jun 2013 23:51:17 +0000 (23:51 +0000)]
- Fix IMAPx registers values calculation
- Initialize SMAPx registers too although they're unused in QEMU
- Do not pass IO/MEM resources to upper bus for activation, handle them locally.
    Previously ACTIVATE method of upper bus was no-op so nothing bad
    happened. But now FDT maps physaddr to vaddr and it causes
    troubles: fdtbus_activate_resource resource assumes that
    bustag/bushandle are already set which in this case is wrong.

11 years agoTeach UART to attach Exynos/s3/s5 class driver.
Aleksandr Rybalko [Sat, 29 Jun 2013 23:48:08 +0000 (23:48 +0000)]
Teach UART to attach Exynos/s3/s5 class driver.

Submitted by: Ruslan Bukin <br@bsdpad.com>
Reviewed by: gonzo

11 years agoEnable patth-through of IRQ30 and IRQ31 to PIC just as comment states
Oleksandr Tymoshenko [Sat, 29 Jun 2013 23:40:44 +0000 (23:40 +0000)]
Enable patth-through of IRQ30 and IRQ31 to PIC just as comment states

11 years agostyle(9) fixes
Steven Hartland [Sat, 29 Jun 2013 23:39:38 +0000 (23:39 +0000)]
style(9) fixes

MFC after: 2 days

11 years agoImport basic support for Samsung Exynos 5 support.
Aleksandr Rybalko [Sat, 29 Jun 2013 23:39:05 +0000 (23:39 +0000)]
Import basic support for Samsung Exynos 5 support.

Submitted by: Ruslan Bukin <br@bsdpad.com>
Reviewed by: gonzo

11 years agoRemove invalid ASSERT which causes a panic on zfs renames when run with ASSERTS.
Steven Hartland [Sat, 29 Jun 2013 23:15:45 +0000 (23:15 +0000)]
Remove invalid ASSERT which causes a panic on zfs renames when run with ASSERTS.
Removal was missed in merge of illumos 3464 (r248571)

MFC after: 2 days

11 years ago - Modify swapon(8) so that it uses most of geli(8) defaults for swap,
Xin LI [Sat, 29 Jun 2013 22:04:04 +0000 (22:04 +0000)]
 - Modify swapon(8) so that it uses most of geli(8) defaults for swap,
   which is presently: AES-XTS, no authentication.  Create provider
   with pagesize as sectorsize by default.
 - Rewrite parsing code for geli(8)-backed swap options, now options
   are required to be exact match, and unrecognized options will trigger
   a warning.
 - Don't initialize GELI device if it's already initialized.  This
   restores previous behavior.
 - Don't duplicate file descriptor when working with geli(8) and
   gbde(8) as there is no need to communicate with the utility other
   than exit status.
 - When calling swap_on_off_* routines, which_prog can only be SWAP_ON
   or SWAP_OFF.  Eliminate unneeded case branches by replacing switch
   with if's.
 - Plug a few memory leaks.

Reviewed by: hrs (but bugs are mine)
MFC after: 1 week
X-MFC-with: r252310, r252332, r252345

11 years agoMake libsupc++'s __cxa_call_terminate() prototype consistent with the
Dimitry Andric [Sat, 29 Jun 2013 20:17:14 +0000 (20:17 +0000)]
Make libsupc++'s __cxa_call_terminate() prototype consistent with the
definition.

Submitted by: dt71@gmx.com
MFC after: 3 days

11 years agoDon't let hastd use C11 atomics.
Ed Schouten [Sat, 29 Jun 2013 20:13:39 +0000 (20:13 +0000)]
Don't let hastd use C11 atomics.

Due to possible concerns about the stability of C11 atomics, use our
existing atomics API instead.

Requested by: pjd

11 years agoDon't log anything if npkts == 0.
Adrian Chadd [Sat, 29 Jun 2013 19:57:57 +0000 (19:57 +0000)]
Don't log anything if npkts == 0.

This occurs at RX DMA start, even though the RX FIFO has plenty of
space. I'll go figure out why, but this shouldn't cause people to
be spammed by these messages.

11 years agoIntroduce accessors for the ccb status word. Convert one (of many more)
Scott Long [Sat, 29 Jun 2013 17:48:59 +0000 (17:48 +0000)]
Introduce accessors for the ccb status word.  Convert one (of many more)
modules to use it, will convert the others once the appropriate shed
color is selected by consensus.

Obtained from: Netflix
MFC after: 3 days

11 years agoCheck the return value from ath_hal_malloc()
Adrian Chadd [Sat, 29 Jun 2013 16:49:00 +0000 (16:49 +0000)]
Check the return value from ath_hal_malloc()

Reported by: uqs

11 years agoUnbreak "zfs jail" and "zfs unjail" (broken since r248571)
Martin Matuska [Sat, 29 Jun 2013 16:45:37 +0000 (16:45 +0000)]
Unbreak "zfs jail" and "zfs unjail" (broken since r248571)

I missed to register zfs_ioc_jail and zfs_ioc_unjail as legacy ioctl's
with the new zfs_ioctl_register_legacy() function.

These operations do not modify pools or datasets so there is no need to
log them to pool history.

Reported by: Alexander Leidinger <ale@FreeBSD.org> and others on current@
MFC after: 3 days

11 years agomdoc: remove EOL whitespace.
Joel Dahl [Sat, 29 Jun 2013 16:05:44 +0000 (16:05 +0000)]
mdoc: remove EOL whitespace.

11 years agoFix -Wunsequenced
Tim Kientzle [Sat, 29 Jun 2013 15:58:03 +0000 (15:58 +0000)]
Fix -Wunsequenced

Submitted by: dt71@gmx.com

11 years agoFix -Wunsequenced warning
Tim Kientzle [Sat, 29 Jun 2013 15:54:17 +0000 (15:54 +0000)]
Fix -Wunsequenced warning

Submitted by:   dt71@gmx.com

11 years agoFix -Wunsequenced warning
Tim Kientzle [Sat, 29 Jun 2013 15:52:48 +0000 (15:52 +0000)]
Fix -Wunsequenced warning

Submitted by: dt71@gmx.com

11 years agoFix -Wunsequenced warning.
Tim Kientzle [Sat, 29 Jun 2013 15:51:27 +0000 (15:51 +0000)]
Fix -Wunsequenced warning.

Submitted by: dt71@gmx.com

11 years agoFix a -Wunsequenced warning.
Tim Kientzle [Sat, 29 Jun 2013 15:49:26 +0000 (15:49 +0000)]
Fix a -Wunsequenced warning.

Submitted by: dt71@gmx.com

11 years agoEnable svnlite on armv6.
Tim Kientzle [Sat, 29 Jun 2013 15:31:23 +0000 (15:31 +0000)]
Enable svnlite on armv6.

11 years agoAdd ARM Generic Timer driver.
Aleksandr Rybalko [Sat, 29 Jun 2013 12:27:50 +0000 (12:27 +0000)]
Add ARM Generic Timer driver.

Submitted by: Ruslan Bukin <br@bsdpad.com>

11 years agoAdd FDT for Arndale board and Samsung Exynos5250 SoC.
Aleksandr Rybalko [Sat, 29 Jun 2013 12:24:11 +0000 (12:24 +0000)]
Add FDT for Arndale board and Samsung Exynos5250 SoC.

Submitted by: Ruslan Bukin <br@bsdpad.com>

11 years agoo Initialize interrupt groups as Group 0 (secure interrupts).
Aleksandr Rybalko [Sat, 29 Jun 2013 12:08:26 +0000 (12:08 +0000)]
o Initialize interrupt groups as Group 0 (secure interrupts).
o Minor cleanup.

Submitted by: Ruslan Bukin <br@bsdpad.com>

11 years agoDon't panic the kernel if we run wpa_supplicant on a hostap VAP.
Rui Paulo [Sat, 29 Jun 2013 06:36:42 +0000 (06:36 +0000)]
Don't panic the kernel if we run wpa_supplicant on a hostap VAP.

Reviewed by: adrian

11 years agoRevert accidental commit.
Peter Wemm [Sat, 29 Jun 2013 05:05:57 +0000 (05:05 +0000)]
Revert accidental commit.

Pointy hat to:  peter

11 years agoHelp out gcc. clang understands.
Peter Wemm [Sat, 29 Jun 2013 04:35:04 +0000 (04:35 +0000)]
Help out gcc.  clang understands.

sys_generic.c:1510: warning: 'precision' may be used uninitialized
*** [sys_generic.o] Error code 1

11 years agoBring some updates from ufs_lookup to ext2fs.
Pedro F. Giffuni [Sat, 29 Jun 2013 01:35:28 +0000 (01:35 +0000)]
Bring some updates from ufs_lookup to ext2fs.

r156418:

Don't set IN_CHANGE and IN_UPDATE on inodes for potentially suspended
file systems.  This could cause deadlocks when creating snapshots.
(We can't do snapshots on ext2fs but it is useful to keep things in sync).

r183079:

- Only set i_offset in the parent directory's i-node during a lookup for
  non-LOOKUP operations.
- Relax a VOP assertion for a DELETE lookup.

r187528:

Move the code from ufs_lookup.c used to do dotdot lookup, into
the helper function. It is supposed to be useful for any filesystem
that has to unlock dvp to walk to the ".." entry in lookup routine.

MFC after: 5 days

11 years agosysconf(3) returns a long, not an int.
David E. O'Brien [Sat, 29 Jun 2013 00:37:49 +0000 (00:37 +0000)]
sysconf(3) returns a long, not an int.

11 years agoBump max number of IRQs for Cortex-Ax family to cover Exynos5 requirement.
Aleksandr Rybalko [Fri, 28 Jun 2013 22:47:33 +0000 (22:47 +0000)]
Bump max number of IRQs for Cortex-Ax family to cover Exynos5 requirement.

Submitted by: Ruslan Bukin <br@bsdpad.com>

11 years agoAdd identification for Cortex-A15 (R0) cores.
Aleksandr Rybalko [Fri, 28 Jun 2013 22:31:17 +0000 (22:31 +0000)]
Add identification for Cortex-A15 (R0) cores.

Submitted by: Ruslan Bukin <br@bsdpad.com>

11 years agoDon't attempt to do DHCP on certain interfaces, similar to what's done for
Xin LI [Fri, 28 Jun 2013 22:25:37 +0000 (22:25 +0000)]
Don't attempt to do DHCP on certain interfaces, similar to what's done for
ipv6_autoconfif() in r212577.

MFC after: 1 week

11 years agosh: Do not close(-1) if pipe() fails.
Jilles Tjoelker [Fri, 28 Jun 2013 21:47:08 +0000 (21:47 +0000)]
sh: Do not close(-1) if pipe() fails.

11 years agoRemove a spurious keg lock acquisition.
Davide Italiano [Fri, 28 Jun 2013 21:13:19 +0000 (21:13 +0000)]
Remove a spurious keg lock acquisition.

11 years agoCorrect the comment above _sleep() function which still mentions 'timo'
Davide Italiano [Fri, 28 Jun 2013 21:04:15 +0000 (21:04 +0000)]
Correct the comment above _sleep() function which still mentions 'timo'
instead of 'sbintime_t'.

Reported by: kan

11 years ago- Trim an unused and bogus Makefile for mount_smbfs.
Davide Italiano [Fri, 28 Jun 2013 21:00:08 +0000 (21:00 +0000)]
- Trim an unused and bogus Makefile for mount_smbfs.
- Reconnect with some minor modifications, in particular now selsocket()
internals are adapted to use sbintime units after recent'ish calloutng
switch.

11 years agoProperly use v_data field. This magically worked (even if wrong) until
Davide Italiano [Fri, 28 Jun 2013 20:32:48 +0000 (20:32 +0000)]
Properly use v_data field. This magically worked (even if wrong) until
now because v_data is the first field of the structure, but it's not
something we should rely on.

11 years agoRemove a reference to LK_DRAIN now that lockmgr(9) is gone from this
Davide Italiano [Fri, 28 Jun 2013 20:21:13 +0000 (20:21 +0000)]
Remove a reference to LK_DRAIN now that lockmgr(9) is gone from this
piece of code.

Reported by: attilio

11 years agoGarbage collect an useless check. smp should be never NULL.
Davide Italiano [Fri, 28 Jun 2013 20:14:30 +0000 (20:14 +0000)]
Garbage collect an useless check. smp should be never NULL.

11 years agoPlug a couple of leakages in smbfs_lookup().
Davide Italiano [Fri, 28 Jun 2013 20:07:24 +0000 (20:07 +0000)]
Plug a couple of leakages in smbfs_lookup().

11 years agoRemove duplicate NULL check in kern_proc_filedesc_out.
Mateusz Guzik [Fri, 28 Jun 2013 18:32:46 +0000 (18:32 +0000)]
Remove duplicate NULL check in kern_proc_filedesc_out.
No functional changes.

MFC after: 1 week

11 years agoRework r252313:
Mikolaj Golub [Fri, 28 Jun 2013 18:07:41 +0000 (18:07 +0000)]
Rework r252313:

The filedesc lock may not be dropped unconditionally before exporting
fd to sbuf: fd might go away during execution.  While it is ok for
DTYPE_VNODE and DTYPE_FIFO because the export is from a vrefed vnode
here, for other types it is unsafe.

Instead, drop the lock in export_fd_to_sb(), after preparing data in
memory and before writing to sbuf.

Spotted by: mjg
Suggested by: kib
Review by: kib
MFC after: 1 week

11 years agosysconf(3) returns a long, not an int.
David E. O'Brien [Fri, 28 Jun 2013 17:18:28 +0000 (17:18 +0000)]
sysconf(3) returns a long, not an int.

11 years agoMake a pass over this page to correct and clarify a few things as well as
John Baldwin [Fri, 28 Jun 2013 16:33:45 +0000 (16:33 +0000)]
Make a pass over this page to correct and clarify a few things as well as
some general word-smithing.
- Don't claim that adaptive mutexes have a timeout (they don't).
- Don't treat pool mutexes as a separate primitive in a few places.
- Describe sleepable read-mostly locks as a separate lock type and add
  them to the various tables.
- Don't claim that sx locks are less efficient.  That hasn't been true in
  a few years now.
- Describe lockmanager locks next to sx locks since they are very similar
  in terms of rules, etc., and so that all the lock primitives are
  grouped together before the non-lock primitives.
- Similarly, move the section on Giant after the description of all the
  non-lock primitives to preserve grouping.
- Condition variables work on several types of locks, not just mutexes.
- Add a bit of language to compare/contrast condition variables with
  sleep/wakeup.
- Add a note about why pause(9) is unique.
- Add some language to define bounded vs unbounded sleeps and explain
  why they are treated separately (bounded sleeps only need CPU time
  to make forward progress).
- Don't state that using mtx_sleep() is a bad idea.  It is in fact rather
  necessary.
- Rework the interaction table a bit.  First, it did not include really
  include sleepable rmlocks and it left out lockmgr entirely.  To get
  things to fit, combine similar lock types into the same column / row,
  and explicitly state what "sleep" means.  The notes about recursion
  and lock order were also a bit banal (lock order is always important,
  not just in the few places annotated here), so remove them.  In
  particular, the lock order note would need to be on just about every
  cell.  If we want to document recursion I think a better approach
  would be a separate table summarizing the recursion rules for each
  lock as having too many notes clutters the table.
- Tweak the tables to use less indentation so everything still fits with
  the added columns.
- Correct a few cells in the context mode table.
- Use mdoc markup instead of explicit markup in a few places.

Requested by: julian
MFC after: 2 weeks

11 years agoFix build with gcc.
Hiroki Sato [Fri, 28 Jun 2013 16:24:14 +0000 (16:24 +0000)]
Fix build with gcc.

11 years agoCorrect a bug that prevented deadlkres from (almost) ever firing.
Ryan Stone [Fri, 28 Jun 2013 15:55:30 +0000 (15:55 +0000)]
Correct a bug that prevented deadlkres from (almost) ever firing.

deadlkres was using a reversed test to check whether ticks had rolled over.
This meant that deadlkres could only fire after ticks had rolled over.
This test was actually unnecessary as deadlkres only ever took the
difference of ticks values which is safe even in the presence of ticks
rollover.  Remove the tests entirely.  Now deadlkres will properly fire
after a lock has been held after the timeout period.

MFC after: 1 month

11 years agoCorrect comment typos.
Sergey Kandaurov [Fri, 28 Jun 2013 14:41:06 +0000 (14:41 +0000)]
Correct comment typos.

11 years agor251088 reverted the default value for UsePrivilegeSeparation from
Dag-Erling Smørgrav [Fri, 28 Jun 2013 09:41:59 +0000 (09:41 +0000)]
r251088 reverted the default value for UsePrivilegeSeparation from
"sandbox" to "yes", but did not update the documentation to match.

11 years agoDon't try to re-insert an already present but invalid page.
Gavin Atkinson [Fri, 28 Jun 2013 07:51:12 +0000 (07:51 +0000)]
Don't try to re-insert an already present but invalid page.

This could happen if a thread doing a page-in loses a ZFS range lock
race to a thread writing to the same range

This fixes "panic: vm_page_alloc: pindex already allocated" in
http://docs.FreeBSD.org/cgi/mid.cgi?1372165971.96049.42.camel

Submitted by: avg
MFC after: 1 week

11 years agoAllow 8259 registers to be read. This is a transient condition
Peter Grehan [Fri, 28 Jun 2013 06:25:04 +0000 (06:25 +0000)]
Allow 8259 registers to be read. This is a transient condition
during Linux boot.

Submitted by: tycho nightingale at pluribusnetworks com
Reviewed by: neel

11 years agoMake sure all CPUID values are handled, instead of exiting the
Peter Grehan [Fri, 28 Jun 2013 06:05:33 +0000 (06:05 +0000)]
Make sure all CPUID values are handled, instead of exiting the
bhyve process when an unhandled one is encountered.

Hide some additional capabilities from the guest (e.g. debug store).

This fixes the issue with FreeBSD 9.1 MP guests exiting the VM on
AP spinup (where CPUID is used when sync'ing the TSCs) and the
issue with the Java build where CPUIDs are issued from a guest
userspace.

Submitted by: tycho nightingale at pluribusnetworks com
Reviewed by: neel
Reported by: many

11 years agoFix build.
Hiroki Sato [Fri, 28 Jun 2013 05:09:01 +0000 (05:09 +0000)]
Fix build.

Spotted by: gjb

11 years agoAllow the PCI config address register to be read. The Linux
Peter Grehan [Fri, 28 Jun 2013 05:01:25 +0000 (05:01 +0000)]
Allow the PCI config address register to be read. The Linux
kernel does this. Also remove an unused header file.

Submitted by: tycho nightingale at pluribusnetworks com
Reviewed by: neel

11 years ago - Add a general purpose resource allocator, vmem, from NetBSD. It was
Jeff Roberson [Fri, 28 Jun 2013 03:51:20 +0000 (03:51 +0000)]
 - Add a general purpose resource allocator, vmem, from NetBSD.  It was
   originally inspired by the Solaris vmem detailed in the proceedings
   of usenix 2001.  The NetBSD version was heavily refactored for bugs
   and simplicity.
 - Use this resource allocator to allocate the buffer and transient maps.
   Buffer cache defrags are reduced by 25% when used by filesystems with
   mixed block sizes.  Ultimately this may permit dynamic buffer cache
   sizing on low KVA machines.

Discussed with: alc, kib, attilio
Tested by: pho
Sponsored by: EMC / Isilon Storage Division

11 years agoThe dtmalloc provider uses the short description of a malloc type as the
Mark Johnston [Fri, 28 Jun 2013 03:14:40 +0000 (03:14 +0000)]
The dtmalloc provider uses the short description of a malloc type as the
function name of its corresponding DTrace probes. These descriptions may
contain whitespace, but probe names cannot, so just replace any whitespace
with underscores when creating probes.

MFC after: 1 week

11 years agoSupport reading registers r0-r3 when unwinding. There is a seperate
Andrew Turner [Thu, 27 Jun 2013 22:26:56 +0000 (22:26 +0000)]
Support reading registers r0-r3 when unwinding. There is a seperate
instruction to load these. We only hit it when unwinding past an trap frame
as in C r0-r3 would never have been saved onto the stack.

11 years agoMake detaching drivers from PCI devices more robust. While here, fix a
John Baldwin [Thu, 27 Jun 2013 20:21:54 +0000 (20:21 +0000)]
Make detaching drivers from PCI devices more robust.  While here, fix a
bug where a PCI device would be powered down if it failed to probe, but
not when its driver was detached (e.g. via kldunload).
- Add a new helper method resource_list_release_active() which forcefully
  releases any active resources of a specified type from a resource list.
- Add a bus_child_detached method for the PCI bus driver which forces any
  active resources to be released (and whines to the console if it finds
  any) and then powers the device down.
- Call pci_child_detached() if we fail to probe a device when a driver
  is kldloaded.  This isn't perfect but can avoid leaking resources
  from a probe() routine in the kldload case.

Reviewed by: imp, brooks
MFC after: 1 month

11 years agoAdd "amdfam10" to the supported CPU types for amd64. This complements
Jung-uk Kim [Thu, 27 Jun 2013 19:47:58 +0000 (19:47 +0000)]
Add "amdfam10" to the supported CPU types for amd64.  This complements
r251691 and 251692.

11 years agoTo avoid LOR, always drop the filedesc lock before exporting fd to sbuf.
Mikolaj Golub [Thu, 27 Jun 2013 19:14:03 +0000 (19:14 +0000)]
To avoid LOR, always drop the filedesc lock before exporting fd to sbuf.

Reviewed by: kib
MFC after: 3 days

11 years agoUpdate T5 register ranges. This is so that regdump skips over registers
Navdeep Parhar [Thu, 27 Jun 2013 18:59:07 +0000 (18:59 +0000)]
Update T5 register ranges.  This is so that regdump skips over registers
with read side-effects.

MFC after: 3 days

11 years agoAdd UNWINDSVCFRAME to provide the unwind pseudo ops to allow us to unwind
Andrew Turner [Thu, 27 Jun 2013 18:54:18 +0000 (18:54 +0000)]
Add UNWINDSVCFRAME to provide the unwind pseudo ops to allow us to unwind
past a trapframe.

Use this macro in exception_exit as it is the function the unwinder enters
as the functions that store the frame setting lr to point to it.

11 years ago- Add vnode-backed swap space specification support. This is enabled when
Hiroki Sato [Thu, 27 Jun 2013 18:28:45 +0000 (18:28 +0000)]
- Add vnode-backed swap space specification support.  This is enabled when
  device names "md" or "md[0-9]*" and a "file" option are specified in
  /etc/fstab like this:

  md    none    swap    sw,file=/swap.bin       0       0

- Add GBDE/GELI encrypted swap space specification support, which
  rc.d/encswap supported.  The /etc/fstab lines are like the following:

  /dev/ada1p1.bde       none    swap    sw      0       0
  /dev/ada1p2.eli       none    swap    sw      0       0

  .eli devices accepts aalgo, ealgo, keylen, and sectorsize as options.

  swapctl(8) can understand an encrypted device in the command line
  like this:

  # swapctl -a /dev/ada2p1.bde

- "-L" flag is added to support "late" option to defer swapon until
  rc.d/mountlate runs.

- rc.d script change:

    rc.d/encswap -> removed
    rc.d/addswap -> just display a warning message if $swapfile is defined
    rc.d/swap1 -> renamed to rc.d/swap
    rc.d/swaplate -> newly added to support "late" option

These changes alleviate a race condition between device creation/removal
and swapon/swapoff.

MFC after: 1 week
Reviewed by: wblock (manual page)

11 years agoFix build.
Gleb Smirnoff [Thu, 27 Jun 2013 10:42:09 +0000 (10:42 +0000)]
Fix build.

11 years agoAdd support for the NTT Docomo L-02C card.
Remko Lodder [Thu, 27 Jun 2013 09:08:07 +0000 (09:08 +0000)]
Add support for the NTT Docomo L-02C card.
(This file didn't get along in the previous commit)

PR: 180017
Submitted by: Masaharu FUJITA
Glanced at by: imp
MFC after: 1 week

11 years agoAdd support for the NTT Docomo L-02C card.
Remko Lodder [Thu, 27 Jun 2013 09:06:00 +0000 (09:06 +0000)]
Add support for the NTT Docomo L-02C card.

PR: 180017
Submitted by: Masaharu FUJITA
Glanced at by: imp
MFC after: 1 week

11 years ago- Request non-cached memory for framebuffer
Oleksandr Tymoshenko [Thu, 27 Jun 2013 00:33:08 +0000 (00:33 +0000)]
- Request non-cached memory for framebuffer
- Properly probe/initialize syscons

11 years agoMove definitions required by userland applications out of acpica_machdep.h.
Jung-uk Kim [Thu, 27 Jun 2013 00:22:40 +0000 (00:22 +0000)]
Move definitions required by userland applications out of acpica_machdep.h.

11 years agoMerge ACPICA 20130626.
Jung-uk Kim [Thu, 27 Jun 2013 00:16:54 +0000 (00:16 +0000)]
Merge ACPICA 20130626.

11 years agoAdd firmware replacement and activation support to nvmecontrol(8) through
Jim Harris [Thu, 27 Jun 2013 00:08:25 +0000 (00:08 +0000)]
Add firmware replacement and activation support to nvmecontrol(8) through
a new firmware command.

NVMe controllers may support up to 7 firmware slots for storing of
different firmware revisions.  This new firmware command supports
firmware replacement (i.e. firmware download) with or without immediate
activation, or activation of a previously stored firmware image.  It
also supports selection of the firmware slot during replacement
operations, using IDENTIFY information from the controller to
check that the specified slot is valid.

Newly activated firmware does not take effect until the new controller
reset, either via a reboot or separate 'nvmecontrol reset' command to the
same controller.

Submitted by: Joe Golio <joseph.golio@emc.com>
Obtained from: EMC / Isilon Storage Division
MFC after: 3 days

11 years agoAdd log page support to nvmecontrol(8) through a new logpage command.
Jim Harris [Wed, 26 Jun 2013 23:53:54 +0000 (23:53 +0000)]
Add log page support to nvmecontrol(8) through a new logpage command.

This includes pretty printers for all of the standard NVMe log pages
(Error, SMART/Health, Firmware), as well as hex output for non-standard
or vendor-specific log pages.

Submitted by: Joe Golio <joseph.golio@emc.com>
Obtained from: EMC / Isilon Storage Division
MFC after: 3 days