]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoMFC r349619: libc: correct iconv buffer overflow
Ed Maste [Wed, 3 Jul 2019 00:01:38 +0000 (00:01 +0000)]
MFC r349619: libc: correct iconv buffer overflow

admbugs: 920
Submitted by: Andrea Venturoli, gabor
Reported by: Andrea Venturoli <security@netfence.it>, NetFence
Approved by: so
Security: CVE-2019-5600
Security: FreeBSD-SA-19:09.iconv

4 years agoMFC 349133 349146 349150: document PCIOCATTACHED
Niclas Zeising [Tue, 2 Jul 2019 17:23:37 +0000 (17:23 +0000)]
MFC 349133 349146 349150: document PCIOCATTACHED

r349133:

pci(4): Document PCIOCATTACHED

Document the PCIOCATTACHED ioctl(2) in the pci(4) manual.
PCIOCATTACHED is used to query if a driver has attached to a PCI.

Reviewed by: bcr, imp
Differential Revision: https://reviews.freebsd.org/D20652

r349146:

pci.4: wordsmith and add missing words

Add missing words after PCI in the description of the PCIOCWRITE and
PCIOCATTACHED ioctls.
Use singular in PCIOCREAD, we only read one register at the time.

Reviewed by: bcr, bjk, rgrimes, cem
Differential Revision: https://reviews.freebsd.org/D20671

r349150:

pci.4: Use plural configuration registers

It is customary to use plural when talking about PCI configure registers.

Reported by: scottl

4 years agoMFC r349600.
Warren Block [Tue, 2 Jul 2019 16:54:46 +0000 (16:54 +0000)]
MFC r349600.

Correct name of vmm(4) pptdevs variable.

4 years agoMFC r349592: Import tzdata 2019b
Philip Paeps [Tue, 2 Jul 2019 12:22:27 +0000 (12:22 +0000)]
MFC r349592: Import tzdata 2019b

4 years agoMFC r349267:
Andrey V. Elsukov [Mon, 1 Jul 2019 10:01:08 +0000 (10:01 +0000)]
MFC r349267:
  Add "tcpmss" opcode to match the TCP MSS value.

  With this opcode it is possible to match TCP packets with specified
  MSS option, whose value corresponds to configured in opcode value.
  It is allowed to specify single value, range of values, or array of
  specific values or ranges. E.g.

   # ipfw add deny log tcp from any to any tcpmss 0-500

4 years agoMFC r346455-r346458, r348520, r348529, r348817, r348818
Vladimir Kondratyev [Sat, 29 Jun 2019 12:49:52 +0000 (12:49 +0000)]
MFC r346455-r346458, r348520, r348529, r348817, r348818

r346455:
psm(4): Add support for 4 and 5 finger touches in synaptics driver

While 4-th and 5-th finger positions are not exported through PS/2
interface, total number of touches is reported by MT trackpads.

r346456:
psm(4): do not process gestures when palm is present

Ignoring of gesture processing when the palm is detected helps to reduce
some of the erratic pointer behavior.

This fixes regression introduced in r317814

Reported by: Ben LeMasurier <ben@crypt.ly>

r346457:
psm(4): respect tap_disabled configuration with enabled Extended support

This fixes a bug where, even when hw.psm.tap_enabled=0, touchpad taps
were processed.
tap_enabled has three states: unconfigured, disabled, and enabled (-1, 0, 1).
To respect PR kern/139272, taps are ignored only when explicity disabled.

Submitted by: Ben LeMasurier <ben@crypt.ly> (initial version)

r346458:
psm(4): give names to synaptics commands

Submitted by: Ben LeMasurier <ben@crypt.ly>

r348520:
psm(4): Add Elantech touchpad IC type 15 found on Thinkpad L480 laptops

PR: 238291
Submitted by: Andrey Kosachenko <andrey.kosachenko@gmail.com>

r348529:
psm(4): Add natural scrolling support to sysmouse protocol

This change enables natural scrolling with two finger scroll enabled
and when user is using a trackpad (mouse and trackpoint are not affected).
Depending on trackpad model it can be activated with setting of
hw.psm.synaptics.natural_scroll or hw.psm.elantech.natural_scroll sysctl
values to 1.

Evdev protocol is not affected by this change too. Tune userland client
e.g. libinput to enable natural scrolling in that case.

Submitted by: nyan_myuji.xyz
Reviewed by: wulf
Differential Revision: https://reviews.freebsd.org/D20447

r348817:
psm(4): Fix Elantech trackpoint support.

Sign bits for X and Y motion data were taken from wrong places.

PR: 238291
Reported by: Andrey Kosachenko <andrey.kosachenko@gmail.com>
Tested by: Andrey Kosachenko <andrey.kosachenko@gmail.com>

r348818:
psm(4): Add extra sanity checks to Elantech trackpoint packet parser.

Add strict checks for unused bit states in Elantech trackpoint packet
parser to filter out spurious events produces by some hardware which
are detected as trackpoint packets. See comment on r328191 for example.

Tested by: Andrey Kosachenko <andrey.kosachenko@gmail.com>

4 years agoMFC r348993,349135:
Martin Matuska [Fri, 28 Jun 2019 22:31:53 +0000 (22:31 +0000)]
MFC r348993,349135:
Sync libarchive with vendor including security fixes

r348993:
  - version bumped to 3.4.0
  - check_symlinks_fsobj() without chdir() and fchdir()
  - bsdtar.1 manpage fixes
  - patches from OpenBSD to libarchive_fe/passphrase.c

r349135:
  PR #1212: RAR5 reader - window_mask was not updated correctly
            (OSS-Fuzz 15278)
  OSS-Fuzz 15120: RAR reader - extend use after free bugfix

4 years agoMFC r349372:
Glen Barber [Fri, 28 Jun 2019 20:28:20 +0000 (20:28 +0000)]
MFC r349372:
 Include files containing metadata specific to the branch in the
 directory where the individual distribution sets exist.

 The new metadata files include the build date, svn branch, and
 revision of the build.

Sponsored by: Rubicon Communications, LLC (Netgate)

4 years agoMFC r348887:
Mitchell Horne [Fri, 28 Jun 2019 01:03:55 +0000 (01:03 +0000)]
MFC r348887:
procstat: Recognize HWCAP and HWCAP2 with auxv command

Approved by: markj (mentor, implicit)

4 years agoMFC r348886:
Mitchell Horne [Fri, 28 Jun 2019 01:01:54 +0000 (01:01 +0000)]
MFC r348886:
RISC-V: expose extension bits in AT_HWCAP

Approved by: markj (mentor, implicit)

4 years agoMFC r348840:
Mitchell Horne [Fri, 28 Jun 2019 00:58:54 +0000 (00:58 +0000)]
MFC r348840:
Remove unused mcall_trap() function

Approved by: markj (mentor, implicit)

4 years agoMFC r348839:
Mitchell Horne [Fri, 28 Jun 2019 00:56:26 +0000 (00:56 +0000)]
MFC r348839:
Clean up some GENERIC options

Approved by: markj (mentor)

4 years agoMFC r348838:
Mitchell Horne [Fri, 28 Jun 2019 00:53:27 +0000 (00:53 +0000)]
MFC r348838:
Announce real and available memory at boot

Approved by: markj (mentor, implicit)

4 years agoMFC r348837:
Mitchell Horne [Fri, 28 Jun 2019 00:50:00 +0000 (00:50 +0000)]
MFC r348837:
Add TSLOG events to initriscv()

Approved by: markj (mentor, implicit)

4 years agoMFC 348835-348836:
Mitchell Horne [Fri, 28 Jun 2019 00:43:38 +0000 (00:43 +0000)]
MFC 348835-348836:
Fix global pointer relaxations in the RISC-V kernel

