]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoAdd /proc/self/mounts to linprocfs; some linux binaries need it.
trasz [Mon, 20 Feb 2017 17:33:25 +0000 (17:33 +0000)]
Add /proc/self/mounts to linprocfs; some linux binaries need it.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoSimplify devfs_fsync() by removing it. This might also be a minor
trasz [Mon, 20 Feb 2017 16:18:33 +0000 (16:18 +0000)]
Simplify devfs_fsync() by removing it. This might also be a minor
optimization, as vn_isdisk() needs to lock a global mutex.

Reviewed by: imp
Tested by: pho
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D9628

7 years agoReimplement linux_arch_prctl() as a wrapper around sysarch(2).
trasz [Mon, 20 Feb 2017 16:13:40 +0000 (16:13 +0000)]
Reimplement linux_arch_prctl() as a wrapper around sysarch(2).
This also adds support for LINUX_ARCH_SET_GS.

Reviewed by: dchagin
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D9372

7 years agoDefer ptracestop() signals that cannot be delivered immediately
badger [Mon, 20 Feb 2017 15:53:16 +0000 (15:53 +0000)]
Defer ptracestop() signals that cannot be delivered immediately

When a thread is stopped in ptracestop(), the ptrace(2) user may request
a signal be delivered upon resumption of the thread. Heretofore, those signals
were discarded unless ptracestop()'s caller was issignal(). Fix this by
modifying ptracestop() to queue up signals requested by the ptrace user that
will be delivered when possible. Take special care when the signal is SIGKILL
(usually generated from a PT_KILL request); no new stop events should be
triggered after a PT_KILL.

Add a number of tests for the new functionality. Several tests were authored
by jhb.

PR: 212607
Reviewed by: kib
Approved by: kib (mentor)
MFC after: 2 weeks
Sponsored by: Dell EMC
In collaboration with: jhb
Differential Revision: https://reviews.freebsd.org/D9260

7 years agoetherswitch: Fix RT305x vlan group operation
sgalabov [Mon, 20 Feb 2017 08:10:41 +0000 (08:10 +0000)]
etherswitch: Fix RT305x vlan group operation

Fix an issue which prevents proper operation (addition/removal of members)
of RT305x vlan groups.

Tested by: yamori813@yahoo.co.jp

Submitted by: yamori813@yahoo.co.jp (initial version)
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D9607

7 years ago[wlanstats] We actually /do/ support per-STA stats!
adrian [Mon, 20 Feb 2017 08:04:06 +0000 (08:04 +0000)]
[wlanstats] We actually /do/ support per-STA stats!

7 years ago[net80211] validate VHT IEs.
adrian [Mon, 20 Feb 2017 04:04:59 +0000 (04:04 +0000)]
[net80211] validate VHT IEs.

7 years ago[net80211] teach the probe response routine to add VHT IEs as appropriate.
adrian [Mon, 20 Feb 2017 04:02:50 +0000 (04:02 +0000)]
[net80211] teach the probe response routine to add VHT IEs as appropriate.

7 years ago[net80211] fix up VHT IE comparison typo
adrian [Mon, 20 Feb 2017 04:02:29 +0000 (04:02 +0000)]
[net80211] fix up VHT IE comparison typo

Whilst here, add a comment that I need to validate VHT IEs.

7 years ago[net80211] fix NULL pointer dereference in VHT operation in hostap mode.
adrian [Mon, 20 Feb 2017 03:45:41 +0000 (03:45 +0000)]
[net80211] fix NULL pointer dereference in VHT operation in hostap mode.

The vht IEs are NULL at this point, so we shouldn't upgrade a node to VHT.
I'll fix the upgrade after this!

Tested:

* ath10k, hostap mode

7 years agosys/dev: Replace zero with NULL for pointers.
pfg [Mon, 20 Feb 2017 03:43:12 +0000 (03:43 +0000)]
sys/dev: Replace zero with NULL for pointers.

Makes things easier to read, plus architectures may set NULL to something
different than zero.

Found with: devel/coccinelle
MFC after: 3 weeks

7 years ago[ifconfig] fix a memory leak!
adrian [Mon, 20 Feb 2017 03:12:46 +0000 (03:12 +0000)]
[ifconfig] fix a memory leak!

Submitted by: Tom Rix <trix@juniper.net>
Differential Revision: https://reviews.freebsd.org/D9675

7 years ago[ifconfig] fix a memory leak.
adrian [Mon, 20 Feb 2017 03:10:56 +0000 (03:10 +0000)]
[ifconfig] fix a memory leak.

Submitted by: Tom Rix <trix@juniper.net>
Differential Revision: https://reviews.freebsd.org/D9654

7 years ago[net80211] RX parameter shuffle in net80211 in preparation for 4x4 NICs and 160MHz...
adrian [Mon, 20 Feb 2017 02:08:08 +0000 (02:08 +0000)]
[net80211] RX parameter shuffle in net80211 in preparation for 4x4 NICs and 160MHz channels.

* Migrate the rx_params stuff out from ieee80211_freebsd.h where it doesn't belong -
  this isn't freebsd specific anymore.

