]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoUpgrade our copies of clang, llvm, lld and lldb to r309439 from the
Dimitry Andric [Sun, 30 Jul 2017 18:01:34 +0000 (18:01 +0000)]
Upgrade our copies of clang, llvm, lld and lldb to r309439 from the
upstream release_50 branch.  This is just after upstream's 5.0.0-rc1.

MFC after: 2 months
X-MFC-with: r321369

6 years agoProperly range check length of parsed information elements in RSU driver.
Hans Petter Selasky [Sun, 30 Jul 2017 16:45:28 +0000 (16:45 +0000)]
Properly range check length of parsed information elements in RSU driver.

Found by: Ilja van Sprundel <ivansprundel@ioactive.com>
MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agoSwitch from using iic_transfer() to iicdev_readfrom/writeto(), mostly so
Ian Lepore [Sun, 30 Jul 2017 16:17:06 +0000 (16:17 +0000)]
Switch from using iic_transfer() to iicdev_readfrom/writeto(), mostly so
that transfers will be done with proper ownership of the bus. No
behavioral changes.

6 years agoAttach ichwd(4) only to ISA bus of the LPC bridge.
Alexander Motin [Sun, 30 Jul 2017 15:19:07 +0000 (15:19 +0000)]
Attach ichwd(4) only to ISA bus of the LPC bridge.

Resource allocation for parent device does not look good by itself, but
attempt to allocate them for unrelated device just does not end up good.
On Asus X99-E WS/USB3.1 system reporting ISA bridge via both PCI and ACPI
this reported to cause kernel panic on shutdown due to messed resources:
https://bugs.freenas.org/issues/25237.

MFC after: 1 week

6 years agoPull in r309503 from upstream clang trunk (by Richard Smith):
Dimitry Andric [Sun, 30 Jul 2017 11:50:16 +0000 (11:50 +0000)]
Pull in r309503 from upstream clang trunk (by Richard Smith):

  PR33902: Invalidate line number cache when adding more text to
  existing buffer.

  This led to crashes as the line number cache would report a bogus
  line number for a line of code, and we'd try to find a nonexistent
  column within the line when printing diagnostics.

This fixes an assertion when building the graphics/champlain port.

Reported by: antoine, kwm
PR: 219139

6 years ago Split the interrupt setup code into two parts: allocation and configuration.
Scott Long [Sun, 30 Jul 2017 06:53:58 +0000 (06:53 +0000)]
Split the interrupt setup code into two parts: allocation and configuration.
    Do the allocation before requesting the IOCFacts message.  This triggers
    the LSI firmware to recognize the multiqueue should be enabled if available.
    Multiqueue isn't used by the driver yet, but this also fixes a problem with
    the cached IOCFacts not matching latter checks, leading to potential problems
    with error recovery.

    As a side-effect, fetch the driver tunables as early as possible.

Reviewed by: slm
Obtained from: Netflix
Differential Revision: D9243

6 years agoBump copyright year.
Xin LI [Sun, 30 Jul 2017 06:27:32 +0000 (06:27 +0000)]
Bump copyright year.

MFC after: 3 days

6 years agoAdd the i2c RTC drivers found on various arm systems.
Ian Lepore [Sun, 30 Jul 2017 00:25:29 +0000 (00:25 +0000)]
Add the i2c RTC drivers found on various arm systems.

6 years agoMove the device descriptions onto the device lines, so they cut and paste
Ian Lepore [Sun, 30 Jul 2017 00:24:15 +0000 (00:24 +0000)]
Move the device descriptions onto the device lines, so they cut and paste
nicely into other config files.

6 years agoAdd a few missing i2c devices that build fine on all arches.
Ian Lepore [Sun, 30 Jul 2017 00:01:31 +0000 (00:01 +0000)]
Add a few missing i2c devices that build fine on all arches.

6 years agoFix building this driver on non-FDT platforms.
Ian Lepore [Sun, 30 Jul 2017 00:00:30 +0000 (00:00 +0000)]
Fix building this driver on non-FDT platforms.

6 years agoReplace the pcf8563 i2c RTC driver with a new nxprtc driver which handles
Ian Lepore [Sat, 29 Jul 2017 23:45:57 +0000 (23:45 +0000)]
Replace the pcf8563 i2c RTC driver with a new nxprtc driver which handles
all the chips in the NXP PCA212x and PCA/PCF85xx series.  In addition to
supporting more chips, this driver uses the countdown timer on the chips as
a fractional seconds counter, giving it a resolution of about 15 milliseconds.

6 years agokldstat: Use sizeof in place of named constants for sizing
Conrad Meyer [Sat, 29 Jul 2017 23:31:21 +0000 (23:31 +0000)]
kldstat: Use sizeof in place of named constants for sizing

No functional change.

This is handy for FreeBSD derivatives that want to modify the value of
MAXPATHLEN, but not the kld_file_stat ABI.

Submitted by: Siddhant Agarwal <sagarwal AT isilon.com>
Sponsored by: Dell EMC Isilon

6 years agolibprocstat(3): fix arguments list for procstat_getargv(3) and procstat_getenvv(3)
Enji Cooper [Sat, 29 Jul 2017 22:25:45 +0000 (22:25 +0000)]
libprocstat(3): fix arguments list for procstat_getargv(3) and procstat_getenvv(3)

Neither libcall takes a fourth argument (`char *errbuf`).

PR: 217884
Submitted by: tobik
MFC after: 1 month

6 years agolibprocstat(3): fix reference (typo) to procstat_freeenvv in description for
Enji Cooper [Sat, 29 Jul 2017 22:19:00 +0000 (22:19 +0000)]
libprocstat(3): fix reference (typo) to procstat_freeenvv in description for
procstat_getargv(3)

PR: 217884
MFC after: 1 month
Submitted by: tobik

6 years agoAdd sys/socket.h to SYNOPSIS for libprocstat(3)
Enji Cooper [Sat, 29 Jul 2017 22:16:05 +0000 (22:16 +0000)]
Add sys/socket.h to SYNOPSIS for libprocstat(3)