The gp register is intended to used by the linker as another means of
performing relaxations, and should point to the small data section (.sdata).

Currently gp is being used as the pcpu pointer within the kernel, but the more
appropriate choice for this is the tp register, which is unused.

Swap existing usage of gp with tp within the kernel, and set up gp properly
at boot with the value of __global_pointer$ for all harts.

Approved by: markj (mentor, implicit)

4 years agoMFC r346021:
Mitchell Horne [Fri, 28 Jun 2019 00:36:26 +0000 (00:36 +0000)]
MFC r346021:
RISC-V: initialize pcpu slightly earlier

In certain scenarios, it is possible for PCPU data to be
accessed before it has been initialized (e.g. during printf
if the kernel was built with the TSLOG option).

Initialize the PCPU pointer for hart 0 at the beginning of
initriscv() rather than near the end.

Approved by: markj (mentor)

4 years agoMFC r344827-344830, r344845:
Mark Johnston [Thu, 27 Jun 2019 16:48:24 +0000 (16:48 +0000)]
MFC r344827-344830, r344845:
Implement minidump support for RISC-V.

4 years agoMFC r349376: Fix strsep_quote() on strings without quotes.
Alexander Motin [Thu, 27 Jun 2019 14:10:58 +0000 (14:10 +0000)]
MFC r349376: Fix strsep_quote() on strings without quotes.

For strings without quotes and escapes dstptr and srcptr are equal, so
zeroing *dstptr before checking *srcptr is not a good idea.  In practice
it means that in -maproot=65534:65533 everything after the colon is lost.

The problem was there since r293305, but before r346976 it was covered by
improper strsep_quote() usage.

PR: 238725

4 years agoMFC: r347065 (by jhb) Emulate the "ADD reg, r/m" instruction (opcode 03H).
Rodney W. Grimes [Wed, 26 Jun 2019 21:59:43 +0000 (21:59 +0000)]
MFC: r347065 (by jhb) Emulate the "ADD reg, r/m" instruction (opcode 03H).

OVMF's flash variable storage is using add instructions when indexing
the variable store bootrom location.

4 years agoMFC r349196:
Mark Johnston [Wed, 26 Jun 2019 17:41:38 +0000 (17:41 +0000)]
MFC r349196:
Make zlib encoding messages idempotent.

PR: 238333

4 years agoMFC r343826, r346698, r349057-r349060, r349073-r349077, r349080-r349086, r349088,
Ian Lepore [Wed, 26 Jun 2019 17:28:55 +0000 (17:28 +0000)]
MFC r343826, r346698, r349057-r349060, r349073-r349077, r349080-r349086, r349088,
    r349091-r349097, r349115, r349119, r349130-r349132, r349143-r349145,
    r349164-r349168, r349174, r349269-r349273

r343826 by yuripv:
pwm.8: fix markup in synopsis, add -f description

r346698 by manu:
arm: allwinner: aw_pwm: compile it as module too

r349057:
Allow pwm(9) components to be selected individually, while 'device pwm'
still includes it all.

r349058:
In detach(), check for failure of bus_generic_detach(), only release
resources if they got allocated (because detach() gets called from attach()
to handle various failures), and delete the pwmbus child if it got created.

r349059:
Don't call pwmbus_attach_bus(), because it may not be present if this
driver is compiled into the kernel but pwmbus will be loaded as a module
when needed (and because of that, pwmbus_attach_bus() is going away in
the near future).  Instead, just directly do what that function did:
register the fdt xfef handle, and attach the pwmbus.

r349060:
Handle failure to enable the clock or obtain its frequency.

r349073:
Do not include pwm.h here, it is purely a userland interface file containing
ioctl defintions for the pwmc driver. It is not part of the pwmbus interface.

r349074:
Move/rename the sys/pwm.h header file to dev/pwm/pwmc.h.  The file contains
ioctl definitions and related datatypes that allow userland control of pwm
hardware via the pwmc device.  The new name and location better reflects its
assocation with a single device driver.

r349075:
Remove pwmbus_attach_bus(), it no longer has any callers.  Also remove a
couple prototypes for functions that never existed (and never will).

r349076:
Use device_delete_children() instead of a locally-rolled copy of it that
leaks the device-list memory.

r349077:
Add a missing #include.  I suspect this used to get included via some header
pollution that was cleaned up recently, and this file got missed in the
cleanup because it's not attached to the build unless you specifically
request this device in a custom kernel config.

r349080:
Make pwmbus driver and devclass vars static; they're not mentioned in any
header file, so they can't be used outside this file anyway.

r349081:
Unwrap prototype lines so that return type and function name are on the
same line.  No functional changes.

r349082:
Spell unsigned int as u_int and channel as chan; eliminates the need to wrap
some long lines.

r349083:
Give the aw_pwm driver a module version.

r349084:
Rename the channel_max method to channel_count, because that's what it's
returning.  (If the channel count is 2, then the max channel number is 1.)

r349085:
Destroy the cdev on device detach.  Also, make the driver and devclass
static, because nothing outside this file needs them.

r349086:
Restructure the pwm device hirearchy and interfaces.

The pwm and pwmbus interfaces were nearly identical, this merges them into a
single pwmbus interface.  The pwmbus driver now implements the pwmbus
interface by simply passing all calls through to its parent (the hardware
driver).  The channel_count method moves from pwm to pwmbus, and the
get_bus method is deleted (just no longer needed).

The net effect is that the interface for doing pwm stuff is now the same
regardless of whether you're a child of pwmbus, or some random driver
elsewhere in the hierarchy that is bypassing the pwmbus layer and is talking
directly to the hardware driver via cross-hierarchy connections established
using fdt data.

The pwmc driver is now a child of pwmbus, instead of being its sibling
(that's why the get_bus method is no longer needed; pwmc now gets the
device_t of the bus using device_get_parent()).

r349088:
Make pwm channel numbers unsigned.

r349091:
The pwm interface was replaced with pwmbus, include the right header file.

r349092:
Make channel number unsigned, and spell unsigned int u_int.  This should
have been part of r349088.

r349093:
This code no longer uses fdt/ofw stuff, no need to include ofw headers.

r349094:
Add module makefiles for pwm.

r349095:
Split the dtb MODULES_EXTRA line to a series of += lines, making it easier
to maintain and keep in alphabetical order, and paving the way for adding
some other modules that aren't dtb-related.

r349096:
Add module makefiles for Texas Instruments ARM SoCs.

The natural place to look for them based on how other SoCs are organized
would be sys/modules/ti, but that's already taken.  Drop a clue into
modules/ti/Makefile directing people to modules/arm_ti if they're looking
for ARM modules.

r349097:
Build SoC-specific modules with GENERIC for the SoCs that have them.

r349115:
Rename pwmbus.h to ofw_pwm.h, because after all the recent changes, there
is nothing left in the file that related to pwmbus at all.  It just contains
prototypes for the functions implemented in dev/pwm.ofw_pwm.c, so name it
accordingly and fix the include protect wrappers to match.

A new pwmbus.h will be coming along in a future commit.

r349119:
Rework pwmbus and pwmc so that each child will handle a single PWM channel.

Previously, there was a pwmc instance for each instance of pwm hardware
regardless of how many pwm channels that hardware supported.  Now there
will be a pwmc instance for each channel when the hardware supports
multiple channels.  With a separate instance for each channel, we can have
"named channels" in userland by making devfs alias entries in /dev/pwm.

These changes add support for ivars to pwmbus, and use an ivar to track the
channel number for each child.  It also adds support for hinted children.

