]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMerge changes from vendor to address several Coverity issues with
ngie [Mon, 12 Dec 2016 02:21:56 +0000 (02:21 +0000)]
Merge changes from vendor to address several Coverity issues with
contrib/libarchive's tests

MFC after: 2 weeks
Obtained from: libarchive (ebe29c, fd0ea2, f9e3de)
Reported by: Coverity

7 years agoWe currently don't do TSO if ip options are present. In case of IPv6, we look at
hiren [Sun, 11 Dec 2016 23:14:47 +0000 (23:14 +0000)]
We currently don't do TSO if ip options are present. In case of IPv6, we look at
in6p_options to check that. That is incorrect as we carry ip options in
in6p_outputopts. Also, just checking for in6p_outputopts being NULL won't
suffice as we combine ip options and ip header fields both in that one field.
The commit fixes this by using ip6_optlen() which correctly calculates length
of only ip options for IPv6.

Reviewed by:     ae, bz
MFC after:     3 weeks
Sponsored by:     Limelight Networks

7 years agoPostpone ZVOL media/block size caching till first open.
mav [Sun, 11 Dec 2016 19:50:39 +0000 (19:50 +0000)]
Postpone ZVOL media/block size caching till first open.

At least on FreeBSD there are no legal way to access media or get its
size without opening device/provider first.  Postponing this caching
allows to skip several disk seeks per ZVOL/snapshot during import.

For HDD pool with 1 ZVOL in dev mode with 1000 snapshots this reduces
pool import time from 40 to 10 seconds.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

7 years agoWhen tmpfs and POSIX shm pagein a page for the sole purpose of performing
alc [Sun, 11 Dec 2016 19:24:41 +0000 (19:24 +0000)]
When tmpfs and POSIX shm pagein a page for the sole purpose of performing
truncation, immediately queue the page for asynchronous laundering rather
than making the page pass through inactive queue first.

Reviewed by: kib, markj

7 years agoPrefix hex memory addresses with 0x in diagnostic messages from the
kib [Sun, 11 Dec 2016 19:01:27 +0000 (19:01 +0000)]
Prefix hex memory addresses with 0x in diagnostic messages from the
SRAT parser.

Submitted by: Oliver Pinter
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D8750

7 years agorsu: fix and enable Rx TCP checksum offloading.
avos [Sun, 11 Dec 2016 17:15:25 +0000 (17:15 +0000)]
rsu: fix and enable Rx TCP checksum offloading.

Tested with Asus USB-N10, STA mode.

7 years agoEnsure that the reported ppid and tsn are taken from the first fragment.
tuexen [Sun, 11 Dec 2016 13:26:35 +0000 (13:26 +0000)]
Ensure that the reported ppid and tsn are taken from the first fragment.

This fixes a bug where the wrong ppid was reported, if
* I-DATA was used on the first fragement was not received first
* DATA was used and different ppids where used.

Thanks to Julian Cordes for making me aware of the issue.

MFC after: 1 week

7 years agoCut to the chase and just call free instead of free(x) + x = NULL
ngie [Sat, 10 Dec 2016 23:58:14 +0000 (23:58 +0000)]
Cut to the chase and just call free instead of free(x) + x = NULL

NULLing out x wasn't required as the memory was immediately scribbled
over with strdup in the following call.

MFC after: 1 week
Submitted by: imp

7 years agofree/NULL out variables prior to calling strdup to avoid leaking memory
ngie [Sat, 10 Dec 2016 23:26:34 +0000 (23:26 +0000)]
free/NULL out variables prior to calling strdup to avoid leaking memory
if arguments are specified more than once with "camcontrol timestamp".

CID: 13668291366831
MFC after: 1 week

7 years agorsu: various initialization fixes.
avos [Sat, 10 Dec 2016 22:31:49 +0000 (22:31 +0000)]
rsu: various initialization fixes.

- Do not ignore initialization errors; call ieee80211_stop()
when initialization failed.
- Use usb_pause_mtx() instead of DELAY() while waiting for firmware
loading; this fixes system freeze during firmware startup.
- Do not execute rsu_stop() when device is powered off; fixes
'unknown board type (rfconfig=0xff)' error when the device is
reattached.

Tested with Asus USB-N10.

7 years agoChange the process limits for RLIMIT_MEMLOCK to RLIM_INFINITY when
ngie [Sat, 10 Dec 2016 22:08:33 +0000 (22:08 +0000)]
Change the process limits for RLIMIT_MEMLOCK to RLIM_INFINITY when
executing :mincore_resid

The default process limits in FreeBSD is 64kB for unprivileged users,
which empirically is too low to run the :mincore_resid testcase.

Process limits are inherited, so even though the default limit for
root users is RLIM_INFINITY, the inherited limit with "sudo" with the
default login.conf will be 64kB.

Use setrlimit to set rlim_max for RLIMIT_MEMLOCK to RLIM_INFINITY to
avoid ENOMEM issues when calling mlock to wire the mmap'ed address
space.

