freebsd.git
9 years agoRemove a debugging line that snuck in with r282419.
gjb [Mon, 4 May 2015 21:34:19 +0000 (21:34 +0000)]
Remove a debugging line that snuck in with r282419.

Pointyhat: gjb
MFC after: 3 days
X-MFC-With: r282419
Sponsored by: The FreeBSD Foundation

9 years agoMFV r225523, r282431:
gjb [Mon, 4 May 2015 21:07:20 +0000 (21:07 +0000)]
MFV r225523, r282431:
 r225523 (hrs):
  Import openresolv-3.4.4.

 r282431:
  Import openresolv-3.7.0.

PR: 199854
Submitted by: yuri@rawbw.com
MFC after: 1 week
Relnotes: yes
Sponsored by: The FreeBSD Foundation

9 years agoIn preparation for the next cycle of official ARM images, add ARM_NEW_PMAP
loos [Mon, 4 May 2015 20:59:23 +0000 (20:59 +0000)]
In preparation for the next cycle of official ARM images, add ARM_NEW_PMAP
to supported kernels.

This is a temporary solution and should be reverted when ARM_NEW_PMAP is
enabled by default.

9 years agoImport openresolv 3.7.0.
gjb [Mon, 4 May 2015 20:51:27 +0000 (20:51 +0000)]
Import openresolv 3.7.0.

PR: 199854
Obtained from: http://roy.marples.name/projects/openresolv
Sponsored by: The FreeBSD Foundation

9 years agoImplement a driver for the PowerPC-base RouterBoard (RB333/600/800/1100)
jhibbits [Mon, 4 May 2015 20:36:00 +0000 (20:36 +0000)]
Implement a driver for the PowerPC-base RouterBoard (RB333/600/800/1100)

Summary:
This has been tested on the RB800, but should work on the RB333, RB600, and
RB1100 as well.

It's currently missing ECC support, but read and write are complete.

Reviewers: imp

Reviewed By: imp

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D2223

9 years agoImplement in-order execution of non-NCQ commands.
mav [Mon, 4 May 2015 19:55:01 +0000 (19:55 +0000)]
Implement in-order execution of non-NCQ commands.

Using status updates in r282364, block queue on BSY, DRQ or ERR bits set.
This can be a performance penalization for non-NCQ commands, but it is
required for proper error recovery and standard compliance.

MFC after: 2 weeks

9 years agoFix arithmetical bug in vnode_pager_haspage(). The check against object size
glebius [Mon, 4 May 2015 18:49:25 +0000 (18:49 +0000)]
Fix arithmetical bug in vnode_pager_haspage().  The check against object size
should be done not with the number of pages in the first block, but with the
overall number of pages.  While here, add KASSERT that makes sure that BMAP
doesn't return completely irrelevant blocks.

Reviewed by: kib
Tested by: pho
Sponsored by: Netflix
Sponsored by: Nginx, Inc.

9 years agoParse filename until first space then print the rest of the line after file
bapt [Mon, 4 May 2015 18:20:31 +0000 (18:20 +0000)]
Parse filename until first space then print the rest of the line after file
inclusion

This is the same behaviour of heirloom's soelim

9 years agoImplement a mechanism for making changes in the kernel<->driver PPS
ian [Mon, 4 May 2015 17:59:39 +0000 (17:59 +0000)]
Implement a mechanism for making changes in the kernel<->driver PPS
interface without breaking ABI or API compatibility with existing drivers.

The existing data structures used to communicate between the kernel and
driver portions of PPS processing contain no spare/padding fields and no
flags field or other straightforward mechanism for communicating changes
in the structures or behaviors of the code.  This makes it difficult to
MFC new features added to the PPS facility.  ABI compatibility is
important; out-of-tree drivers in module form are known to exist.  (Note
that the existing api_version field in the pps_params structure must
contain the value mandated by RFC 2783 and any RFCs that come along after.)

These changes introduce a pair of abi-version fields which are filled in
by the driver and the kernel respectively to indicate the interface
version.  The driver sets its version field before calling the new
pps_init_abi() function.  That lets the kernel know how much of the
pps_state structure is understood by the driver and it can avoid using
newer fields at the end of the structure that it knows about if the driver
is a lower version.  The kernel fills in its version field during the init
call, letting the driver know what features and data the kernel supports.