In pwmc, the driver checks for a label hint, and if present, it's used to
create an alias for the cdev in /dev/pwm.  It's not anticipated that hints
will be heavily used, but it's easy to do and allows quick ad-hoc creation
of named channels from userland by using kenv to create hint.pwmc.N.label=
hints.  Upcoming changes will add FDT support, and most labels will
probably be specified that way.

r349130:
Add ofw_pwmbus to enumerate pwmbus devices on systems configured with fdt
data.  Also, add fdt support to pwmc.

r349131:
Implement the ofw_bus_get_node method in aw_pwm(4) so that ofw_pwmbus can
find its metadata for instantiating children.

r349132:
Add back a const qualifier I somehow fumbled away between test-building
and committing recent changes.

r349143:
Put the pwmc cdev filenames under the pwm directory along with any label
names.  I.e., everything related to pwm now goes in /dev/pwm.  This will
make it easier for userland tools to turn an unqualified name into a fully
qualified pathname, whether it's the base pwmcX.Y name or a label name.

r349144:
Follow changes in the pwmc(4) driver in relation to device filenames.

The driver now names its cdev nodes pwmcX.Y where X is unit number and
Y is the channel within that unit.  Change the default device name from
pwmc0 to pwmc0.0.  The driver now puts cdev files and label aliases in
the /dev/pwm directory, so allow the user to provide unqualified names
with -f and automatically prepend the /dev/pwm part for them.

Update the examples in the manpage to show the new device name format
and location within /dev/pwm.

r349145:
Put periods at the ends of argument descriptions.  Explain the relationship
between the period and duty arguments.

r349164:
Remove everything related to channels from the pwmc public interface, now
that there is a pwmc(4) instance per channel and the channel number is
maintained as a driver ivar rather than being passed in from userland.

r349165:
Explain the relationship between PWM hardware channels being controlled and
pwmc(4) device filenames.  Also, use uppercase PWM when the term is being
used as an acronym, and expand the acronym where it's first used.

r349166:
Rearrange the argument checking and processing so that enable and disable
can be combined with configuring the period and duty cycle (the same ioctl
sets all 3 values at once, so there's no reason to require the user to run
the program twice to get all 3 things set).

r349167:
Oops, it seems I left out the word 'cycle', fix it.

r349168:
Add a pwmc(4) manpage.

r349174:
Handle labels specified with hints even on FDT systems.  Hints are the
easiest thing for a user to control (via loader.conf or kenv+kldload), so
handle them in addition to any label specified via the FDT data.

r349269:
Some mundane tweaks and cleanups to help de-clutter the diffs of some
upcoming functional changes.

Add an ofw_compat_data table for probing compat strings, and use it to add
PNP data.  Remove some stray semicolons at the end of macro definitions,
and add a PWM_LOCK_ASSERT macro to round out the usual suite.  Move the
device_t and driver_methods structs to the end of the file.  Tweak comments.

r349270:
Add support for the PWM(9) API.  This allows configuring the pwm output using
pwm(9), but also maintains the historical sysctl config interface for
compatiblity with existing apps.  The two config systems are not compatible
with each other; if you use both interfaces to change configurations you're
likely to end up with incorrect output or none at all.

r349271:
Catch up with recent changes in pwmbus(9).  The pwm(9) and pwmbus(9)
interfaces were unified into pwmbus(9), and the PWMBUS_CHANNEL_MAX method
was renamed PWMBUS_CHANNEL_COUNT.  The pwmbus_attach_bus() function just
went away completely.  Also, fix a few typos such as s/is/if/.

r349272:
Do some general cleanup and light wordsmithing.

Sort methods alphabetically.  Wrap long lines.  Start sentences on a new
line.  Remove contractions (not because it's a good idea, just to silence
igor).  Add some explanation of the units for the period and duty arguments
and the convention for channel numbers.

r349273:
Add pwm to the armv7 GENERIC kernel, it's now used by TI and Allwinner.

4 years agoMFC r340130, r340134:
Ian Lepore [Wed, 26 Jun 2019 16:38:46 +0000 (16:38 +0000)]
MFC r340130, r340134:

r340130: (by oshogbo)

libcapsicum: Introduce caph_{rights,ioctls,fcntls}_limit

The idea behind those functions is not to force consumers to remember that there
is a need to check errno on failure. We already have a caph_enter(3) function
which does the same for cap_enter(2).

r340134: (by oshogbo)

Fix a recusive call introduce in the r340130.

4 years agoMFC r341268, r342003-r342007, r342087-r342088, r342091
Ian Lepore [Wed, 26 Jun 2019 15:34:35 +0000 (15:34 +0000)]
MFC r341268, r342003-r342007, r342087-r342088, r342091

r341268 by manu:
arm64: allwinner: Add a dtbo to have cpu operating points

This enables cpufreq on A64 boards.

r342003 by manu:
Add a pwm subsystem so we can configure pwm controller from kernel and userland.

The pwm subsystem consist of API for PWM controllers, pwmbus to register them
and a pwm(8) utility to talk to them from userland.

Reviewed by: oshgobo (capsicum), bcr (manpage), 0mp (manpage)
Differential Revision: https://reviews.freebsd.org/D17938

r342004 by manu:
arm64: allwinner: Add pwm driver

Add a pwm driver for Allwinner PWM
Add pwm and aw_pwm to the GENERIC kernel

r342005 by manu:
arm64: allwinner: Add DTSO for pwm and r_pwm

Those are both dtso (overlays) for the two pwm controllers found on the A64.

r342006 by manu:
arm64: allwinner: Fix pwm dtso

Double patched files ended up in the tree

Reported by: kevans

r342007 by manu:
pwm: Fix some arches by using %ju and casting to uintmax_t

Reported by: ci.freebsd.org

r342087 by manu:
pwm: Convert period and duty to unsigned int

We don't need a 64 bits value to store nanoseconds

Discused with: ian, jhibbits

r342088 by manu:
pwm(8): Add percentage value support for duty cycle

r342091 by manu:
allwinner: aw_pwm: Read value at attach

The booloaded might have configured the pwm controller so read the values.

4 years agoMFC r348740-r348741, r348995
Ian Lepore [Sun, 23 Jun 2019 16:59:06 +0000 (16:59 +0000)]
MFC r348740-r348741, r348995

r348740:
Don't refer to the cpu variable in a KASSERT before initializing it.

r348741:
For armv6 and armv7, build hwpmc_armv7.c as well as the base hwpmc_arm.c.

Submitted by: Arnaud YSMAL <arnaud.ysmal@stormshield.eu>

r348995:
Don't attempt to include hwpmc support for armv6, we're missing some of the
necessary support functions in cpu-v6.h, and it may be that the only armv6
platform we support (RPi, the bcm2835 SOC) is incapable of supporting hwpmc.

Reported by: dim@

4 years agoMFC r348169-r348170, r348172-r348173, r348183-r348184
Ian Lepore [Sun, 23 Jun 2019 16:16:55 +0000 (16:16 +0000)]
MFC r348169-r348170, r348172-r348173, r348183-r348184

r348169:
Define macros making it easier to define bus-specific pnpinfo for FDT systems.

Pnpinfo is bus-specific and requires the bus name. The FDTCOMPAT_PNP_INFO()
macro makes it easier to define new FDT-based pnpinfo for busses other than
simplebus.

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

r348170:
Add pnpinfo for icee(4) on fdt systems.

r348172:
Use the new FDTCOMPAT_PNP_INFO() macro to define SPIBUS_FDT_PNP_INFO().
Also rename SPIBUS_PNP_INFO -> SPIBUS_FDT_PNP_INFO because there could be
other kinds of pnpinfo for other (non-fdt) bus attachments.