sys/socket.h is required for procstat_get_socket_info(3), added in
r221807.

MFC after: 1 month
PR: 217884
Submitted by: tobik

6 years agoRemove superfluous `exit 0` added in r321702
Enji Cooper [Sat, 29 Jul 2017 22:03:21 +0000 (22:03 +0000)]
Remove superfluous `exit 0` added in r321702

atf_skip triggers equivalent functionality, which means the `exit 0`
is unreachable code.

PR: 220164
MFC after: 1 month
MFC with: r321702

6 years agoLoad geom_gate(4) if necessary before running tests; skip if it can't be loaded
Enji Cooper [Sat, 29 Jul 2017 22:01:17 +0000 (22:01 +0000)]
Load geom_gate(4) if necessary before running tests; skip if it can't be loaded

The test code prior to r311893 loaded geom_gate at test start if necessary and
skipped the tests if it couldn't be loaded.

The ATF-ifcation of this test done in r311893 unfortunately dropped this
functionality.

This change restores the geom_gate module load and skips the test(s) if unavailable
in an ATF-like way.

MFC after: 1 month
PR: 220164
Reported by: gjb

6 years agoVendor import of lldb release_50 branch r309439:
Dimitry Andric [Sat, 29 Jul 2017 21:31:51 +0000 (21:31 +0000)]
Vendor import of lldb release_50 branch r309439:
https://llvm.org/svn/llvm-project/lldb/branches/release_50@309439

6 years agoVendor import of lld release_50 branch r309439:
Dimitry Andric [Sat, 29 Jul 2017 21:30:27 +0000 (21:30 +0000)]
Vendor import of lld release_50 branch r309439:
https://llvm.org/svn/llvm-project/lld/branches/release_50@309439

6 years agoVendor import of libc++ release_50 branch r309439:
Dimitry Andric [Sat, 29 Jul 2017 21:29:58 +0000 (21:29 +0000)]
Vendor import of libc++ release_50 branch r309439:
https://llvm.org/svn/llvm-project/libcxx/branches/release_50@309439

6 years agoVendor import of clang release_50 branch r309439:
Dimitry Andric [Sat, 29 Jul 2017 21:28:13 +0000 (21:28 +0000)]
Vendor import of clang release_50 branch r309439:
https://llvm.org/svn/llvm-project/cfe/branches/release_50@309439

6 years agoVendor import of llvm release_50 branch r309439:
Dimitry Andric [Sat, 29 Jul 2017 21:25:18 +0000 (21:25 +0000)]
Vendor import of llvm release_50 branch r309439:
https://llvm.org/svn/llvm-project/llvm/branches/release_50@309439

6 years agoAdd a new "-N" option to umount(8), that does a forced dismount of an NFS mount
Rick Macklem [Sat, 29 Jul 2017 20:08:25 +0000 (20:08 +0000)]
Add a new "-N" option to umount(8), that does a forced dismount of an NFS mount
point.

The new "-N" option does a forced dismount of an NFS mount point, but avoids
doing any checking of the mounted-on path, so that it will not get hung
when a vnode lock is held by another hung process on the mounted-on vnode.
The most common case of this is a "umount" with the "-f" option.
Other than avoiding checking the mounted-on path, it performs the same
forced dismount as a successful "umount -f" would do.

This commit includes a content change to the man page.

Tested by: pho
Reviewed by: kib
MFC after: 2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D11735

6 years agoAdd kernel support for the NFS client forced dismount "umount -N" option.
Rick Macklem [Sat, 29 Jul 2017 19:52:47 +0000 (19:52 +0000)]
Add kernel support for the NFS client forced dismount "umount -N" option.

When an NFS mount is hung against an unresponsive NFS server, the "umount -f"
option can be used to dismount the mount. Unfortunately, "umount -f" gets
hung as well if a "umount" without "-f" has already been done. Usually,
this is because of a vnode lock being held by the "umount" for the mounted-on
vnode.
This patch adds kernel code so that a new "-N" option can be added to "umount",
allowing it to avoid getting hung for this case.
It adds two flags. One indicates that a forced dismount is about to happen
and the other is used, along with setting mnt_data == NULL, to handshake
with the nfs_unmount() VFS call.
It includes a slight change to the interface used between the client and
common NFS modules, so I bumped __FreeBSD_version to ensure both modules are
rebuilt.

Tested by: pho
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D11735

6 years agoAdd inline functions to convert between sbintime_t and decimal time units.
Ian Lepore [Sat, 29 Jul 2017 17:00:23 +0000 (17:00 +0000)]
Add inline functions to convert between sbintime_t and decimal time units.
Use them in some existing code that is vulnerable to roundoff errors.

The existing constant SBT_1NS is a honeypot, luring unsuspecting folks into
writing code such as long_timeout_ns*SBT_1NS to generate the argument for a
sleep call.  The actual value of 1ns in sbt units is ~4.3, leading to a
large roundoff error giving a shorter sleep than expected when multiplying
by the trucated value of 4 in SBT_1NS.  (The evil honeypot aspect becomes
clear after you waste a whole day figuring out why your sleeps return early.)

6 years agoFix IORDY bits definition.
Alexander Motin [Sat, 29 Jul 2017 13:54:28 +0000 (13:54 +0000)]
Fix IORDY bits definition.

According to the ATA specs, IORDYDIS should be bit 10, IORDY -- bit 11.

PR: 221049
Submitted by: aaron.styx@baesystems.com
MFC after: 1 week

6 years agoDon't use libc++ when cross-building for gcc arches
Dimitry Andric [Sat, 29 Jul 2017 12:22:29 +0000 (12:22 +0000)]
Don't use libc++ when cross-building for gcc arches

Since we imported clang 5.0.0, the version check in Makefile.inc1 which
checks whether to use libc++ fires even when the compiler for the target
architecture is gcc 4.2.1.  This is because only X_COMPILER_VERSION is
checked.  Also check X_COMPILER_TYPE, so it will only use libc++ when an
external gcc toolchain is used.

