]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoReplace spaces with tabs in definition of SCTP system calls, for consistency
rwatson [Wed, 7 Dec 2016 16:11:55 +0000 (16:11 +0000)]
Replace spaces with tabs in definition of SCTP system calls, for consistency
with the remainder of the syscalls.master file.  This problem does not occur
in the freebsd32 version of the same system calls.

7 years agoExport the whole thread name in kinfo_proc
vangyzen [Wed, 7 Dec 2016 15:04:22 +0000 (15:04 +0000)]
Export the whole thread name in kinfo_proc

kinfo_proc::ki_tdname is three characters shorter than
thread::td_name.  Add a ki_moretdname field for these three
extra characters.  Add the new field to kinfo_proc32, as well.
Update all in-tree consumers to read the new field and assemble
the full name, except for lldb's HostThreadFreeBSD.cpp, which
I will handle separately.  Bump __FreeBSD_version.

Reviewed by: kib
MFC after: 1 week
Relnotes: yes
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D8722

7 years agoAdd ACPI support to the arm64 mp code. We use the Multiple APIC Description
andrew [Wed, 7 Dec 2016 14:35:05 +0000 (14:35 +0000)]
Add ACPI support to the arm64 mp code. We use the Multiple APIC Description
Table to find the CPUs to find the CPUs to start. Currently we assume PSCI,
however this assumption is shared with the FDT code.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoAdd ACPI support to the PSCI driver. This checks the Fixed ACPI Description
andrew [Wed, 7 Dec 2016 14:24:53 +0000 (14:24 +0000)]
Add ACPI support to the PSCI driver. This checks the Fixed ACPI Description
Table to find if the hardware supports PSCI, and if so what method the
kernel should use to interact with it.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoStyle fix.
br [Wed, 7 Dec 2016 13:19:19 +0000 (13:19 +0000)]
Style fix.

Sponsored by: DARPA, AFRL

7 years agohyperv/vmbus: Use pause if possible.
sephe [Wed, 7 Dec 2016 08:12:02 +0000 (08:12 +0000)]
hyperv/vmbus: Use pause if possible.

This makes booting on Hyper-V w/ small # of vCPUs work properly.

Reported by: Hongxiong Xian <v-hoxian microsoft com>, Hongjiang Zhang <honzhan microsoft com>
MFC after: 1 week
Sponsored by: Microsoft

7 years agoFix a kernel panic in DTrace's rw_iswriter subroutine.
gnn [Wed, 7 Dec 2016 07:27:47 +0000 (07:27 +0000)]
Fix a kernel panic in DTrace's rw_iswriter subroutine.
On FreeBSD the sense of rw_write_held() and rw_iswriter() were reversed,
probably due to a cut and paste error. Using rw_iswriter() would cause
the kernel to panic.

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

7 years agoFix typo.
delphij [Wed, 7 Dec 2016 06:29:01 +0000 (06:29 +0000)]
Fix typo.

7 years agocxgbe(4): unsigned short isn't large enough to store link speed (which
np [Wed, 7 Dec 2016 04:23:08 +0000 (04:23 +0000)]
cxgbe(4): unsigned short isn't large enough to store link speed (which
is in Mbps) for 100Gbps links.

MFC after: 3 days

7 years ago[net80211] flesh out more RX phy information.
adrian [Wed, 7 Dec 2016 04:03:51 +0000 (04:03 +0000)]
[net80211] flesh out more RX phy information.

I'm teaching my ath10k port to communicate up the per-rate / channel width
information I get from the firmware.

The HT40 flag field should just be retired and instead moved to use the
PHY bandwidth field.

7 years ago[net80211] start refactoring out the "am I a wep / group key!" code.
adrian [Wed, 7 Dec 2016 04:02:41 +0000 (04:02 +0000)]
[net80211] start refactoring out the "am I a wep / group key!" code.

This is a bunch of pointer arithmetic that is copypasta'ed everywhere.
Let's undo that copypasta.

7 years agoUse the official spelling for NULL arguments to typed sysctl handlers.
markj [Wed, 7 Dec 2016 01:15:10 +0000 (01:15 +0000)]
Use the official spelling for NULL arguments to typed sysctl handlers.

Reported by: bde

7 years agoConvert result of hash_packet6() into host byte order.
ae [Tue, 6 Dec 2016 23:52:56 +0000 (23:52 +0000)]
Convert result of hash_packet6() into host byte order.

For IPv4 similar function uses addresses and ports in host byte order,
but for IPv6 it used network byte order. This led to very bad hash
distribution for IPv6 flows. Now the result looks similar to IPv4.

Reported by: olivier
MFC after: 1 week
Sponsored by: Yandex LLC

7 years agoSupport spaces in group names.
bdrewery [Tue, 6 Dec 2016 23:43:04 +0000 (23:43 +0000)]
Support spaces in group names.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoProvide dummy sysctls for v_cache_count and v_tcached.
markj [Tue, 6 Dec 2016 22:52:45 +0000 (22:52 +0000)]
Provide dummy sysctls for v_cache_count and v_tcached.

