]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoUpdate mandoc to 1.14.2
bapt [Mon, 31 Jul 2017 19:34:38 +0000 (19:34 +0000)]
Update mandoc to 1.14.2

6 years agoImport mandoc 1.14.2
bapt [Mon, 31 Jul 2017 19:17:54 +0000 (19:17 +0000)]
Import mandoc 1.14.2

6 years agoRemove redundant include directories which expand to a noop,
cy [Mon, 31 Jul 2017 19:07:45 +0000 (19:07 +0000)]
Remove redundant include directories which expand to a noop,
"-I/lib/krb5 -I -I".

Reviewed by: ngie@, markm@
MFC after: 1 month
Differential Revision: D11769

6 years agoBatch v_wire_count decrements in vm_hold_free_pages().
markj [Mon, 31 Jul 2017 18:48:58 +0000 (18:48 +0000)]
Batch v_wire_count decrements in vm_hold_free_pages().

Atomic updates to v_wire_count are a significant source of contention, so
combine multiple updates into one in this easy case. Also remove an old
printf that gets executed if the page is shared-busied, which is a case
that will lead to a panic anyway.

Reviewed by: alc, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11791

6 years agoAdd myself to the calendar.
mjoras [Mon, 31 Jul 2017 18:10:10 +0000 (18:10 +0000)]
Add myself to the calendar.

Reported by: mckusick
Approved by: rstone (mentor)
Differential Revision: https://reviews.freebsd.org/D11797

6 years agoDon't trace running threads that have interrupts disabled.
markj [Mon, 31 Jul 2017 17:57:54 +0000 (17:57 +0000)]
Don't trace running threads that have interrupts disabled.

In this case we shouldn't assume that the thread has a valid frame pointer.

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11787

6 years agoAdd myself to calendar.freebsd
erj [Mon, 31 Jul 2017 17:57:44 +0000 (17:57 +0000)]
Add myself to calendar.freebsd

Reported by: mckusick

6 years agoAdd myself to calendar.
dru [Mon, 31 Jul 2017 17:49:47 +0000 (17:49 +0000)]
Add myself to calendar.

6 years ago[wlanwds] allow for a DWDS AP VAP to be not be the first VAP on a NIC.
adrian [Mon, 31 Jul 2017 17:33:57 +0000 (17:33 +0000)]
[wlanwds] allow for a DWDS AP VAP to be not be the first VAP on a NIC.

The wlanwds code was just creating a clone VAP without specifying the MAC
address to use for said clone VAP.  This meant that if an interface
was cloned from an AP interface that wasn't the first created VAP
(which shares the same MAC as the parent physical interface by default)
then the cloned interface would have the wrong MAC and traffic wouldn't work.

Besides chip bugs (ha!) this isn't a requirement.

So, teach wlanwds to:

* look up the link layer address for a given interface (which really should
  be a library interface, and will likely quickly become one);
* use this when creating a cloned interface for a DWDS peer;
* (net80211 already has the infrastructure to do this, it just needed to be
  used);
* add some extra logging to see what MAC addresses, parent interfaces, etc
  are being created.

Whilst here, add a reminder that I should extend this to include monitoring
a specific VAP for DWDS updates rather than just the parent interface.

This is the first step in allowing for multiple DWDS hops, which is a
pre-requisite for adrian's house having wifi in the single upstairs room.

Tested:

* AR9380, DWDS AP + AP mode - with DWDS AP being the second VAP created
  with a different MAC address;
* AR9331 (Carambola2), AP + DWDS STA;
* passing traffic

TODO:

* fix 802.11s so this DWDS stuff is no longer required!

6 years agoFix a logic bug in the split PCI interrupt code that slipped through
scottl [Mon, 31 Jul 2017 16:55:56 +0000 (16:55 +0000)]
Fix a logic bug in the split PCI interrupt code that slipped through

Reported by: Harry Schmalzbauer

6 years agoRestore a few rather important lines of code that got fumbled in r321746.
ian [Mon, 31 Jul 2017 16:46:16 +0000 (16:46 +0000)]
Restore a few rather important lines of code that got fumbled in r321746.

6 years agoAdd an entry to the freebsd calendar for myself.
scottl [Mon, 31 Jul 2017 15:50:58 +0000 (15:50 +0000)]
Add an entry to the freebsd calendar for myself.

Reported by: kirk

6 years agoAdd myself to the birthday calendar.
jamie [Mon, 31 Jul 2017 15:29:44 +0000 (15:29 +0000)]
Add myself to the birthday calendar.

Reminded by: mckusick

6 years agoCheck the clock-halted flag every time the clock is read, not just once
ian [Mon, 31 Jul 2017 15:24:40 +0000 (15:24 +0000)]
Check the clock-halted flag every time the clock is read, not just once
at startup.  The flag stays set until the clock is loaded with good time,
so we need to keep saying the time is invalid until that happens.

6 years agoImprove FHA locality control for NFS read/write requests.
mav [Mon, 31 Jul 2017 15:23:19 +0000 (15:23 +0000)]
Improve FHA locality control for NFS read/write requests.

This change adds two new tunables, allowing to control serialization for
read and write NFS requests separately.  It does not change the default
behavior since there are too many factors to consider, but gives additional
space for further experiments and tuning.