To implement the new version information in a way that is backwards
compatible with code from before these changes, the high bit of the
lightly-used 'kcmode' field is repurposed as a flag bit that indicates the
driver is aware of the abi versioning scheme.  Basically if this bit is
clear that indicates a "version 0" driver and if it is set the driver_abi
field indicates the version.

These changes also move the recently-added 'mtx' field of pps_state from
the middle to the end of the structure, and make the kernel code that uses
this field conditional on the driver being abi version 1 or higher.  It
changes the only driver currently supplying the mtx field, usb_serial, to
use pps_init_abi().

Reviewed by: hselasky@

9 years agoDo not remove libmap32.conf in make delete-old as it may remove user modified
bapt [Mon, 4 May 2015 17:01:51 +0000 (17:01 +0000)]
Do not remove libmap32.conf in make delete-old as it may remove user modified
version by mistake

9 years agoStyle fix
bapt [Mon, 4 May 2015 16:59:09 +0000 (16:59 +0000)]
Style fix

Reported by: bdrewery

9 years agoRemove now unneeded libmap32.conf
bapt [Mon, 4 May 2015 16:34:08 +0000 (16:34 +0000)]
Remove now unneeded libmap32.conf

9 years agoRework PRIVATELIB
bapt [Mon, 4 May 2015 16:28:54 +0000 (16:28 +0000)]
Rework PRIVATELIB

Now when a lib is marked as PRIVATELIB it is renamed into libprivate$foo instead
of being installed in /usr/lib/private and playing with rpath.

Also allow to install headers for PRIVATELIBS in that case the headers will be
installed in /usr/include/private/$foo

Keep the headers under a private namespace to prevent third party build system
to easily find them to ensure they are only used on purpose.

This allows for non base applications to statically link against a library in
base which is linked to a privatelib

Treating PRIVATELIBS as regular libraries allows to push them into our current
compatX packages if needed.

While here finish promotion of libevent as PRIVATELIB
Install header for bsdstat and libucl

Differential Revision: https://reviews.freebsd.org/D2365
Reviewed by: brooks, des
Discussed with: imp

9 years agoAdd logic to detect if the net/bsdec2-image-upload port needs
gjb [Mon, 4 May 2015 15:04:39 +0000 (15:04 +0000)]
Add logic to detect if the net/bsdec2-image-upload port needs
to be installed. [1]

For the cw-ec2-portinstall and ec2ami targets, touch the
.TARGET file after completion to prevent duplicate invocations.

Add cw-ec2-portinstall and ec2ami to CLEANFILES.

Submitted by: cperciva[1]
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

9 years agoOn an icache sync by address/len, round the length up if the operation spans
ian [Mon, 4 May 2015 14:55:21 +0000 (14:55 +0000)]
On an icache sync by address/len, round the length up if the operation spans
a cacheline boundary.

PR: 199740
Submitted by: Juergen Weiss <weiss@uni-mainz.de>

9 years agoVarious updates to the ftruncate(2) documentation:
jhb [Mon, 4 May 2015 14:47:00 +0000 (14:47 +0000)]
Various updates to the ftruncate(2) documentation:
- Note that ftruncate(2) can operate on shared memory objects and cross
  reference shm_open(2).
- Note that ftruncate(2) does not change the file position pointer (aka
  seek pointer) of the file descriptor.
- ftruncate(2) will fail with EINVAL for all sorts of other fd types than
  just sockets, so instead note that it fails for all but regular files and
  shared memory objects.
- Note that ftruncate(2) also appeared in 4.2BSD along with truncate(2).
  (Or at least the manpage for both appeared in 4.2, I did not check the
  kernel code itself to see if either predated 4.2.)

PR: 199472 (2)
Submitted by: andrew@ugh.net.au (2)
MFC after: 1 week

9 years agoPartially revert r255486, the first argument to socketpair() is a socket
jhb [Mon, 4 May 2015 14:23:31 +0000 (14:23 +0000)]
Partially revert r255486, the first argument to socketpair() is a socket
domain, not a file descriptor.  Use 'domain' instead of the original 'd'
for this argument to match socket(2).