Reviewed by: emaste, rpokala
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D11776

6 years agovtnet: Support jumbo frames without TSO/GSO
Kristof Provost [Sat, 29 Jul 2017 09:22:48 +0000 (09:22 +0000)]
vtnet: Support jumbo frames without TSO/GSO

Currently in Virtio driver without TSO/GSO features enabled, the max scatter
gather segments for the TX path can be 4, which limits the support for 9K JUMBO
frames. 9K JUMBO frames results in more than 4 scatter gather segments and
virtio driver fails to send the frame down to host OS. With TSO/GSO feature
enabled max scatter gather segments can be 64, then 9K JUMBO frames are fine,
this is making virtio driver to support JUMBO frames only with TSO/GSO.

Increasing the VTNET_MIN_TX_SEGS which is the case for non TSO/GSO to 32 to
support upto 64K JUMBO frames to Host.

Submitted by: Lohith Bellad <lohithbsd@gmail.com>
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D8803

6 years agoBe a bit more liberal about sysctl naming.
Ed Schouten [Sat, 29 Jul 2017 08:35:07 +0000 (08:35 +0000)]
Be a bit more liberal about sysctl naming.

On the systems on which I tested this exporter, I never ran into metrics
that were named in such a way that they couldn't be exported to
Prometheus metrics directly. Now it turns out that on systems with NUMA,
the sysctl tree contains metrics named dev.${driver}.${index}.%domain.
For these metrics, the % in the name is problematic, as Prometheus
doesn't allow this symbol to be used.

Remove the assertions that were originally put in place to prevent the
exporter from generating malformed output and add code to deal with it
accordingly. For metric names, convert any unsupported character to an
underscore. For label values, perform string escaping.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221035
Reported by: lifanov@

6 years agoFix possible crash for the NFSv4.1 pNFS client.
Rick Macklem [Sat, 29 Jul 2017 02:25:49 +0000 (02:25 +0000)]
Fix possible crash for the NFSv4.1 pNFS client.

If the nfsrpc_createlayoutrpc() call in nfsrpc_getcreatelayout() fails,
the code used nfhpp when it might be set NULL. This patch checks for
the error cases (laystat != 0) and avoids using nfhpp for the failure case.
This would only affect NFSv4.1 mounts with the "pnfs" option.
Found while testing the "umount -N" patch not yet in head.

MFC after: 2 weeks

6 years agoMFV r321673:
Martin Matuska [Fri, 28 Jul 2017 23:56:07 +0000 (23:56 +0000)]
MFV r321673:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #926: ensure ar strtab is null terminated

MFC after: 1 week

6 years agoUpdate vendor/libarchive to git de20494ba2a4fcff8b56010faa75467ad8d5a40b
Martin Matuska [Fri, 28 Jul 2017 23:51:08 +0000 (23:51 +0000)]
Update vendor/libarchive to git de20494ba2a4fcff8b56010faa75467ad8d5a40b

Relevant vendor changes:
  PR #926: ensure ar strtab is null terminated

6 years agoUpdate vendor/libarchive to git 347ac2b6adfd4bca7418d30d7278d5343fc6e25e
Martin Matuska [Fri, 28 Jul 2017 23:48:51 +0000 (23:48 +0000)]
Update vendor/libarchive to git 347ac2b6adfd4bca7418d30d7278d5343fc6e25e

libarchive 3.3.3dev

6 years agocxgbe/iw_cxgbe: Log the end point's history and flags to the trace
Navdeep Parhar [Fri, 28 Jul 2017 22:28:45 +0000 (22:28 +0000)]
cxgbe/iw_cxgbe: Log the end point's history and flags to the trace
buffer just before it's freed.

MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agoMerge ACPICA 20170728.
Jung-uk Kim [Fri, 28 Jul 2017 22:23:29 +0000 (22:23 +0000)]
Merge ACPICA 20170728.

6 years agobhyve/vga.c: fix atc_color_select_67 bit shift
Ryan Libby [Fri, 28 Jul 2017 21:47:10 +0000 (21:47 +0000)]
bhyve/vga.c: fix atc_color_select_67 bit shift

Gcc noticed that the result of the bit shift is always zero.  Shift so
that the ATC_CS_C67 bits end up in bits 6 & 7.

Reviewed by: grehan, tychon
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11775

6 years agobhyve/pci_e82545.c: squelch gcc warning for noreturn procedure
Ryan Libby [Fri, 28 Jul 2017 21:42:59 +0000 (21:42 +0000)]
bhyve/pci_e82545.c: squelch gcc warning for noreturn procedure

Gcc complained that e82545_tx_thread has a return type declared but
doesn't return anything.  Annotate the procedure with _Noreturn.

Reviewed by: grehan
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11774

6 years agoAdd an entry to UPDATING for r321665.
Rick Macklem [Fri, 28 Jul 2017 21:14:28 +0000 (21:14 +0000)]
Add an entry to UPDATING for r321665.

6 years agoModify /etc/rc.d/nfsd so it doesn't force a startup of nfsuserd for NFSv4.
Rick Macklem [Fri, 28 Jul 2017 21:07:57 +0000 (21:07 +0000)]
Modify /etc/rc.d/nfsd so it doesn't force a startup of nfsuserd for NFSv4.

Given that RFC7530 allows uid/gids to be placed in owner/owner_group
strings directly, many NFSv4 environments don't need the nfsuserd.
This small patch modified /etc/rc.d/nfsd so that it does not force
startup of the nfsuserd daemon unless nfs_server_managegids is enabled.
This implies that nfsuserd_enable="YES" must be added to /etc/rc.conf
for NFSv4 server environments that use Kerberos mounts or clients that
do not support the uid/gid in string capability.
Since this could be considered a POLA violation, it will not be MFC'd.

Discussed on: freebsd-current