setrlimit requires root access to increase rlim_max, so require root
privileges when running the test

Discovered when executing the tests with sudo, e.g.
"sudo kyua test -k /usr/tests/lib/libc/sys/Kyuafile mincore_test"

MFC after: 2 weeks

7 years agoAdd some tests for reaper functionality (in procctl()).
jilles [Sat, 10 Dec 2016 22:05:24 +0000 (22:05 +0000)]
Add some tests for reaper functionality (in procctl()).

MFC after: 1 week

7 years agoTentatively apply https://reviews.llvm.org/D18730 to work around gcc PR
dim [Sat, 10 Dec 2016 22:03:44 +0000 (22:03 +0000)]
Tentatively apply https://reviews.llvm.org/D18730 to work around gcc PR
70528 (bogus error: constructor required before non-static data member).
This should fix buildworld with the external gcc package.

Reported by: https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc/

7 years agoAdd missed vfs.zfs.zfetch.max_idistance sysctl.
mav [Sat, 10 Dec 2016 21:19:27 +0000 (21:19 +0000)]
Add missed vfs.zfs.zfetch.max_idistance sysctl.

7 years agorsu: use bitmap for all debug messages.
avos [Sat, 10 Dec 2016 20:19:57 +0000 (20:19 +0000)]
rsu: use bitmap for all debug messages.

- Replace all remaining DPRINTF(N)'s with RSU_DPRINTF.
- Add new RSU_DEBUG_USB flag to track error codes returned by
usbd_do_request_flags().
- Improve few messages.

7 years agorsu(4): refresh the manpage.
avos [Sat, 10 Dec 2016 19:14:51 +0000 (19:14 +0000)]
rsu(4): refresh the manpage.

- Add monitor mode into the list of supported modes.
- Describe promiscuous mode limitations in CAVEATS section.

Reported by: adrian

7 years agorsu: add promiscuous mode support.
avos [Sat, 10 Dec 2016 18:47:13 +0000 (18:47 +0000)]
rsu: add promiscuous mode support.

- Add partial promiscuous mode support (no management frames;
they cannot be received by the firmware and net80211 at the same time).
- Add monitor mode support (all frames).

Tested with Asus, USB-N10.

7 years agoNow that external gcc directly natively links to libc++ we can remove
bapt [Sat, 10 Dec 2016 18:29:39 +0000 (18:29 +0000)]
Now that external gcc directly natively links to libc++ we can remove
the dirty hack made to fake libstdc++

7 years ago[evdev] Adds evdev support to sysmouse(4) driver
gonzo [Sat, 10 Dec 2016 18:07:16 +0000 (18:07 +0000)]
[evdev] Adds evdev support to sysmouse(4) driver

For horizontal (T-axis) wheel reporting which is not supported by
sysmouse protocol kern.evdev.sysmouse_t_axis sysctl is introduced.
It can take following values:

0 - no T-axis events (default)
1 - T-axis events are originated in ums(4) driver.
2 - T-axis events are originated in psm(4) driver.

Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D8597

7 years ago[iwn] Perform BUS_DMASYNC_PREREAD when initializing RX buffer
gonzo [Sat, 10 Dec 2016 17:59:34 +0000 (17:59 +0000)]
[iwn] Perform BUS_DMASYNC_PREREAD when initializing RX buffer

BUS_DMASYNC_PREREAD is required when setting up RX buffer, otherwise
data provided by card can be overwritten by data evicted from cache

Also use proper tag when setting up RX descriptor

Reviewed by: adrian, avos, ivadasz
Differential Revision: https://reviews.freebsd.org/D8717

7 years agorsu: increase Rx buffer size from 8k to 30k.
avos [Sat, 10 Dec 2016 17:06:55 +0000 (17:06 +0000)]
rsu: increase Rx buffer size from 8k to 30k.

This is required for USB Rx aggregation
(and fixes 'could not allocate RX mbuf' / few other failures).

While here, reduce the number of Rx buffers from 100 to 1 -
the driver never uses more than one Rx buffer.

Tested with Asus USB-N10.

7 years agoAdd support for encrypted kernel crash dumps.
def [Sat, 10 Dec 2016 16:20:39 +0000 (16:20 +0000)]
Add support for encrypted kernel crash dumps.

Changes include modifications in kernel crash dump routines, dumpon(8) and
savecore(8). A new tool called decryptcore(8) was added.

A new DIOCSKERNELDUMP I/O control was added to send a kernel crash dump
configuration in the diocskerneldump_arg structure to the kernel.
The old DIOCSKERNELDUMP I/O control was renamed to DIOCSKERNELDUMP_FREEBSD11 for
backward ABI compatibility.

dumpon(8) generates an one-time random symmetric key and encrypts it using
an RSA public key in capability mode. Currently only AES-256-CBC is supported
but EKCD was designed to implement support for other algorithms in the future.
The public key is chosen using the -k flag. The dumpon rc(8) script can do this
automatically during startup using the dumppubkey rc.conf(5) variable.  Once the
keys are calculated dumpon sends them to the kernel via DIOCSKERNELDUMP I/O
control.