PR: 199491
Reported by: sp55aa@qq.com
MFC after: 1 week

9 years agoRestore CPU dependent compile time conditionals.
cy [Mon, 4 May 2015 12:42:52 +0000 (12:42 +0000)]
Restore CPU dependent compile time conditionals.

MFC after: 1 month (with r281143 and r282408)

9 years agoMFV ntp 4.2.8p2 (r281348)
cy [Mon, 4 May 2015 04:45:59 +0000 (04:45 +0000)]
MFV ntp 4.2.8p2 (r281348)

Reviewed by:    delphij (suggested MFC)
Approved by: roberto
Security:       CVE-2015-1798, CVE-2015-1799
Security:       VuXML ebd84c96-dd7e-11e4-854e-3c970e169bc2
MFC after: 1 month

9 years agoEmulate the 'CMP r/m8, imm8' instruction encountered when booting a Windows
neel [Mon, 4 May 2015 04:27:23 +0000 (04:27 +0000)]
Emulate the 'CMP r/m8, imm8' instruction encountered when booting a Windows
Vista guest.

Reported by: Leon Dang (ldang@nahannisys.com)
MFC after: 1 week

9 years agoFix string concatenation - "wlan_##name" -> "wlan_" #name
adrian [Mon, 4 May 2015 00:47:22 +0000 (00:47 +0000)]
Fix string concatenation - "wlan_##name" -> "wlan_" #name

PR: kern/197623
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoUse bssid validation for data frames only + add RUN -> RUN state transition
adrian [Mon, 4 May 2015 00:32:10 +0000 (00:32 +0000)]
Use bssid validation for data frames only + add RUN -> RUN state transition

However, IBSS merge will be performed only if a driver calls
ieee80211_ibss_merge(); so, this applicable to the ath(4) only.
Also, this should fix bug 167870.

PR: kern/199632
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoAdd node_clear_keyixmap() and use it in the ieee80211_free_node() / node_reclaim().
adrian [Mon, 4 May 2015 00:29:19 +0000 (00:29 +0000)]
Add node_clear_keyixmap() and use it in the ieee80211_free_node() / node_reclaim().

PR: kern/199672
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoFix the voltage and clock levels for cpufreq on RPi 2.
loos [Mon, 4 May 2015 00:01:35 +0000 (00:01 +0000)]
Fix the voltage and clock levels for cpufreq on RPi 2.

Submitted by: Daisuke Aoyama <aoyama@peach.ne.jp>

9 years ago[iwn] Do not filter control frames in monitor mode.
adrian [Sun, 3 May 2015 23:40:12 +0000 (23:40 +0000)]
[iwn] Do not filter control frames in monitor mode.

PR: kern/197143
Submitted by:  Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoHandle properly IBSS merges (works with patch from bug 199632).
adrian [Sun, 3 May 2015 23:39:44 +0000 (23:39 +0000)]
Handle properly IBSS merges (works with patch from bug 199632).

PR: kern/197143
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoFix various powersave races + optimize tx/rx pointer update when powersave is off.
adrian [Sun, 3 May 2015 23:39:02 +0000 (23:39 +0000)]
Fix various powersave races + optimize tx/rx pointer update when powersave is off.

PR: kern/197143
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years ago[iwn?] Use correct sequence numbers with non-QoS STAs.
adrian [Sun, 3 May 2015 23:38:32 +0000 (23:38 +0000)]
[iwn?] Use correct sequence numbers with non-QoS STAs.

PR: kern/197143
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoFix warning about comparison of integers of different signs.
adrian [Sun, 3 May 2015 23:37:13 +0000 (23:37 +0000)]
Fix warning about comparison of integers of different signs.

PR: kern/197143
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years ago[iwn?] Fix memory leak in wpi_reset_tx_ring().
adrian [Sun, 3 May 2015 23:36:25 +0000 (23:36 +0000)]
[iwn?] Fix memory leak in wpi_reset_tx_ring().

PR: kern/197143
Differential Revision: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoUse nitems() for counting elements in arrays.
adrian [Sun, 3 May 2015 23:35:44 +0000 (23:35 +0000)]
Use nitems() for counting elements in arrays.