r348173:
Rename IICBUS_FDT_PNPINFO -> IICBUS_FDT_PNP_INFO because all the other
existing pnpinfo-related macros right now use PNP_INFO, not PNPINFO.

r348183:
Add pnpinfo.

r348184:
Add pnpinfo to all i2c drivers that have FDT compat data.

4 years agoMFC r341386 (by manu):
Ian Lepore [Sun, 23 Jun 2019 16:05:53 +0000 (16:05 +0000)]
MFC r341386 (by manu):

Add Silergy SYR827 PMIC driver

SYR827 is a PMIC that can output a voltage from 0.7125V to 1.5V in 12.5mV steps
It's controlled via I2C.

4 years agoMFC r348141, r348143
Ian Lepore [Sun, 23 Jun 2019 16:00:29 +0000 (16:00 +0000)]
MFC r348141, r348143

r348141:
Handle the driftfile option correctly when ntpd_flags is empty.

The logic I originally wrote to detect whether a driftfile option was in the
set of flags was based on the result of removing the pattern *flag* being an
empty string.  That didn't handle the case where the string was empty to
begin with.  Doh!  So now it also specifically checks for an empty string.

The result of the bad check was that ntpd would run without a driftfile, but
it would do so only if it was running as root instead of the non-priveleged
ntpd user, which isn't a typical case.  Ntpd runs fine without a driftfile,
although it does take it longer to stabilize the clock frequency at startup.

Reported by: avg@
Pointy hat: ian@

r348143:
Remove accidentally-added blank line; the style throughout this file
is to use no whitespace between a comment block and the code it describes.

4 years agoMFC r348123, r348164, r348166
Ian Lepore [Sun, 23 Jun 2019 15:58:46 +0000 (15:58 +0000)]
MFC r348123, r348164, r348166

r348123:
Add pnp info to the imx_i2c driver.

r348164:
Mark i2c slave devices busy while they own the bus.

Many i2c slave drivers are in modules that can be unloaded.  If they detach
while IO is in progress the bus would be hung forever.  Conversely,
lower-layer drivers (iicbus and the hardware driver) also live in modules
and other kinds of bad things happen if they get detached while IO is in
progress.  Because device_busy() propagates up to parents, marking the slave
device busy while it owns the bus solves both kinds of problems that come
with detaching i2c devices while IO is in progress.

r348166:
Release the bus-recovery gpio pins in detach(), so that unload then
reload of the module works without "pin already allocated" errors.

4 years agoMFC r348120:
Ian Lepore [Sun, 23 Jun 2019 15:55:41 +0000 (15:55 +0000)]
MFC r348120:

Add a new 'tr' (transfer) mode to i2c(8) to support more i2c controllers.

Some i2c controller hardware does not provide a way to do individual START,
REPEAT-START and STOP actions on the i2c bus.  Instead, they can only do
a complete transfer as a single operation.  Typically they can do either
START-data-STOP or START-data-REPEATSTART-data-STOP.  In the i2c driver
framework, this corresponds to the iicbus_transfer method.  In the userland
interface they are initiated with the I2CRDWR ioctl command.

These changes add a new 'tr' mode which can be specified with the '-m'
command line option.  This mode should work on all hardware; when an i2c
controller driver doesn't directly support the iicbus_transfer method,
code in the i2c driver framework uses the lower-level START/REPEAT/STOP
methods to implement the transfer.  After this new mode has gotten some
testing on various hardware, the 'tr' mode should probably become the
new default mode.

PR: 189914

4 years agoMFC r348737:
Alan Somers [Sun, 23 Jun 2019 13:44:06 +0000 (13:44 +0000)]
MFC r348737:

Add a testing facility to manually reclaim a vnode

Add the debug.try_reclaim_vnode sysctl. When a pathname is written to it, it
will be reclaimed, as long as it isn't already or doomed. The purpose is to
gain test coverage for vnode reclamation, which is otherwise hard to
achieve.

Add the debug.ftry_reclaim_vnode sysctl.  It does the same thing, except
that its argument is a file descriptor instead of a pathname.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20519

4 years agoMFC r348316:
Alan Somers [Sun, 23 Jun 2019 13:40:56 +0000 (13:40 +0000)]
MFC r348316:

VOP_ADVLOCK.9: fix description of flags

* F_RDLCK, F_UNLCK, and F_WRLCK aren't flags.  They're stored in the
  fl.l_type field.
* Add F_REMOTE, added in r177633
* Add F_NOINTR, added in r180025

Sponsored by: The FreeBSD Foundation

4 years agoMFC r348251:
Alan Somers [Sun, 23 Jun 2019 13:35:01 +0000 (13:35 +0000)]
MFC r348251:

Remove "struct ucred*" argument from vtruncbuf

vtruncbuf takes a "struct ucred*" argument. AFAICT, it's been unused ever
since that function was first added in r34611. Remove it.  Also, remove some
"struct ucred" arguments from fuse and nfs functions that were only used by
vtruncbuf.

Reviewed by: cem
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20377

4 years agoMFC r348802:
Konstantin Belousov [Sun, 23 Jun 2019 11:09:08 +0000 (11:09 +0000)]
MFC r348802:
Remove lazy FPU switch support from amd64.

For the merge, the hw.lazy_fpu_switch sysctl was kept but made read-only
with the value of 0.

4 years agoMFC r348799:
Konstantin Belousov [Sun, 23 Jun 2019 11:02:31 +0000 (11:02 +0000)]
MFC r348799:
i386 trap.c: Remove unused MAX_TRAP_MSG define.

4 years agoMFC r348813:
Konstantin Belousov [Sun, 23 Jun 2019 11:01:09 +0000 (11:01 +0000)]
MFC r348813:
Make trap_msg array constant as well.

4 years agoMFC r348798:
Konstantin Belousov [Sun, 23 Jun 2019 10:59:53 +0000 (10:59 +0000)]
MFC r348798:
amd64 trap.c: Modernize syntax around trap_msg[].

4 years agoMFC r349160:
Glen Barber [Thu, 20 Jun 2019 14:34:45 +0000 (14:34 +0000)]
MFC r349160:
 Fix passing ${CONF_FILES} (which contains MAKE_CONF and
 SRC_CONF, __MAKE_CONF and SRCCONF, respectively) through
 to arm_install_base() and chroot_arm_build_release().
 This prevents failures when the target image is intended
 to be build with make.conf(5) and src.conf(5) overrides,
 which are correctly handled for non-embedded image builds.

PR: 238615
Sponsored by: The FreeBSD Foundation

4 years agoMFC r348728:
Michael Tuexen [Thu, 20 Jun 2019 07:50:38 +0000 (07:50 +0000)]
MFC r348728:

r347382 added receiver side DSACK support for the TCP base stack.
The corresponding changes for the RACK stack where missed and are added
by this commit.

4 years agodrm2/intel_iic: stop using iicbus_set_nostop
Andriy Gapon [Thu, 20 Jun 2019 06:53:59 +0000 (06:53 +0000)]
drm2/intel_iic: stop using iicbus_set_nostop

The desired mode of transmitting messages is implemented by subclassing
iicbb driver and overriding its iicbus_transfer method with an almost
identical copy that issues the stop condition only at the very end.

iicbus_set_nostop is very broken and is set to be removed from the KPI.

This is a direct commit as in head the drm drivers have been moved out
of the tree.
The same change has been committed to FreeBSDDesktop/drm-legacy.

4 years agoMFC r349152:
Cy Schubert [Thu, 20 Jun 2019 05:01:35 +0000 (05:01 +0000)]
MFC r349152:

Make ipf_objbytes a constant. ipf_objbytes is a table of internal data
structures that are saved across reboots by ipfs(8). The table is not
changed at runtime.