Some utilities (notably top(1)) exit if any of their input sysctls don't
exist, and the removal of the above-mentioned PG_CACHE-related sysctls
makes it difficult to run such utilities on different versions of the
kernel without recompiling.

Requested by: bde

7 years agoRequire the STACK option for code that captures stacks of running threads.
markj [Tue, 6 Dec 2016 22:48:28 +0000 (22:48 +0000)]
Require the STACK option for code that captures stacks of running threads.

stack_machdep.c is compiled if either of the DDB or STACK options is
specified, but stack_save_td_running() isn't useable from DDB. Moreover,
stack_save_td_running() works by raising an NMI on the CPU running the
target thread, and the corresponding handler is compiled only if STACK is
configured.

Reported by: kib
MFC after: 1 week

7 years agoDuring the bootstrap phase, when building the minimal llvm library on
dim [Tue, 6 Dec 2016 20:44:40 +0000 (20:44 +0000)]
During the bootstrap phase, when building the minimal llvm library on
PowerPC, add lib/Support/Atomic.cpp.  This is needed because upstream
llvm revision r271821 disabled the use of std::call_once, which causes
some fallback functions from Atomic.cpp to be used instead.

Reported by: Mark Millard
PR: 214902
X-MFC-With: 309124

7 years agoProperly sign extend the result of jrand48() and mrand48().
ed [Tue, 6 Dec 2016 19:08:29 +0000 (19:08 +0000)]
Properly sign extend the result of jrand48() and mrand48().

These functions are supposed to return a value between [_2^31, 2^31).
This doesn't seem to work on 64-bit systems, where we return a value
between [0, 3^32). Patch up the function to use proper casts to int32_t.
While there, fix some other style bugs.

MFC after: 2 weeks

7 years agotcpdump: allow to use BIOCROTZBUF in capability mode
oshogbo [Tue, 6 Dec 2016 18:58:42 +0000 (18:58 +0000)]
tcpdump: allow to use BIOCROTZBUF in capability mode

The libpcap library can use a BIOCROTZBUF ioctl when net.bpf.zerocopy_enable
sysctl is set.

Reported by: olivier@
Tested by: olivier@

7 years agoFix possible integer overflow in guest memory bounds checking, which could
glebius [Tue, 6 Dec 2016 18:50:44 +0000 (18:50 +0000)]
Fix possible integer overflow in guest memory bounds checking, which could
lead to access from the virtual machine to the heap of the bhyve(8) process.

Submitted by: Felix Wilhelm <fwilhelm ernw.de>
Patch by: grehan
Security: FreeBSD-SA-16:38.bhyve

7 years agoFix possible buffer overflow(s) in link_ntoa(3).
glebius [Tue, 6 Dec 2016 18:50:33 +0000 (18:50 +0000)]
Fix possible buffer overflow(s) in link_ntoa(3).

A specially crafted sockaddr_dl argument can trigger a static buffer overflow
in the libc library, with possibility to rewrite with arbitrary data following
static buffers that belong to other library functions.

Reviewed by: kib
Security: FreeBSD-SA-16:37.libc

7 years agoWhen telnetd(8) composes argument list for login(1), an unexpected sequence
glebius [Tue, 6 Dec 2016 18:50:22 +0000 (18:50 +0000)]
When telnetd(8) composes argument list for login(1), an unexpected sequence
of memory allocation failures combined with insufficient error checking
could result in the construction and execution of an argument sequence that
was not intended.

Fix that treating malloc(3) failures as fatal condition.

Submitted by: brooks
Security: FreeBSD-SA-16:36.telnetd

7 years agoAuto-generate 2 test cases that differ only in structure and SCM_XXX constant
sobomax [Tue, 6 Dec 2016 18:22:25 +0000 (18:22 +0000)]
Auto-generate 2 test cases that differ only in structure and SCM_XXX constant
used. We can do it programmatically, but that would make code convoluted
and more complex. I have two more of those types coming for the CLOCK_REALTIME
and CLOCK_MONOTONIC. This seems like an elegant and scallable approach.

7 years agoDo not leak curthread->inact_mtx when cancelling in pthread_cond_wait(3).
kib [Tue, 6 Dec 2016 17:13:17 +0000 (17:13 +0000)]
Do not leak curthread->inact_mtx when cancelling in pthread_cond_wait(3).

Leave robust-protected region before checking for cancellation by
calling _thr_testcancel().  Otherwise, if cancelling request was
pending, the cancel handler is called with the dandling inact_mtx,
which triggers an assert if any mutex operation is performed by the
handler.

Reported and tested by: Dimitri Staessens <dimitri.staessens@intec.ugent.be>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRemove unneeded hack fixed by r309626.
bdrewery [Tue, 6 Dec 2016 17:06:14 +0000 (17:06 +0000)]
Remove unneeded hack fixed by r309626.

strvis(3) being tainted by our mbtowc(3) calls was causing
spurious failures here.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agostrvis(3): Avoid internal state of multibyte functions being tainted.
bdrewery [Tue, 6 Dec 2016 17:05:02 +0000 (17:05 +0000)]
strvis(3): Avoid internal state of multibyte functions being tainted.