PR: kern/197143
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoDo not include WPI_START_SCAN event processing into non-debug builds.
adrian [Sun, 3 May 2015 23:35:11 +0000 (23:35 +0000)]
Do not include WPI_START_SCAN event processing into non-debug builds.

PR: kern/197143
Submitted by:  Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoFix sequence number generation for beacon frames.
adrian [Sun, 3 May 2015 23:34:24 +0000 (23:34 +0000)]
Fix sequence number generation for beacon frames.

PR: kern/197143
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoAdd debug output for WPI_BEACON_SENT event.
adrian [Sun, 3 May 2015 23:30:04 +0000 (23:30 +0000)]
Add debug output for WPI_BEACON_SENT event.

PR: kern/197143
Submitted by:  Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoTry to fix passive scanning hang on beacon miss.
adrian [Sun, 3 May 2015 23:28:54 +0000 (23:28 +0000)]
Try to fix passive scanning hang on beacon miss.

PR: kern/197143
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoAdd comment about AUTH -> AUTH state transition + fix some style issues.
adrian [Sun, 3 May 2015 23:27:36 +0000 (23:27 +0000)]
Add comment about AUTH -> AUTH state transition + fix some style issues.

PR: kern/197143
Submitted by:  Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoDisplay more information for beacon miss debugging.
adrian [Sun, 3 May 2015 23:25:33 +0000 (23:25 +0000)]
Display more information for beacon miss debugging.

PR: kern/197143
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoLimit minimum threshold of missed beacons.
adrian [Sun, 3 May 2015 23:24:20 +0000 (23:24 +0000)]
Limit minimum threshold of missed beacons.

PR: kern/197143
Submitted by:  Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoImprove beacon miss detection.
adrian [Sun, 3 May 2015 23:21:16 +0000 (23:21 +0000)]
Improve beacon miss detection.

PR: kern/197143
Submitted by:  Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoCreate another debug category for WPI_BEACON_MISSED notification.
adrian [Sun, 3 May 2015 23:18:28 +0000 (23:18 +0000)]
Create another debug category for WPI_BEACON_MISSED notification.

Differential Revision: kern/197143
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoUnbreak scanning after RUN -> SCAN state transition.
adrian [Sun, 3 May 2015 23:09:47 +0000 (23:09 +0000)]
Unbreak scanning after RUN -> SCAN state transition.

PR: kern/197143
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoCheck channels which are passed in IBSS mode.
adrian [Sun, 3 May 2015 23:08:25 +0000 (23:08 +0000)]
Check channels which are passed in IBSS mode.

PR: kern/197143
Submitted by:  Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoDo not disable beacon notifications (unbreaks scanning on passive channels).
adrian [Sun, 3 May 2015 23:06:19 +0000 (23:06 +0000)]
Do not disable beacon notifications (unbreaks scanning on passive channels).

PR: kern/197143
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoFix pause scan time calculation (the remainder must be less than beacon interval).
adrian [Sun, 3 May 2015 23:03:06 +0000 (23:03 +0000)]
Fix pause scan time calculation (the remainder must be less than beacon interval).

PR: kern/197143
Submitted by:  Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoFix active/passive dwell calculation.
adrian [Sun, 3 May 2015 22:56:36 +0000 (22:56 +0000)]
Fix active/passive dwell calculation.

PR: kern/197143
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoTurn off led when leaving RUN state.
adrian [Sun, 3 May 2015 22:55:06 +0000 (22:55 +0000)]
Turn off led when leaving RUN state.

PR: kern/197143
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoFor eabi 5 (what FreeBSD uses), be sure to tag all executables and
imp [Sun, 3 May 2015 22:51:42 +0000 (22:51 +0000)]
For eabi 5 (what FreeBSD uses), be sure to tag all executables and
shared libraries as either SOFT or HARD float to comply with the EABI
standard.

Differential Revision: https://reviews.freebsd.org/D2401

9 years agoWhen merging the floating point type attribute, and reporting an error
imp [Sun, 3 May 2015 22:51:29 +0000 (22:51 +0000)]
When merging the floating point type attribute, and reporting an error
when things don't match, report which file has them and which one
doesn't correctly.