When the kernel receives the DIOCSKERNELDUMP I/O control it generates a random
IV and sets up the key schedule for the specified algorithm. Each time the
kernel tries to write a crash dump to the dump device, the IV is replaced by
a SHA-256 hash of the previous value. This is intended to make a possible
differential cryptanalysis harder since it is possible to write multiple crash
dumps without reboot by repeating the following commands:
# sysctl debug.kdb.enter=1
db> call doadump(0)
db> continue
# savecore

A kernel dump key consists of an algorithm identifier, an IV and an encrypted
symmetric key. The kernel dump key size is included in a kernel dump header.
The size is an unsigned 32-bit integer and it is aligned to a block size.
The header structure has 512 bytes to match the block size so it was required to
make a panic string 4 bytes shorter to add a new field to the header structure.
If the kernel dump key size in the header is nonzero it is assumed that the
kernel dump key is placed after the first header on the dump device and the core
dump is encrypted.

Separate functions were implemented to write the kernel dump header and the
kernel dump key as they need to be unencrypted. The dump_write function encrypts
data if the kernel was compiled with the EKCD option. Encrypted kernel textdumps
are not supported due to the way they are constructed which makes it impossible
to use the CBC mode for encryption. It should be also noted that textdumps don't
contain sensitive data by design as a user decides what information should be
dumped.

savecore(8) writes the kernel dump key to a key.# file if its size in the header
is nonzero. # is the number of the current core dump.

decryptcore(8) decrypts the core dump using a private RSA key and the kernel
dump key. This is performed by a child process in capability mode.
If the decryption was not successful the parent process removes a partially
decrypted core dump.

Description on how to encrypt crash dumps was added to the decryptcore(8),
dumpon(8), rc.conf(5) and savecore(8) manual pages.

EKCD was tested on amd64 using bhyve and i386, mipsel and sparc64 using QEMU.
The feature still has to be tested on arm and arm64 as it wasn't possible to run
FreeBSD due to the problems with QEMU emulation and lack of hardware.

Designed by: def, pjd
Reviewed by: cem, oshogbo, pjd
Partial review: delphij, emaste, jhb, kib
Approved by: pjd (mentor)
Differential Revision: https://reviews.freebsd.org/D4712

7 years agoRegen after 309805
bapt [Sat, 10 Dec 2016 13:30:18 +0000 (13:30 +0000)]
Regen after 309805

7 years agorsu: add TSF field into Rx radiotap.
avos [Sat, 10 Dec 2016 13:30:16 +0000 (13:30 +0000)]
rsu: add TSF field into Rx radiotap.

Tested with Asus USB-N10.

7 years agoMake WITHOUT_CAPSICUM implying WITHOUT_CASPER
bapt [Sat, 10 Dec 2016 13:29:51 +0000 (13:29 +0000)]
Make WITHOUT_CAPSICUM implying WITHOUT_CASPER

PR: 214562
Reported by: dewayne@heuristicsystems.com.au
MFC after: 2 days

7 years agoFix pkg groupshow <gid>
bapt [Sat, 10 Dec 2016 12:48:48 +0000 (12:48 +0000)]
Fix pkg groupshow <gid>

PR: 204676
Submitted by: longwitz@incore.de
MFC after: 2 days

7 years agoRespect WITHOUT_FINGER in src.conf when running make delete-old
bapt [Sat, 10 Dec 2016 12:28:43 +0000 (12:28 +0000)]
Respect WITHOUT_FINGER in src.conf when running make delete-old

PR: 213719
Submitted by: philippe.michel7@sfr.fr
MFC after: 2 days

7 years agoRespect WITHOUT_BOOTPD in src.conf when running make delete-old
bapt [Sat, 10 Dec 2016 12:26:49 +0000 (12:26 +0000)]
Respect WITHOUT_BOOTPD in src.conf when running make delete-old

PR: 213720
Submitted by: philippe.michel7@sfr.fr
MFC after: 2 days

7 years agoRespect WITHOUT_BOOTPARAMD in src.conf when running make delete-old
bapt [Sat, 10 Dec 2016 12:24:31 +0000 (12:24 +0000)]
Respect WITHOUT_BOOTPARAMD in src.conf when running make delete-old

PR: 213721
Submitted by: philippe.michel7@sfr.fr
MFC after: 2 days

7 years agoRespect WITHOUT_RBOOTD in src.conf when running make delete-old
bapt [Sat, 10 Dec 2016 12:21:24 +0000 (12:21 +0000)]
Respect WITHOUT_RBOOTD in src.conf when running make delete-old

PR: 213722
Submitted by: philippe.michel7@sfr.fr
MFC after: 2 days

7 years agoAlso remove auditdistd files if src.conf has WITHOUT_AUDIT
bapt [Sat, 10 Dec 2016 12:18:03 +0000 (12:18 +0000)]
Also remove auditdistd files if src.conf has WITHOUT_AUDIT

PR: 213723
Submitted by: philippe.michel7@sfr.fr
MFC after: 2 days