* Don't use a hard-coded number of chains in the ioctl header; now we can shuffle
  MAX_CHAINS around so it can be used in the right spot.

* Extend the signal/noisefloor levels in the mimo stats struct to userland to include
  the signal and noisefloor levels for each 20MHz slice of a 160MHz channel.

* Bump the number of EVM pilots in preparation for 4x4 and 160MHz channels.

Tested:

* ath(4), STA mode
* iwn(4), STA mode
* local ath10k port, STA mode

TODO:

* 11ax chips will come with 5GHz 8x8 hardware for lots of MU-MIMO - I'll re-bump it
  at that point.

Note:

* This breaks the driver and ifconfig ABI; please recompile  the kernel,
  ifconfig and wpa_supplicant/hostapd.

7 years agoRemove lib/libpam tests after they were removed from the source tree in r313975
ngie [Mon, 20 Feb 2017 01:45:12 +0000 (01:45 +0000)]
Remove lib/libpam tests after they were removed from the source tree in r313975

X-MFC with: r313975
Sponsored by: Dell EMC Isilon

7 years agoUpgrade to OpenPAM Radula.
des [Mon, 20 Feb 2017 00:56:46 +0000 (00:56 +0000)]
Upgrade to OpenPAM Radula.

7 years agoAdd a file descriptor in struct url for netrc
bapt [Mon, 20 Feb 2017 00:14:31 +0000 (00:14 +0000)]
Add a file descriptor in struct url for netrc

When using libfetch in an application that drops privileges when fetching
like pkg(8) then user complain because the application does not read anymore
${HOME}/.netrc. Now a caller can prepare a fd to the said file and manually
assign it to the structure.

It is also a first step to allow to capsicumize libfetch applications

Reviewed by: allanjude, des
Approved by: des
Differential Revision: https://reviews.freebsd.org/D9678

7 years agoA forced commit to note other portion of the Makefile change accidentally
ngie [Sun, 19 Feb 2017 22:00:11 +0000 (22:00 +0000)]
A forced commit to note other portion of the Makefile change accidentally
committed in r313972

The code committed in r313962 implicitly relies on python 2.x to generate
testvect.h . There are a handful of issues with this approach:

- python is not an explicit build dependency for FreeBSD
- python 2.x is deprecated and will be removed sometime in the future
  (potentially before 11.x's EOL), and the script does not function with
  python 3.5 (it uses deprecated idioms and incompatible function calls).
- python(1) (by default) lives in /usr/local/bin (${LOCALBASE}/bin) and
  gentestvect.py is a dependency of testvect.h (prior to r313972) which
  means that if the mtime of the generator script was newer than the
  mtime of the test vector, it could cause a spurious build failure in
  build time or at install time.

A better solution using C/C++ should be devised.

Discussed with: allanjude
MFC after: 2 weeks
X-MFC with: r313962, r313972
Sponsored by: Dell EMC Isilon

7 years agoUnbreak the build when "make obj" is executed beforehand
ngie [Sun, 19 Feb 2017 21:19:44 +0000 (21:19 +0000)]
Unbreak the build when "make obj" is executed beforehand

Using relative paths imply working directory (in this case .OBJDIR), whereas the
sources live in the .CURDIR-relative path.

MFC after: 2 weeks
X-MFC with: r313962
Pointyhat to: allanjude
Sponsored by: Dell EMC Isilon

7 years agoVendor import of OpenPAM Radula.
des [Sun, 19 Feb 2017 21:00:46 +0000 (21:00 +0000)]
Vendor import of OpenPAM Radula.

7 years agoApply noexec mount option for mmap(PROT_EXEC).
kib [Sun, 19 Feb 2017 20:51:04 +0000 (20:51 +0000)]
Apply noexec mount option for mmap(PROT_EXEC).

Right now the noexec mount option disallows image activators to try
execve the files on the mount point.  Also, after r127187, noexec
also limits max_prot map entries permissions for mappings of files
from such mounts, but not the actual mapping permissions.

As result, the API behaviour is inconsistent.  The files from noexec
mount can be mapped with PROT_EXEC, but if mprotect(2) drops execution
permission, it cannot be re-enabled later.  Make this consistent
logically and aligned with behaviour of other systems, by disallowing
PROT_EXEC for mmap(2).

Note that this change only ensures aligned results from mmap(2) and
mprotect(2), it does not prevent actual code execution from files
coming from noexec mount.  Such files can always be read into
anonymous executable memory and executed from there.

Reported by: shamaz.mazum@gmail.com
PR: 217062
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoMFamd64 r313933: microoptimize pmap_protect_pte1().
kib [Sun, 19 Feb 2017 20:40:07 +0000 (20:40 +0000)]
MFamd64 r313933: microoptimize pmap_protect_pte1().

Noted by: alc
Tested by: mmel
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoOnly notify blacklistd for successful logins in auth.c
lidl [Sun, 19 Feb 2017 20:35:39 +0000 (20:35 +0000)]
Only notify blacklistd for successful logins in auth.c

Reported by: Rick Adams
Reviewed by: des
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoAdd a driver for the RouterBoard RB800 User LED
jhibbits [Sun, 19 Feb 2017 19:56:12 +0000 (19:56 +0000)]
Add a driver for the RouterBoard RB800 User LED

This may work on other RouterBoard PPC platforms, but I don't have any to test
with.

7 years agoDocument r313854 (kern.cam.ctl.iscsi.maxtags).
mav [Sun, 19 Feb 2017 19:46:47 +0000 (19:46 +0000)]
Document r313854 (kern.cam.ctl.iscsi.maxtags).

MFC after: 12 days

7 years agoimprove PBKDF2 performance
allanjude [Sun, 19 Feb 2017 19:30:31 +0000 (19:30 +0000)]
improve PBKDF2 performance

The PBKDF2 in sys/geom/eli/pkcs5v2.c is around half the speed it could be

GELI's PBKDF2 uses a simple benchmark to determine a number of iterations
that will takes approximately 2 seconds. The security provided is actually
half what is expected, because an attacker could use the optimized
algorithm to brute force the key in half the expected time.

With this change, all newly generated GELI keys will be approximately 2x
as strong. Previously generated keys will talk half as long to calculate,
resulting in faster mounting of encrypted volumes. Users may choose to
rekey, to generate a new key with the larger default number of iterations
using the geli(8) setkey command.

Security of existing data is not compromised, as ~1 second per brute force
attempt is still a very high threshold.

PR: 202365
Original Research: https://jbp.io/2015/08/11/pbkdf2-performance-matters/
Submitted by: Joe Pixton <jpixton@gmail.com> (Original Version), jmg (Later Version)
Reviewed by: ed, pjd, delphij
Approved by: secteam, pjd (maintainer)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D8236

7 years agoUpdate pci_vendors to 2017.02.15
bapt [Sun, 19 Feb 2017 18:16:47 +0000 (18:16 +0000)]
Update pci_vendors to 2017.02.15

MFC after: 3 days

7 years agoIn pmap_enter(), set the PG_MANAGED flag on the new PTE in one place,
alc [Sun, 19 Feb 2017 18:00:57 +0000 (18:00 +0000)]
In pmap_enter(), set the PG_MANAGED flag on the new PTE in one place,
rather two places, and do so before the pmap lock is acquired.

Submitted by: Yufeng Zhou <yz70@rice.edu>
Reviewed by: kib
MFC after: 1 week

7 years agoAdd USB Mass Storage CTL frontend. This makes it possible
trasz [Sun, 19 Feb 2017 17:47:43 +0000 (17:47 +0000)]
Add USB Mass Storage CTL frontend.  This makes it possible
for USB OTG-capable hardware to implement device side of USB
Mass Storage, ie pretend it's a flash drive.  It's configured
in the same way as other CTL frontends, using ctladm(8)
or ctld(8).  Differently from usfs(4), all the configuration
can be done without rebuilding the kernel.

Testing and review is welcome.  Right now I'm still moving,
and I don't have access to my test environment, so I'm somewhat
reluctant to making larger changes to this code; on the other
hand I don't want to let it sit on Phab until my testing setup
is back, because I want to get it into 11.1-RELEASE.

Reviewed by: emaste (cursory), wblock (man page)
MFC after: 2 weeks
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8787

7 years agoImport mandoc 1.4.1rc2
bapt [Sun, 19 Feb 2017 17:46:37 +0000 (17:46 +0000)]
Import mandoc 1.4.1rc2

7 years agoImport mandoc 1.4.1rc2
bapt [Sun, 19 Feb 2017 17:41:20 +0000 (17:41 +0000)]
Import mandoc 1.4.1rc2

7 years agobsdgrep: document ignored option -u
emaste [Sun, 19 Feb 2017 17:40:24 +0000 (17:40 +0000)]
bsdgrep: document ignored option -u

MSDOS and Windows GNU grep uses -u to mean "print byte offsets as if
running on an UNIX system." The option has no effect on systems that
do not use CRLF line endings.

PR: 171200
Submitted by: deeptech71@gmail.com, Anders Jensen-Waud
MFC after: 1 month

7 years agoRemove obsolete comment after prior rev.
imp [Sun, 19 Feb 2017 17:38:17 +0000 (17:38 +0000)]
Remove obsolete comment after prior rev.

7 years agoImport libucl 20170219
bapt [Sun, 19 Feb 2017 17:37:16 +0000 (17:37 +0000)]
Import libucl 20170219

MFC after: 3 days

7 years agoRemove dead mentions of CAM target mode APIs from drivers.
mav [Sun, 19 Feb 2017 17:27:58 +0000 (17:27 +0000)]
Remove dead mentions of CAM target mode APIs from drivers.

This makes grepping kernel for target mode implementation much easier.

7 years agobsdgrep: fix EOF handling with --mmap
emaste [Sun, 19 Feb 2017 17:23:27 +0000 (17:23 +0000)]
bsdgrep: fix EOF handling with --mmap

Rework part of the loop in grep_fgetln to return the rest of the line
and ensure that we still advance the buffer by the length of the rest
of the line.

PR: 165471
Submitted by: Kyle Evans <kevans91@ksu.edu>
MFC after: 1 month

7 years agoThere are some Linux binaries that expect the system to obey the "addr"
trasz [Sun, 19 Feb 2017 17:17:06 +0000 (17:17 +0000)]
There are some Linux binaries that expect the system to obey the "addr"
parameter to mmap(2), even if MAP_FIXED is not explicitly specified.
Android ART is one example.  Implement bug compatibility for this case
in linuxulator.

Reviewed by: dchagin@
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D9373

7 years agoMake savecore(8) output nicer by specifying the maximum field width
trasz [Sun, 19 Feb 2017 16:59:00 +0000 (16:59 +0000)]
Make savecore(8) output nicer by specifying the maximum field width
instead of minimum one (precision instead of width).

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoRemove broken remnants of obsolete INOT API.
mav [Sun, 19 Feb 2017 16:40:03 +0000 (16:40 +0000)]
Remove broken remnants of obsolete INOT API.

MFC after: 2 weeks

7 years agolocks: make trylock routines check for 'unowned' value
mjg [Sun, 19 Feb 2017 16:28:46 +0000 (16:28 +0000)]
locks: make trylock routines check for 'unowned' value

Since fcmpset can fail without lock contention e.g. on arm, it was possible
to get spurious failures when the caller was expecting the primitive to succeed.

Reported by: mmel

7 years agoMake mdconfig(8) not segfault when the kernel returns garbage data.
trasz [Sun, 19 Feb 2017 16:08:58 +0000 (16:08 +0000)]
Make mdconfig(8) not segfault when the kernel returns garbage data.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoMake sure the thread constructor and destructor eventhandlers are
hselasky [Sun, 19 Feb 2017 13:15:33 +0000 (13:15 +0000)]
Make sure the thread constructor and destructor eventhandlers are
called for all threads belonging to a procedure. Currently the first
thread in a procedure is kept around as an optimisation step and is
never freed. Because the first thread in a procedure is never freed
nor allocated, its destructor and constructor callbacks are never
called which means per thread structures allocated by dtrace and the
Linux emulation layers for example, might be present for threads which
don't need these structures.

This patch adds a thread construction and destruction call for the
first thread in a procedure.

Tested: dtrace, linux emulation
Reviewed by: kib @
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoImplement rt_tgsigqueueinfo system call used by glibc for pthread_sigqueue(3).
dchagin [Sun, 19 Feb 2017 07:38:11 +0000 (07:38 +0000)]
Implement rt_tgsigqueueinfo system call used by glibc for pthread_sigqueue(3).

MFC after: 2 week

7 years agoMFamd64 r313933: microoptimize pmap_protect_pde().
kib [Sun, 19 Feb 2017 06:14:33 +0000 (06:14 +0000)]
MFamd64 r313933: microoptimize pmap_protect_pde().

Noted by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoCapsicum-ize lam(1)
allanjude [Sun, 19 Feb 2017 06:02:41 +0000 (06:02 +0000)]
Capsicum-ize lam(1)

lam(1) is used in portsnap(8), so lock it down

Reviewed by: emaste, cem, jonathan
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D8076

7 years agoMissed addition to r313936.
mav [Sun, 19 Feb 2017 05:29:06 +0000 (05:29 +0000)]
Missed addition to r313936.

CTIO waitq present only in ISP_TARGET_MODE.

MFC after: 2 weeks

7 years agoMove CTIO waitq from per-LUN to per-channel.
mav [Sun, 19 Feb 2017 05:07:02 +0000 (05:07 +0000)]
Move CTIO waitq from per-LUN to per-channel.

All resources lack of which may put CTIO into the queue are either
per-channel or potentially per-queue, but none of them are per-LUN.

This is a first step to fix live LUN disabling.  Before this change
any CTIOs held in a queue in time of disabling were just leaked.

MFC after: 2 weeks

7 years agoRestore PBA setup for igb(4) class devices.
sbruno [Sun, 19 Feb 2017 05:06:29 +0000 (05:06 +0000)]
Restore PBA setup for igb(4) class devices.

Do no write to PBA register on igb(4) devices unless we need
to make adjustments for the 82575 and jumbo frames.

Remove redundant LPE/~LPE assignments.

Move e1000_lv_jumbo_workaround_ich8lan() invokcation into a block
so that its not executed in the igb case.

Move em(4) class assignments of RCTL values to its own code block.

Adjust a few direct accesses of ifp->mtu to use accessor functions.

PR: 216734
Submitted by: Kaho Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>

7 years agoFix regression in r313898 on i386.
kib [Sun, 19 Feb 2017 03:57:41 +0000 (03:57 +0000)]
Fix regression in r313898 on i386.

Use large enough type for calculation of mtrr physmask.  Typical
cpu_maxphyaddr is 36 or larger.

Reported and tested by: sbruno
Sponsored by: The FreeBSD Foundation
MFC after: 13 days

7 years agoMicrooptimize amd64/pmap.c pmap_protect_pde().
kib [Sun, 19 Feb 2017 03:33:20 +0000 (03:33 +0000)]
Microoptimize amd64/pmap.c pmap_protect_pde().

For the loop that dirties vm_pages in case superpage was written to,
check the complete condition before the loop.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoBring back r313037, with fixes for mips:
jah [Sun, 19 Feb 2017 02:03:09 +0000 (02:03 +0000)]
Bring back r313037, with fixes for mips:

Implement get_pcpu() for amd64/sparc64/mips/powerpc, and use it to
replace pcpu_find(curcpu) in MI code.

Reviewed by: andreast, kan, lidl
Tested by: lidl(mips, sparc64), andreast(powerpc)
Differential Revision: https://reviews.freebsd.org/D9587

7 years agolocks: clean up trylock primitives
mjg [Sat, 18 Feb 2017 22:06:03 +0000 (22:06 +0000)]
locks: clean up trylock primitives

In particular thius reduces accesses of the lock itself.

7 years agoInclude ${LOCALBASE}/bin in $PATH when running "make checkworld"
ngie [Sat, 18 Feb 2017 21:47:32 +0000 (21:47 +0000)]
Include ${LOCALBASE}/bin in $PATH when running "make checkworld"

Some of the tests in devel/atf // devel/kyua rely on the tools being in $PATH,
which means that the tests fail when run via "make checkworld" because $PATH
is restricted to exclude directory elements like "${LOCALBASE}/bin".

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoQuote path to doxygen/kyua in test(1) -x check
ngie [Sat, 18 Feb 2017 21:41:50 +0000 (21:41 +0000)]
Quote path to doxygen/kyua in test(1) -x check

This is a basic stopgap against ${LOCALBASE} containing spaces in it

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoAdd new catrigl.c (r313761) APIs to include/complex.h
mmokhi [Sat, 18 Feb 2017 21:08:09 +0000 (21:08 +0000)]
Add new catrigl.c (r313761) APIs to include/complex.h

Reviewed by: bde, emaste
Approved by: bde, emaste (src committers)
Differential Revision: https://reviews.freebsd.org/D9615

7 years agoFor translated packets do not adjust UDP checksum if it is zero.
ae [Sat, 18 Feb 2017 19:53:37 +0000 (19:53 +0000)]
For translated packets do not adjust UDP checksum if it is zero.

In case when decrypted and decapsulated packet is an UDP datagram,
check that its checksum is not zero before doing incremental checksum
adjustment.

Reported by: Eugene Grosbein
Tested by: Eugene Grosbein

7 years agoFix the last case when kldload(8) wasn't printing the name of the module
glebius [Sat, 18 Feb 2017 18:57:29 +0000 (18:57 +0000)]
Fix the last case when kldload(8) wasn't printing the name of the module
that failed to load.

7 years agoAdd dtb files for Boundary Devices Nitrogen 6 family boards. FreeBSD runs
ian [Sat, 18 Feb 2017 18:31:42 +0000 (18:31 +0000)]
Add dtb files for Boundary Devices Nitrogen 6 family boards.  FreeBSD runs
on a nitrogen6x quad 2gb, and is expected to run on all the imx6 boards in
the nitrogen6 family.

7 years agoAdd definitions for the IEEE-1588 registers.
ian [Sat, 18 Feb 2017 18:27:28 +0000 (18:27 +0000)]
Add definitions for the IEEE-1588 registers.

7 years agoChange the naming of imx{5,6} gpio pins to exactly match the names used in
ian [Sat, 18 Feb 2017 18:24:03 +0000 (18:24 +0000)]
Change the naming of imx{5,6} gpio pins to exactly match the names used in
the chip reference manuals: GPIOn_IOnn.

7 years agoMake fsck(8) default to "ufs", like eg mount(8) does.
trasz [Sat, 18 Feb 2017 11:43:13 +0000 (11:43 +0000)]
Make fsck(8) default to "ufs", like eg mount(8) does.

Approved by: imp
Discussed with: kib
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D9621

7 years agoStyle(9), some XXX comments fix. No functional changes.
dchagin [Sat, 18 Feb 2017 10:01:17 +0000 (10:01 +0000)]
Style(9), some XXX comments fix. No functional changes.

MFC after: 1 week

7 years agoInitialize cap_rights before use.
dchagin [Sat, 18 Feb 2017 09:39:20 +0000 (09:39 +0000)]
Initialize cap_rights before use.

MFC after: 1 week

7 years agoFinich r313684.
dchagin [Sat, 18 Feb 2017 07:21:50 +0000 (07:21 +0000)]
Finich r313684.

Convert linux_recv(), linux_send() and linux_accept() system call arguments
to the register_t type too.

PR: 217161
MFC after: 3 days
xMFC with: r313284,r313285,r313684

7 years agoSpell VMXNET3_LEGACY_TX correctly.
loos [Sat, 18 Feb 2017 06:18:14 +0000 (06:18 +0000)]
Spell VMXNET3_LEGACY_TX correctly.

Obtained from: pfSense
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoChange XCOPY memory allocations.
mav [Sat, 18 Feb 2017 06:03:16 +0000 (06:03 +0000)]
Change XCOPY memory allocations.

Before this change XCOPY code could allocate memory in chunks up to 16-32MB
(VMware does XCOPY in 4MB chunks by default), that could be difficult for
VM subsystem to do due to KVA fragmentation, that sometimes created huge
allocation delays, blocking any I/O for respective LU for that time.

This change limits allocations down to TPC_MAX_IO_SIZE, which is 1MB now.
1MB is also not a cookie, but ZFS also can do that for large blocks, so
it should be less dramatic.  As drawback this increases CPU overhead, but
it still look acceptable comparing to time consumed by ZFS read/write.

MFC after: 1 week

7 years agoFix panic with unlocked vnode to vrecycle().
bdrewery [Sat, 18 Feb 2017 05:07:53 +0000 (05:07 +0000)]
Fix panic with unlocked vnode to vrecycle().

MFC after: 2 weeks

7 years agomtx: plug the 'opts' argument when not used
mjg [Sat, 18 Feb 2017 01:52:10 +0000 (01:52 +0000)]
mtx: plug the 'opts' argument when not used

7 years agoxdev: Fix after libc++ update in r300873.
bdrewery [Sat, 18 Feb 2017 00:08:13 +0000 (00:08 +0000)]
xdev: Fix after libc++ update in r300873.

The xdev build needed the same fixes as libcompat and external toolchain
support needed for handling of --sysroot, -L, -B, etc.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoiwi, ral, zyd: fix possible use-after-free.
avos [Fri, 17 Feb 2017 23:20:22 +0000 (23:20 +0000)]
iwi, ral, zyd: fix possible use-after-free.

MFC after: 5 days

7 years agoxdev: Build yacc which is needed for recent libpcap updates.
bdrewery [Fri, 17 Feb 2017 22:51:34 +0000 (22:51 +0000)]
xdev: Build yacc which is needed for recent libpcap updates.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoMETA_MODE+xdev: Don't rebuild build-tools during normal build.
bdrewery [Fri, 17 Feb 2017 22:51:21 +0000 (22:51 +0000)]
META_MODE+xdev: Don't rebuild build-tools during normal build.

See r297997 for more information.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoRely on CPUID feature only to enable attaching. MTRR are architectural
kib [Fri, 17 Feb 2017 22:50:41 +0000 (22:50 +0000)]
Rely on CPUID feature only to enable attaching. MTRR are architectural
and there is no reason to check cpu family or vendor.

Noted by:   royger
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D9657

7 years agosmp_rendezvous() works for UP case as well, reduce duplicated
kib [Fri, 17 Feb 2017 22:49:52 +0000 (22:49 +0000)]
smp_rendezvous() works for UP case as well, reduce duplicated
code.  Also fix cast and remove unneeded XXX in comment.

Noted and reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D9657

7 years agosx: fix mips builld after r313855
mjg [Fri, 17 Feb 2017 22:09:55 +0000 (22:09 +0000)]
sx: fix mips builld after r313855

The namespace in this file really needs cleaning up. In the meantime
let inline primitives be defined as long as LOCK_DEBUG is not enabled.

Reported by: kib

7 years agoPush max_frame_len back into iflib so that jumbo frame sizes work.
sbruno [Fri, 17 Feb 2017 21:30:16 +0000 (21:30 +0000)]
Push max_frame_len back into iflib so that jumbo frame sizes work.

Reported by: pho

7 years agoEnable capsicum on MALTA kernels.
brooks [Fri, 17 Feb 2017 21:25:24 +0000 (21:25 +0000)]
Enable capsicum on MALTA kernels.

This adds less that 10K to the kernel and should probably be done in the
other std.* configs.

7 years agoMerge i386 and amd64 mtrr drivers.
kib [Fri, 17 Feb 2017 21:08:32 +0000 (21:08 +0000)]
Merge i386 and amd64 mtrr drivers.

Reviewed by: royger, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D9648

7 years agoext2fs: Remove unused assignment.
pfg [Fri, 17 Feb 2017 20:56:43 +0000 (20:56 +0000)]
ext2fs: Remove unused assignment.

Value is re-assigned a few lines later without being read.

Found by: Clang static analyzer
MFC after: 1 week

7 years agoMake ctl(4) build with CTL_IO_DELAY defined.
ken [Fri, 17 Feb 2017 20:15:27 +0000 (20:15 +0000)]
Make ctl(4) build with CTL_IO_DELAY defined.

sys/cam/ctl/ctl.c:
In ctl_datamove(), inside CTL_IO_DELAY, add a lun variable and fill
it in before trying to dereference it.

MFC after: 3 days
Sponsored by: Spectra Logic

7 years agoAdd task attribute support to camcontrol(8).
ken [Fri, 17 Feb 2017 20:04:22 +0000 (20:04 +0000)]
Add task attribute support to camcontrol(8).

Users can use the new generic argument, -Q task_attr, to specify a task
attribute (simple, ordered, head of queue, aca) for the commands issued.
The the default is simple, which works with all SCSI devices that support
tagged queueing.

This will mostly be useful for debugging target behavior in certain
situations.

You can try it out by compiling CTL with CTL_IO_DELAY turned on (in
sys/cam/ctl/ctl_io.h) and then do something like this with one of the CTL
LUNs:

ctladm delay 0:0 -l done -t 10
camcontrol tur da34 -v

And at then before the 10 second timer is up, in another terminal:

camcontrol inquiry da34 -Q ordered -v

The Inquiry should complete just after the TUR completes.  Ordinarily
it would complete first because of the delay injection, but because the
task attribute is set to ordered in this case, CTL holds it up until the
previous command has completed.

sbin/camcontrol/camcontrol.c:
Add the new generic argument, -Q, which allows the user to specify
a SCSI task attribute.  The user can specify task attributes by
name or numerically.

Add a new task_attr arguments to SCSI sub-functions.

sbin/camcontrol/attrib.c,
sbin/camcontrol/camcontrol.h,
sbin/camcontrol/fwdownload.c,
sbin/camcontrol/modeedit.c,
sbin/camcontrol/persist.c,
sbin/camcontrol/timestamp.c,
sbin/camcontrol/zone.c:
Add the new task_attr argument to SCSI sub-functions.

sbin/camcontrol/camcontrol.8:
Document the new -Q option, and add an example.

Sponsored by: Spectra Logic
MFC after: 1 week

7 years agoUpdate OLD_DIRS for various targets so that some of the branches of
sbruno [Fri, 17 Feb 2017 20:02:40 +0000 (20:02 +0000)]
Update OLD_DIRS for various targets so that some of the branches of
directories are pruned when the appropriate knobs are turned.

Specifically, turning off bsdconfig, locales, examples, i18n, man,
ntp, syscons.  It may not seem like a lot, but it helps when trying
to keep an x86 image under 96MB for MFSRoot netbooting.

Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D9558

7 years agosort(1): Remove unneeded initializations.
pfg [Fri, 17 Feb 2017 19:53:20 +0000 (19:53 +0000)]
sort(1): Remove unneeded initializations.

Found by: Clang static analyzer

7 years ago[asmc] Add support for MacBook Pro 11,2
adrian [Fri, 17 Feb 2017 18:49:18 +0000 (18:49 +0000)]
[asmc] Add support for MacBook Pro 11,2

This patch will add support for MacBookPro 11.2.
For the macros, the MBP11_* macros (for the existing MacBookPro11.3) did not
match so they have been renamed to MBP113_* and a new MBP112_* has been
added (modified copy of MBP11_*).

Some trailing whitespaces may have been removed automatically.

PR: kern/214836
Obtained from: Johannes Lundberg <johannes@brilliantservice.co.jp

7 years agoMVF: 313876
jpaetzel [Fri, 17 Feb 2017 17:52:12 +0000 (17:52 +0000)]
MVF: 313876

7504 kmem_reap hangs spa_sync and administrative tasks

illumos/illumos-gate@405a5a0f5c3ab36cb76559467d1a62ba648bd809
https://github.com/illumos/illumos-gate/commit/405a5a0f5c3ab36cb76559467d1a62ba648bd80

https://www.illumos.org/issues/7504

  We see long spa_sync(). We are waiting to hold dp_config_rwlock for writer. Some
  other thread holds dp_config_rwlock for reader, then calls arc_get_data_buf(),
  which finds that arc_is_overflowing()==B_TRUE. So it waits (while holding
  dp_config_rwlock for reader) for arc_reclaim_thread to signal arc_reclaim_waiters_cv.
  Before signaling, arc_reclaim_thread does arc_kmem_reap_now(), which takes ~seconds.

Author: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>

7 years agomtx: get rid of file/line args from slow paths if they are unused
mjg [Fri, 17 Feb 2017 15:40:24 +0000 (15:40 +0000)]
mtx: get rid of file/line args from slow paths if they are unused

This denotes changes which went in by accident in r313877.

On most production kernels both said parameters are zeroed and have nothing
reading them in either __mtx_lock_sleep or __mtx_unlock_sleep. Thus this change
stops passing them by internal consumers which this is the case.

Kernel modules use _flags variants which are not affected kbi-wise.

7 years agomtx: restrict r313875 to kernels without LOCK_PROFILING
mjg [Fri, 17 Feb 2017 15:34:40 +0000 (15:34 +0000)]
mtx: restrict r313875 to kernels without LOCK_PROFILING

7 years agomtx: microoptimize lockstat handling in __mtx_lock_sleep
mjg [Fri, 17 Feb 2017 14:55:59 +0000 (14:55 +0000)]
mtx: microoptimize lockstat handling in __mtx_lock_sleep

This saves a function call and multiple branches after the lock is acquired.

7 years agoMake inline lockstat checks just inspect lockstat_enabled
mjg [Fri, 17 Feb 2017 14:05:57 +0000 (14:05 +0000)]
Make inline lockstat checks just inspect lockstat_enabled

There is no correctness issue and this lets the kernel just test one typically
false variable.

7 years agoPublish fp[get][set]sticky() for ARMv6.
mmel [Fri, 17 Feb 2017 13:49:46 +0000 (13:49 +0000)]
Publish fp[get][set]sticky() for ARMv6.

Although fp[get][set]sticky() functions are obsolete, they are still
required for GNU fortran49 library.

MFC after: 2 months
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D9634

7 years agoImplement GFP_DMA32 flag in the LinuxKPI.
hselasky [Fri, 17 Feb 2017 13:31:11 +0000 (13:31 +0000)]
Implement GFP_DMA32 flag in the LinuxKPI.
Define all FreeBSD native GFP bits as GFP_NATIVE_MASK.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agox86: fix MTRR initialization if EARLY_AP_STARTUP is used
royger [Fri, 17 Feb 2017 12:47:51 +0000 (12:47 +0000)]
x86: fix MTRR initialization if EARLY_AP_STARTUP is used

MTRR handlers are set in {amd64/i686}_mem_drvinit, which is called at
SI_SUB_DRIVERS, and that's too late when EARLY_AP_STARTUP is set because APs
have already started at this point. {amd64/i686}_mrinit is also called too late
for the BSP, since that happens when the memory device is attached, also after
APs have already started.

Move the position to SI_SUB_CPU, and also initialize the state for the BSP, so
that the APs can correctly get to the same state as the BSP.

Sponsored by: Citrix Systems R&D
MFC after: 1 week
Reviewed by: jhb, kib
Differential Revision: https://reviews.freebsd.org/D9630

7 years agoUse full name for the month
bapt [Fri, 17 Feb 2017 11:31:27 +0000 (11:31 +0000)]
Use full name for the month

Reported by: brueffer

7 years agoAlso add vsevolod@ in the authors
bapt [Fri, 17 Feb 2017 11:26:03 +0000 (11:26 +0000)]
Also add vsevolod@ in the authors

7 years agoAdd history and Authors section in the manpage
bapt [Fri, 17 Feb 2017 11:17:56 +0000 (11:17 +0000)]
Add history and Authors section in the manpage

Submitted by: dteske
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D9419

7 years agoPublish __aeabi_uidiv and __aeabi_idiv as compatible symbols from libc.
mmel [Fri, 17 Feb 2017 11:16:19 +0000 (11:16 +0000)]
Publish __aeabi_uidiv and __aeabi_idiv as compatible symbols from libc.

Due to bug[1] in libcompiler_rt, all symbols declared by
DEFINE_AEABI_FUNCTION_ALIAS() are not hidden. All these but two
are explicitly exported from libc and don't causes problems.

Remaining two, __aeabi_uidiv and __aeabi_idiv, infecting all
non-versioned shared libraries. And these symbols are consumed
by many (if not all) packages[2].

As workaround, export these from libc as compatible symbols,
in global namespace. With this, these are still visible for
rtld, but static linker doesn't use then.

[1]
DEFINE_AEABI_FUNCTION_ALIAS() macro uses '.set' directive for
declaration of aliased symbol. Unfortunately, '.set' doesn't
inherit visibility of base symbol, and macro don't explicitly
sets visibility for aliased one.

[2]
Given symbols are exported from non-versioned libraries only if
library itself uses them. So, if world is built for CPU with
HW divide, these function are not used and given symbols are
not exported. By this, contents of these libraries is not stable,
and all packages fails to run.

Note: Due to r313823 I'm forced to commit this too early, without
leave enough time for proper review.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D9632

7 years agosx: fix compilation on UP kernels after r313855
mjg [Fri, 17 Feb 2017 10:58:12 +0000 (10:58 +0000)]
sx: fix compilation on UP kernels after r313855

sx primitives use inlines as opposed to macros. Change the tested condition
to LOCK_DEBUG which covers the case, but is slightly overzelaous.

Reported by: kib

7 years agoAdd documentations related to new APIs of r313761
mmokhi [Fri, 17 Feb 2017 08:25:48 +0000 (08:25 +0000)]
Add documentations related to new APIs of r313761

PR: 216850 216851 216852 216856 216857 216858
Submitted by: sgk@troutmask.apl.washington.edu
Reported by: sgk@troutmask.apl.washington.edu
Reviewed by: bde emaste hselasky
Approved by: bde emaste hselasky
Differential Revision: https://reviews.freebsd.org/D9491

7 years agoFix building of r313761 on platforms that
mmokhi [Fri, 17 Feb 2017 08:22:32 +0000 (08:22 +0000)]
Fix building of r313761 on platforms that
`long double` is alias of `double` (MIPS, etc)

PR: 216850 216851 216852 216856 216857 216858
Reported by: emsate
Reviewed by: bde emaste hselasky
Approved by: bde emaste hselasky
Differential Revision: https://reviews.freebsd.org/D9491

7 years agoRemove ahb references as well as 1640 info in aha.4
imp [Fri, 17 Feb 2017 06:49:54 +0000 (06:49 +0000)]
Remove ahb references as well as 1640 info in aha.4