Differential Revision: https://reviews.freebsd.org/D2400

9 years agoAdd TX status codes (obtained from iwlegacy)
adrian [Sun, 3 May 2015 22:49:47 +0000 (22:49 +0000)]
Add TX status codes (obtained from iwlegacy)

PR: kern/197143
Differential Revision: Andriy Voskoboinyk <s3erios@gmail.com>
Obtained from: Linux drivers/net/wireless/iwlegacy

9 years agoMove radiooff_task to the internal taskqueue.
adrian [Sun, 3 May 2015 22:47:06 +0000 (22:47 +0000)]
Move radiooff_task to the internal taskqueue.

PR: kern/197143
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoUse another workaround for scanning.
adrian [Sun, 3 May 2015 22:43:45 +0000 (22:43 +0000)]
Use another workaround for scanning.

PR: kern/197143
Submitted by:  Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoAdd wpi_check_bss_filter()
adrian [Sun, 3 May 2015 22:34:32 +0000 (22:34 +0000)]
Add wpi_check_bss_filter()

PR: kern/197143
Submitted by:  Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoFix KASSERT statements in if_wpi_debug.h
adrian [Sun, 3 May 2015 22:32:45 +0000 (22:32 +0000)]
Fix KASSERT statements in if_wpi_debug.h

PR: kern/197143
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoRemove workaround for bug 199676.
adrian [Sun, 3 May 2015 22:30:11 +0000 (22:30 +0000)]
Remove workaround for bug 199676.

PR: kern/197143
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoRemove old iv_bss entry from the node table
adrian [Sun, 3 May 2015 22:28:42 +0000 (22:28 +0000)]
Remove old iv_bss entry from the node table

This may happen on RUN -> SCAN -> RUN -> SCAN state transition:

1. RUN -> SCAN: in ieee80211_sta_join1(): iv_bss will be moved to obss,
   refcnt will be reduced by 2 (default minimum).

Now, if old iv_bss have some extra references (for example, from
unacknowledged probe responses), it will not be freed and will stay
in the node table.

2. SCAN -> RUN.

3. If old iv_bss will not be deleted by the time when the next RUN -> SCAN
   state transition occurs, then sta_leave() will reduce it's reference
   counter once more. As a result, two last users will free it -> this will
   lead to kernel panic.

In this patch old iv_bss entry is explicitly removed from the node table in
ieee80211_sta_join1() (as a result, it will not be processed by sta_leave()).

PR: kern/199676
Differential Revision: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoAdd a few local variables to improve readability.
adrian [Sun, 3 May 2015 22:13:55 +0000 (22:13 +0000)]
Add a few local variables to improve readability.

PR: kern/197143
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoRemove this; it's currently a no-op.
adrian [Sun, 3 May 2015 22:10:28 +0000 (22:10 +0000)]
Remove this; it's currently a no-op.

History note: it's good to document what the driver expects like this even
if it's currently a no-op.

Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoRetry twice at the same rate.
adrian [Sun, 3 May 2015 20:56:33 +0000 (20:56 +0000)]
Retry twice at the same rate.

Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoImplement basic PxTFD.STS.BSY reporting.
mav [Sun, 3 May 2015 07:43:58 +0000 (07:43 +0000)]
Implement basic PxTFD.STS.BSY reporting.

MFC after: 2 weeks

9 years agoFix the vt(4) framebuffer driver on RPi 2.
loos [Sat, 2 May 2015 22:48:56 +0000 (22:48 +0000)]
Fix the vt(4) framebuffer driver on RPi 2.

Use the BCM2835_MBOX_CHAN_PROP mbox channel to setup the framebuffer,
remove DMA code (its now done in bcm2835_mbox.c).

Also adjust the color palette when bcm2708_fb.fbswap is set.  The
firmware used on RPi 2 uses this mode.

Tested on: RPi-B and RPi 2 with 16, 24 and 32bpp
Note: The 32bpp mode on RPi-B has the red and blue swapped, this
is a know problem (not a driver problem).