6 years agoPull in r308891 from upstream llvm trunk (by Benjamin Kramer):
Dimitry Andric [Fri, 28 Jul 2017 20:13:25 +0000 (20:13 +0000)]
Pull in r308891 from upstream llvm trunk (by Benjamin Kramer):

  [CodeGenPrepare] Cut off FindAllMemoryUses if there are too many uses.

  This avoids excessive compile time. The case I'm looking at is
  Function.cpp from an old version of LLVM that still had the giant
  memcmp string matcher in it. Before r308322 this compiled in about 2
  minutes, after it, clang takes infinite* time to compile it. With
  this patch we're at 5 min, which is still bad but this is a
  pathological case.

  The cut off at 20 uses was chosen by looking at other cut-offs in LLVM
  for user scanning. It's probably too high, but does the job and is
  very unlikely to regress anything.

  Fixes PR33900.

  * I'm impatient and aborted after 15 minutes, on the bug report it was
    killed after 2h.

Pull in r308986 from upstream llvm trunk (by Simon Pilgrim):

  [X86][CGP] Reduce memcmp() expansion to 2 load pairs (PR33914)

  D35067/rL308322 attempted to support up to 4 load pairs for memcmp
  inlining which resulted in regressions for some optimized libc memcmp
  implementations (PR33914).

  Until we can match these more optimal cases, this patch reduces the
  memcmp expansion to a maximum of 2 load pairs (which matches what we
  do for -Os).

  This patch should be considered for the 5.0.0 release branch as well

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

These fix a hang (or extremely long compile time) when building older
LLVM ports.

Reported by:    antoine
PR:             219139

6 years agoRevert r321659, re-enabling ChallengeResponseAuthentication, which was
Glen Barber [Fri, 28 Jul 2017 18:46:02 +0000 (18:46 +0000)]
Revert r321659, re-enabling ChallengeResponseAuthentication, which was
discussed a while back between cperciva@ and so@, and I forgot.

Reported by: cperciva
Sponsored by: The FreeBSD Foundation

6 years agoTurn off ChallengeResponseAuthentication for EC2 AMIs, one of EC2's
Glen Barber [Fri, 28 Jul 2017 18:27:30 +0000 (18:27 +0000)]
Turn off ChallengeResponseAuthentication for EC2 AMIs, one of EC2's
requirements.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

6 years agobinmiscctl should use modfind instead of kldfind
Sean Bruno [Fri, 28 Jul 2017 18:11:53 +0000 (18:11 +0000)]
binmiscctl should use modfind instead of kldfind

kldfind() only matches kernel modules, so if you link imgact_binmisc directly
into the kernel, binmiscctl can't find it, tries to load it, and errors
out with:
  Can't load imgact_binmisc kernel module: File exists

A quick search of other base commands shows that the correct procedure is to
call modfind(), and then try kldload() if that fails.

PR: 218593
Submitted by: Dan Nelson <dnelson_1901@yahoo.com>
MFC after: 1 week

6 years agoImport ACPICA 20170728.
Jung-uk Kim [Fri, 28 Jul 2017 17:44:36 +0000 (17:44 +0000)]
Import ACPICA 20170728.

6 years agoSimplify flow control.
Konstantin Belousov [Fri, 28 Jul 2017 12:22:32 +0000 (12:22 +0000)]
Simplify flow control.

Also add explicit comment why libc cannot simply rely on open(2)
failure in capability mode.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoFix remapping VM attributes on Armada 38x
Marcin Wojtas [Fri, 28 Jul 2017 11:51:55 +0000 (11:51 +0000)]
Fix remapping VM attributes on Armada 38x

pmap_remap_vm_attr() function requires indexes to
pte2_attr_tab as the arguments (VM_MEMATTR_).
Mistakenly, instead of them, actual values from the
table were used (PTE2_ATTR_), when applying
work-around for Marvell Armada 38x SoCs.

Submitted by: Marcin Wojtas (mw@semihalf.com)
Reported by: Rafal Kozik (rk@semihalf.com)
Reviewed by: cognet (mentor)
Approved by: cognet (mentor)
Obtained from: Semihalf
Differential Revision: https://reviews.freebsd.org/D11704

6 years agoRemove the unused mutex since r273220.
Luiz Otavio O Souza [Fri, 28 Jul 2017 04:41:57 +0000 (04:41 +0000)]
Remove the unused mutex since r273220.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC (Netgate)

6 years agoFix style bugs in ksyms.c.
Mark Johnston [Fri, 28 Jul 2017 03:18:18 +0000 (03:18 +0000)]
Fix style bugs in ksyms.c.

No functional change intended.

MFC after: 3 days

6 years agoRestrict permissions on /dev/ksyms to 0400.
Mark Johnston [Fri, 28 Jul 2017 03:14:31 +0000 (03:14 +0000)]
Restrict permissions on /dev/ksyms to 0400.

The ksyms(4) device was added specifically for use by lockstat(1), which
as a DTrace consumer must run as root.

Discussed with: emaste
MFC after: 3 days

6 years agoAllow _.disk.image to be specified.
Warner Losh [Fri, 28 Jul 2017 02:00:03 +0000 (02:00 +0000)]
Allow _.disk.image to be specified.

Submitted by: ask at develooper dot com (reworked to new structure)
PR: 199191
Sponsored by: Netflix
MFC After: 3 days

6 years agoEnsure that ordinary files that happen to start with .git, .hg and
Warner Losh [Fri, 28 Jul 2017 01:59:58 +0000 (01:59 +0000)]
Ensure that ordinary files that happen to start with .git, .hg and
.cvs into the image.

This makes .gitignore files in the working tree appear in the final
tree...

PR: 192178
Submitted by: Jason Unovitch
Sponsored by: Netflix
MFC After: 3 days

6 years agoProperly expand shell glob characters in NANO_PACKAGE_LIST.
Warner Losh [Fri, 28 Jul 2017 01:59:53 +0000 (01:59 +0000)]
Properly expand shell glob characters in NANO_PACKAGE_LIST.

The defualt NANO_PACKAGE_LIST is *, which fails to work
properly. Expand glob characters and make sure that we install the
special pkg package first.

