]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoAdd myself to calendar
kp [Mon, 31 Jul 2017 09:13:18 +0000 (09:13 +0000)]
Add myself to calendar

Reminded by:  mckusick

6 years agoAdd my birthday entry to the calendar file.
n_hibma [Mon, 31 Jul 2017 08:16:12 +0000 (08:16 +0000)]
Add my birthday entry to the calendar file.

6 years agoAdd myself
romain [Mon, 31 Jul 2017 08:11:58 +0000 (08:11 +0000)]
Add myself

Reminded by: mckusick

6 years agoAdd myself to calendar
tsoome [Mon, 31 Jul 2017 08:11:05 +0000 (08:11 +0000)]
Add myself to calendar

Reminded by:  mckusick

6 years agoAdd my birthday.
br [Mon, 31 Jul 2017 08:10:02 +0000 (08:10 +0000)]
Add my birthday.

6 years agoAdd myself to calendar
manu [Mon, 31 Jul 2017 07:58:29 +0000 (07:58 +0000)]
Add myself to calendar

Reminded by:  mckusick

6 years agocalendar: Add myself.
sephe [Mon, 31 Jul 2017 07:48:08 +0000 (07:48 +0000)]
calendar: Add myself.

Reminded by: mckusick

6 years agohyperv: Add VF bringup scripts and devd rules.
sephe [Mon, 31 Jul 2017 07:18:15 +0000 (07:18 +0000)]
hyperv: Add VF bringup scripts and devd rules.

How network VF works with hn(4) on Hyper-V in non-transparent mode:

- Each network VF has a cooresponding hn(4).
- The network VF and the it's cooresponding hn(4) have the same hardware
  address.
- Once the network VF is up, e.g. ifconfig VF up:
  o  All of the transmission should go through the network VF.
  o  Most of the reception goes through the network VF.
  o  Small amount of reception may go through the cooresponding hn(4).
     This reception will happen, even if the the cooresponding hn(4) is
     down.  The cooresponding hn(4) will change the reception interface
     to the network VF, so that network layer and application layer will
     be tricked into thinking that these packets were received by the
     network VF.
  o  The cooresponding hn(4) pretends the physical link is down.
- Once the network VF is down or detached:
  o  All of the transmission should go through the cooresponding hn(4).
  o  All of the reception goes through the cooresponding hn(4).
  o  The cooresponding hn(4) fallbacks to the original physical link
     detection logic.

All these features are mainly used to help live migration, during which
the network VF will be detached, while the network communication to the
VM must not be cut off.  In order to reach this level of live migration
transparency, we use failover mode lagg(4) with the network VF and the
cooresponding hn(4) attached to it.

To ease user configuration for both network VF and non-network VF, the
lagg(4) will be created by the following rules, and the configuration
of the cooresponding hn(4) will be applied to the lagg(4) automatically.

Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D11635

6 years agoRemove now-unused variable.
ian [Mon, 31 Jul 2017 03:19:16 +0000 (03:19 +0000)]
Remove now-unused variable.

6 years agoUse the new clock_schedule() to arrange for clock_settime() to be called
ian [Mon, 31 Jul 2017 01:36:51 +0000 (01:36 +0000)]
Use the new clock_schedule() to arrange for clock_settime() to be called
at the right time to keep the RTC hardware time in sync, instead of using
pause_sbt() to sleep until the right time.

6 years agoAdd clock_schedule(), a feature that allows realtime clock drivers to
ian [Mon, 31 Jul 2017 01:18:21 +0000 (01:18 +0000)]
Add clock_schedule(), a feature that allows realtime clock drivers to
request that their clock_settime() methods be called at a given offset
from top-of-second.  This adds a timeout_task to the rtc_instance so that
each clock can be separately added to taskqueue_thread with the scheduling
it prefers, instead of looping through all the clocks at once with a
single task on taskqueue_thread.  If a driver doesn't call clock_schedule()
the default is the old behavior: clock_settime() is queued immediately.

The motivation behind this is that I was on the path of adding identical
code to a third RTC driver to figure out a delta to top-of-second and
sleep for that amount of time because writing the the RTC registers resets
the hardware's concept of top-of-second.  (Sometimes it's not top-of-second,
some RTC clocks tick over a half second after you set their time registers.)
Worst-case would be to sleep for almost a full second, which is a rude thing
to do on a shared task queue thread.

6 years agoCorrect the predicates on which lockstat:::{thread,spin}-spin fire.
markj [Mon, 31 Jul 2017 00:59:28 +0000 (00:59 +0000)]
Correct the predicates on which lockstat:::{thread,spin}-spin fire.

In particular, they should fire only if the lock was owned by another
thread when we first attempted to acquire that lock.

MFC after: 1 week

6 years agoAdd taskqueue_enqueue_timeout_sbt(), because sometimes you want more control
ian [Mon, 31 Jul 2017 00:54:50 +0000 (00:54 +0000)]
Add taskqueue_enqueue_timeout_sbt(), because sometimes you want more control
over the scheduling precision than 'ticks' can offer, and because sometimes
you're already working with sbintime_t units and it's dumb to convert them
to ticks just so they can get converted back to sbintime_t under the hood.