4 years agoMFC r348764: Allow UMA hash tables to expand faster then 2x in 20 seconds.
Alexander Motin [Thu, 20 Jun 2019 01:18:15 +0000 (01:18 +0000)]
MFC r348764: Allow UMA hash tables to expand faster then 2x in 20 seconds.

ZFS ABD allocates tons of 4KB chunks via UMA, requiring huge hash tables.
With initial hash table size of only 32 elements it takes ~20 expansions
or ~400 seconds to adapt to handling 220GB ZFS ARC.  During that time not
only the hash table is highly inefficient, but also each of those expan-
sions takes significant time with the lock held, blocking operation.

On my test system with 256GB of RAM and ZFS pool of 28 HDDs this change
reduces time needed to first time read 240GB from ~300-400s, during which
system is quite busy and unresponsive, to only ~150s with light CPU load
and just 5 sub-second CPU spikes to expand the hash table.

4 years agoMFC r349148:
Mark Johnston [Thu, 20 Jun 2019 00:23:51 +0000 (00:23 +0000)]
MFC r349148:
Add some missing MLINKs for tree(3).

4 years agoMFC r348772: Restore ARC MFU/MRU pressure
Andriy Gapon [Wed, 19 Jun 2019 20:27:31 +0000 (20:27 +0000)]
MFC r348772: Restore ARC MFU/MRU pressure

Submitted by: Slawa Olhovchenkov <slw@zxy.spb.ru>
Sponsored by: Integros [integros.com]

4 years agoMFC r348228: amdgpio: fix reading status of input pins
Andriy Gapon [Wed, 19 Jun 2019 20:20:02 +0000 (20:20 +0000)]
MFC r348228: amdgpio: fix reading status of input pins

4 years agoMFC r348227: amdgpio: remove new line symbols from pin names
Andriy Gapon [Wed, 19 Jun 2019 20:18:34 +0000 (20:18 +0000)]
MFC r348227: amdgpio: remove new line symbols from pin names

4 years agoMFC r348159: add mrsas_shutdown method
Andriy Gapon [Wed, 19 Jun 2019 20:15:53 +0000 (20:15 +0000)]
MFC r348159: add mrsas_shutdown method

Sponsored by: Panzura

4 years agoMFC r348152: Add USB ID for CP2112
Andriy Gapon [Wed, 19 Jun 2019 20:09:04 +0000 (20:09 +0000)]
MFC r348152: Add USB ID for CP2112

4 years agoMFC r349192:
Jonathan T. Looney [Wed, 19 Jun 2019 16:25:39 +0000 (16:25 +0000)]
MFC r349192:
  Add the ability to limit how much the code will fragment the RACK send map
  in response to SACKs. The default behavior is unchanged; however, the
  limit can be activated by changing the new net.inet.tcp.rack.split_limit
  sysctl.

Approved by: so (gordon)
Security: CVE-2019-5599

4 years agoMFC r347228: makesyscalls: use @generated tag in generated files
Ed Maste [Wed, 19 Jun 2019 14:57:51 +0000 (14:57 +0000)]
MFC r347228: makesyscalls: use @generated tag in generated files

Multiple tools use @generated to identify generated files (for example,
in a review Phabricator will by default hide diffs in generated files).
Use the @generated tag in makesyscalls.sh as we've done for other
generated files.

Sponsored by: The FreeBSD Foundation

4 years agovtfontcvt: whitespace and other cleanup
Ed Maste [Wed, 19 Jun 2019 13:19:36 +0000 (13:19 +0000)]
vtfontcvt: whitespace and other cleanup

MFC r343842: vtfontcvt: whitespace cleanup

MFC r348653: vtfontcvt: use VFNT_MAP_{NORMAL|BOL}_RH symbolic constants

MFC r348656: vtfontcvt: unwrap a line per style(9)

PR: 205707
Submitted by: Dmitry Wagin

4 years agoMFC r348985:
Cy Schubert [Wed, 19 Jun 2019 01:28:13 +0000 (01:28 +0000)]
MFC r348985:

Enclose a long multi-line single conditional statement in braces to
improve legibility and aesthetics.

4 years agoUnmount filesystems on jail removal with "-f", to get around a situation
Jamie Gritton [Tue, 18 Jun 2019 23:49:13 +0000 (23:49 +0000)]
Unmount filesystems on jail removal with "-f", to get around a situation
where the jail root vnode reference is stopping the filesystem from
unmounting, when the jail is removed by still exists in a dying state.

PR: 238517
Reported by: matthias at harz.de

4 years agoMFC r348657:
Mark Johnston [Tue, 18 Jun 2019 16:31:05 +0000 (16:31 +0000)]
MFC r348657:
elfcopy: Use libelftc's string table routines to build .shstrtab.

PR: 234949

4 years agoMFC r348654:
Mark Johnston [Tue, 18 Jun 2019 16:30:35 +0000 (16:30 +0000)]
MFC r348654:
elfcopy: Use elf_getscn() instead of iterating over all sections.

PR: 234949

4 years agoMFC r348652:
Mark Johnston [Tue, 18 Jun 2019 16:29:46 +0000 (16:29 +0000)]
MFC r348652:
libelf: Use a red-black tree to manage the section list.

PR: 234949

4 years agoMFC of 349032
Kirk McKusick [Mon, 17 Jun 2019 21:31:27 +0000 (21:31 +0000)]
MFC of 349032

Clarify -r and -R only usable for level 0 dumps.

4 years agoMFC r347950:
Mark Johnston [Mon, 17 Jun 2019 15:14:26 +0000 (15:14 +0000)]
MFC r347950:
Use M_NEXTFIT in memguard(9).

4 years agoMFC r347949, r347955:
Mark Johnston [Mon, 17 Jun 2019 15:13:15 +0000 (15:13 +0000)]
MFC r347949, r347955:
Implement the M_NEXTFIT allocation strategy for vmem(9).

4 years agoMFC r348459:
Mark Johnston [Mon, 17 Jun 2019 15:11:54 +0000 (15:11 +0000)]
MFC r348459:
acpi_dock(4): Notify devd(8) on dock status change.

PR: 238138

4 years agoMFC r348785:
Mark Johnston [Mon, 17 Jun 2019 15:11:04 +0000 (15:11 +0000)]
MFC r348785:
Replace uses of vm_page_unwire(m, PQ_NONE) with vm_page_unwire_noq(m).

4 years agoMFC: r347583
Rick Macklem [Mon, 17 Jun 2019 00:37:55 +0000 (00:37 +0000)]
MFC: r347583
Replace global list for grouplist with list(s) for each exportlist element.

In mountd.c, the grouplist structures are linked into a single global
linked list headed by "grphead". The only use of this linked list is
to free all list elements when the exportlist elements are also all being
free'd at the time the exports are being reloaded.
This patch replaces this one global linked list head with a list head in
each exportlist structure, where the grouplist elements for that exported
file system are linked.
The only change is that now the grouplist elements are free'd with the
associated exportlist element as they are free'd instead of all grouplist
elements being free'd after the exportlist elements are free'd. This
change should have no effect in practice.
This is being done, since a future patch that will add a "-I" option for
incrementally updating the exports in the kernel needs to know which
grouplist elements are associated with each exported file system and
having them linked into a list headed by the exportlist element does that.

PR: 237860

4 years agoMFC: r347498
Rick Macklem [Mon, 17 Jun 2019 00:20:39 +0000 (00:20 +0000)]
MFC: r347498
Factor code into two new functions in preparation for a future commit.