The main motivation for this change is very low write speed in case of ZFS
with sync=always or when NFS clients requests sychronous operation, when
every separate request has to be written/flushed to ZIL, and requests are
processed one at a time.  Setting vfs.nfsd.fha.write=0 in that case allows
to increase ZIL throughput by several times by coalescing writes and cache
flushes.  There is a worry that doing it may increase data fragmentation
on disks, but I suppose it should not happen for pool with SLOG.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

6 years agospellcheck jhale's calendar entry
asomers [Mon, 31 Jul 2017 15:21:26 +0000 (15:21 +0000)]
spellcheck jhale's calendar entry

6 years agoAdd a detach() method.
ian [Mon, 31 Jul 2017 14:58:01 +0000 (14:58 +0000)]
Add a detach() method.

6 years agoSwitch from using iic_transfer() to iicdev_readfrom/writeto(), mostly so
ian [Mon, 31 Jul 2017 14:57:02 +0000 (14:57 +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.  Also add a detach() method.

6 years agoDon't request CTLTYPE_OPAQUE if we can't print them.
gallatin [Mon, 31 Jul 2017 14:56:35 +0000 (14:56 +0000)]
Don't request CTLTYPE_OPAQUE if we can't print them.

The intent is to skip expensive opaque sysctls like tcp_pcblist unless
they are explicitly requested. Sysctl nodes like this don't show up in
sysctl -a, but they do generate output that winds up being dropped,
unless the user specifically requested  binary/hex output or opaques.

This reduces the runtime of sysctl in many circumstances on a loaded
system.  It also reduces the likelihood that simply gathering
diagnostics on a sick machine (stuck lock, etc) via sysctl -a might
push it over the edge into a total lockup.

Reviewed by: jtl
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D11461

6 years agoAdd myself.
nyan [Mon, 31 Jul 2017 14:53:03 +0000 (14:53 +0000)]
Add myself.

Reminded by: mckusick

6 years agoAdd myself to the calendar
asomers [Mon, 31 Jul 2017 14:50:42 +0000 (14:50 +0000)]
Add myself to the calendar

Reported by: mckusick

6 years agoAdd myself to the calendar
mm [Mon, 31 Jul 2017 14:49:44 +0000 (14:49 +0000)]
Add myself to the calendar

Reminded by: mckusick

6 years agoAdd my birthday to the FreeBSD calendar
rpokala [Mon, 31 Jul 2017 14:42:38 +0000 (14:42 +0000)]
Add my birthday to the FreeBSD calendar

Requested by: mckusick

6 years agoAdd myself to the calendar
jhibbits [Mon, 31 Jul 2017 14:16:35 +0000 (14:16 +0000)]
Add myself to the calendar

Reminded by: mckusick

6 years agoadd myself to calendar.freebsd
wen [Mon, 31 Jul 2017 13:32:35 +0000 (13:32 +0000)]
add myself to calendar.freebsd

6 years agoadd myself to calendar.freebsd
lifanov [Mon, 31 Jul 2017 13:08:47 +0000 (13:08 +0000)]
add myself to calendar.freebsd

6 years agoRemove some dead statistics related code and a structure field from the
hselasky [Mon, 31 Jul 2017 12:09:24 +0000 (12:09 +0000)]
Remove some dead statistics related code and a structure field from the
mlx4en driver which is used by its Linux counterpart, but not under
FreeBSD.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoMake sure on-stack buffer is properly aligned.
hselasky [Mon, 31 Jul 2017 12:03:45 +0000 (12:03 +0000)]
Make sure on-stack buffer is properly aligned.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoAdd inpcb pointer to struct ipsec_ctx_data and pass it to the pfil hook
ae [Mon, 31 Jul 2017 11:04:35 +0000 (11:04 +0000)]
Add inpcb pointer to struct ipsec_ctx_data and pass it to the pfil hook
from enc_hhook().

This should solve the problem when pf is used with if_enc(4) interface,
and outbound packet with existing PCB checked by pf, and this leads to
deadlock due to pf does its own PCB lookup and tries to take rlock when
wlock is already held.

Now we pass PCB pointer if it is known to the pfil hook, this helps to
avoid extra PCB lookup and thus rlock acquiring is not needed.
For inbound packets it is safe to pass NULL, because we do not held any
PCB locks yet.

PR: 220217
MFC after: 3 weeks
Sponsored by: Yandex LLC

6 years agoAdd myself to calendar
sgalabov [Mon, 31 Jul 2017 09:46:48 +0000 (09:46 +0000)]
Add myself to calendar

Reminded by: mckusick

6 years agoAdd myself.
eugen [Mon, 31 Jul 2017 09:18:53 +0000 (09:18 +0000)]
Add myself.

Reminded by:    mckusick
Approved by: vsevolod (mentor)

6 years agoRemove cycle_t type from the LinuxKPI similar to Linux upstream.
hselasky [Mon, 31 Jul 2017 09:17:54 +0000 (09:17 +0000)]
Remove cycle_t type from the LinuxKPI similar to Linux upstream.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoFix broken usage of the mlx4_read_clock() function:
hselasky [Mon, 31 Jul 2017 09:15:15 +0000 (09:15 +0000)]
Fix broken usage of the mlx4_read_clock() function:
 - return value has too small width
 - cycle_t is unsigned and cannot be less than zero

Sponsored by: Mellanox Technologies
MFC after: 1 week

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