9 years agoFix the sc(4) framebuffer driver on RPi 2.
loos [Sat, 2 May 2015 22:40:41 +0000 (22:40 +0000)]
Fix the sc(4) framebuffer driver on RPi 2.

Use the BCM2835_MBOX_CHAN_PROP mbox channel to setup the framebuffer,
remove unused code and unnecessary includes.

Adjust the color palette when bcm2708_fb.fbswap is set on /chosen/bootargs
node of DTB.  The firmware used on RPi 2 uses this mode.

Tested on: RPi-B and RPi 2 with 16, 24 and 32bpp

9 years agoAdd the routines to query and setup the framebuffer state using the
loos [Sat, 2 May 2015 22:24:33 +0000 (22:24 +0000)]
Add the routines to query and setup the framebuffer state using the
BCM2835_MBOX_CHAN_PROP channel.  The old channel (BCM2835_MBOX_CHAN_FB)
seems deprecated on recent firmware versions and is causing a freeze on
RPi 2.

The actual changes in the framebuffer drivers will follow in subsequent
commits.

9 years agoFix the kernel ident for RPI2.
loos [Sat, 2 May 2015 20:41:49 +0000 (20:41 +0000)]
Fix the kernel ident for RPI2.

9 years agoAfter r281643 an #ifdef IFT_FOO preprocessor directive returns false,
glebius [Sat, 2 May 2015 20:37:40 +0000 (20:37 +0000)]
After r281643 an #ifdef IFT_FOO preprocessor directive returns false,
since types became a enum C type.  Some software uses such ifdefs to
determine whether an operating systems supports certain interface type.
Of course, such check is bogus. E.g. FreeBSD defines about 250 interface
types, but supports only around 20.
However, we need not upset such software so provide a set of defines. The
current set was taken to suffice the dhcpd.

Reported & tested by: Guy Yur <guyyur gmail.com>

9 years agoRemove #ifdef IFT_FOO.
glebius [Sat, 2 May 2015 20:31:27 +0000 (20:31 +0000)]
Remove #ifdef IFT_FOO.

Submitted by: Guy Yur <guyyur gmail.com>

9 years agoInstead of reading, validating and adjusting value of the vm.swap_async_max
glebius [Sat, 2 May 2015 20:27:37 +0000 (20:27 +0000)]
Instead of reading, validating and adjusting value of the vm.swap_async_max
in the main swapper work cycle, do it in the sysctl handler.  This removes
extra mutex acquisition from the main cycle and makes the sysctl knob return
error on an invalid value, instead of accepting and fixing it.

Reviewed by: kib
Sponsored by: Netflix
Sponsored by: Nginx, Inc.

9 years agoRemove an unused variable.
loos [Sat, 2 May 2015 20:14:43 +0000 (20:14 +0000)]
Remove an unused variable.

9 years agoDon't advertise the Intel SMX capability to the guest.
neel [Sat, 2 May 2015 19:07:49 +0000 (19:07 +0000)]
Don't advertise the Intel SMX capability to the guest.

Reported by: Leon Dang (ldang@nahannisys.com)
MFC after: 1 week

9 years agonv_malloc can fail in userland.
oshogbo [Sat, 2 May 2015 18:12:34 +0000 (18:12 +0000)]
nv_malloc can fail in userland.
Add check to prevent a NULL pointer dereference.

Pointed out by: mjg
Approved by: pjd (mentor)

9 years agoRemove duplicated code using macro template for the nvlist_add_.* functions.
oshogbo [Sat, 2 May 2015 18:10:45 +0000 (18:10 +0000)]
Remove duplicated code using macro template for the nvlist_add_.* functions.

Approved by: pjd (mentor)

9 years agoAdd test case for unpack with diffrent flags.
oshogbo [Sat, 2 May 2015 18:07:47 +0000 (18:07 +0000)]
Add test case for unpack with diffrent flags.

Approved by: pjd (mentor)

9 years agoIntroduce the NV_FLAG_NO_UNIQUE flag. When set, it allows to store
oshogbo [Sat, 2 May 2015 18:03:47 +0000 (18:03 +0000)]
Introduce the NV_FLAG_NO_UNIQUE flag. When set, it allows to store
multiple values using the same key in a nvlist.

