]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoIn the pthread_once(), if the initializer has already run, then the
kib [Tue, 8 Sep 2015 08:41:07 +0000 (08:41 +0000)]
In the pthread_once(), if the initializer has already run, then the
calling thread is supposed to see accesses issued by the initializer.
This means that the read of the once_control->state variable should
have an acquire semantic.  Use atomic_thread_fence_acq() when the
value read is ONCE_DONE, instead of straightforward atomic_load_acq(),
to only put a barrier when needed (*).

On the other hand, the updates of the once_control->state with the
intermediate progress state do not need to synchronize with other
state accesses, remove _acq suffix.

Reviewed by: alc (previous version)
Suggested by: alc (*)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoEnable TSF timer in monitor mode.
kevlo [Tue, 8 Sep 2015 08:06:20 +0000 (08:06 +0000)]
Enable TSF timer in monitor mode.

Tested on RT5370, sta mode.
Submitted by: Andriy Voskoboinyk <s3erios at gmail com>
Differential Revision: https://reviews.freebsd.org/D3591

8 years agoAdd TSF field into TX/RX radiotap headers
kevlo [Tue, 8 Sep 2015 08:02:14 +0000 (08:02 +0000)]
Add TSF field into TX/RX radiotap headers

Tested on RT5370, sta mode.
Submitted by: Andriy Voskoboinyk <s3erios at gmail com>
Differential Revision: https://reviews.freebsd.org/D3590

8 years agoFix comparison in run_key_set_cb().
kevlo [Tue, 8 Sep 2015 07:53:10 +0000 (07:53 +0000)]
Fix comparison in run_key_set_cb().

Tested on RT5370, sta mode.

Submitted by: Andriy Voskoboinyk <s3erios at gmail com>
Differential Revision: https://reviews.freebsd.org/D3589

8 years ago- Remove empty key_update_* functions.
kevlo [Tue, 8 Sep 2015 07:50:35 +0000 (07:50 +0000)]
- Remove empty key_update_* functions.
- Hide "struct ieee80211_node *" -> "struct run_node *" casting behind
  RUN_NODE() macro.
- Simplify IEEE80211_HAS_ADDR4 macro definition
- Fix a comment (desn't -> doesn't)

Submitted by: Andriy Voskoboinyk <s3erios at gmail com>
Differential Revision: https://reviews.freebsd.org/D3588

8 years agoTo simplify upcoming changes to the inactive queue scan, change the code
alc [Tue, 8 Sep 2015 04:18:57 +0000 (04:18 +0000)]
To simplify upcoming changes to the inactive queue scan, change the code
so that there is only one place where pages are freed and only one place
where pages are moved to the tail of the queue.

Reviewed by: kib
Sponsored by: EMC / Isilon Storage Division

8 years agoUpdate DTrace nfs scripts to track the proper provider names.
gnn [Tue, 8 Sep 2015 00:30:10 +0000 (00:30 +0000)]
Update DTrace nfs scripts to track the proper provider names.

Submitted by: Alex Burlyga

8 years agoDon't call enable_all_rings if the adapter has been freed.
adrian [Mon, 7 Sep 2015 23:16:39 +0000 (23:16 +0000)]
Don't call enable_all_rings if the adapter has been freed.

This is a subtle use-after-free race that results in some very undesirable
hang behaviour.