7 years agoAdd entries to remove timed files with make delete-old if WITHOUT_TIMED is set
bapt [Sat, 10 Dec 2016 12:14:41 +0000 (12:14 +0000)]
Add entries to remove timed files with make delete-old if WITHOUT_TIMED is set

PR: 213724
Submitted by: philippe.michel7@sfr.fr
MFC after: 2 days

7 years agoPerl is not available in base fix scripts depending on it to use
bapt [Sat, 10 Dec 2016 12:02:32 +0000 (12:02 +0000)]
Perl is not available in base fix scripts depending on it to use
the version from ports

PR: 215159
Reported by: Anatoly Kamchatnov <akamch@gmail.com>
MFC after: 2 days

7 years agoUpdate pci ids database to 2016.11.21
bapt [Sat, 10 Dec 2016 11:41:26 +0000 (11:41 +0000)]
Update pci ids database to 2016.11.21

MFC after: 2 days

7 years agoThis adds a configuration for arm64 users that track CURRENT but
gnn [Sat, 10 Dec 2016 10:00:27 +0000 (10:00 +0000)]
This adds a configuration for arm64 users that track CURRENT but
don't need the extra debug facilities.  Copied from the amd64
configuration of the same name.

Submitted by: Nikolai Lifanov
Reviewed by: emaste
MFC after: 2 weeks

7 years agoAdd Genesys Logic USB hub.
phk [Sat, 10 Dec 2016 09:10:48 +0000 (09:10 +0000)]
Add Genesys Logic USB hub.

Make two other USB hub descriptions more precise.

7 years agoImprove upon r309394
marcel [Sat, 10 Dec 2016 03:31:38 +0000 (03:31 +0000)]
Improve upon r309394

Instead of taking an extra reference to deal with pfsync_q_ins()
and pfsync_q_del() taken and dropping a reference (resp,) make
it optional of those functions to take or drop a reference by
passing an extra argument.

Submitted by: glebius@

7 years agoDon't create FBT probes for lock owner methods.
markj [Sat, 10 Dec 2016 03:13:11 +0000 (03:13 +0000)]
Don't create FBT probes for lock owner methods.

These functions may be called in DTrace probe context, so they cannot be
safely traced. Moreover, they are currently only used by DTrace, so their
corresponding FBT probes are not particularly useful.

MFC after: 2 weeks

7 years agoConsistently use fbt_excluded() on all architectures.
markj [Sat, 10 Dec 2016 03:11:05 +0000 (03:11 +0000)]
Consistently use fbt_excluded() on all architectures.

MFC after: 2 weeks

7 years agoUse a consistent snapshot of the lock state in owner_mtx().
markj [Sat, 10 Dec 2016 02:59:34 +0000 (02:59 +0000)]
Use a consistent snapshot of the lock state in owner_mtx().

MFC after: 2 weeks

7 years agoReturn a non-NULL owner only if the lock is exclusively held in owner_sx().
markj [Sat, 10 Dec 2016 02:56:44 +0000 (02:56 +0000)]
Return a non-NULL owner only if the lock is exclusively held in owner_sx().

Fix some whitespace bugs while here.

MFC after: 2 weeks

7 years agolibelftc: add elf{32,64}-tradlittlemips target emulation names
emaste [Sat, 10 Dec 2016 01:40:10 +0000 (01:40 +0000)]
libelftc: add elf{32,64}-tradlittlemips target emulation names

Sponsored by: The FreeBSD Foundation

7 years agoUse _test_unmount instead of test_unmount in cleanup to avoid
ngie [Fri, 9 Dec 2016 23:44:25 +0000 (23:44 +0000)]
Use _test_unmount instead of test_unmount in cleanup to avoid
false positives with atf_check when tmpfs is not loaded, etc

MFC after: 1 week

7 years ago- Ignore errors from umount
ngie [Fri, 9 Dec 2016 23:43:33 +0000 (23:43 +0000)]
- Ignore errors from umount
- Use _test_unmount instead of test_unmount in cleanup

MFC after: 1 week

7 years agoMake test_unmount usable in cleanup subroutines
ngie [Fri, 9 Dec 2016 23:42:04 +0000 (23:42 +0000)]
Make test_unmount usable in cleanup subroutines

- Duplicate test_unmount to _test_unmount
- Remove atf_check calls
- Call _test_unmount from test_unmount, checking the exit code
  at the end, and returning it to maintain the test_unmount
  "contract"

MFC after: 1 week

7 years agoImplement Intel's log page 0xc1 (Read Command Latency Log) and page
imp [Fri, 9 Dec 2016 23:37:14 +0000 (23:37 +0000)]
Implement Intel's log page 0xc1 (Read Command Latency Log) and page
0xc1 (Write Command Latency Log).

Sponsored By: Netflix, Inc