6 years ago Don't re-parse PCI IDs in order to set card-specific flags, use
scottl [Mon, 31 Jul 2017 00:05:49 +0000 (00:05 +0000)]
Don't re-parse PCI IDs in order to set card-specific flags, use
    the flags field in the PCIID table.

6 years agortwn(4): refresh manpage
avos [Mon, 31 Jul 2017 00:03:42 +0000 (00:03 +0000)]
rtwn(4): refresh manpage

- Remove 'if_rtwn_load="YES"' line from loader.conf; the module was
renamed in r319733 + it will be loaded automatically as a dependency.
- Move new sentence to new line.
- Add short description for dev.rtwn.%d.rx_buf_size tunable.

6 years agortwn_usb: add support for fragmented Rx.
avos [Sun, 30 Jul 2017 23:35:21 +0000 (23:35 +0000)]
rtwn_usb: add support for fragmented Rx.

Since device can pass multiple frames in a single payload temporary
Rx buffer was big enough to hold all of them; now the driver can
concatenate a single frame from multiple payloads.

The Rx buffer size may be configured via tunable (dev.rtwn.%d.rx_buf_size).

Tested with:
 - rtl8188cus, rtl8188eu and rtl8821au (STA mode).
 - (by kevlo) rtl8192cu and rtl8188eu.

PR: 218527
Reviewed by: kevlo
Differential Revision: https://reviews.freebsd.org/D11705

6 years agobsdinstall: default to UEFI-only boot on arm64
emaste [Sun, 30 Jul 2017 23:15:30 +0000 (23:15 +0000)]
bsdinstall: default to UEFI-only boot on arm64

Reviewed by: allanjude
Sponsored by: The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D11721

6 years agoChange from using underbar function names to normal function names for
scottl [Sun, 30 Jul 2017 22:34:24 +0000 (22:34 +0000)]
Change from using underbar function names to normal function names for
the informational print functions.  Collapse the debug API a bit to be
more generic and not require as much code duplication.  While here, fix
a bug in MPS that was already fixed in MPR.

6 years agozyd: code cleanup + drop unneeded cast.
avos [Sun, 30 Jul 2017 22:17:08 +0000 (22:17 +0000)]
zyd: code cleanup + drop unneeded cast.

No functional change intended.

6 years agoRemove unused symbols.
kib [Sun, 30 Jul 2017 21:52:22 +0000 (21:52 +0000)]
Remove unused symbols.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agortwn: drop unnecessary / wrong conversion.
avos [Sun, 30 Jul 2017 21:50:45 +0000 (21:50 +0000)]
rtwn: drop unnecessary / wrong conversion.

The 'chan' field occupies only one byte.

6 years agoAvoid using [LINUX_]SHAREDPAGE constant directly in the vdso code.
dchagin [Sun, 30 Jul 2017 21:24:20 +0000 (21:24 +0000)]
Avoid using [LINUX_]SHAREDPAGE constant directly in the vdso code.
This is needed for https://reviews.freebsd.org/D11780.

Reported by: kib@

6 years agoFix AM/PM mode handling. The bits to mask off in the hours register changes
ian [Sun, 30 Jul 2017 19:58:31 +0000 (19:58 +0000)]
Fix AM/PM mode handling.  The bits to mask off in the hours register changes
between 12/24 hour mode.  Also fix conversion between 12 and 24 hour mode.
It's not as easy as adding/subtracting 12, because the clock doesn't roll
over 11->0, it rolls over 12->1; 0 isn't a valid hour in AM/PM mode.

6 years agoBugfixes and enhancements...
ian [Sun, 30 Jul 2017 18:46:38 +0000 (18:46 +0000)]
Bugfixes and enhancements...

Don't enable the oscillator when it is found to be stopped at init time,
just let the first setting of valid time start it.  But still report a dead
battery if it's stopped at init time.

Don't force the chip into 24hr mode, just cope with whatever mode it is
already in.

Align the RTC clock to top of second when setting it.

6 years agoUpgrade our copies of clang, llvm, lld and lldb to r309439 from the
dim [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.
hselasky [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 [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.
mav [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):
dim [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.
scottl [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.
delphij [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 [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 [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 [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 [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 [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
cem [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)
ngie [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
ngie [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)
ngie [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
ngie [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
ngie [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 agoAdd a new "-N" option to umount(8), that does a forced dismount of an NFS mount
rmacklem [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.
rmacklem [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 [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.
mav [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
dim [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
kp [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 [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.
rmacklem [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:
mm [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 agocxgbe/iw_cxgbe: Log the end point's history and flags to the trace
np [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.
jkim [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
rlibby [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
rlibby [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.
rmacklem [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.
rmacklem [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):
dim [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
gjb [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
gjb [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
sbruno [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.
jkim [Fri, 28 Jul 2017 17:44:36 +0000 (17:44 +0000)]
Import ACPICA 20170728.

6 years agoSimplify flow control.
kib [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
mw [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.
loos [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.
markj [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.
markj [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.
imp [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
imp [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.
imp [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 [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
zbb [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
sbruno [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
sbruno [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
sbruno [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.
rmacklem [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.
kib [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
manu [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.
kib [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.
ken [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.
ken [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 [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.
mav [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
gjb [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
bz [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
emaste [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.
kib [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.
kib [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
mav [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 [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
scottl [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
emaste [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.
loos [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 [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 [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
emaste [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 [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 [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 [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.
np [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