Factor code into two functions.
read_exportfile() a functon  which reads the exports file(s) and calls
get_exportlist_one() to process each of them.
delete_export() a function which deletes the exports in the kernel for a file
system.
The contents of these functions is just the same code as was used to do the
operations, moved into separate functions. As such, there is no semantic change.
This is being done in preparation for a future commit that will add an
option to do incremental changes of kernel exports upon receiving SIGHUP.

PR: 237860

4 years agoMFC: r347476
Rick Macklem [Mon, 17 Jun 2019 00:00:12 +0000 (00:00 +0000)]
MFC: r347476
Factor out some exportlist list operations into separate functions.

This patch moves the code that removes and frees all exportlist elements
out into a separate function called free_exports().
It does the same for the insertion of a new exportlist entry into a list.
It also adds a second argument to ex_search() for the list to use.
None of these changes have any semantic effect. They are being done to
prepare the code for future patches that convert the single linked list
for the exportlist to a hash table of lists and a patch that will do
incremental changes of exports in the kernel.
And it fixes the argument for SLIST_HEAD_INITIALIZER() to a pointer,
which doesn't really matter, since SLIST_HEAD_INITIALIZER() doesn't use
the argument.

PR: 237860

4 years agoMFC: r347390
Marius Strobl [Sun, 16 Jun 2019 15:34:10 +0000 (15:34 +0000)]
MFC: r347390

- Merge r338254 from cxgbe(4):
  Use fcmpset instead of cmpset when appropriate.
- Revert r277226 of cxgbe(4), obsolete since r334320.

4 years agoMFC: r347222
Marius Strobl [Sun, 16 Jun 2019 15:30:07 +0000 (15:30 +0000)]
MFC: r347222

o Avoid determining the MAC class (LEM/EM or IGB) - possibly even multiple
  times - on every interrupt by using an own set of device methods for the
  IGB class. This translates to introducing igb_if_intr_{disable,enable}()
  and igb_if_{rx,tx}_queue_intr_enable() with that IGB-specific code moved
  out of their EM counterparts and otherwise continuing to use the EM IFDI
  methods also for IGB.
  Note that igb_if_intr_{disable,enable}() also issue E1000_WRITE_FLUSH as
  lost with the conversion of igb(4) to iflib(4).
  Also note, that the em_if_{disable,enable}_intr() methods are renamed to
  em_if_intr_{disable,enable}() for consistency with the names used in the
  interface declaration.
o In em_intr():
  - Don't bother to bail out if the interrupt type is "legacy", i. e. INTx
    or MSI, as iflib(4) doesn't use ift_legacy_intr methods for MSI-X. All
    other iflib(4)-based drivers avoid this check, too.
  - Given that only the MSI-X interrupts have one-shot behavior (by taking
    advantage of the EIAC register), explicitly disable interrupts. Hence,
    em_intr() now matches what {em,igb}_irq_fast() previously did (in case
    of igb(4) supposedly also to work around MSI message reordering errata
    on certain systems).
o In em_if_intr_disable():
  - Clear the EIAC register unconditionally for 82574 and not just in case
    of MSI-X, matching em_if_intr_enable() and bringing back the last hunk
    of r206437 lost with the iflib(4) conversion.
  - Write to EM_EIAC for clearing said register instead of to the IGB-only
    E1000_EIAC used ever since the iflib(4) conversion.

Reviewed by: shurd
Differential Revision: https://reviews.freebsd.org/D20176

4 years agoMFC: r347221, r347245
Marius Strobl [Sun, 16 Jun 2019 15:25:46 +0000 (15:25 +0000)]
MFC: r347221, r347245

o Use iflib_fast_intr_rxtx() also for "legacy" interrupts, i. e. INTx and
  MSI. Unlike as with iflib_fast_intr_ctx(), the former will also enqueue
  _task_fn_tx() in addition to _task_fn_rx() if appropriate, bringing TCP
  TX throughput of EM-class devices on par with the MSI-X case and, thus,
  close to wirespeed/pre-iflib(4) times again. [1]
  Note that independently of the interrupt type, the UDP performance with
  these MACs still is abysmal and nowhere near to where it was before the
  conversion of em(4) to iflib(4).
o In iflib_init_locked(), announce which free list failed to set up.
o In _task_fn_tx() when running netmap(4), issue ifdi_intr_enable instead
  of the ifdi_tx_queue_intr_enable method in case of a "legacy" interrupt
  as the latter is valid with MSI-X only.
o Instead of adding the missing - and apparently convoluted enough that a
  DBG_COUNTER_INC was put into a wrong spot in _task_fn_rx() - checks for
  ifdi_{r,t}x_queue_intr_enable being available in the MSI-X case also to
  iflib_fast_intr_rxtx(), factor these out to iflib_device_register() and
  make the checks fail gracefully rather than panic. This avoids invoking
  the checks at runtime over and over again in iflib_fast_intr_rxtx() and
  _task_fn_{r,t}x() - even if it's just in case of INVARIANTS - and makes
  these functions more readable.
o In iflib_rx_structures_setup(), only initialize LRO resources if device
  and driver have LRO capability in order to not waste memory. Also, free
  the LRO resources again if setting them up fails for one of the queues.
  However, don't bother invoking iflib_rx_sds_free() in that case because
  iflib_rx_structures_setup() doesn't call iflib_rxsd_alloc() either (and
  iflib_{device,pseudo}_register() will issue iflib_rx_sds_free() in case
  of failure via iflib_rx_structures_free(), but there definitely is some
  asymmetry left to be fixed, though).
o Similarly, free LRO resources again in iflib_rx_structures_free().
o In iflib_irq_set_affinity(), handle get_core_offset() errors gracefully
  instead of panicing (but only in case of INVARIANTS). This is a follow-
  up to r344132 (MFCed to stable/12 in r344163) as such bugs shouldn't be
  fatal.
o Likewise, handle unknown iflib_intr_type_t in iflib_irq_alloc_generic()
  gracefully, too.
o Bring yet more sanity to iflib_msix_init():
  - If the device doesn't provide enough MSI-X vectors or not all vectors
    can be allocate so the expected number of queues in addition to admin
    interrupts can't be supported, try MSI next (and then INTx) as proper
    MSI-X vector distribution can't be assured in such cases. In essence,
    this change brings r254008 forward to iflib(4). Also, this is the fix
    alluded to in the commit message of r343934.
  - If the MSI-X allocation has failed, don't prematurely announce MSI is
    going to be used as the latter in fact may not be available either.
  - When falling back to MSI, only release the MSI-X table resource again
    if it was allocated in iflib_msix_init(), i. e. isn't supplied by the
    driver, in the first place.
o In mp_ndesc_handler(), handle unknown type arguments gracefully, too.

PR: 235031 (likely) [1]
Reviewed by: shurd
Differential Revision: https://reviews.freebsd.org/D20175

4 years agoMFC: r347211
Marius Strobl [Sun, 16 Jun 2019 15:11:52 +0000 (15:11 +0000)]
MFC: r347211

- Remove the unused ifc_link_irq and ifc_mtx_name members of struct iflib_ctx.
- Remove the only ever written to ift_db_mtx_name member of struct iflib_txq.
- Remove the unused or only ever written to ifr_size, ifr_cq_pidx, ifr_cq_gen
  and ifr_lro_enabled members of struct iflib_rxq.
- Consistently spell DMA, RX and TX uppercase in comments, messages etc.
  instead of mixing with some lowercase variants.
- Consistently use if_t instead of a mix of if_t and struct ifnet pointers.
- Bring the function comments of _iflib_fl_refill(), iflib_rx_sds_free() and
  iflib_fl_setup() in line with reality.