Approved by: pjd (mentor)
Obtained from: WHEEL Systems (http://www.wheelsystems.com)

Update man page.

Reviewed by: AllanJude
Approved by: pjd (mentor)

9 years agoApproved, oprócz użycie RESTORE_ERRNO() do ustawiania errno.
oshogbo [Sat, 2 May 2015 17:45:52 +0000 (17:45 +0000)]
Approved, oprócz użycie RESTORE_ERRNO() do ustawiania errno.

Change the nvlist_recv() function to take additional argument that
specifies flags expected on the received nvlist. Receiving a nvlist with
different set of flags than the ones we expect might lead to undefined
behaviour, which might be potentially dangerous.

Update consumers of this and related functions and update the tests.

Approved by: pjd (mentor)

Update man page for nvlist_unpack, nvlist_recv, nvlist_xfer, cap_recv_nvlist
and cap_xfer_nvlist.

Reviewed by: AllanJude
Approved by: pjd (mentor)

9 years agoInitialize PxCMD on reset and make its read-only bits such.
mav [Sat, 2 May 2015 16:11:29 +0000 (16:11 +0000)]
Initialize PxCMD on reset and make its read-only bits such.

MFC after: 2 weeks

9 years agoHandle ATA_SEND_FPDMA_QUEUED as NCQ in ahci_port_stop().
mav [Sat, 2 May 2015 14:43:37 +0000 (14:43 +0000)]
Handle ATA_SEND_FPDMA_QUEUED as NCQ in ahci_port_stop().

MFC after: 1 week

9 years agoCapsicumize col(1)
bapt [Sat, 2 May 2015 12:22:24 +0000 (12:22 +0000)]
Capsicumize col(1)

9 years agoActually push the right tests
bapt [Sat, 2 May 2015 12:19:24 +0000 (12:19 +0000)]
Actually push the right tests

9 years agoAdd regression test about reverse line feed to col(1)
bapt [Sat, 2 May 2015 12:08:28 +0000 (12:08 +0000)]
Add regression test about reverse line feed to col(1)

9 years agoAdd regression tests for soelim(1)
bapt [Sat, 2 May 2015 11:09:58 +0000 (11:09 +0000)]
Add regression tests for soelim(1)

9 years agoFix an off-by-one bug in string/array handling which lead to memory overwrite
bz [Sat, 2 May 2015 08:31:16 +0000 (08:31 +0000)]
Fix an off-by-one bug in string/array handling which lead to memory overwrite
and follow-up assertion errors on at least ARM after r282257,
with nvp_magic being 0x6e7600:
Assertion failed: ((nvp)->nvp_magic == 0x6e7670), function nvpair_name, file .../subr_nvpair.c, line 713.

Sponsored by: DARPA/AFRL

9 years agoEmulate machine check related MSRs to allow guest OSes like Windows to boot.
neel [Sat, 2 May 2015 04:19:11 +0000 (04:19 +0000)]
Emulate machine check related MSRs to allow guest OSes like Windows to boot.

Reported by: Leon Dang (ldang@nahannisys.com)
MFC after: 2 weeks

9 years agoAdvertise an additional memory BAR in the "dummy" device emulation.
neel [Sat, 2 May 2015 03:25:24 +0000 (03:25 +0000)]
Advertise an additional memory BAR in the "dummy" device emulation.

This is useful for testing the MOVS emulation when both the source and
destination addresses are in the MMIO space.

MFC after: 1 week

9 years agoRemove support for being compiled under OABI. We don't support that
imp [Sat, 2 May 2015 03:01:03 +0000 (03:01 +0000)]
Remove support for being compiled under OABI. We don't support that
any more, so this is just dead code.

Differential Revision: https://reviews.freebsd.org/D2419

9 years agofork(2): Add a note to the effect that kqueue descriptors, unlike other
markj [Sat, 2 May 2015 00:29:27 +0000 (00:29 +0000)]
fork(2): Add a note to the effect that kqueue descriptors, unlike other
descriptor types, are not inherited from the parent process.

Reported by: kmacy
MFC after: 1 week

9 years agoRemove a stale reference to the stop_scheduler_on_panic tunable, which
markj [Sat, 2 May 2015 00:27:58 +0000 (00:27 +0000)]
Remove a stale reference to the stop_scheduler_on_panic tunable, which
itself was removed in r243515.

MFC after: 1 week

9 years agoDon't drop the idr lock before verifying that the newly-inserted element
markj [Sat, 2 May 2015 00:26:38 +0000 (00:26 +0000)]
Don't drop the idr lock before verifying that the newly-inserted element
is present in the tree. Otherwise there exists a window during which the
element could be removed by another thread, triggering an incorrect
assertion failure.

Reviewed by: jeff
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

9 years agoImprove compatibility groff's soelim
bapt [Fri, 1 May 2015 23:54:09 +0000 (23:54 +0000)]
Improve compatibility groff's soelim
While here implement -C from GNU groff

Reported by: delphij

9 years agoCorrect - handling.
delphij [Fri, 1 May 2015 22:43:26 +0000 (22:43 +0000)]
Correct - handling.

Reported by: pkg-fallout
X-MFC-with: r282318

9 years agoImport sqlite3 3.8.9
bapt [Fri, 1 May 2015 21:59:32 +0000 (21:59 +0000)]
Import sqlite3 3.8.9

9 years agoAdd a note about the replacement of GNU groff's soelim(1)
bapt [Fri, 1 May 2015 21:26:40 +0000 (21:26 +0000)]
Add a note about the replacement of GNU groff's soelim(1)

9 years agoNo need for result_use_check attribute in reallocf(3).
pfg [Fri, 1 May 2015 20:40:48 +0000 (20:40 +0000)]
No need for result_use_check attribute in reallocf(3).

9 years agoApply the copyright the the same owners as the original malloc(3) where most of
bapt [Fri, 1 May 2015 20:37:59 +0000 (20:37 +0000)]
Apply the copyright the the same owners as the original malloc(3) where most of
the text here comes from

Reported by: many
Discussed with: miod@OpenBSD.org
Pointyhat to: bapt

9 years agoFix the loader for sparc64.
andreast [Fri, 1 May 2015 20:35:09 +0000 (20:35 +0000)]
Fix the loader for sparc64.
The commit from r279799 missed the adaptation of md_load in
sparc64/loader/main.c. This resulted in Memory Address Align issues at the
early boot stage.

Tested on a netbooted Fire 120.

9 years agoBump _FreeBSD_version after reallocarray import
bapt [Fri, 1 May 2015 20:25:47 +0000 (20:25 +0000)]
Bump _FreeBSD_version after reallocarray import

Requested by: delphij

9 years agoReplace groff's soelim by soeliminate(1) renamed soelim(1)
bapt [Fri, 1 May 2015 20:08:25 +0000 (20:08 +0000)]
Replace groff's soelim by soeliminate(1) renamed soelim(1)

9 years agoMove reallocarray definition to the _BSD_VISIBLE block
bapt [Fri, 1 May 2015 19:14:32 +0000 (19:14 +0000)]
Move reallocarray definition to the _BSD_VISIBLE block
Add the required __alloc_size attributes

Requested by: pfg

9 years agolibc now has reallocarray
bapt [Fri, 1 May 2015 18:34:29 +0000 (18:34 +0000)]
libc now has reallocarray

9 years agoRemove bundled reallocarray(3) since it is now in libc
bapt [Fri, 1 May 2015 18:32:54 +0000 (18:32 +0000)]
Remove bundled reallocarray(3) since it is now in libc

9 years agoImport reallocarray(3) from OpenBSD
bapt [Fri, 1 May 2015 18:32:16 +0000 (18:32 +0000)]
Import reallocarray(3) from OpenBSD

Add a manpage for it, assign the copyright to the OpenBSD project on it since it
is mostly copy/paste from OpenBSD manpage.
style(9) fixes

Differential Revision: https://reviews.freebsd.org/D2420
Reviewed by: kib

9 years agoAdd nvlist_flags() function, which returns nvlist's public flags.
oshogbo [Fri, 1 May 2015 17:50:24 +0000 (17:50 +0000)]
Add nvlist_flags() function, which returns nvlist's public flags.

Approved by: pjd (mentor)