Sponsored by: Netflix
Submitted by: wout at canodus dot be
PR: 219405
MFC After: 3 days

6 years ago[ar71xx] get rid of ath_pci - it's built as a module now.
Adrian Chadd [Fri, 28 Jul 2017 01:17:38 +0000 (01:17 +0000)]
[ar71xx] get rid of ath_pci - it's built as a module now.

6 years agoFix TEX index acquisition using L2 attributes
Zbigniew Bodek [Thu, 27 Jul 2017 23:14:17 +0000 (23:14 +0000)]
Fix TEX index acquisition using L2 attributes

The TEX index is selected using (TEX0 C B) bits
from the L2 descriptor. Use correct index by masking
and shifting those bits accordingly.

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

6 years agoDrop IXL RX lock during TCP_LRO, fixes LOR mahem while holding the RX
Sean Bruno [Thu, 27 Jul 2017 23:01:07 +0000 (23:01 +0000)]
Drop IXL RX lock during TCP_LRO, fixes LOR mahem while holding the RX
queue lock when the uppoer stack is called inside TCP_LRO

Submitted by: Kevin Bowling <kevin.bowling@kev009.com>
Reviewed by: erj
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D11724

6 years agoSlight restructure of iflib_busdma_load_mbuf_sg() to fix accounting
Sean Bruno [Thu, 27 Jul 2017 22:53:47 +0000 (22:53 +0000)]
Slight restructure of iflib_busdma_load_mbuf_sg() to fix accounting
when m_collapse() fails.

Submitted by: krzystof.galazka@intel.com
Reviewed by: Jeb Cramer <cramerj@intel.com>
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D11476

6 years agoDeprecate unused int isc_max_txqsets and int isc_max_rxqsets as they
Sean Bruno [Thu, 27 Jul 2017 21:21:43 +0000 (21:21 +0000)]
Deprecate unused int isc_max_txqsets and int isc_max_rxqsets as they
were redundant and not being used to set anything up.

Submitted by: Matt Macy <mmacy@mattmacy.io>
Reported by: Jeb Cramer <cramerj@intel.com>
Sponsored by: Limelight Networks

6 years agoReplace the checks for MNTK_UNMOUNTF with a macro that does the same thing.
Rick Macklem [Thu, 27 Jul 2017 20:55:31 +0000 (20:55 +0000)]
Replace the checks for MNTK_UNMOUNTF with a macro that does the same thing.

This patch defines a macro that checks for MNTK_UNMOUNTF and replaces
explicit checks with this macro. It has no effect on semantics, but
prepares the code for a future patch where there will also be a
NFS specific flag for "forced dismount about to occur".

Suggested by: kib
MFC after: 2 weeks

6 years agoMake it possible to request nosys logging to console.
Konstantin Belousov [Thu, 27 Jul 2017 20:45:41 +0000 (20:45 +0000)]
Make it possible to request nosys logging to console.

New kern.lognosys values are
1 - log to ctty
2 - log to console
3 - log to both.

Inspired by: eugen
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoAllwinner A64: fix typo
Emmanuel Vadot [Thu, 27 Jul 2017 17:51:51 +0000 (17:51 +0000)]
Allwinner A64: fix typo

'pll_ddr0' is the dram parent, not 'pll_ddr'

6 years agoMake the number of children for pctrie node available outside subr_pctrie.c.
Konstantin Belousov [Thu, 27 Jul 2017 16:40:14 +0000 (16:40 +0000)]
Make the number of children for pctrie node available outside subr_pctrie.c.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
X-Differential revision: https://reviews.freebsd.org/D11435

6 years agoRemove duplicate assignments from r321622.
Kenneth D. Merry [Thu, 27 Jul 2017 15:51:56 +0000 (15:51 +0000)]
Remove duplicate assignments from r321622.

Submitted by: mav
MFC after: 3 days
Sponsored by: Spectra Logic

6 years agoFix probing FC targets with hard addressing turned on.
Kenneth D. Merry [Thu, 27 Jul 2017 15:33:57 +0000 (15:33 +0000)]
Fix probing FC targets with hard addressing turned on.

This largely reverts FreeBSD SVN change 289937 from October 25th, 2015.

The intent of that change was to keep loop IDs persistent across
chip reinits.

The problem is that the change turned on the PREVLOOP /
PREV_ADDRESS bit (bit 7 in Firmware Options 2), which tells the
Qlogic chip to not participate in the loop if it can't get the
requested loop address.  It also turned off soft addressing on 2400
(4Gb) and newer controllers.

The isp(4) driver defaults to loop address 0, and the tape drives
I have tested default to loop address 0 if hard addressing is turned
on.  So when hard loop addressing is turned on on the drive, the isp(4)
driver just refuses to participate in the loop.

The solution is to largely revert that change.  I left some elements
in place that are related to virtual ports, since they were new.

This does work with IBM tape drives with hard and soft addressing
turned on.  I have tested it with 4Gb, 8Gb, and 16Gb controllers.

sys/dev/isp.c:
Largely revert FreeBSD SVN change 289937.  I left the
ispmbox.h changes in place.

Don't use the PREV_ADDRESS bit on initialization.  It tells
the chip to not participate if it can't get the requested
loop ID.

Do use soft addressing on 2400 and newer chips.

Use hard addressing when the user has requested a specific
initiator ID.  (hint.isp.X.iid=N in /boot/loader.conf)

Leave some of the virtual port options from that change in
place, but don't turn on the PREV_ADDRESS bit.

Reviewed by: mav
MFC after: 3 days
Sponsored by: Spectra Logic

6 years agoAlways set the receive mask in loader.efi. Some UEFI implementations set
Andrew Turner [Thu, 27 Jul 2017 15:06:34 +0000 (15:06 +0000)]
Always set the receive mask in loader.efi. Some UEFI implementations set
this to be too restrictive. We need to have both broadcast and unicast
enabled for loader to work. Set them in all cases to ensure this is true.