- Judging problem reports, people are wondering what on earth messages like:
  "TX(0) desc avail = 1024, pidx = 0"
  are trying to indicate. Thus, extend this string to be more like that of
  non-iflib(4) Ethernet MAC drivers, notifying about a watchdog timeout due
  to which the interface will be reset.
- Take advantage of the M_HAS_VLANTAG macro.
- Use false/true rather than FALSE/TRUE for variables of type bool.
- Use FALLTHROUGH as advocated by style(9).

4 years agoMFC: r344062 (partial)
Marius Strobl [Sun, 16 Jun 2019 14:53:53 +0000 (14:53 +0000)]
MFC: r344062 (partial)

- For diff reduction, bring in as much of the taskqgroup_attach{,_cpu}(9)
  fix from r344062 as possible without breaking KBI, which in turn means
  that these functions still don't properly work across architectures in
  stable/12 (in theory, compat shims should be possible but result in a
  PITA to maintain). However, e. g. the static iflib_irq_set_affinity()
  now also takes the irq as an if_irq_t instead of an int.
- Move the gtaskqueue_enqueue_fn typedef from <sys/gtaskqueue.h> to
  the gtaskqueue implementation as it's only used and needed there.
- Change the GTASK_INIT macro to use "gtask" rather than "task" as
  argument given that it actually operates on a struct gtask rather
  than a struct task.
- Let subr_gtaskqueue.c consistently use __func__ to print functions
  names.

4 years agoMFC: r344060, r344064
Marius Strobl [Sun, 16 Jun 2019 11:34:56 +0000 (11:34 +0000)]
MFC: r344060, r344064

Further correct and optimize the bus_dma(9) usage of iflib(4):
o Correct the obvious bugs in the netmap(4) parts:
  - No longer check for the existence of DMA maps as bus_dma(9)
    is used unconditionally in iflib(4) since r341095 (MFCed to
    stable/12 in r343304).
  - Supply the correct DMA tag and map pairs to bus_dma(9)
    functions (see also the commit message of r343753, MFCed to
    stable/12 in r343933).
  - In iflib_netmap_timer_adjust(), add synchronization of the
    TX descriptors before calling the ift_txd_credits_update
    method as the latter evaluates the TX descriptors possibly
    updated by the MAC.
  - In _task_fn_tx(), wrap the netmap(4)-specific bits in
    #ifdef DEV_NETMAP just as done in _task_fn_admin() and
    _task_fn_rx() respectively.
o In iflib_fast_intr_rxtx(), synchronize the TX rather than
  the RX descriptors before calling the ift_txd_credits_update
  method (see also above).
o There's no need to synchronize an RX buffer that is going to
  be recycled in iflib_rxd_pkt_get(), yet; it's sufficient to
  do that as late as passing RX buffers to the MAC via the
  ift_rxd_refill method. Hence, combine that synchronization
  with the synchronization of new buffers into a common spot
  in _iflib_fl_refill().
o There's no need to synchronize the RX descriptors of a free
  list in preparation of the MAC updating their statuses with
  every invocation of rxd_frag_to_sd(); it's enough to do this
  once before handing control over to the MAC, i. e. before
  calling ift_rxd_flush method in _iflib_fl_refill(), which
  already performs the necessary synchronization.
o Given that the ift_rxd_available method evaluates the RX
  descriptors which possibly have been altered by the MAC,
  synchronize as appropriate beforehand. Most notably this
  is now done in iflib_rxd_avail(), which in turn means that
  we don't need to issue the same synchronization yet again
  before calling the ift_rxd_pkt_get method in iflib_rxeof().
o In iflib_txd_db_check(), synchronize the TX descriptors
  before handing them over to the MAC for transmission via
  the ift_txd_flush method.
o In iflib_encap(), move the TX buffer synchronization after
  the invocation of the ift_txd_encap() method. If the MAC
  driver fails to encapsulate the packet and we retry with
  a defragmented mbuf chain or finally fail, the cycles for
  TX buffer synchronization have been wasted. Synchronizing
  afterwards matches what non-iflib(4) drivers typically do
  and is sufficient as the MAC will not actually start with
  the transmission before - in this case - the ift_txd_flush
  method is called.
  Moreover, for the latter reason the synchronization of the
  TX descriptors in iflib_encap() can go as it's enough to
  synchronize them before passing control over to the MAC by
  issuing the ift_txd_flush() method (see above).
o In iflib_txq_can_drain(), only synchronize TX descriptors
  if the ift_txd_credits_update method accessing these is
  actually called.

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

4 years agoMFC: r343979
Marius Strobl [Sun, 16 Jun 2019 10:46:02 +0000 (10:46 +0000)]
MFC: r343979

As struct cryptop is wrapped in #ifdef _KERNEL, userland doesn't
need to drag in <sys/_task.h> either.

4 years agoMFC r348681: Only respond to the PCIe Attention Button if a device is
Colin Percival [Sat, 15 Jun 2019 20:25:36 +0000 (20:25 +0000)]
MFC r348681: Only respond to the PCIe Attention Button if a device is
already plugged in.

This unbreaks attaching disks to EC2 "bare metal" instances.

4 years agoMFC r347370: Bump EC2 AMI filesystem size up to 4000 MB.
Colin Percival [Sat, 15 Jun 2019 20:24:19 +0000 (20:24 +0000)]
MFC r347370: Bump EC2 AMI filesystem size up to 4000 MB.

The latest stable/12 snapshot broke because it ran out of disk space.

4 years agoMFC r348498: libatf: remove workaround not required after atf >= 0.18 update
Ed Maste [Sat, 15 Jun 2019 09:28:48 +0000 (09:28 +0000)]
MFC r348498: libatf: remove workaround not required after atf >= 0.18 update

lib/atf/libatf-c/tests/Makefile added the -Wno-duplicate-decl-specifier
due to an issue with an old version of ATF.  ATF has long since been
updated to a version with the fix so the workaround is no longer
necessary.

Found during review for PR 236889.

PR: 236889

4 years agoMFC r348497: octusb: fix detach loop over USB ports
Ed Maste [Sat, 15 Jun 2019 09:25:40 +0000 (09:25 +0000)]
MFC r348497: octusb: fix detach loop over USB ports

Sponsored by: The FreeBSD Foundation

4 years agoMFC r348714:
Allan Jude [Fri, 14 Jun 2019 15:09:08 +0000 (15:09 +0000)]
MFC r348714:

zpool.8: the comment property is not read-only

The comment property was listed in the man page twice, once under the list
of read-only properties, and again (correctly), under the list of user
editable properties.

PR: 238355
Reported by: Michael Zuo <muh.muhten@gmail.com>
Sponsored by: Klara Systems

4 years agoMFC r348774:
Andrey V. Elsukov [Fri, 14 Jun 2019 10:39:05 +0000 (10:39 +0000)]
MFC r348774:
  Use underscores for internal variable name to avoid conflicts.

4 years agoMFC r346160:
Li-Wen Hsu [Thu, 13 Jun 2019 20:16:26 +0000 (20:16 +0000)]
MFC r346160:

Suppress old gcc warning about null format string

This is workaround to make head build on gcc using architectures

Sponsored by: The FreeBSD Foundation

4 years agoMFC r348747:
Mark Johnston [Thu, 13 Jun 2019 16:34:55 +0000 (16:34 +0000)]
MFC r348747:
Add sysctls for uma_kmem_{limit,total}.

4 years agoMFC r348746:
Mark Johnston [Thu, 13 Jun 2019 16:34:25 +0000 (16:34 +0000)]
MFC r348746:
Remove the volatile qualifer from uma_kmem_total.

4 years agoMFC r348742:
Mark Johnston [Thu, 13 Jun 2019 16:33:55 +0000 (16:33 +0000)]
MFC r348742:
Fix a race between fasttrap and the user breakpoint handler.