The mbtoc(3) and wctomb(3) functions use internal state which may be
tainted before the call to strvis(3).  In this context we can just use
the thread-safe versions mbrtoc(3) and wcrtomb(3) which allow passing
our own state from our stack.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoAdd rcorder-visualize.sh, which generates graphviz from rc.d scripts
vangyzen [Tue, 6 Dec 2016 15:49:39 +0000 (15:49 +0000)]
Add rcorder-visualize.sh, which generates graphviz from rc.d scripts

This is imported from NetBSD.  The author--Joerg Sonnenberger--agreed
to apply a two-clause BSD license, just so the license was clear.

This source tree location matches NetBSD, and is the first place someone
might look for such a tool.

Obtained from: Joerg Sonnenberger via NetBSD
MFC after: 3 days
Sponsored by: Dell EMC

7 years agolocale: fix the powerpc build
vangyzen [Tue, 6 Dec 2016 15:42:18 +0000 (15:42 +0000)]
locale: fix the powerpc build

Reported by: markj (and bde, in a way)
MFC after: 3 days
X-MFC with: r309364
Sponsored by: Dell EMC

7 years agoAdd the missing gic_common.h include for GIC_BUS_FDT.
andrew [Tue, 6 Dec 2016 15:16:00 +0000 (15:16 +0000)]
Add the missing gic_common.h include for GIC_BUS_FDT.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoCreate two GIC ivars to find the bus type and GIC hardware version. These
andrew [Tue, 6 Dec 2016 15:12:14 +0000 (15:12 +0000)]
Create two GIC ivars to find the bus type and GIC hardware version. These
will be used by the gicv2m and ITS ACPI drivers to only attach to the
correct parent.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoifndef atomic_cas_* in cddl code in preparation for native implementations
mjg [Tue, 6 Dec 2016 14:08:49 +0000 (14:08 +0000)]
ifndef atomic_cas_* in cddl code in preparation for native implementations

This is a temporary change to not require all architectures to import at once.

Discussed with: jhb

7 years agoMove the common bit manipulation macros from the GICv3 header to the
andrew [Tue, 6 Dec 2016 13:55:19 +0000 (13:55 +0000)]
Move the common bit manipulation macros from the GICv3 header to the
common GIC header file.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMove the stored signal mask later in the jump buf. It was being clobbered
andrew [Tue, 6 Dec 2016 13:46:12 +0000 (13:46 +0000)]
Move the stored signal mask later in the jump buf. It was being clobbered
by a later store of a VFP register.

Sponsored by: ABT Systems Ltd

7 years agoAdda new common GIC header to handle the common parts of the GICv2 and
andrew [Tue, 6 Dec 2016 12:57:28 +0000 (12:57 +0000)]
Adda new common GIC header to handle the common parts of the GICv2 and
GICv3 drivers. For now it just contains common distributor registers.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agocxgbe(4): Update firmwares from version 1.16.12.0 to 1.16.22.0.
np [Tue, 6 Dec 2016 12:43:07 +0000 (12:43 +0000)]
cxgbe(4): Update firmwares from version 1.16.12.0 to 1.16.22.0.

Obtained from: Chelsio Communications
MFC after: 3 days
Sponsored by: Chelsio Communications

7 years agoAdd the full set of GICD_PIDR* registers
andrew [Tue, 6 Dec 2016 11:41:19 +0000 (11:41 +0000)]
Add the full set of GICD_PIDR* registers

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoWhitespace changes.
tuexen [Tue, 6 Dec 2016 10:21:25 +0000 (10:21 +0000)]
Whitespace changes.

The tools using to generate the sources has been updated and produces
different whitespaces. Commit this seperately to avoid intermixing
these with real code changes.

MFC after: 3 days

7 years agoFix the armv6 build after r309553.
loos [Tue, 6 Dec 2016 06:15:28 +0000 (06:15 +0000)]
Fix the armv6 build after r309553.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agorsu: fix printf format specifiers.
avos [Tue, 6 Dec 2016 06:12:01 +0000 (06:12 +0000)]
rsu: fix printf format specifiers.

7 years agoRemove svn[lite]{bench,fsfs} if either MK_SVN == no or MK_SVNLITE == no
ngie [Tue, 6 Dec 2016 06:04:13 +0000 (06:04 +0000)]
Remove svn[lite]{bench,fsfs} if either MK_SVN == no or MK_SVNLITE == no

MFC after: 1 week

7 years agolibdtrace: Don't use a read-only handle for enumerating pid probes.
markj [Tue, 6 Dec 2016 04:28:56 +0000 (04:28 +0000)]
libdtrace: Don't use a read-only handle for enumerating pid probes.

Enumeration of return probes involves disassembling subroutines in the
target process, and ptrace(2) is currently used to read from the target
process. libproc could read from the backing file instead to avoid this
problem, but in the common case libdtrace will have a writeable handle
on the process anyway. In particular, a writeable handle is needed to list
USDT probes, and libdtrace will cache such a handle for processes that it
controls via dtrace -c and -p.

7 years agoBump the libproc library version.
markj [Tue, 6 Dec 2016 04:23:32 +0000 (04:23 +0000)]
Bump the libproc library version.