This allows the Cavium ThunderX 2s in the netperf cluster to netboot using
a USB NIC.

PR: 221001
Reviewed by: emaste, tsoome
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11732

6 years agoFix singular/plural "users" output.
Alexander Motin [Thu, 27 Jul 2017 14:34:57 +0000 (14:34 +0000)]
Fix singular/plural "users" output.

It was broken during libxo'fication.

PR: 221039
Submitted by: timur@
MFC after: 1 week

6 years agoBump the image size for BANANAPI and CUBIEBOARD2 to 1.5G, as
Glen Barber [Thu, 27 Jul 2017 13:37:21 +0000 (13:37 +0000)]
Bump the image size for BANANAPI and CUBIEBOARD2 to 1.5G, as
1G is no longer large enough.

Reported by: manu
Sponsored by: The FreeBSD Foundation

6 years agoAfter inpcb route caching was put back in place there is no need for
Bjoern A. Zeeb [Thu, 27 Jul 2017 13:03:36 +0000 (13:03 +0000)]
After inpcb route caching was put back in place there is no need for
flowtable anymore (as flowtable was never considered to be useful in
the forwarding path).

Reviewed by: np
Differential Revision: https://reviews.freebsd.org/D11448

6 years agogenericize target exclusion for missing external toolchain
Ed Maste [Thu, 27 Jul 2017 12:29:31 +0000 (12:29 +0000)]
genericize target exclusion for missing external toolchain

Previously we excluded riscv from make universe / tinderbox if the
required xtoolchain package was not installed. Make that logic generic
so that we can loop over multiple architectures, in preparation to test
patches to have other architectures rely on external toolchain.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11652

6 years agoUse MFENCE to serialize RDTSC on non-Intel CPUs.
Konstantin Belousov [Thu, 27 Jul 2017 08:37:07 +0000 (08:37 +0000)]
Use MFENCE to serialize RDTSC on non-Intel CPUs.

Kernel already used the stronger barrier instruction for AMDs, correct
the userspace fast gettimeofday() implementation as well.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D11728

6 years agoAllow to specify targets by absolute paths in libmap.conf.
Konstantin Belousov [Thu, 27 Jul 2017 08:33:31 +0000 (08:33 +0000)]
Allow to specify targets by absolute paths in libmap.conf.

Submitted by: Tatu Kilappa <tatu.kilappa@iki.fi>
PR: 221032
MFC after: 2 weeks

6 years agoadaasync(): Set ADA_STATE_WCACHE based on ADA_FLAG_CAN_WCACHE
Alexander Motin [Thu, 27 Jul 2017 07:28:29 +0000 (07:28 +0000)]
adaasync(): Set ADA_STATE_WCACHE based on ADA_FLAG_CAN_WCACHE

The attached patch lets adaasync() set ADA_STATE_WCACHE based on
ADA_FLAG_CAN_WCACHE instead of ADA_FLAG_CAN_RAHEAD.

This fixes a regression introduced in r300207 which changed
the flag names.

PR: 220948
Submitted by: Fabian Keil <fk@fabiankeil.de>
Obtained from: ElectroBSD
MFC after: 1 week

6 years agoAs in r315225, discard 3072 bytes of RC4 bytestream instead of 1024.
Cy Schubert [Thu, 27 Jul 2017 06:26:15 +0000 (06:26 +0000)]
As in r315225, discard 3072 bytes of RC4 bytestream instead of 1024.

PR: 217920
Submitted by: codarren@hackers.mu
Reviewed by: emaste, cem
Approved by: so (implicit, in r315225)
MFC after: 1 week
Differential Revision: D11747
Patterned after: r315225

6 years agoFix some broken logic used in obtaining the certain config pages. I'm
Scott Long [Thu, 27 Jul 2017 05:31:48 +0000 (05:31 +0000)]
Fix some broken logic used in obtaining the certain config pages.  I'm
surprised that this even pretended to work.

PR: 215793
Submitted by: longwitz@incore.de

6 years agouart: add AX99100 chipset support
Ed Maste [Thu, 27 Jul 2017 02:53:18 +0000 (02:53 +0000)]
uart: add AX99100 chipset support

PR: 215837
Submitted by: joe@thrallingpenguin.com
MFC after: 2 weeks

6 years agoFix the port vlan support in e6000 based switches.
Luiz Otavio O Souza [Thu, 27 Jul 2017 02:38:53 +0000 (02:38 +0000)]
Fix the port vlan support in e6000 based switches.

Reduce the use of local copies of switch register data.

The switch now works with the upstream dsa node (i.e. the upstream DTS).

Tested on: ClearFog Pro (88E6176), SG-3100 (88E6141)
Sponsored by: Rubicon Communications, LLC (Netgate)

6 years ago- Check the slot type capability, set SDHCI_SLOT_{EMBEDDED,NON_REMOVABLE}
Marius Strobl [Wed, 26 Jul 2017 22:04:23 +0000 (22:04 +0000)]
- Check the slot type capability, set SDHCI_SLOT_{EMBEDDED,NON_REMOVABLE}
  for embedded slots. Fail in the sdhci(4) initialization for slot type
  shared, which is completely unsupported by this driver at the moment. [1]
  For Intel eMMC controllers, taking the embedded slot type into account
  obsoltes setting SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE so remove these quirk
  entries.
- Hide the 1.8 V VDD capability when the slot is detected as non-embedded,
  as the SDHCI specification explicitly states that 1.8 V VDD is applicable
  to embedded slots only. [2]
- Define some easy bits of the SDHCI specification v4.20. [3]
- Don't leak bus_dma(9) resources in failure paths of sdhci_init_slot().

Obtained from: DragonFlyBSD 65704a46 [1], 7ba10b88 [2], 0df14648 [3]

6 years agoCorrectly use the size of a pointer rather than that of a pointer to a
Marius Strobl [Wed, 26 Jul 2017 21:59:37 +0000 (21:59 +0000)]
Correctly use the size of a pointer rather than that of a pointer to a
pointer.

