]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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

7 years agonet80211 + drivers: convert to ieee80211_crypto_get_key_wepidx().
avos [Wed, 7 Dec 2016 22:16:07 +0000 (22:16 +0000)]
net80211 + drivers: convert to ieee80211_crypto_get_key_wepidx().

Proposed by: adrian

7 years agoSilence a warning produced by newer versions of gcc.
tuexen [Wed, 7 Dec 2016 22:01:09 +0000 (22:01 +0000)]
Silence a warning produced by newer versions of gcc.

MFC after: 1 week

7 years agoFix Typo
imp [Wed, 7 Dec 2016 21:47:14 +0000 (21:47 +0000)]
Fix Typo

7 years agoFix a bug in sctp_sendmsgx(), where the sid provided by the user
tuexen [Wed, 7 Dec 2016 21:24:49 +0000 (21:24 +0000)]
Fix a bug in sctp_sendmsgx(), where the sid provided by the user
was hot honored.

MFC after: 3 days

7 years agoCleanup the names of SSN, SID, TSN, FSN, PPID and MID.
tuexen [Wed, 7 Dec 2016 19:30:59 +0000 (19:30 +0000)]
Cleanup the names of SSN, SID, TSN, FSN, PPID and MID.

This made a couple of bugs visible in handling SSN wrap-arounds
when using DATA chunks. Now bulk transfer seems to work fine...
This fixes the issue reported in
https://github.com/sctplab/usrsctp/issues/111

MFC after: 1 week

7 years agoreadelf(1) -S: Include zero index and match binutils' no-name
cem [Wed, 7 Dec 2016 18:33:40 +0000 (18:33 +0000)]
readelf(1) -S: Include zero index and match binutils' no-name

Include the SHN_UNDEF (zero) index special section in extended-attribute
ELF files, like GNU binutils' readelf.

Additionally, print "<no-name>" for sections without names, like GNU
binutils.

Reviewed by: kaiw@
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D8707

7 years agoRegnerate system-call definitions following r309677 correcting a whitespace
rwatson [Wed, 7 Dec 2016 16:12:27 +0000 (16:12 +0000)]
Regnerate system-call definitions following r309677 correcting a whitespace
glitch in syscalls.master.

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