7 years agolibproc: Add support for some proc_attach() flags.
markj [Tue, 6 Dec 2016 04:22:38 +0000 (04:22 +0000)]
libproc: Add support for some proc_attach() flags.

This change adds some handling for the equivalent of Solaris' PGRAB_*
flags. In particular, support for PGRAB_RDONLY is needed to avoid a
nasty deadlock: dtrace(1) may otherwise stop the master process for its
pseudo-terminal and end up blocking while writing to standard output.

7 years agolibproc: Cache symbol tables for mapped objects upon access.
markj [Tue, 6 Dec 2016 04:21:35 +0000 (04:21 +0000)]
libproc: Cache symbol tables for mapped objects upon access.

Extend the file handle cache entries to include symbol tables as well. An
index is used to implement binary search by symbol value. Lookups by
name are comparatively rare and are thus still implemented with a linear
search, but support for a binary search by name would be straightforward
to add if needed.

7 years agolibproc: Match prefixes when looking up mapped object by name.
markj [Tue, 6 Dec 2016 04:20:32 +0000 (04:20 +0000)]
libproc: Match prefixes when looking up mapped object by name.

When looking up an object by name, allow prefix matches if no direct match
is found. This allows one to, for example, match libc entry probes with:

 # dtrace -n 'pid$target:libc.so::entry' -c ./foo

instead of requiring "libc.so.7" or a glob.

Also remove proc_obj2map() as it currently just duplicates the
functionality of proc_name2map(). It's supposed to take a Solaris
link-map ID as a paramter, but support for this isn't implemented and
isn't required to support DTrace's pid provider.

7 years agolibproc: Cache ELF handles for loaded objects.
markj [Tue, 6 Dec 2016 04:19:08 +0000 (04:19 +0000)]
libproc: Cache ELF handles for loaded objects.

libproc previously created a new handle for each symbol lookup, which
gives rather egregious performance for DTrace's ustack() action. With
this change libproc will cache the libelf descriptor upon access, making
lookups much faster in the common case.

7 years agolibproc: Improve .gnu_debuglink support.
markj [Tue, 6 Dec 2016 04:18:09 +0000 (04:18 +0000)]
libproc: Improve .gnu_debuglink support.

As of r278658 libproc looks for debug files under /usr/lib/debug and will
use them if available. This change fleshes out that support a bit further:
- Check for a .gnu_debuglink section and use the file name specified
  there if one is present.
- Validate external debug files with the CRC in the .gnu_debuglink
  section so as to avoid using stale or corrupt debug files.
- Search for debug files in the directory containing the referencing
  object or in the .debug subdirectory, as GDB does.

7 years agolibproc: Make proc_getpid() an accessor for struct proc_handle.
markj [Tue, 6 Dec 2016 04:14:20 +0000 (04:14 +0000)]
libproc: Make proc_getpid() an accessor for struct proc_handle.

This allows librtld_db to fetch the PID from a handle without calling into
libproc. Together with r303531, this means that librtld_db no longer
references symbols from libproc.

7 years agoFix style bugs and remove trailing whitespace in libproc and librtld_db.
markj [Tue, 6 Dec 2016 04:13:02 +0000 (04:13 +0000)]
Fix style bugs and remove trailing whitespace in libproc and librtld_db.

MFC after: 1 week

7 years agoMFV r309587:
mm [Tue, 6 Dec 2016 01:35:27 +0000 (01:35 +0000)]
MFV r309587:

Sync libarchive with vendor.

Vendor bugfixes:

libarchive #831:
  Spelling fixes
libarchive #832:
  Relax sanity checks of number fields in tar header even more
OSS-Fuzz #16:
  Fix possible hang in uudecode_filter_read()
OSS-Fuzz #220:
  Reject an 'ar' filename table larger than 1GB or a filename larger
  than 1MB.

MFC after: 1 week

7 years agoRework syscall structure lookups.
jhb [Tue, 6 Dec 2016 00:39:00 +0000 (00:39 +0000)]
Rework syscall structure lookups.

Avoid always using an O(n^2) loop over known syscall structures with
strcmp() on each system call.  Instead, use a per-ABI cache indexed by
the system call number. The first 1024 system calls (which should cover
all of the normal system calls in currently-supported ABIs) use a flat array
indexed by the system call number to find system call structure.  For other
system calls, a linked list of structures storing an integer to structure
mapping is stored in the ABI.  The linked list isn't very smart, but it
should only be used by buggy applications invoking unknown system calls.

This also fixes handling of unknown system calls which currently trigger
a NULL pointer dereference.

Reviewed by: kib
MFC after: 2 weeks

7 years agoDon't attach to Host-PCI bridges with a bad bus number.
jhb [Tue, 6 Dec 2016 00:36:02 +0000 (00:36 +0000)]
Don't attach to Host-PCI bridges with a bad bus number.

If the bus number assigned to a Host-PCI bridge doesn't match the first
bus number in the associated producer range from _CRS, print a warning and
fail to attach rather than panicking due to an assertion failure.

At least one single-socket Dell machine leaves a "ghost" Host-PCI bridge
device in the ACPI namespace that seems to correspond to the I/O hub in
the second socket of a two-socket machine.  However, the BIOS doesn't
configure the settings for this "ghost" bridge correctly, nor does it have
any PCI devices behind it.