Reported by: Coverity
CID: 1378432

6 years agocc_cubic: restore braces around if-condition block
Ed Maste [Wed, 26 Jul 2017 21:23:09 +0000 (21:23 +0000)]
cc_cubic: restore braces around if-condition block

r307901 was reverted in r321480, restoring an incorrect block
delimitation bug present in the original cc_cubic commit. Restore
only the bugfix (brace addition) from r307901.

CID: 1090182
Approved by: sbruno

6 years agoAdd a debug sysctl that lets you see i2c bus traffic through this device.
Ian Lepore [Wed, 26 Jul 2017 21:20:57 +0000 (21:20 +0000)]
Add a debug sysctl that lets you see i2c bus traffic through this device.

6 years agoAdd support for tracking nested calls to iicbus_request/release_bus().
Ian Lepore [Wed, 26 Jul 2017 21:06:26 +0000 (21:06 +0000)]
Add support for tracking nested calls to iicbus_request/release_bus().

Usually it is sufficient to use iicbus_transfer_excl(), or one of the
higher-level convenience functions that use it, to reserve the bus for the
duration of each register access.  Occasionally it is important that a
series of accesses or read-modify-write operations must be done without any
other intervening access to the device, to prevent corrupting state.

Without support for nested request/release, slave device drivers would have
to stop using high-level convenience functions and resort to working with
arrays of iic_msg structs just for a few operations (often involving
one-time device setup or infrequent configuration changes).

The changes here appear large from a glance at the diff, but in fact they're
nearly trivial, and the large diff is because of changes in indentation and
the re-wrapping of comments caused by that.  One notable change is that
iicbus_release_bus() now ignores the IICBUS_CALLBACK(IIC_RELEASE_BUS) return
value.  The old error handling left the bus in a kind of limbo state where
it was still owned at the iicbus layer, but drivers rarely check the return
of the release call, and it's unclear what they would do to recover from an
error return anyway.  No existing low-level drivers return any kind of error
from IIC_RELEASE_BUS except one EINVAL for "you don't own the bus", to which
the right response is probably to carry on with the process of releasing the
reference to the bus anyway.

6 years agoAdd a pair of convenience routines for doing simple "register" read/writes
Ian Lepore [Wed, 26 Jul 2017 20:40:24 +0000 (20:40 +0000)]
Add a pair of convenience routines for doing simple "register" read/writes
on i2c devices, where the "register" can be any length.

Many (perhaps most) common i2c devices are organized as a collection of
(usually 1-byte-wide) registers, and are accessed by first writing a 1-byte
register index/offset number, then by reading or writing the data.
Generally there is an auto-increment feature so the when multiple bytes
are read or written, multiple contiguous registers are accessed.

Most existing slave device drivers allocate an array of iic_msg structures,
fill in all the transfer info, and invoke iicbus_transfer().  These new
functions commonize all that and reduce register access to a simple call
with a few arguments.

6 years agocxgbe(4): Some updates to the common code.
Navdeep Parhar [Wed, 26 Jul 2017 20:20:58 +0000 (20:20 +0000)]
cxgbe(4): Some updates to the common code.

- Updated register ranges.
- Helper routines for access to TP registers.
- Updated routine to read flash parameters.

Obtained from: Chelsio Communications
MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agoMark pages after EOF as clean after pageout.
Konstantin Belousov [Wed, 26 Jul 2017 20:07:05 +0000 (20:07 +0000)]
Mark pages after EOF as clean after pageout.

Suppose that a file on NFS has partially filled last page, and this
page is dirty.  NFS VOP_PAGEOUT() method only marks the the page clean
up to the block of the last written byte, leaving other blocks dirty.
Also any page which erronously exists in the vnode vm_object past EOF
is also left marked as dirty.

With the introduction of the buf-cache coherent pager, each pass of
syncer over the object with such page results in creation of B_DELWRI
buffer due to VOP_WRITE() call.  This buffer is noted on next syncer
pass, which results e.g. a visible manifestation of shutdown never
finishing vnode sync.  Note that before buf-cache coherency commit, a
dirty page might left never synced to server if a partial writes
occur.

Fix this by clearing dirty bits after EOF.  Only blocks of the partial
page which are completely after EOF are marked clean, to avoid
possible user data loss.

Reported by: mav
Reviewed by: alc, markj
Tested by: mav, pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D11697

6 years agoMove rtvals initialization out of the region protected by NFS node
Konstantin Belousov [Wed, 26 Jul 2017 20:01:31 +0000 (20:01 +0000)]
Move rtvals initialization out of the region protected by NFS node
lock.

Noted by: alc
Reviewed by: alc, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
X-Differential revision: https://reviews.freebsd.org/D11697

6 years agoPass the last exception trap frame to kdb_trap. This allows show registers
Andrew Turner [Wed, 26 Jul 2017 17:39:10 +0000 (17:39 +0000)]
Pass the last exception trap frame to kdb_trap. This allows show registers
in ddb to show the traps registers, and not the registers from within the
panic call.

Sponsored by: DARPA, AFRL

6 years agoAdd an auxiliary subroutine to generate some events for testing
Li-Wen Hsu [Wed, 26 Jul 2017 12:07:46 +0000 (12:07 +0000)]
Add an auxiliary subroutine to generate some events for testing

This test is also timeout on a quiet system because there is nobody triggering
read probefunc while test execution.

Reviewed by: gnn, markj, ngie
Differential Revision: https://reviews.freebsd.org/D11731

6 years agoUpgrade to the latest sources generated from the CloudABI specification.
Ed Schouten [Wed, 26 Jul 2017 06:57:15 +0000 (06:57 +0000)]
Upgrade to the latest sources generated from the CloudABI specification.

The CloudABI specification has had some minor changes over the last half
year. No substantial features have been added, but some features that
are deemed unnecessary in retrospect have been removed:

- mlock()/munlock():

  These calls tend to be used for two different purposes: real-time
  support and handling of sensitive (cryptographic) material that
  shouldn't end up in swap. The former use case is out of scope for
  CloudABI. The latter may also be handled by encrypting swap.

  Removing this has the advantage that we no longer need to worry about
  having resource limits put in place.

- SOCK_SEQPACKET:

  Support for SOCK_SEQPACKET is rather inconsistent across various
  operating systems. Some operating systems supported by CloudABI (e.g.,
  macOS) don't support it at all. Considering that they are rarely used,
  remove support for the time being.

- getsockname(), getpeername(), etc.:

  A shortcoming of the sockets API is that it doesn't allow you to
  create socket(pair)s, having fake socket addresses associated with
  them. This makes it harder to test applications or transparently
  forward (proxy) connections to them.

  With CloudABI, we're slowly moving networking connectivity into a
  separate daemon called Flower. In addition to passing around socket
  file descriptors, this daemon provides address information in the form
  of arbitrary string labels. There is thus no longer any need for
  requesting socket address information from the kernel itself.

This change also updates consumers of the generated code accordingly.
Even though system calls end up getting renumbered, this won't cause any
problems in practice. CloudABI programs always call into the kernel
through a kernel-supplied vDSO that has the numbers updated as well.

Obtained from: https://github.com/NuxiNL/cloudabi

6 years agoMark name_PCTRIE_LOOKUP_LE() generated function unused.
Konstantin Belousov [Wed, 26 Jul 2017 06:42:01 +0000 (06:42 +0000)]
Mark name_PCTRIE_LOOKUP_LE() generated function unused.

The PCTRIE macro will be shortly applied in a situation where
LOOKUP_LE is not needed.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
X-Differential revision: https://reviews.freebsd.org/D11435

6 years ago[iwm] Sync rs (rate-selection) API definitions from Linux iwlwifi.
Adrian Chadd [Wed, 26 Jul 2017 05:52:37 +0000 (05:52 +0000)]
[iwm] Sync rs (rate-selection) API definitions from Linux iwlwifi.

* While there clean up alignments and line wrapping in existing
  definitions for rs API in if_iwmreg.h

Obtained from: dragonflybsd.git 085e37a042bdb17081e495e46919359ce43aa118

6 years ago[iwm] Add iwm_mvm_send_lq_cmd() from Linux iwlwifi to if_iwm_util.c.
Adrian Chadd [Wed, 26 Jul 2017 05:51:31 +0000 (05:51 +0000)]
[iwm] Add iwm_mvm_send_lq_cmd() from Linux iwlwifi to if_iwm_util.c.

Obtained from: dragonflybsd.git 8a5dd7783e407856754093f5b1c9c757c64534b7

6 years ago[iwm] Sync statistics API definitions with Linux iwlwifi.
Adrian Chadd [Wed, 26 Jul 2017 05:40:52 +0000 (05:40 +0000)]
[iwm] Sync statistics API definitions with Linux iwlwifi.

Obtained from: dragonflybsd.git 75895a53a9c1ba60d75be9b4bf6e49a37f91a7cf

6 years ago[iwm] Cleanup mbufq draining. Add iwm_xmit_queue_drain() like in iwn(4).
Adrian Chadd [Wed, 26 Jul 2017 05:29:08 +0000 (05:29 +0000)]
[iwm] Cleanup mbufq draining. Add iwm_xmit_queue_drain() like in iwn(4).

* iwm_xmit_queue_drain() calls ieee80211_free_node(), removing a possible
  memory leak, compared to using just mbufq_drain().

* Remove duplicate mbufq_drain() from iwm_mvm_rm_sta(), this should be
  handled in the caller.

Obtained from: dragonflybsd.git 339d45fda40072e0aca5ece639173204716f11fe

6 years ago[iwm] if_iwm - Use chan list from ieee80211_scan_state for scan, not ic_channels.
Adrian Chadd [Wed, 26 Jul 2017 05:26:01 +0000 (05:26 +0000)]
[iwm] if_iwm - Use chan list from ieee80211_scan_state for scan, not ic_channels.

* Limiting the channel list with "ifconfig wlan0 chanlist ..." now will
  actually set the list of channels scanned by iwm.

Tested:

* Intel 7260, STA mode, setting chanlist to 1-14 and 36-254, and indeed it does what
  it should!

6 years agoRemove trailing slash (/) for consistency.
Cy Schubert [Wed, 26 Jul 2017 02:05:09 +0000 (02:05 +0000)]
Remove trailing slash (/) for consistency.

6 years agoQuiet a message that sounds far more dire than it really is.
Scott Long [Wed, 26 Jul 2017 01:48:13 +0000 (01:48 +0000)]
Quiet a message that sounds far more dire than it really is.

6 years agoNO_CLEAN: Hide delete-old output.
Bryan Drewery [Tue, 25 Jul 2017 20:51:06 +0000 (20:51 +0000)]
NO_CLEAN: Hide delete-old output.

It is full of distracting noise about UPDATING and may confuse
the user about what is actually being deleted.  It is also
possible to have directories removed on every run with
use of WITHOUT_ knobs that the mtree files do not
account for and for which the directories are incorrectly
in OLD_DIRS currently.

X-MFC-With: r321443
MFC after: 1 month
Sponsored by: Dell EMC Isilon

6 years agoOnly build libzfs_core in 'make libraries' if needed.
Bryan Drewery [Tue, 25 Jul 2017 20:43:37 +0000 (20:43 +0000)]
Only build libzfs_core in 'make libraries' if needed.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoRemove unneeded dependency for libzfs.
Bryan Drewery [Tue, 25 Jul 2017 20:43:26 +0000 (20:43 +0000)]
Remove unneeded dependency for libzfs.

This dependency does nothing since cddl/lib/libzfs is never
added into the 'make libraries' dependency chain
directly.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoImprove the clarity of a comment added in r321385 by not referring to
Marius Strobl [Tue, 25 Jul 2017 20:36:44 +0000 (20:36 +0000)]
Improve the clarity of a comment added in r321385 by not referring to
volatile SDHCI specification lingo.