7 years agoPermit loading of efirt module even when there's no EFI to call. The
imp [Fri, 9 Dec 2016 23:37:11 +0000 (23:37 +0000)]
Permit loading of efirt module even when there's no EFI to call. The
module loading is successful, but attempts to use it will not be
successful. This is similar to what we do (did?) with ACPI on non-ACPI
systems. We succeed if we can't find the necessary information to hook
into EFI, but still fail if we're unable to allocate resources if we
do find EFI.

Not Objected to by: kib@
MFC Afer: 3 days

7 years agoKeep /usr/bin/ld for WITHOUT_BINUTILS but WITH_LLD_AS_LD
emaste [Fri, 9 Dec 2016 22:51:58 +0000 (22:51 +0000)]
Keep /usr/bin/ld for WITHOUT_BINUTILS but WITH_LLD_AS_LD

Reported by: Nikolai Lifanov

7 years agoOnly run mdconfig -d -u 3 if /dev/md3 exists on the system
ngie [Fri, 9 Dec 2016 22:50:43 +0000 (22:50 +0000)]
Only run mdconfig -d -u 3 if /dev/md3 exists on the system

This will prevent "cleanup failures" (exit code != 0 returned) when
tmpfs is not loaded

MFC after: 1 week

7 years agoCheck that SCM_XXX timestamp returned by the kernel is less 1 second
sobomax [Fri, 9 Dec 2016 22:13:00 +0000 (22:13 +0000)]
Check that SCM_XXX timestamp returned by the kernel is less 1 second
away in the past from the current time. This should be plenty for the
scheduler to do its job. It provides assurance that the timestamp
returned is actually a valid one, not just some random garbage.

7 years agoAllow bogus_page to be passed to pager(s).
glebius [Fri, 9 Dec 2016 21:21:24 +0000 (21:21 +0000)]
Allow bogus_page to be passed to pager(s).

7 years agoFix build for 32-bit machines.
glebius [Fri, 9 Dec 2016 20:50:35 +0000 (20:50 +0000)]
Fix build for 32-bit machines.

Submitted by: tuexen

7 years agosrc.conf.5: regen after r309142 (WITH_LLD_AS_LD knob)
emaste [Fri, 9 Dec 2016 19:09:58 +0000 (19:09 +0000)]
src.conf.5: regen after r309142 (WITH_LLD_AS_LD knob)

Reported by: Nikolai Lifanov
Sponsored by: The FreeBSD Foundation

7 years agoUse acquire write to cr_lock to complement with release write at end
glebius [Fri, 9 Dec 2016 19:07:31 +0000 (19:07 +0000)]
Use acquire write to cr_lock to complement with release write at end
of locked region.

Submitted by: kib

7 years agoConditionalize PG_CACHE sysctls on COMPAT_FREEBSD11.
markj [Fri, 9 Dec 2016 18:55:27 +0000 (18:55 +0000)]
Conditionalize PG_CACHE sysctls on COMPAT_FREEBSD11.

Reviewed by: glebius, imp, jhb
Differential Revision: https://reviews.freebsd.org/D8736

7 years agoAdd a COMPAT_FREEBSD11 kernel option.
markj [Fri, 9 Dec 2016 18:54:12 +0000 (18:54 +0000)]
Add a COMPAT_FREEBSD11 kernel option.

Use it wherever COMPAT_FREEBSD10 is currently specified.

Reviewed by: glebius, imp, jhb
Differential Revision: https://reviews.freebsd.org/D8736

7 years agoTreat R_X86_64_PLT32 relocs as R_X86_64_PC32.
glebius [Fri, 9 Dec 2016 18:07:28 +0000 (18:07 +0000)]
Treat R_X86_64_PLT32 relocs as R_X86_64_PC32.

If we load a binary that is designed to be a library, it produces
relocatable code via assembler directives in the assembly itself
(rather than compiler options).  This emits R_X86_64_PLT32 relocations,
which are not handled by the kernel linker.

Submitted by: gallatin
Reviewed by: kib