Tested by: royger
MFC after: 2 weeks

7 years agoUpdate vendor/libarchive to git ddb3954bfdb9a0a98d50fb1c50cbecb603d9adf0
mm [Tue, 6 Dec 2016 00:35:20 +0000 (00:35 +0000)]
Update vendor/libarchive to git ddb3954bfdb9a0a98d50fb1c50cbecb603d9adf0

Vendor bugfixes:

libarchive #831:
  Spelling fixes
libarchive #832:
  Relax sanity checks of number fields in tar header even more
OSS-Fuzz #16:
  Fix possible hang in uudecode_filter_read()
OSS-Fuzz #220:
  Reject an 'ar' filename table larger than 1GB or a filename larger
  than 1MB.

7 years agorsu: add hardware crypto support (WEP, TKIP and CCMP).
avos [Tue, 6 Dec 2016 00:13:49 +0000 (00:13 +0000)]
rsu: add hardware crypto support (WEP, TKIP and CCMP).

This change includes firmware commands for key setup +
some additional checking via CAMREAD / CAMWRITE registers.
Nothing (except rsu_delete_key() for pairwise keys) is deferred;
to ensure that things are done in order rsu_set_key() will wait
until key deletion task will be finished.

Tested with Asus USB-N10 (all ciphers).

Differences from initial (reviewed) patch:
- Pause AC queues before disassociation - since CMD_DISCONNECT clears
crypto state all pending frames must be processed / dropped before it.
- Check sc_running flag before trying to set static keys.
- Clear key index from bitmap even when firmware command fails
(it will be invalidated via CAMWRITE anyway).

Reviewed by: adrian, kevlo
Tested by: kevlo
Differential Revision: https://reviews.freebsd.org/D8706

7 years agoBump Dd for addition of T6.
jhb [Tue, 6 Dec 2016 00:05:38 +0000 (00:05 +0000)]
Bump Dd for addition of T6.

Pointy hat to: jhb

7 years agoDocument support for Terminator 6 adapters in cxgbe(4) and cxgbev(4).
jhb [Tue, 6 Dec 2016 00:01:53 +0000 (00:01 +0000)]
Document support for Terminator 6 adapters in cxgbe(4) and cxgbev(4).

Approved by: np
MFC after: 3 days
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D8716

7 years agoFix the NFSv4.1 server for Open reclaim after a reboot.
rmacklem [Mon, 5 Dec 2016 22:36:25 +0000 (22:36 +0000)]
Fix the NFSv4.1 server for Open reclaim after a reboot.

The NFSv4.1 server failed to update the nfs-stablerestart file for
a client when the client was issued its first Open. As such, recovery
of Opens after a server reboot failed with NFSERR_NOGRACE.
This patch fixes this.
It also changes the code so that it malloc()'s the 1024 byte array
instead of allocating it on the kernel stack for both NFSv4.0 and NFSv4.1.
Note that this bug only affected NFSv4.1 and only when clients attempted
to reclaim Opens after a server reboot.

MFC after: 2 weeks

7 years agopflog: Correctly initialise subrulenr
kp [Mon, 5 Dec 2016 21:52:10 +0000 (21:52 +0000)]
pflog: Correctly initialise subrulenr

subrulenr is considered unset if it's set to -1, not if it's set to 1.
See contrib/tcpdump/print-pflog.c pflog_print() for a user.

This caused incorrect pflog output (tcpdump -n -e -ttt -i pflog0):
  rule 0..16777216(match)
instead of the correct output of
  rule 0/0(match)

PR: 214832
Submitted by: andywhite@gmail.com

7 years agoRefactor the regression test code by splitting huge monolithic C
sobomax [Mon, 5 Dec 2016 17:21:04 +0000 (17:21 +0000)]
Refactor the regression test code by splitting huge monolithic C
file into smaller pieces that are hopefully easier to understand
and extend. This is to pave the ground for adding few more
socket timestamp formats that I am working on here.

No functional changes (I hope).

7 years agoFix build breakage caused by r309531.
mmel [Mon, 5 Dec 2016 15:55:51 +0000 (15:55 +0000)]
Fix build breakage caused by r309531.

Reported by: andrew
MFC after: 2 weeks
X-MFC with: r309531

7 years agoFix error in the example section
sevan [Mon, 5 Dec 2016 13:23:22 +0000 (13:23 +0000)]
Fix error in the example section
Adjust formatting highlighted by igor.

PR: 214683
Submitted by: Anindya Mukherjee <anindya49 AT hotmail DOT com>
Reviewed by: jilles
Approved by: bcr (mentor)
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D8591

7 years agoRelease DMAR table after using it.
kib [Mon, 5 Dec 2016 11:42:09 +0000 (11:42 +0000)]
Release DMAR table after using it.

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

7 years agoRename fast taskqueues used by DMAR to avoid naming conflict of the
kib [Mon, 5 Dec 2016 11:41:09 +0000 (11:41 +0000)]
Rename fast taskqueues used by DMAR to avoid naming conflict of the
sleepable and spin mutexes created by the queues.

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