Reviewed by: pkelsey
Obtained from: Kip Macy, NextBSD (https://github.com/NextBSD/NextBSD/commit/91a9bd1dbb33dafb41684d054e59d73976de9654)

8 years agoFix off-by-one bugs.
loos [Mon, 7 Sep 2015 21:59:11 +0000 (21:59 +0000)]
Fix off-by-one bugs.

While here, only set the GPIO pin state for output pins.

Pointy hat to: loos
Sponsored by: Rubicon Communications (Netgate)

8 years agoIn libz's inflateMark(), avoid left-shifting a negative integer, which
dim [Mon, 7 Sep 2015 20:55:14 +0000 (20:55 +0000)]
In libz's inflateMark(), avoid left-shifting a negative integer, which
is undefined.

Reviewed by: delphij
Differential Revision: https://reviews.freebsd.org/D3344
MFC after: 3 days

8 years agofd: make rights a mandatory argument to fgetvp_rights
mjg [Mon, 7 Sep 2015 20:05:56 +0000 (20:05 +0000)]
fd: make rights a mandatory argument to fgetvp_rights

The only caller already always passes rights.

8 years agofd: make the common case in filecaps_copy work lockless
mjg [Mon, 7 Sep 2015 20:02:56 +0000 (20:02 +0000)]
fd: make the common case in filecaps_copy work lockless

The filedesc lock is only needed if ioctls caps are present, which is a
rare situation. This is a step towards reducing the scope of the filedesc
lock.

8 years agoAs expected, things aren't as simple as hoped. Consequently, we have
marcel [Mon, 7 Sep 2015 17:56:49 +0000 (17:56 +0000)]
As expected, things aren't as simple as hoped. Consequently, we have
no option but to use the smbios information to fill in the blanks.
It's a good thing UGA is a protocol of the past and GOP has all the
info we need.

Anyway, the logic has been tweaked a little to get the easier bits
of information up front. This includes the resolution and the frame
buffer address. Then we look at the smbios information and define
expected values as well as the missing bits (frame buffer offset and
stride). If the values obtained match the expect values, we fill in
the blanks and return. Otherwise we use the existing detection logic
to figure it out.

Rename the environment variables from uga_framebuffer abd uga_stride
to hw.efifb.address and hw.efifb.stride. The latter names are more
in line with other variable names.

We currently have hardcoded settings for:
1.  Mid-2007 iMac (iMac7,1)
2.  Late-2007 MacBook (MacBook3,1)

8 years agoFollow-up to r287442: Move sysctl to compiled-once file
cem [Mon, 7 Sep 2015 16:44:28 +0000 (16:44 +0000)]
Follow-up to r287442: Move sysctl to compiled-once file

Avoid duplicate sysctl nodes.

Found by: tijl
Approved by: markj (mentor)
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D3586

8 years agoUse load-acquire semantics while waiting for td_lock to be released. The
andrew [Mon, 7 Sep 2015 14:01:18 +0000 (14:01 +0000)]
Use load-acquire semantics while waiting for td_lock to be released. The
store should have release semantics and will have due to the dsb above it
so add a comment to explain this. [1]

While here update the code to not reload the current thread, it's already
in a register, we just need to not trash it.

Suggested by: kib [1]
Sponsored by: ABT Systems Ltd

8 years agoRFC 4960 requires that packets containing an INIT chunk bundled with
tuexen [Mon, 7 Sep 2015 14:00:38 +0000 (14:00 +0000)]
RFC 4960 requires that packets containing an INIT chunk bundled with
another chunk are silently discarded. Do so, instead of sending an
ABORT.

MFC after: 1 week

8 years agoAdd two new portal group options "tag" and "foreign".
mav [Mon, 7 Sep 2015 13:43:05 +0000 (13:43 +0000)]
Add two new portal group options "tag" and "foreign".

They are going to be useful in clustered setups.

8 years agoWhen dropping to EL1 ensure we have written to all special registers by
andrew [Mon, 7 Sep 2015 10:13:14 +0000 (10:13 +0000)]
When dropping to EL1 ensure we have written to all special registers by
moving the instruction barrier to just before we drop exception level.

Sponsored by: ABT Systems Ltd

8 years agomissed file that should have been included in r287528
allanjude [Mon, 7 Sep 2015 02:00:05 +0000 (02:00 +0000)]
missed file that should have been included in r287528

PR: 184110
Submitted by: Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Approved by: wblock (mentor)

8 years agoDocument the sctp blackhole sysctl MIB
allanjude [Mon, 7 Sep 2015 01:21:56 +0000 (01:21 +0000)]
Document the sctp blackhole sysctl MIB

PR: 184110
Submitted by: Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Reviewed by: wblock
Approved by: wblock (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3528

8 years agoAdd support for receiving flowtype, flowid and RSS bucket information as part of...
adrian [Sun, 6 Sep 2015 20:57:57 +0000 (20:57 +0000)]
Add support for receiving flowtype, flowid and RSS bucket information as part of recvmsg().

Submitted by: Tiwei Bie <btw@mail.ustc.edu.cn>
Differential Revision: https://reviews.freebsd.org/D3562

8 years agoReplace rss_m2cpuid with rss_soft_m2cpuid_v4 for ip_direct_nh.nh_m2cpuid,
adrian [Sun, 6 Sep 2015 20:20:48 +0000 (20:20 +0000)]
Replace rss_m2cpuid with rss_soft_m2cpuid_v4 for ip_direct_nh.nh_m2cpuid,
because the RSS hash may need to be recalculated.

Submitted by: Tiwei Bie <btw@mail.ustc.edu.cn>
Differential Revision: https://reviews.freebsd.org/D3564

8 years agoRemove last traces of USEPRIVATELIB
bapt [Sun, 6 Sep 2015 20:17:14 +0000 (20:17 +0000)]
Remove last traces of USEPRIVATELIB

8 years agoPrefer pciids database from ports if present
bapt [Sun, 6 Sep 2015 20:05:29 +0000 (20:05 +0000)]
Prefer pciids database from ports if present

Given the pciids database on ports is updated more often than the one in base
prefer this version if present, otherwise read the one from base.

MFC after: 1 week
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D3391

8 years agoParallelize the usr.sbin/ntp subdirectory build
ngie [Sun, 6 Sep 2015 18:58:33 +0000 (18:58 +0000)]
Parallelize the usr.sbin/ntp subdirectory build

Articulate all needed dependencies for the subdirectories

MFC after: 1 week

8 years agoFix inverted output re: stack protection no-execute flag in procstat(1)
allanjude [Sun, 6 Sep 2015 17:47:03 +0000 (17:47 +0000)]
Fix inverted output re: stack protection no-execute flag in procstat(1)

PR: 196110
Submitted by: Joerg Pernfuss <code.jpe@gmail.com>
Approved by: bapt (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D3576

8 years agoUpdate lldb's FREEBSD-Xlist to match reality.
dim [Sun, 6 Sep 2015 11:48:50 +0000 (11:48 +0000)]
Update lldb's FREEBSD-Xlist to match reality.

8 years agoAllow LUN options modification via CTL_LUNREQ_MODIFY.
mav [Sun, 6 Sep 2015 11:23:01 +0000 (11:23 +0000)]
Allow LUN options modification via CTL_LUNREQ_MODIFY.

Not all changes take effect, but that is a different question.

8 years agoMove setting of media parameters inside open routines.
mav [Sun, 6 Sep 2015 09:54:56 +0000 (09:54 +0000)]
Move setting of media parameters inside open routines.

This is preparation for possibility to open/close media several times
per LUN life cycle.  While there, rename variables to reduce confusion.
As additional bonus this allows to open read-only media, such as ZFS
snapshots.

8 years agoTrack changes to kern.maxvnodes and appropriately increase or decrease
mckusick [Sun, 6 Sep 2015 05:50:51 +0000 (05:50 +0000)]
Track changes to kern.maxvnodes and appropriately increase or decrease
the size of the name cache hash table (mapping file names to vnodes)
and the vnode hash table (mapping mount point and inode number to vnode).
An appropriate locking strategy is the key to changing hash table sizes
while they are in active use.

Reviewed by: kib
Tested by:   Peter Holm
Differential Revision: https://reviews.freebsd.org/D2265
MFC after:   2 weeks

8 years agoReduce diff with linux 3.8.13 on i915 headers
bapt [Sat, 5 Sep 2015 23:22:59 +0000 (23:22 +0000)]
Reduce diff with linux 3.8.13 on i915 headers

8 years agoYet another fix for gcc 4.2
bapt [Sat, 5 Sep 2015 22:33:40 +0000 (22:33 +0000)]
Yet another fix for gcc 4.2

8 years agoRemove extra i++
bapt [Sat, 5 Sep 2015 21:55:01 +0000 (21:55 +0000)]
Remove extra i++

Reported by: allanjude@

8 years agoRevert last two commits to em(4)/igb(4). Reports are coming in that
sbruno [Sat, 5 Sep 2015 21:12:19 +0000 (21:12 +0000)]
Revert last two commits to em(4)/igb(4).  Reports are coming in that
this breaks initialization and reads from EEPROM on boot/driver load.

r287469 is being reverted as a dependancy on r287467

8 years agoFix build error on gcc platforms
allanjude [Sat, 5 Sep 2015 19:28:41 +0000 (19:28 +0000)]
Fix build error on gcc platforms

Approved by: bapt (mentor)

8 years agoAuto-detect the UGA frame buffer and stride on a MacBook. We're
marcel [Sat, 5 Sep 2015 18:24:51 +0000 (18:24 +0000)]
Auto-detect the UGA frame buffer and stride on a MacBook. We're
striking a delicate balance between exhaustive searching and
banking on assumptions. The environment variables can be used
as a fall-back anyway. With this change, all known and tested
Macs with only UGA should have a working console out of the
box... for now...

8 years agoEliminate pointless requeueing of pages from terminated objects. These
alc [Sat, 5 Sep 2015 17:34:49 +0000 (17:34 +0000)]
Eliminate pointless requeueing of pages from terminated objects.  These
pages will have left the inactive queue before the page daemon performs
its next scan.  Also, ignore references to pages from terminated objects.
This allows the clean pages to be freed a little sooner.

Move some comments to their proper place, i.e., next to the code that
they describe, and update other nearby comments.

Reviewed by: kib
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd ddb show commands to print the special registers and to ask the
andrew [Sat, 5 Sep 2015 17:29:07 +0000 (17:29 +0000)]
Add ddb show commands to print the special registers and to ask the
hardware to perform address translation for us. These are useful to help
track down what caused us to enter the debugger.

Sponsored by: ABT Systems Ltd

8 years agoIntroduce libxo to procstat(1)
allanjude [Sat, 5 Sep 2015 17:02:01 +0000 (17:02 +0000)]
Introduce libxo to procstat(1)

Reviewed by: rodrigc, bapt
Approved by: marcel (mentor)
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D2446

8 years agoFix build with gcc 4.2
bapt [Sat, 5 Sep 2015 16:59:30 +0000 (16:59 +0000)]
Fix build with gcc 4.2

Reported by: kib

8 years agoDo not pass lle to nd6_ns_output(). Use newly-added
melifaro [Sat, 5 Sep 2015 14:14:03 +0000 (14:14 +0000)]
Do not pass lle to nd6_ns_output().  Use newly-added
  nd6_llinfo_get_holdsrc() to extract desired IPv6 source
  from holdchain and pass it to the nd6_ns_output().

8 years agoDo not consume extra reference. This is a bug in r287479.
kib [Sat, 5 Sep 2015 12:28:18 +0000 (12:28 +0000)]
Do not consume extra reference.  This is a bug in r287479.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoCross reference sesutil(8) and ses(4)
bapt [Sat, 5 Sep 2015 10:29:47 +0000 (10:29 +0000)]
Cross reference sesutil(8) and ses(4)

Submitted by: trasz
MFC after: 1 month (with r287473)

8 years agoUse Jenkins hash for TCP syncache.
glebius [Sat, 5 Sep 2015 10:15:19 +0000 (10:15 +0000)]
Use Jenkins hash for TCP syncache.

o Unlike xor, in Jenkins hash every bit of input affects virtually
  every bit of output, thus salting the hash actually works. With
  xor salting only provides a false sense of security, since if
  hash(x) collides with hash(y), then of course, hash(x) ^ salt
  would also collide with hash(y) ^ salt. [1]
o Jenkins provides much better distribution than xor, very close to
  ideal.

TCP connection setup/teardown benchmark has shown a 10% increase
with default hash size, and with bigger hashes that still provide
possibility for collisions. With enormous hash size, when dataset is
by an order of magnitude smaller than hash size, the benchmark has
shown 4% decrease in performance decrease, which is expected and
acceptable.

Noticed by: Jeffrey Knockel <jeffk cs.unm.edu> [1]
Benchmarks by: jch
Reviewed by: jch, pkelsey, delphij
Security: strengthens protection against hash collision DoS
Sponsored by: Nginx, Inc.

8 years agoDeclare the writes around the call to VFS_SYNC() in
kib [Sat, 5 Sep 2015 08:48:24 +0000 (08:48 +0000)]
Declare the writes around the call to VFS_SYNC() in
softdep_ast_cleanup_proc().

Tested by: pho (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoDo not skip entries without LLE_VALID flag.
melifaro [Sat, 5 Sep 2015 06:24:00 +0000 (06:24 +0000)]
Do not skip entries without LLE_VALID flag.
This one fixes showing incomplete entries in ndp -an.

MFC after: 2 weeks

8 years agoMake in6ifa_ifpwithaddr() take const param.
melifaro [Sat, 5 Sep 2015 05:54:09 +0000 (05:54 +0000)]
Make in6ifa_ifpwithaddr() take const param.
Remove unneded DECONST from in6_lltable_rtcheck().

8 years agoConstantify lookup key in ifa_ifwith* functions.
melifaro [Sat, 5 Sep 2015 05:33:20 +0000 (05:33 +0000)]
Constantify lookup key in ifa_ifwith* functions.
Some places in our network stack already have const
arguments (like if_output() routines and LLE functions).

Code using ifa_ifwith (and similar functins) along with
LLE/_output functions is currently bound to use tricks
like __DECONST(). Provide a cleaner way by making sockaddr
lookup key really constant.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D3464

8 years agoMy MacBook has UGA only, but we fail to detect any changes
marcel [Sat, 5 Sep 2015 03:27:23 +0000 (03:27 +0000)]
My MacBook has UGA only, but we fail to detect any changes
in the frame buffer when we flip pixels. Allow the detection
to be bypassed by setting the uga_framebuffer and uga_stride
variables. The kernel console works fine even when we can't
detect pixel changes in the frame buffer, which indicates
that the problem could be with reading from the frame buffer
and not writing to it.

8 years agojhg -> jgh
feld [Sat, 5 Sep 2015 01:00:02 +0000 (01:00 +0000)]
jhg -> jgh

Submitted by: junovitch
Approved by: delphij (implicit)

8 years agoAdd a new sesutil(8) utility
bapt [Sat, 5 Sep 2015 00:06:01 +0000 (00:06 +0000)]
Add a new sesutil(8) utility

This is an utility for managing SCSI Enclosure Services (SES) device.

For now only one command is supported "locate" which will change the test of the
external LED associated to a given disk.

Usage if the following:
sesutil locate disk [on|off]

Disk can be a device name: "da12" or a special keyword: "all".

Reviewed by: mav
MFC after: 1 month
Relnotes: yes
Sponsored by: gandi.net
Differential Revision: https://reviews.freebsd.org/D3544

8 years agoUpdate ports-secteam roster
feld [Fri, 4 Sep 2015 20:15:20 +0000 (20:15 +0000)]
Update ports-secteam roster

Approved by: delphij

8 years agoRemove rge driver from Broadcom XLR
sbruno [Fri, 4 Sep 2015 19:57:28 +0000 (19:57 +0000)]
Remove rge driver from Broadcom XLR

nlge(4) is supposed to deprecate rge(4) for Broadcom XLR when it was
introduced 5 years ago.

rge doesn't build on -CURRENT due to MII changes. All the XLR kernel confs
use nlge. Let's get rid of the old driver for FreeBSD 11. We can use
10-STABLE or SVN to go back and look at the old driver if needed.

Differential Revision: https://reviews.freebsd.org/D3339
Submitted by: kevin.bowling@kev009.com

8 years agoAdd more BCM gigabit PHYs
sbruno [Fri, 4 Sep 2015 17:48:19 +0000 (17:48 +0000)]
Add more BCM gigabit PHYs

Gleaned from a public header file. 5402 and 5404 look like they may be
used on embedded devices. 5478 and 5488 are switch PHYs. 5754 change is just
to note a product alias.

Differential Revision: https://reviews.freebsd.org/D3338
Submitted by: kevin.bowling@kev009.com

8 years agoem(4): Add Skylake/I219 support.
sbruno [Fri, 4 Sep 2015 17:21:55 +0000 (17:21 +0000)]
em(4): Add Skylake/I219 support.
- driver rev 7.5.2
- use new functions em_flush* for i219 devices

Differential Revision: https://reviews.freebsd.org/D3163
Submitted by: erj jfv
Reviewed by: jfv
MFC after: 1 month
Relnotes: Yes
Sponsored by: Intel Corporation

8 years agoTurn on RAWDCF by default.
cy [Fri, 4 Sep 2015 16:59:01 +0000 (16:59 +0000)]
Turn on RAWDCF by default.

Suggested by: ian
Approved by: roberto
MFC after: 1 week

8 years agoe1000: Shared code updates
sbruno [Fri, 4 Sep 2015 16:30:48 +0000 (16:30 +0000)]
e1000: Shared code updates
-    Fix compiler warning in 80003es2lan.c
-    Add return value handler for e1000_*_kmrn_reg_80003es2lan
-    Fix usage of DEBUGOUT
-    Remove unnecessary variable initializations.
-    Removed unused variables (complaints from gcc).
-    Edit defines in 82571.h.
-    Add workaround for igb hw errata.
-    Shared code changes for Skylake/I219 support.
-    Remove unused OBFF and LTR functions.

Differential Revision: https://reviews.freebsd.org/D3162
Submitted by: erj
MFC after: 1 month
Sponsored by: Intel Corporation

8 years agoRemove remnant from USEPRIVATELIB removal
bapt [Fri, 4 Sep 2015 16:13:25 +0000 (16:13 +0000)]
Remove remnant from USEPRIVATELIB removal

Sponsored by: gandi.net

8 years agoigb(4): Update and fix HW errata
sbruno [Fri, 4 Sep 2015 16:07:27 +0000 (16:07 +0000)]
igb(4): Update and fix HW errata
- HW errata workaround for IPv6 offload w/ extension headers
- Edited start of if_igb.c (Device IDs / #includes) to match ixgbe/ixl

Differential Revision: https://reviews.freebsd.org/D3165
Submitted by: erj
MFC after: 1 month
Sponsored by: Intel Corporation

8 years agoMake tcp_mtudisc() static and void. No functional changes.
glebius [Fri, 4 Sep 2015 12:02:12 +0000 (12:02 +0000)]
Make tcp_mtudisc() static and void. No functional changes.

Sponsored by: Nginx, Inc.

8 years agoAnother addition to r287455.
mav [Fri, 4 Sep 2015 10:16:21 +0000 (10:16 +0000)]
Another addition to r287455.

8 years agoAddition to r287455.
mav [Fri, 4 Sep 2015 10:14:58 +0000 (10:14 +0000)]
Addition to r287455.

8 years agoDon't leak memory in an error case.
tuexen [Fri, 4 Sep 2015 09:24:07 +0000 (09:24 +0000)]
Don't leak memory in an error case.

MFC after: 1 week

8 years agoAdd a NULL pointer check to silence the clang code analyzer.
tuexen [Fri, 4 Sep 2015 09:22:16 +0000 (09:22 +0000)]
Add a NULL pointer check to silence the clang code analyzer.

MFC after: 1 week

8 years agoRemove some dead code.
mav [Fri, 4 Sep 2015 09:19:01 +0000 (09:19 +0000)]
Remove some dead code.

8 years agoFix build.
delphij [Fri, 4 Sep 2015 08:04:12 +0000 (08:04 +0000)]
Fix build.

8 years agoMFV r287451 + 287452: file 5.24 + fix for bin/181436.
delphij [Fri, 4 Sep 2015 05:56:14 +0000 (05:56 +0000)]
MFV r287451 + 287452: file 5.24 + fix for bin/181436.

PR: 181436
MFC after: 2 weeks

8 years agoAdd more mmap tests related to character devices.
jhb [Fri, 4 Sep 2015 01:02:21 +0000 (01:02 +0000)]
Add more mmap tests related to character devices.
- Add cdev-related tests for bad args.
- Add two simple tests cases for mapping /dev/zero that test for
  MAP_ANON-like behavior.

Reviewed by: alc, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3323

8 years agoExpose an interface to determine if an ACE is inherited.
delphij [Fri, 4 Sep 2015 00:14:20 +0000 (00:14 +0000)]
Expose an interface to determine if an ACE is inherited.

Submitted by: sef
Reviewed by: trasz
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D3540

8 years agoFix a bug where two SHUTDOWN_ACK chunks were sent if a SHUTDOWN chunk was
tuexen [Thu, 3 Sep 2015 22:15:56 +0000 (22:15 +0000)]
Fix a bug where two SHUTDOWN_ACK chunks were sent if a SHUTDOWN chunk was
received acking all outstanding data.

8 years agoDetect badly behaved coredump note helpers
cem [Thu, 3 Sep 2015 20:32:10 +0000 (20:32 +0000)]
Detect badly behaved coredump note helpers

Coredump notes depend on being able to invoke dump routines twice; once
in a dry-run mode to get the size of the note, and another to actually
emit the note to the corefile.

When a note helper emits a different length section the second time
around than the length it requested the first time, the kernel produces
a corrupt coredump.

NT_PROCSTAT_FILES output length, when packing kinfo structs, is tied to
the length of filenames corresponding to vnodes in the process' fd table
via vn_fullpath.  As vnodes may move around during dump, this is racy.

So:

 - Detect badly behaved notes in putnote() and pad underfilled notes.

 - Add a fail point, debug.fail_point.fill_kinfo_vnode__random_path to
   exercise the NT_PROCSTAT_FILES corruption.  It simply picks random
   lengths to expand or truncate paths to in fo_fill_kinfo_vnode().

 - Add a sysctl, kern.coredump_pack_fileinfo, to allow users to
   disable kinfo packing for PROCSTAT_FILES notes.  This should avoid
   both FILES note corruption and truncation, even if filenames change,
   at the cost of about 1 kiB in padding bloat per open fd.  Document
   the new sysctl in core.5.

 - Fix note_procstat_files to self-limit in the 2nd pass.  Since
   sometimes this will result in a short write, pad up to our advertised
   size.  This addresses note corruption, at the risk of sometimes
   truncating the last several fd info entries.

 - Fix NT_PROCSTAT_FILES consumers libutil and libprocstat to grok the
   zero padding.

With suggestions from: bjk, jhb, kib, wblock
Approved by: markj (mentor)
Relnotes: yes
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D3548

8 years agoCurrently the Linux character device mmap handling only supports mmap
jhb [Thu, 3 Sep 2015 18:27:39 +0000 (18:27 +0000)]
Currently the Linux character device mmap handling only supports mmap
operations that map a single page that has an associated vm_page_t.
This does not permit mapping larger regions (such as a PCI memory
BAR) and it does not permit mapping addresses beyond the top of RAM
(such as a 64-bit BAR located above the top of RAM).

Instead of using a single OBJT_DEVICE object and passing the physaddr via
the offset as a hack, create a new sglist and OBJT_SG object for each
mmap request. The requested memory attribute is applied to the object
thus affecting all pages mapped by the request.

Reviewed by: hselasky, np
MFC after: 1 week
Sponsored by: Chelsio
Differential Revision: https://reviews.freebsd.org/D3386

8 years agor249170 was just plain wrong. The effect of the change is to always
sbruno [Thu, 3 Sep 2015 17:46:57 +0000 (17:46 +0000)]
r249170 was just plain wrong.  The effect of the change is to always
delete a logic volume on status change which is NOT what we want here.

The original code is correct in that when the volume changes status
the driver will only delete the volume if the status is one of the
fatal errors.  A drive failure in a mirrored volume is NOT a situtation
where the volume should dissapear.

Reported on freebsd-scsi@:
https://lists.freebsd.org/pipermail/freebsd-scsi/2015-September/006800.html

MFC after: 3 days

8 years agoAvoid sub-shell for realpath(1) for bmake by using its built-in :tA.
bdrewery [Thu, 3 Sep 2015 17:01:58 +0000 (17:01 +0000)]
Avoid sub-shell for realpath(1) for bmake by using its built-in :tA.

MFC after: 2 weeks
Approved by: portmgr (implicit)

8 years agoSmall UA cleanup.
mav [Thu, 3 Sep 2015 12:56:57 +0000 (12:56 +0000)]
Small UA cleanup.

8 years agoFix copy-paste bug introduced in r275458.
mav [Thu, 3 Sep 2015 12:15:14 +0000 (12:15 +0000)]
Fix copy-paste bug introduced in r275458.

MFC after: 3 days

8 years agoUse proper term in the ctld(8) and iscsid(8) man pages.
trasz [Thu, 3 Sep 2015 11:43:56 +0000 (11:43 +0000)]
Use proper term in the ctld(8) and iscsid(8) man pages.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoSimplify the introductory example in ctl.conf(5) down to absolute
trasz [Thu, 3 Sep 2015 11:42:59 +0000 (11:42 +0000)]
Simplify the introductory example in ctl.conf(5) down to absolute
basics.  The more complicated cases - like how to use physical
ports - are explained later, in the "EXAMPLES" section.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoThe dumpfs(8) utility doesn't actually use disktab(5); remove it
trasz [Thu, 3 Sep 2015 11:40:47 +0000 (11:40 +0000)]
The dumpfs(8) utility doesn't actually use disktab(5); remove it
from "SEE ALSO".

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoFix acl_strip_np(3) breakage introduced in r279962.
trasz [Thu, 3 Sep 2015 11:31:34 +0000 (11:31 +0000)]
Fix acl_strip_np(3) breakage introduced in r279962.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoFix the way acl_init(3) uses posix_memalign(3) - the latter doesn't
trasz [Thu, 3 Sep 2015 11:30:39 +0000 (11:30 +0000)]
Fix the way acl_init(3) uses posix_memalign(3) - the latter doesn't
set errno.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoRename YP to NIS in the manpages.
araujo [Thu, 3 Sep 2015 07:18:52 +0000 (07:18 +0000)]
Rename YP to NIS in the manpages.

Approved by: bapt (mentor)
Differential Revision: D3555

8 years agoSync with the latest code from OpenBSD.
araujo [Thu, 3 Sep 2015 07:12:40 +0000 (07:12 +0000)]
Sync with the latest code from OpenBSD.

Approved by: rodrigc (mentor)
Differential Revision: D3550

8 years agoLower the compiler warning: unused-but-set-variable.
araujo [Thu, 3 Sep 2015 06:53:17 +0000 (06:53 +0000)]
Lower the compiler warning: unused-but-set-variable.

Approved by: bapt (mentor)
Differential Revision: D3556

8 years agoFor UGA, the frame buffer address obtained by scanning the
marcel [Thu, 3 Sep 2015 04:35:17 +0000 (04:35 +0000)]
For UGA, the frame buffer address obtained by scanning the
PCI BARs does not necessarily correspond to the upper-left
most pixel. Scan the frame buffer for which byte changed
when changing the pixel at (0,0).

Use the same technique to determine the stride. Except for
changing the pixel at (0,0), we change the pixel at (0,1).

PR: 202730
Tested by: hartzell (at) alerce.com

8 years agoFix mandoc(1) "WARNING: end of line whitespace"
dteske [Thu, 3 Sep 2015 03:58:59 +0000 (03:58 +0000)]
Fix mandoc(1) "WARNING: end of line whitespace"

MFC after: 3 days
X-MFC-to: stable/10

8 years agoRemove non-functional examples.
dteske [Thu, 3 Sep 2015 03:29:44 +0000 (03:29 +0000)]
Remove non-functional examples.

MFC after: 3 days
X-MFC-to: stable/10

8 years agoEnable both i2c1 and i2c2. These devices are disabled in TI's DTS
gonzo [Thu, 3 Sep 2015 02:28:18 +0000 (02:28 +0000)]
Enable both i2c1 and i2c2. These devices are disabled in TI's DTS
so they were disabled during DTS transition. Though there are
no standard devices/drivers on them people might use iic(4) userland
interface to access these buses.

8 years agopmap_mapdev_attr() also takes a vm_paddr_t.
jhibbits [Thu, 3 Sep 2015 01:38:15 +0000 (01:38 +0000)]
pmap_mapdev_attr() also takes a vm_paddr_t.

This was missed in r235936.  With recent work for 36-bit paddr, this is now
needed.

8 years agoDon't leak 'var'.
delphij [Thu, 3 Sep 2015 01:15:23 +0000 (01:15 +0000)]
Don't leak 'var'.

Reported by: clang static analyzer

8 years agofd: remove UMA_ZONE_ZINIT argument from Files zone
mjg [Wed, 2 Sep 2015 23:14:39 +0000 (23:14 +0000)]
fd: remove UMA_ZONE_ZINIT argument from Files zone

Originally it was added in order to prevent trashing of objects with
INVARIANTS enabled. The same effect is now provided with mere UMA_ZONE_NOFREE.

This reverts r286921.

Discussed with: kib

8 years agoDon't trash memory from UMA_ZONE_NOFREE zones.
mjg [Wed, 2 Sep 2015 23:09:01 +0000 (23:09 +0000)]
Don't trash memory from UMA_ZONE_NOFREE zones.

Objects obtained from such zones are supposed to retain type stability,
which was violated by aforementioned trashing.

This is a follow-up to r284861.

Discussed with: kib

8 years agoioat(4): pci_save/restore_state to persist MSI-X registers over BDXDE reset
cem [Wed, 2 Sep 2015 22:48:41 +0000 (22:48 +0000)]
ioat(4): pci_save/restore_state to persist MSI-X registers over BDXDE reset

Also for BWD devices, per jimharris@.

Reviewed by: jhb
Approved by: markj (mentor)
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D3552

8 years agoMinor code cleanups (no functional changes).
dteske [Wed, 2 Sep 2015 21:53:48 +0000 (21:53 +0000)]
Minor code cleanups (no functional changes).

MFC after: 3 days
X-MFC-to: stable/10

8 years agosh: Allow empty << EOF markers.
jilles [Wed, 2 Sep 2015 19:49:55 +0000 (19:49 +0000)]
sh: Allow empty << EOF markers.

8 years agoSimplify kvm symbol resolution and error handling. The symbol table
hrs [Wed, 2 Sep 2015 18:51:36 +0000 (18:51 +0000)]
Simplify kvm symbol resolution and error handling.  The symbol table
nl_symbols will eventually be organized into several modules depending
on MK_* variables.

8 years agoDivide statistics in the number of packets with 1000 instead of 1024
hrs [Wed, 2 Sep 2015 18:42:35 +0000 (18:42 +0000)]
Divide statistics in the number of packets with 1000 instead of 1024
in human-readable form.

PR: 183598

8 years agoAfter the introduction of direct dispatch, the pacing code in g_down()
imp [Wed, 2 Sep 2015 17:29:30 +0000 (17:29 +0000)]
After the introduction of direct dispatch, the pacing code in g_down()
broke in two ways. One, the pacing variable was accessed in multiple
threads in an unsafe way. Two, since large numbers of I/O could come
down from the buf layer at one time, large numbers of allocation
failures could happen all at once, resulting in a huge pace value that
would limit I/Os to 10 IOPS for minutes (or even hours) at a
time. While a real solution to these problems requires substantial
work (to go to a no-allocation after the first model, or to have some
way to wait for more memory with some kind of reserve for pager and
swapper requests), it is relatively easy to make this simplistic
pacing less pathological.

Move to using a volatile variable with loads and stores. While this is
a little racy, losing the race is safe: either you get memory and
proceed, or you don't and queue. Second, sleep for 1ms (or one tick, whichever
is larger) instead of 100ms. This removes the artificial 10 IOPS limit
while still easing up on new I/Os during memory shortages. Remove
tying the amount of time we do this to the number of failed requests
and do it only as long as we keep failing requests.

Finally, to avoid needless recursion when memory is tight (start ->
g_io_deliver() -> g_io_request() -> start -> ... until we use 1/2 the
stack), don't do direct dispatch while pacing. This should be a rare
event (not steady state) so the performance hit here is worth the
extra safety of not starving g_down() with directly dispatched I/O.

Differential Review: https://reviews.freebsd.org/D3546

8 years ago- snprintf() returns at most size-1 of the chars printed into
hrs [Wed, 2 Sep 2015 16:50:49 +0000 (16:50 +0000)]
- snprintf() returns at most size-1 of the chars printed into
  the buffer.  (n == hostlen) also means the buffer length was
  too short.

- Use sdl->sdl_data only when (sdl->sdl_nlen > 0 && sdl->sdl_alen == 0)
  to prevent redundant output.

8 years agoioat: re-initialize interrupts after resetting hw on BDXDE
cem [Wed, 2 Sep 2015 16:48:03 +0000 (16:48 +0000)]
ioat: re-initialize interrupts after resetting hw on BDXDE

Resetting some generations of the I/OAT hardware (just BDXDE for now)
resets the corresponding MSI-X registers.  So, teardown and
re-initialize interrupts after resetting the hardware.

Reviewed by: jimharris
Approved by: markj (mentor)
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D3549