7 years agoBackout accidentially leaked in r309746 not yet reviewed patch :(
glebius [Fri, 9 Dec 2016 18:00:45 +0000 (18:00 +0000)]
Backout accidentially leaked in r309746 not yet reviewed patch :(

7 years agoUse counter_ratecheck() in the ICMP rate limiting.
glebius [Fri, 9 Dec 2016 17:59:15 +0000 (17:59 +0000)]
Use counter_ratecheck() in the ICMP rate limiting.

Together with: rrs, jtl

7 years agoProvide counter_ratecheck(), a MP-friendly substitution to ppsratecheck().
glebius [Fri, 9 Dec 2016 17:58:34 +0000 (17:58 +0000)]
Provide counter_ratecheck(), a MP-friendly substitution to ppsratecheck().
When rated event happens at a very quick rate, the ppsratecheck() is not
only racy, but also becomes a performance bottleneck.

Together with: rrs, jtl

7 years agoDon't bundle a SACK chunk with a SHUTDOWN chunk if it is not required.
tuexen [Fri, 9 Dec 2016 17:58:07 +0000 (17:58 +0000)]
Don't bundle a SACK chunk with a SHUTDOWN chunk if it is not required.

MFC after: 1 week

7 years agoDon't send multiple SHUTDOWN chunks in a single packet.
tuexen [Fri, 9 Dec 2016 17:57:17 +0000 (17:57 +0000)]
Don't send multiple SHUTDOWN chunks in a single packet.

Thanks to Felix Weinrank for making me aware of this issue.

MFC after: 1 week

7 years agoAdd registers for jz4780 audio and PDMA controllers.
br [Fri, 9 Dec 2016 17:16:09 +0000 (17:16 +0000)]
Add registers for jz4780 audio and PDMA controllers.

Sponsored by: DARPA, AFRL

7 years agoMore debugging code I missed in r309051.
des [Fri, 9 Dec 2016 16:14:55 +0000 (16:14 +0000)]
More debugging code I missed in r309051.

Reported by: jbeich, jkim

7 years agoAdd more LinuxKPI PCI definitions.
hselasky [Fri, 9 Dec 2016 15:05:09 +0000 (15:05 +0000)]
Add more LinuxKPI PCI definitions.

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

7 years agoPrefer function macros over regular macros in the LinuxKPI.
hselasky [Fri, 9 Dec 2016 15:01:37 +0000 (15:01 +0000)]
Prefer function macros over regular macros in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoCapsicum support for dd(1)
robak [Fri, 9 Dec 2016 14:51:05 +0000 (14:51 +0000)]
Capsicum support for dd(1)

Adds Capsicum sandboxing to dd utility.

Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com>
Reviewed by: allanjude, emaste, oshogbo
Approved by: oshogbo
Sponsored by: Mysterious Code Ltd.
Differential Revision: https://reviews.freebsd.org/D8543

7 years agoAvoid malloc() warnings when using the LinuxKPI by zero-checking
hselasky [Fri, 9 Dec 2016 14:06:22 +0000 (14:06 +0000)]
Avoid malloc() warnings when using the LinuxKPI by zero-checking
the allocation flags.

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

7 years agoMSIX can support more than 256 IRQs. Make sure the invalid IRQ number
hselasky [Fri, 9 Dec 2016 13:53:31 +0000 (13:53 +0000)]
MSIX can support more than 256 IRQs. Make sure the invalid IRQ number
set in the LinuxKPI is big enough.

Sponsored by:           Mellanox Technologies
MFC after: 1 week

7 years agoPrefix some _pci_xxx() functions in the Linux KPI with linux_ and make
hselasky [Fri, 9 Dec 2016 13:47:50 +0000 (13:47 +0000)]
Prefix some _pci_xxx() functions in the Linux KPI with linux_ and make
sure the IRQ number used by these functions is unsigned.

Sponsored by:           Mellanox Technologies
MFC after: 1 week

7 years agoPrefix the Linux KPI's kmem_xxx() functions with linux_ to avoid
hselasky [Fri, 9 Dec 2016 13:41:26 +0000 (13:41 +0000)]
Prefix the Linux KPI's kmem_xxx() functions with linux_ to avoid
conflict with the opensolaris kernel module.

This patch solves a problem where the kernel linker will incorrectly
resolve opensolaris kmem_xxx() functions as linuxkpi ones, which leads
to a panic when these functions are used.

Submitted by: gallatin @
Sponsored by:           Mellanox Technologies
MFC after: 1 week

7 years agohyperv/storvsc: Minor style changes; no functional changes.
sephe [Fri, 9 Dec 2016 06:18:12 +0000 (06:18 +0000)]
hyperv/storvsc: Minor style changes; no functional changes.

Reported by: rpokala
MFC after: 1 week
Sponsored by: Microsoft

7 years agohyperv/storvsc: Fix the SCSI disk attachment issue.
sephe [Fri, 9 Dec 2016 03:16:36 +0000 (03:16 +0000)]
hyperv/storvsc: Fix the SCSI disk attachment issue.

On pre-WS2016 Hyper-V, if the only LUNs > 7 are used, then all disks
fails to attach.  Mainly because those versions of Hyper-V do not set
SRB_STATUS properly and deliver junky INQUERY responses.

Submitted by: Hongjiang Zhang <honzhan microsoft com>
Reported by: Hongxiong Xian <v-hoxian microsoft com>
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8724

7 years agocxgbe(4): netmap does not set IFCAP_NETMAP in an ifnet's if_capabilities
np [Fri, 9 Dec 2016 02:21:27 +0000 (02:21 +0000)]
cxgbe(4): netmap does not set IFCAP_NETMAP in an ifnet's if_capabilities
any more (since r307394).  Do it in the driver instead.

MFC after: 1 week

7 years agoPatch the nfsd so that it doesn't register with rpcbind for an NFSv4 only
rmacklem [Thu, 8 Dec 2016 23:29:56 +0000 (23:29 +0000)]
Patch the nfsd so that it doesn't register with rpcbind for an NFSv4 only
server.

This patch uses the sysctl vfs.nfsd.server_min_nfsvers to determine
if/what versions of NFS service should be registered with rpcbind.
For NFSv4 only, it does not register at all, since NFSv4 always uses 2049
and does not require rpcbind.
For NFSv3 minimum, it registers NFSv3 but not NFSv2.

Tested by: jmader2@gmu.edu
Submitted by: jmader2@gmu.edu (earlier version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D8696

7 years agoPull in r281586 from upstream llvm trunk (by Wei Mi):
dim [Thu, 8 Dec 2016 21:02:34 +0000 (21:02 +0000)]
Pull in r281586 from upstream llvm trunk (by Wei Mi):

  Add some shortcuts in LazyValueInfo to reduce compile time of
  Correlated Value Propagation.

  The patch is to partially fix PR10584. Correlated Value Propagation
  queries LVI to check non-null for pointer params of each callsite. If
  we know the def of param is an alloca instruction, we know it is
  non-null and can return early from LVI. Similarly, CVP queries LVI to
  check whether pointer for each mem access is constant. If the def of
  the pointer is an alloca instruction, we know it is not a constant
  pointer. These shortcuts can reduce the cost of CVP significantly.

  Differential Revision: https://reviews.llvm.org/D18066

This significantly reduces memory usage and compilation time when
compiling a particular C++ source file of the graphics/colmap port.

PR: 215136
MFC after: 3 days

7 years agorsu: fix incorrect register addresses.
avos [Thu, 8 Dec 2016 20:54:54 +0000 (20:54 +0000)]
rsu: fix incorrect register addresses.

7 years agoFunctions in their own section
dteske [Thu, 8 Dec 2016 19:28:12 +0000 (19:28 +0000)]
Functions in their own section

7 years agoRemove unnecessary trailing backslashes
dteske [Thu, 8 Dec 2016 19:26:22 +0000 (19:26 +0000)]
Remove unnecessary trailing backslashes

7 years agoerr.D_PROC_CREATEFAIL.many.d passes, so remove the EFAIL annotation.
markj [Thu, 8 Dec 2016 18:56:35 +0000 (18:56 +0000)]
err.D_PROC_CREATEFAIL.many.d passes, so remove the EFAIL annotation.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoFix the typos and style(9) in comment.
loos [Thu, 8 Dec 2016 18:18:48 +0000 (18:18 +0000)]
Fix the typos and style(9) in comment.

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

7 years agoAdd support for "hidden" Wi-Fi networks
dteske [Thu, 8 Dec 2016 16:41:18 +0000 (16:41 +0000)]
Add support for "hidden" Wi-Fi networks

PR: bin/214933
Submitted by: Maxim Filimonov <che@bein.link>
Reviewed by: dteske, allanjude, adrian
MFC after: 6 days
X-MFC-with: Follow-up commit for style

7 years agoAdd jz4780 internal codec initialization driver.
br [Thu, 8 Dec 2016 16:28:34 +0000 (16:28 +0000)]
Add jz4780 internal codec initialization driver.

Sponsored by: DARPA, AFRL

7 years agoFix spa_alloc_tree sorting by offset in r305331.
mav [Thu, 8 Dec 2016 15:58:03 +0000 (15:58 +0000)]
Fix spa_alloc_tree sorting by offset in r305331.

Original commit "7090 zfs should improve allocation order" declares alloc
queue sorted by time and offset.  But in practice io_offset is always zero,
so sorting happened only by time, while order of writes with equal time was
completely random.  On Illumos this did not affected much thanks to using
high resolution timestamps.  On FreeBSD due to using much faster but low
resolution timestamps it caused bad data placement on disks, affecting
further read performance.

This change switches zio_timestamp_compare() from comparing uninitialized
io_offset to really populated io_bookmark values.  I haven't decided yet
what to do with timestampts, but on simple tests this change gives the
same peformance results by just making code to work as declared.

MFC after: 1 week

7 years agoUse the populate() driver paging method for i915 driver.
kib [Thu, 8 Dec 2016 11:39:08 +0000 (11:39 +0000)]
Use the populate() driver paging method for i915 driver.

In particular, the fault access type is accounted for when the
aperture page is moved to GTT domain.  On the other hand, the current
pager structure is left intact, most important, only one page is
instantiated per populate call.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

7 years agoImplement the populate() pager method for phys pager.
kib [Thu, 8 Dec 2016 11:35:53 +0000 (11:35 +0000)]
Implement the populate() pager method for phys pager.

It allows to provide configurable agressive prefaulting and useful
hints to page daemon about memory allocations, on faults for pages
managed by phys pager.  In fact, this implementation is superior to
the MAP_SHARED_PHYS hack from my Postgresql paper, while giving
similar benefits of reducing the page faults numbers on SysV shared
memory mappings.

Reviewed by: alc
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

7 years agoAdd a new populate() pager method and extend device pager ops vector
kib [Thu, 8 Dec 2016 11:26:11 +0000 (11:26 +0000)]
Add a new populate() pager method and extend device pager ops vector
with cdev_pg_populate() to provide device drivers access to it.  It
gives drivers fine control of the pages ownership and allows drivers
to implement arbitrary prefault policies.

The populate method is called on a page fault and is supposed to
populate the vm object with the page at the fault location and some
amount of pages around it, at pager's discretion.  VM provides the
pager with the hints about current range of the object mapping, to
avoid instantiation of immediately unused pages, if pager decides so.
Also, VM passes the fault type and map entry protection to the pager,
allowing it to force the optimal required ownership of the mapped
pages.

Installed pages must contiguously fill the returned region, be fully
valid and exclusively busied.  Of course, the pages must be compatible
with the object' type.

After populate() successfully returned, VM fault handler installs as
many instantiated pages into the process page tables as it sees
reasonable, while still obeying the correct semantic for COW and vm
map locking.

The method is opt-in, pager sets OBJ_POPULATE flag to indicate that
the method can be called.  If pager' vm objects can be shadowed, pager
must implement the traditional getpages() method in addition to the
populate().  Populate() might fall back to the getpages() on per-call
basis as well, by returning VM_PAGER_BAD error code.

For now for device pagers, the populate() method is only allowed to be
used by the managed device pagers, but the limitation is only made
because there is no unmanaged fault handlers which could use it right
now.

KPI designed together with, and reviewed by: alc
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

7 years agoMove map_generation snapshot value into struct faultstate.
kib [Thu, 8 Dec 2016 10:29:41 +0000 (10:29 +0000)]
Move map_generation snapshot value into struct faultstate.

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

7 years agoStyle.
kib [Thu, 8 Dec 2016 10:28:51 +0000 (10:28 +0000)]
Style.

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

7 years ago[net80211] add a field for storing a 64 bit TSC.
adrian [Thu, 8 Dec 2016 07:57:16 +0000 (07:57 +0000)]
[net80211] add a field for storing a 64 bit TSC.

7 years ago[net80211] begin fleshing out support for channel survey information to be
adrian [Thu, 8 Dec 2016 07:56:25 +0000 (07:56 +0000)]
[net80211] begin fleshing out support for channel survey information to be
pushed back up into net80211.

7 years agohyperv/timesync: Support "sent TC" to improve accuracy.
sephe [Thu, 8 Dec 2016 05:37:39 +0000 (05:37 +0000)]
hyperv/timesync: Support "sent TC" to improve accuracy.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8723

7 years agohyperv/vmbus: Utilize vmbus_chan_run_task()
sephe [Thu, 8 Dec 2016 05:15:00 +0000 (05:15 +0000)]
hyperv/vmbus: Utilize vmbus_chan_run_task()

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8686

7 years agoPreviously, vm_radix_remove() would panic if the radix trie didn't
alc [Thu, 8 Dec 2016 04:29:29 +0000 (04:29 +0000)]
Previously, vm_radix_remove() would panic if the radix trie didn't
contain a vm_page_t at the specified index.  However, with this
change, vm_radix_remove() no longer panics.  Instead, it returns NULL
if there is no vm_page_t at the specified index.  Otherwise, it
returns the vm_page_t.  The motivation for this change is that it
simplifies the use of radix tries in the amd64, arm64, and i386 pmap
implementations.  Instead of performing a lookup before every remove,
the pmap can simply perform the remove.

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D8708

7 years agoUse the correct path to date(1).
markj [Wed, 7 Dec 2016 23:38:18 +0000 (23:38 +0000)]
Use the correct path to date(1).

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoUse the native data model instead of forcing ILP32 in tst.provregex3.ksh.
markj [Wed, 7 Dec 2016 23:37:51 +0000 (23:37 +0000)]
Use the native data model instead of forcing ILP32 in tst.provregex3.ksh.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoRun DTrace test scripts with "tst" set to the test script file name.
markj [Wed, 7 Dec 2016 23:36:15 +0000 (23:36 +0000)]
Run DTrace test scripts with "tst" set to the test script file name.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agonet80211: remove obsolete comment.
avos [Wed, 7 Dec 2016 23:33:59 +0000 (23:33 +0000)]
net80211: remove obsolete comment.

The described LOR should be fixed in r302283.

7 years agoAddress regressions in SA-16:37.libc.
glebius [Wed, 7 Dec 2016 23:18:00 +0000 (23:18 +0000)]
Address regressions in SA-16:37.libc.

PR: 215105
Submitted by: <jtd2004a sbcglobal.net>

7 years agoSwitch if_run.c to use a bitmap for debug levels rather than arbitrary
gavin [Wed, 7 Dec 2016 22:52:12 +0000 (22:52 +0000)]
Switch if_run.c to use a bitmap for debug levels rather than arbitrary
values. This more closely matches other wifi drivers in the tree.
The bitmap levels have been based closely on other drivers (primarily
[u]rtwn(4)) in the hope that one day these can be unified into a shared
wifi-debug framework.

This is the first step of several pieces of work I'm planning on doing
with the run(4) driver. I may well adjust and refine some of the debug
bitmaps at a later date.

Reviewed by: adrian, avos
Differential Revision: https://reviews.freebsd.org/D8704