7 years agoRemove an unneeded header. It was used when we had an arm64 specific GIC
andrew [Mon, 5 Dec 2016 11:40:54 +0000 (11:40 +0000)]
Remove an unneeded header. It was used when we had an arm64 specific GIC
driver, however with INTRNG this has been merged into a common arm driver.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoreadelf(1): Add support for extended program header numbers
cem [Mon, 5 Dec 2016 03:11:52 +0000 (03:11 +0000)]
readelf(1): Add support for extended program header numbers

Add support for extended program header numbers to elftoolchain
'readelf -h'.

Reviewed by: emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D8702

7 years agoUse trunc_page() instead of rolling my own in pmap_track_page()
jhibbits [Mon, 5 Dec 2016 02:27:50 +0000 (02:27 +0000)]
Use trunc_page() instead of rolling my own in pmap_track_page()

7 years agoAdd Edimax EW-7622UMN to the list of devices supported by rsu(4).
kevlo [Mon, 5 Dec 2016 01:46:45 +0000 (01:46 +0000)]
Add Edimax EW-7622UMN to the list of devices supported by rsu(4).

7 years agoImport tzdata 2016j
bapt [Sun, 4 Dec 2016 23:23:59 +0000 (23:23 +0000)]
Import tzdata 2016j

MFC after: 2 days

7 years agorsu: fix RSSI reporting, partially revert r288414.
avos [Sun, 4 Dec 2016 21:40:49 +0000 (21:40 +0000)]
rsu: fix RSSI reporting, partially revert r288414.

- Append RCR_APP_PHYSTS bit after firmware loading - otherwise
firmware will reset the register and this modification will be lost.
(without it Rx PHY descriptor section will contain garbage).
- Check if R92S_RXDW0_PHYST bit is set (like it is done in rtwn(4)) -
even if infosz is non-zero the section may not contain anything useful.
- In case, if descriptor is absent (A-MPDU?) use last calibrated RSSI
(rtwn(4) uses RSSI from the previous (sub)frame; probably, this
approach should be used here too).

Tested with Asus USB-N10, STA mode.

7 years agoUpdate jemalloc to 4.4.0.
jasone [Sun, 4 Dec 2016 21:13:26 +0000 (21:13 +0000)]
Update jemalloc to 4.4.0.

7 years agoRestructure the code to handle reporting of non-exited processes from
kib [Sun, 4 Dec 2016 20:44:58 +0000 (20:44 +0000)]
Restructure the code to handle reporting of non-exited processes from
wait(2).
- Do not acquire the process spinlock if neither WTRAPPED nor WUNTRACED
  options were passed [1].
- Extract the code to report alive process into a new helper
  report_alive_proc() and use it for trapped, stopped and continued
  childrens.

Note that the process spinlock is required around the WTRAPPED and
WUNTRACED tests, because P_STOPPED_TRACE and P_STOPPED_SIG flags are
set before other threads are stopped at the suspension point, and that
threads increment p_suspcount while owning only the process spinlock,
the process lock is dropped by them.  If the spinlock is not taken for
tests, the syscall thread might miss both p_suspcount increment and
wakeup in wakeup in thread_suspend_switch().

Based on the submission by: mjg [1]
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoFixes for NVIDIA Tegra124 clocks:
mmel [Sun, 4 Dec 2016 16:04:22 +0000 (16:04 +0000)]
Fixes for NVIDIA Tegra124 clocks:
 - EMC clock have standard peripheral clock block. Use it.
 - Implement full frequency set method for PLLD2. This PLL
   is used as HDMI pixel clock so we must be able to set it
   to wide range of frequencies, within 5% tolerance allowed
   by HDMI specification. Due to this, full state space search
   (over m, n, p fields) is necessary.

MFC after: 3 weeks

7 years agoClock framework fixes:
mmel [Sun, 4 Dec 2016 16:02:59 +0000 (16:02 +0000)]
Clock framework fixes:
 - The clk_test_freq() (aka CLK_SET_DRYRUN) doesn't change frequency,
   don't cache it result.
 - Fix busy condition for clk_set_freq().

MFC after: 3 weeks

7 years agoDo not try to recreate wlan(4) interface if it already exists.
avos [Sun, 4 Dec 2016 15:58:34 +0000 (15:58 +0000)]
Do not try to recreate wlan(4) interface if it already exists.

This should fix error messages caused by devd(8) during startup:

Starting Network: lo0 wlan0.
...
Starting devd.
ifconfig: SIOCS80211: Device busy
wpa_supplicant already running?  (pid=323).

MFC after: 2 weeks

7 years agoAdd IDs for HDA codecs found on Nvidia Tegra SoCs.
mmel [Sun, 4 Dec 2016 15:28:30 +0000 (15:28 +0000)]
Add IDs for HDA codecs found on Nvidia Tegra SoCs.

MFC after: 2 weeks

7 years agoImplement fake pmap_mapdev_attr() for ARMv6.
mmel [Sun, 4 Dec 2016 15:27:39 +0000 (15:27 +0000)]
Implement fake pmap_mapdev_attr() for ARMv6.
This function is referenced, but never called from DRM2 code. Also,
real behavior of pmap_mapdev_attr() in ARM world is unclear as we don't
have any additional attribute for a device memory type.