4 years agoMFC r348745, r348751:
Mark Johnston [Thu, 13 Jun 2019 16:33:01 +0000 (16:33 +0000)]
MFC r348745, r348751:
Conditionalize an in_epoch() call on INVARIANTS.

4 years agoMFC r348743:
Mark Johnston [Thu, 13 Jun 2019 16:32:03 +0000 (16:32 +0000)]
MFC r348743:
Make the linuxkpi's alloc_pages() consistently return wired pages.

4 years agoMFC r346149:
Baptiste Daroussin [Thu, 13 Jun 2019 08:00:32 +0000 (08:00 +0000)]
MFC r346149:

Update mandoc to 1.14.5

Relnotes: yes

4 years agoMFC r348422: Pass data pointers to the driver in way in expects.
Alexander Motin [Thu, 13 Jun 2019 01:23:03 +0000 (01:23 +0000)]
MFC r348422: Pass data pointers to the driver in way in expects.

Probably due to historical reasons the driver uses In/Out arguments in
odd way.  While this tool still never uses Out arguments to see that,
make the code to not trigger EINVAL in possible future uses.

4 years agoMFC r347151,347181,347968,348421,348698,348701:
Konstantin Belousov [Wed, 12 Jun 2019 11:48:04 +0000 (11:48 +0000)]
MFC r347151,347181,347968,348421,348698,348701:
Switch to use shared vnode locks for text files during image activation.

For MFC, VOP_GET_WRITECOUNT was left in the slot for KBI stability, but it
is unused.

4 years agoMFC r348360:
Konstantin Belousov [Wed, 12 Jun 2019 11:09:33 +0000 (11:09 +0000)]
MFC r348360:
Do not go into sleep in sleepq_catch_signals() when SIGSTOP from
PT_ATTACH was consumed.

PR: 231445

4 years agoMFC r348682:
Andrey V. Elsukov [Wed, 12 Jun 2019 10:50:17 +0000 (10:50 +0000)]
MFC r348682:
  Initialize V_nat64out methods explicitly.

  It looks like initialization of static variable doesn't work for
  VIMAGE and this leads to panic.

4 years agoMFC r348669
Vincenzo Maffione [Tue, 11 Jun 2019 15:36:36 +0000 (15:36 +0000)]
MFC r348669

Add myself to committers-src.dot and calendar.freebsd

Reviewed by:    mckusick
Differential Revision:  https://reviews.freebsd.org/D20518

4 years agoMFC r348655:
Mark Johnston [Tue, 11 Jun 2019 15:19:22 +0000 (15:19 +0000)]
MFC r348655:
libelftc: Fix some minor style bugs.

4 years agoMFC r348660:
Mark Johnston [Tue, 11 Jun 2019 15:18:50 +0000 (15:18 +0000)]
MFC r348660:
Remove an outdated header comment for vm_page.c.

4 years agoMFC r348790: Fix comparison signedness in arc_is_overflowing().
Alexander Motin [Tue, 11 Jun 2019 14:32:32 +0000 (14:32 +0000)]
MFC r348790: Fix comparison signedness in arc_is_overflowing().

When ARC size is very small, aggsum_lower_bound(&arc_size) may return
negative values, that due to unsigned comparison caused delays, waiting
for arc_adjust() to "fix" it by calling aggsum_value(&arc_size).  Use
of signed comparison there fixes the problem.

4 years agoMFC r348788: Explicitly start ARC adjustment on limits change.
Alexander Motin [Tue, 11 Jun 2019 14:32:03 +0000 (14:32 +0000)]
MFC r348788: Explicitly start ARC adjustment on limits change.

While formally it is not necessary, but the sooner it start, the sooner it
finish, and supposedly less disturbing for workload it will be.

4 years agoMFC r348586: MFV r348585: 9683 Allow bypassing devid in vdev_disk_open()
Alexander Motin [Tue, 11 Jun 2019 14:30:41 +0000 (14:30 +0000)]
MFC r348586: MFV r348585: 9683 Allow bypassing devid in vdev_disk_open()

illumos/illumos-gate@6fe4f3002ca33af5ab7123ed78d81899dadf2fbb

Reviewed by: Sara Hartse <sara.hartse@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     Pavel Zakharov <pavel.zakharov@delphix.com>

This is irrelevant to FreeBSD, just to reduce divergence.

4 years agoMFC r348584: MFV r348583: 9847 leaking dd_clones (DMU_OT_DSL_CLONES) objects
Alexander Motin [Tue, 11 Jun 2019 14:30:09 +0000 (14:30 +0000)]
MFC r348584: MFV r348583: 9847 leaking dd_clones (DMU_OT_DSL_CLONES) objects

illumos/illumos-gate@17fb938fd6cdce3ff1bb47dafda0774f742249a3

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author:     Matthew Ahrens <mahrens@delphix.com>

4 years agoMFC r348581: MFV r348580:
Alexander Motin [Tue, 11 Jun 2019 14:29:21 +0000 (14:29 +0000)]
MFC r348581: MFV r348580:
9559 zfs diff handles files on delete queue in fromsnap poorly

illumos/illumos-gate@20633e304b57bc98f70fdb194081b7023adf527b

Reviewed by: Joshua M. Clulow <josh@sysmgr.org>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author:     Paul Dagnelie <pcd@delphix.com>

4 years agoMFC r348579: MFV r348578: 9962 zil_commit should omit cache thrash
Alexander Motin [Tue, 11 Jun 2019 14:28:16 +0000 (14:28 +0000)]
MFC r348579: MFV r348578: 9962 zil_commit should omit cache thrash

illumos/illumos-gate@cab3a55e158118937e07d059c46f1bc14d1f254d

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Approved by: Joshua M. Clulow <josh@sysmgr.org>
Author:     Prakash Surya <prakash.surya@delphix.com>

4 years agoMFC r348577: MFV r348576: 9963 Seperate tunable for disabling ZIL vdev flush
Alexander Motin [Tue, 11 Jun 2019 14:27:35 +0000 (14:27 +0000)]
MFC r348577: MFV r348576: 9963 Seperate tunable for disabling ZIL vdev flush

illumos/illumos-gate@f8fdf6812567ce1a3b76a6bee2ee3f04bd3fcaca

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     Prakash Surya <prakash.surya@delphix.com>

4 years agoMFC r348574: MFV r348573: 9993 zil writes can get delayed in zio pipeline
Alexander Motin [Tue, 11 Jun 2019 14:26:55 +0000 (14:26 +0000)]
MFC r348574: MFV r348573: 9993 zil writes can get delayed in zio pipeline

illumos/illumos-gate@2258ad0b755b24a55c6173b1e6bb6188389f72dd

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     George Wilson <george.wilson@delphix.com>

4 years agoMFC r348570: MFV r348568: 9466 add JSON output support to channel programs
Alexander Motin [Tue, 11 Jun 2019 14:26:14 +0000 (14:26 +0000)]
MFC r348570: MFV r348568: 9466 add JSON output support to channel programs

illumos/illumos-gate@5267591016146502784860802129b16dab6f135c

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: Sara Hartse <sara.hartse@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     Alek Pinchuk <apinchuk@datto.com>

4 years agoMFC r348567: MFV r348555:
Alexander Motin [Tue, 11 Jun 2019 14:25:03 +0000 (14:25 +0000)]
MFC r348567: MFV r348555:
9690 metaslab of vdev with no space maps was flushed during removal

illumos/illumos-gate@4e75ba682600b2bf19d158577d528c3db65050e8

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author:     Serapheim Dimitropoulos <serapheim@delphix.com>