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

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