MFC after: 2 weeks

7 years agoFix too low volume on MSI H170 GAMING M3 board by poking vendor
yongari [Sun, 4 Dec 2016 05:55:18 +0000 (05:55 +0000)]
Fix too low volume on MSI H170 GAMING M3 board by poking vendor
specific COEF.

7 years agoRecognize RealTek ALC1150 7.1 channel HD audio codec.
yongari [Sun, 4 Dec 2016 05:46:30 +0000 (05:46 +0000)]
Recognize RealTek ALC1150 7.1 channel HD audio codec.

7 years agoioat(4): Compile on i386
cem [Sun, 4 Dec 2016 04:04:57 +0000 (04:04 +0000)]
ioat(4): Compile on i386

Truncate BUS_SPACE_MAXADDR_40BIT to essentially BUS_SPACE_MAXADDR_32BIT on
platforms with 32-bit bus_addr_t (i.e., i386).

PR: 215034
Reported by: ngie@
Sponsored by: Dell EMC Isilon

7 years agocoredump_phnum_test: Make expected pheader count more flexible
cem [Sun, 4 Dec 2016 03:50:57 +0000 (03:50 +0000)]
coredump_phnum_test: Make expected pheader count more flexible

Note: this test still requires binutils readelf (from ports) to pass, until a
few issues are resolved in elftoolchain.

PR: 215019
Reported by: ngie@
Sponsored by: Dell EMC Isilon

7 years agoindent(1): remove unneeded comma.
pfg [Sun, 4 Dec 2016 03:10:25 +0000 (03:10 +0000)]
indent(1): remove unneeded comma.

It is not a good practice to start a newline with a comma anyways.

Discussed with:  bjk
Differential Revision: https://reviews.freebsd.org/D8690

7 years agoRelax sanity check of number fields in tar header even more.
mm [Sun, 4 Dec 2016 02:58:13 +0000 (02:58 +0000)]
Relax sanity check of number fields in tar header even more.

This fixes reading tar archives created by older versions of
plexus-archiver (used by maven-assembly-plugin) that fill uid and gid
fields with spaces (PLXCOMP-233).

Vendor issue:
https://github.com/libarchive/libarchive/issues/832

Reported by: Antoine Brodin <antoine@freebsd.org>
MFC after: 1 week

7 years agoFix a typo (move parenthesis to correct location in the line).
jhibbits [Sun, 4 Dec 2016 02:15:46 +0000 (02:15 +0000)]
Fix a typo (move parenthesis to correct location in the line).

Before this, it would cause the one consumer of this API in powerpc usage
(dev/dpaa) to set the PTE WIMG flags to empty instead of --M-, making the
cache-enabled buffer portals non-coherent.

7 years agoUnbreak "make depend" with sys/modules/ioat by adding opt_ddb.h to SRCS
ngie [Sun, 4 Dec 2016 02:08:40 +0000 (02:08 +0000)]
Unbreak "make depend" with sys/modules/ioat by adding opt_ddb.h to SRCS

MFC after: 2 weeks

7 years ago[camcontrol] init ts=0 to quieten gcc.
adrian [Sat, 3 Dec 2016 20:35:39 +0000 (20:35 +0000)]
[camcontrol] init ts=0 to quieten gcc.

It "looks" like ts is set to something on success, and not modified on
error.

Checked on IRC with: cem

7 years agoFix bug preventing limits(1) from being applied
dteske [Sat, 3 Dec 2016 19:03:40 +0000 (19:03 +0000)]
Fix bug preventing limits(1) from being applied

PR: misc/212493
Differential Revision: https://reviews.freebsd.org/D8232
Submitted by: girgen
Reviewed by: adrian
MFC after: 3 days
X-MFC-to: stable/11

7 years agoBuild smbios.ko as a module for amd64 and i386
rpokala [Sat, 3 Dec 2016 17:54:08 +0000 (17:54 +0000)]
Build smbios.ko as a module for amd64 and i386

For whatever reason, smapi, smbios, vpd are all under the "bios" directory.
smapi is only for i386, so the entire "bios" directory is only built for
i386. Break smapi out, and make only it i386-specific. Then, build the
"bios" directory for both amd64 and i386.

Reviewed by: imp
MFC after: 1 week
Sponsored by: Panasas
Differential Revision: https://reviews.freebsd.org/D8609

7 years agoRevert r253678, r253661:
pfg [Sat, 3 Dec 2016 17:44:43 +0000 (17:44 +0000)]
Revert r253678, r253661:
Fix a segfault in ctfmerge(1) due to a bug in GCC.

The change was correct and the bug real, but upstream didn't adopt it
and we want to remain in sync. When/if upstream does something about it
we can bring their version.

The bug in question was fixed in GCC 4.9 which is now the default in
FreeBSD's ports. Our native gcc-4.2, which is still in use in some Tier-2
platforms also has a workaround so no end-user should be harmed by the
revert.

7 years agortwn: fix bitmap size calculation.
avos [Sat, 3 Dec 2016 17:27:10 +0000 (17:27 +0000)]
rtwn: fix bitmap size calculation.

Tested with RTL8188CE, STA mode.

7 years agorsu: fix frame processing in the Rx path (similar to r292207).
avos [Sat, 3 Dec 2016 16:02:53 +0000 (16:02 +0000)]
rsu: fix frame processing in the Rx path (similar to r292207).

- Fill in Rx radiotap header correctly (for every packet in a chain;
not once per chain).
- Fix rate / flags fields in Rx radiotap.
- Add debug messages for discarded frames.
- Pass received control (< sizeof(struct ieee80211_frame)) frames
to net80211 (if allowed by device filter; cannot happen yet).

Tested with Asus USB-N10.

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

7 years agoFix logic error so the R92C_TDECTRL register value is updated correctly.
kevlo [Sat, 3 Dec 2016 14:41:53 +0000 (14:41 +0000)]
Fix logic error so the R92C_TDECTRL register value is updated correctly.

Reviewed by: avos

7 years agorsu: remove unused structures / variables.
avos [Sat, 3 Dec 2016 14:26:58 +0000 (14:26 +0000)]
rsu: remove unused structures / variables.

7 years agoDIRDEPS_BUILD: Fix '/' in group names creating a bad cookie.
bdrewery [Sat, 3 Dec 2016 05:29:35 +0000 (05:29 +0000)]
DIRDEPS_BUILD: Fix '/' in group names creating a bad cookie.

This is reworking the change in r296585 but to still properly install
the files.  This limits the change to only the DIRDEPS_BUILD logic
for what it considers the name of the staging set, which is what the
cookie name is based off of.

Sponsored by: Dell EMC Isilon
MFC after: 1 week

7 years agoRevert r296585.
bdrewery [Sat, 3 Dec 2016 05:29:31 +0000 (05:29 +0000)]
Revert r296585.

This broke installing dtrace test files.  It was poorly tested.

Reported by: markj
Pointyhat to: bdrewery
MFC after: 1 week

7 years agoCreate the /usr/lib/include symlink as relative.
bdrewery [Sat, 3 Dec 2016 05:29:12 +0000 (05:29 +0000)]
Create the /usr/lib/include symlink as relative.

This ugly code is done to avoid assuming LIBDIR is 2 components
deep.

Reported by: jhb

7 years agoDon't build :strvis_locale if VIS_NOLOCALE is undefined
ngie [Sat, 3 Dec 2016 03:56:20 +0000 (03:56 +0000)]
Don't build :strvis_locale if VIS_NOLOCALE is undefined

The copy of contrib/libc-vis on ^/stable/10 doesn't contain all of the features
in the ^/stable/11 // ^/head version, including VIS_NOLOCALE. The risk is lower
in conditionally running the test instead of backporting the newer version of
libc-vis

MFC after: now

7 years agoRestore pathing for factor(1), which unnecessarily diverged in r278616
ngie [Sat, 3 Dec 2016 03:13:32 +0000 (03:13 +0000)]
Restore pathing for factor(1), which unnecessarily diverged in r278616

factor lives in /usr/games/, not /usr/bin, in NetBSD.

The correct way to handle this is do on-the-fly manipulation of the test
script via ATF_TESTS_SH_SED_<foo>, not by modify the pathing directly in
the test script.

This is being done to resolve an unnecessary conflict made when pulling
back ^/head@r309469 (contrib/netbsd-tests update) to ^/stable/10.

No functional change

MFC after: now

7 years ago[ath] use the correct AMPDU frame limit for the given node, rather than the global...
adrian [Sat, 3 Dec 2016 02:47:41 +0000 (02:47 +0000)]
[ath] use the correct AMPDU frame limit for the given node, rather than the global config.

This is important in hostap, ibss, (11s at some magical future date, etc)
where different nodes may have smaller limits.

Oops!

MFC after: 1 week
Relnotes: Yes

7 years ago[net80211] prepare for 11ac aware NICs that want to know per-vdev channel and centre...
adrian [Sat, 3 Dec 2016 02:45:18 +0000 (02:45 +0000)]
[net80211] prepare for 11ac aware NICs that want to know per-vdev channel and centre frequencies.

* ic_freq is the centre of the primary channel, not the centre of the
  HT40/HT80/etc channel.  Add a method to access that.
* Add a method to access the centre of the primary channel, including
  knowing the centre of the 5/10/20/40/80, versus the primary channel.
  Ie, it's the centre of the 40, 80, 160MHz channel.
* Add a method to access the centre frequency of the secondary 80MHz
  channel - we don't support VHT yet, but when we do.
* Add methods to access the current channel and the per-dev desired
  channel.  Ideally drivers that do full offload with a per-vap channel
  configuration should use the vap channel, NOT ic_curchan.
  Non-offload drivers that require net80211 to change the channel should
  be accessing ic_curchan.

7 years agoExpect 01:main to fail
ngie [Sat, 3 Dec 2016 02:24:15 +0000 (02:24 +0000)]
Expect 01:main to fail

Changes were made to ZFS in the past year with respect to how ACLs
are handled, causing failures in this test. Mark it TODO so (hopefully)
someone more knowledgeable (like mav or trasz) will fix the code or the
test.

PR: 212323