]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMFC r339886:
Navdeep Parhar [Wed, 27 Mar 2019 19:40:31 +0000 (19:40 +0000)]
MFC r339886:

rping(1): Make sure the socket address defaults to something reasonable
when running as the server.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Reviewed by: hselasky@, np@
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D17707

5 years agoMFC r339717, r339749, and r339809.
Navdeep Parhar [Wed, 27 Mar 2019 19:37:50 +0000 (19:37 +0000)]
MFC r339717, r339749, and r339809.

r339717:
cxgbe(4): Allow "pass" filters to distribute matching traffic using a
subset of a VI's RSS indirection table.

This makes it possible to make groups out of rx queues and steer
different kinds of traffic to different groups.  For example, an
interface with 8 rx queues could have all non-TCP traffic delivered to
queues 0-3 and all TCP traffic to queues 4-7.

Note that it is already possible for filters to steer traffic to a
particular queue or to distribute it using the full indirection table
(much like normal rx does).

Sponsored by: Chelsio Communications

r339749:
cxgbe(4): Add a knob to split the rx queues for a netmap enabled
interface into two groups.  Filters can be used to match traffic
and distribute it across a group.

hw.cxgbe.nm_split_rss

Sponsored by: Chelsio Communications

r339809:
cxgbetool(8): Add a subaction (tcbrss <n>) that can be used with "pass"
action to distribute traffic using the half of the VI's RSS indirection
table.

The value specified should either be the start of the VI's RSS slice
(available at dev.<ifname>.<inst>.rss_base since r339700) or the
midpoint (rss_base + rss_size/2).  The traffic that hits the filter will
use the first or second half of the indirection table respectively.
The indirection table can be populated in different ways to achieve
different kinds of traffic/load distributions.  For example, r339749
allows a netmap interface to have half the rx queues in the first half
of the table and the rest in the other.

Sponsored by: Chelsio Communications

5 years agoMFC r339705:
Navdeep Parhar [Wed, 27 Mar 2019 19:24:37 +0000 (19:24 +0000)]
MFC r339705:

cxgbe(4): Update the VI's default queue when netmap is enabled/disabled.

Sponsored by: Chelsio Communications

5 years agoMFC r339700:
Navdeep Parhar [Wed, 27 Mar 2019 19:18:10 +0000 (19:18 +0000)]
MFC r339700:

cxgbe(4): new sysctl to display the start of the RSS region for a VI.

dev.<ifname>.<inst>.rss_base

For example:
dev.cc.0.rss_base: 0
dev.cc.1.rss_base: 128
dev.vcc.0.rss_base: 256
dev.vcc.1.rss_base: 384

Sponsored by: Chelsio Communications

5 years agoMFC: r344982, r345022
Vladimir Kondratyev [Wed, 27 Mar 2019 19:16:03 +0000 (19:16 +0000)]
MFC: r344982, r345022

atrtc(4): install ACPI RTC/CMOS operation region handler

FreeBSD base system does not provide an ACPI handler for the PC/AT RTC/CMOS
device with PnP ID PNP0B00; on some HP laptops, the absence of this handler
causes suspend/resume and poweroff(8) to hang or fail [1], [2]. On these
laptops EC _REG method queries the RTC date/time registers via ACPI
before suspending/powering off. The handler should be registered before
acpi_ec driver is loaded.

This change adds handler to access CMOS RTC operation region described in
section 9.15 of ACPI-6.2 specification [3]. It is installed only for ACPI
version of atrtc(4) so it should not affect old ACPI-less i386 systems.

It is possible to disable the handler with loader tunable:
debug.acpi.disabled=atrtc

Informational debugging printf can be enabled by setting hw.acpi.verbose=1
in loader.conf

[1] https://wiki.freebsd.org/Laptops/HP_Envy_6Z-1100
[2] https://wiki.freebsd.org/Laptops/HP_Notebook_15-af104ur
[3] https://uefi.org/sites/default/files/resources/ACPI_6_2.pdf

PR: 207419, 213039
Submitted by: Anthony Jenkins <Scoobi_doo@yahoo.com>
Reviewed by: ian
Discussed on: acpi@, 2013-2015, several threads
Differential Revision: https://reviews.freebsd.org/D19314

5 years agoMFC some iw_cxgbe fixes (r339667, r339891, r340063, r342266, r342270,
Navdeep Parhar [Wed, 27 Mar 2019 18:46:47 +0000 (18:46 +0000)]
MFC some iw_cxgbe fixes (r339667, r339891, r340063, r342266, r342270,
r342272, r342288-r342289, r343569, r344617, and r345307).

r339667:
cxgbe/iw_cxgbe: save the ep in the driver-private provider_data field.

Submitted By: Lily Wang @ Netapp

r339891:
cxgbe/iw_cxgbe: Install the socket upcall before calling soconnect to
ensure that it always runs when soisconnected does.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications

r340063:
cxgbe/iw_cxgbe: Suppress spurious "Unexpected streaming data ..."
messages.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications

r342266:
cxgbe/iw_cxgbe: Use DSGLs to write to card's memory when appropriate.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications

r342270:
cxgbe/iw_cxgbe: Add a knob for testing that lets iWARP connections cycle
through 4-tuples quickly.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications

r342272:
cxgbe/iw_cxgbe: Use -ve errno when interfacing with linuxkpi/OFED.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications

r342288:
cxgbe/iw_cxgbe: Do not terminate CTRx messages with \n.

r342289:
cxgbe/iw_cxgbe: Remove redundant CTRs from c4iw_alloc/c4iw_rdev_open.
This information is readily available elsewhere.

Sponsored by: Chelsio Communications

r343569:
cxgbe/iw_cxgbe: Fix an address calculation in the memory registration code that
was added in r342266.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications

r344617:
libcxgb4: Don't spam stderr.  Write combining is not enabled by default
by the FreeBSD driver.

r345307:
iw_cxgbe: Remove unused smac_idx from the ep structure.

Submitted by: Krishnamraju Eraparaju @ Chelsio

5 years agoMFC r339628:
Navdeep Parhar [Wed, 27 Mar 2019 18:22:08 +0000 (18:22 +0000)]
MFC r339628:

cxgbe(4): improve the accuracy of various TSO limits reported to the kernel.

Sponsored by: Chelsio Communications

5 years agoMFC r344569, r344618, r344621
Baptiste Daroussin [Wed, 27 Mar 2019 14:51:03 +0000 (14:51 +0000)]
MFC r344569, r344618, r344621

r344569:
Implement parallel mounting for ZFS filesystem

It was first implemented on Illumos and then ported to ZoL.
This patch is a port to FreeBSD of the ZoL version.
This patch also includes a fix for a race condition that was amended

With such patch Delphix has seen a huge decrease in latency of the mount phase
(https://github.com/openzfs/openzfs/commit/a3f0e2b569 for details).
With that current change Gandi has measured improvments that are on par with
those reported by Delphix.

Zol commits incorporated:
https://github.com/zfsonlinux/zfs/commit/a10d50f999511d304f910852c7825c70c9c9e303
https://github.com/zfsonlinux/zfs/commit/e63ac16d25fbe991a356489c86d4077567dfea21

Reviewed by: avg, sef
Approved by: avg, sef
Obtained from: ZoL
Relnotes: yes
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D19098

r344618:
Fix regression introduced in r344569

Reported by: cy
Tested by: cy
Submitted by: Fatih Acar <fatih@gandi.net>

r344621:
Fix a regression introduced in r344569

Import a fix from illumos (thanks Toomas Soomas for pointing at it)

See https://www.illumos.org/issues/10205 for more details
Illumos commit: https://github.com/illumos/illumos-gate/commit/247b7da039fd88350c50e3d7fef15bdab6bef215

Submitted by: jack@gandi.net
Reported by: cy
Reviewed by: tsoome, cy, bapt
Obtained from: Illumos

5 years agoMFC r344340:
Baptiste Daroussin [Wed, 27 Mar 2019 14:47:10 +0000 (14:47 +0000)]
MFC r344340:

calendar: use iconv to respect the output encoding

calendar(1) can have input in various encoding, specifying
LANG=<locale_name> to enable calendar(1) to determine which one to use.

The problem is the content of the calendar itself is exposed as is making it
unreadable in many cases. For example french calendar which is encoded
ISO8859-1 is rendered badly in a fr_FR.UTF-8 environment.

Using iconv allows to solve this issue.
This will also allow to keep only 1 encoding in base for those files without
breaking user existing setup

Reported by: many
Differential Revision: https://reviews.freebsd.org/D19221

5 years agoMFC r345324:
Konstantin Belousov [Wed, 27 Mar 2019 10:58:37 +0000 (10:58 +0000)]
MFC r345324:
vm_fault_copy_entry: accept invalid source pages.

5 years agoMFC r344994:
Andriy Voskoboinyk [Wed, 27 Mar 2019 09:18:34 +0000 (09:18 +0000)]
MFC r344994:
urtw(4): add promiscuous mode callback

Also, pass control frames to the host while in MONITOR mode and / or
when promiscuous mode is enabled.

Was tested with Netgear WG111 v3 (RTL8187B), STA / MONITOR modes.

5 years agoMFC r345318:
Andriy Voskoboinyk [Wed, 27 Mar 2019 08:55:59 +0000 (08:55 +0000)]
MFC r345318:
lockf(1): return EX_UNAVAILABLE if -n is used and the lock file does not
exist

Apply EX_UNAVAILABLE patch part from PR 170775 to match the documentation.

Was checked with a command from PR 210770:
lockf -n /tmp/doesnotexist echo; echo $?

PR: 210770

5 years agoMFC r342961:
Hans Petter Selasky [Tue, 26 Mar 2019 13:52:01 +0000 (13:52 +0000)]
MFC r342961:
snd_uaudio: Add quirks for Edirol UA-25EX in advanced driver mode.

Extend the vendor class USB audio quirk to cover devices without
the USB audio control descriptor.

PR: 234794
Sponsored by: Mellanox Technologies

5 years agoMFC r343352:
Hans Petter Selasky [Tue, 26 Mar 2019 13:48:59 +0000 (13:48 +0000)]
MFC r343352:
Add USB quirk.

Submitted by: Gary Jennejohn <gljennjohn@gmail.com>
Sponsored by: Mellanox Technologies

5 years agoMFC r344795:
Hans Petter Selasky [Tue, 26 Mar 2019 13:45:11 +0000 (13:45 +0000)]
MFC r344795:
Fix typos in libusb.

Found by: Denis Ahrens <denis@h3q.com>
Sponsored by: Mellanox Technologies

5 years agoMFC r345011:
Hans Petter Selasky [Tue, 26 Mar 2019 13:42:44 +0000 (13:42 +0000)]
MFC r345011:
Eliminate useless warning message when reading sysctl node in mlx4core.

Sponsored by: Mellanox Technologies

5 years agoMFC r345010:
Hans Petter Selasky [Tue, 26 Mar 2019 13:40:33 +0000 (13:40 +0000)]
MFC r345010:
Improve support for switching to and from command polling mode in mlx4core.

Make sure the enter and leave polling routines can be called multiple times
with same setting. Ignore setting polling or event mode twice. This fixes a
deadlock during shutdown if polling mode was already selected.

Sponsored by: Mellanox Technologies

5 years agoMFC r344920:
Hans Petter Selasky [Tue, 26 Mar 2019 13:37:56 +0000 (13:37 +0000)]
MFC r344920:
Teardown ifnet after stopping port in the mlx4en(4) driver.

mlx4_en_stop_port() calls mlx4_en_put_qp() which can refer the link level
address of the network interface, which in turn will be freed by the
network interface detach function. Make sure the port is stopped
before detaching the network interface.

Sponsored by: Mellanox Technologies

5 years agoMFC r344919:
Hans Petter Selasky [Tue, 26 Mar 2019 13:33:36 +0000 (13:33 +0000)]
MFC r344919:
Don't hold state lock while detaching network device instance in mlx4en(4).

It can happen during shutdown that the lock will recurse when the mlx4en(4)
instance is part of a lagg interface. Call ether_ifdetach() unlocked.

Backtrace:
panic(): _sx_xlock_hard: recursed on non-recursive sx &mdev->state_lock
_sx_xlock_hard()
_sx_xlock()
mlx4_en_ioctl()
if_setlladdr()
lagg_port_destroy()
lagg_port_ifdetach()
if_detach()
mlx4_en_destroy_netdev()
mlx4_en_remove()
mlx4_remove_device()
mlx4_unregister_device()
mlx4_unload_one()
mlx4_shutdown()
linux_pci_shutdown()
bus_generic_shutdown()

Sponsored by: Mellanox Technologies

5 years agoMFC r345070:
Konstantin Belousov [Tue, 26 Mar 2019 11:03:09 +0000 (11:03 +0000)]
MFC r345070:
isci(4): Use controller->lock for busdma tags.

5 years agoMFC r345442:
Konstantin Belousov [Tue, 26 Mar 2019 10:58:29 +0000 (10:58 +0000)]
MFC r345442:
Add UPDATING note for geom_uzip(4)/xz, and bump geom_uzip(4) man page date.

5 years agoMerge r344741:
Gleb Smirnoff [Mon, 25 Mar 2019 18:19:37 +0000 (18:19 +0000)]
Merge r344741:
  Remove bogus assert that I added in r319722. It is a legitimate case
  to call soabort() on a newborn socket created by sonewconn() in case
  if further setup of PCB failed. Code in sofree() handles such socket
  correctly.

  Submitted by: jtl, rrs

5 years agoMFC: r345387
Jung-uk Kim [Mon, 25 Mar 2019 17:45:47 +0000 (17:45 +0000)]
MFC: r345387

Catch up with Clang 7.0.

5 years agoMFC r345009:
David Bright [Mon, 25 Mar 2019 17:03:39 +0000 (17:03 +0000)]
MFC r345009:

Fix a scribbler in the PMS driver.

The ESGL bit was left uninitialized when executing the REPORT LUNS
ioctl. This could allow a zeroed data buffer to be treated as a
scatter/gather list. The firmware would eventually walk past the end
of the data buffer, potentially find what looked like a valid
address/length pair, and write the result to semi-random memory.

Obtained from:  Dell EMC Isilon
Sponsored by:   Dell EMC Isilon

5 years agoMFC 345379:
Glen Barber [Mon, 25 Mar 2019 14:50:38 +0000 (14:50 +0000)]
MFC 345379:
 Bump the IMAGE_SIZE for arm64 SoC images to prevent failures due
 to full filesystem.  This makes the size of the arm64 SoC images
 consistent with armv6 and armv7.

Sponsored by: The FreeBSD Foundation

5 years agoMFC r344823:
Mark Johnston [Mon, 25 Mar 2019 14:08:49 +0000 (14:08 +0000)]
MFC r344823:
Show wiring state of map entries in procstat -v.

5 years agoMFC r344935:
Mark Johnston [Mon, 25 Mar 2019 14:05:35 +0000 (14:05 +0000)]
MFC r344935:
Have pthread_cond_destroy() return EBUSY if the condvar has waiters.

PR: 234805

5 years agoMFC r345355:
Mark Johnston [Mon, 25 Mar 2019 14:04:23 +0000 (14:04 +0000)]
MFC r345355:
Ensure that we use a 64-bit value for the last mmap() argument.

5 years agoMFC r344502: sh: Add set -o pipefail
Jilles Tjoelker [Sun, 24 Mar 2019 22:10:26 +0000 (22:10 +0000)]
MFC r344502: sh: Add set -o pipefail

The pipefail option allows checking the exit status of all commands in a
pipeline more easily, at a limited cost of complexity in sh itself. It works
similarly to the option in bash, ksh93 and mksh.

Like ksh93 and unlike bash and mksh, the state of the option is saved when a
pipeline is started. Therefore, even in the case of commands like
  A | B &
a later change of the option does not affect the exit status, the same way
  (A | B) &
works.

Since SIGPIPE is not handled specially, more work in the script is required
for a proper exit status for pipelines containing commands such as head that
may terminate successfully without reading all input. This can be something
like

(
cmd1
r=$?
if [ "$r" -gt 128 ] && [ "$(kill -l "$r")" = PIPE ]; then
exit 0
else
exit "$r"
fi
) | head

PR: 244270
Relnotes: yes

5 years agoMFC r345220:
Oleksandr Tymoshenko [Sat, 23 Mar 2019 23:44:40 +0000 (23:44 +0000)]
MFC r345220:

Fix build for KLD dyn_sysctl example

Looks like the example was broken by change of SYSCTL_STATIC_CHILDREN
definition in r267992. Fix build by switching to using SYSCTL_ADD_ROOT_NODE

PR: 236139
Submitted by: Andrew Reiter <arr@watson.org>

5 years agoMFC r343998:
Oleksandr Tymoshenko [Sat, 23 Mar 2019 23:43:33 +0000 (23:43 +0000)]
MFC r343998:

Fix off-by-one error in BERI virtio driver

The hardcoded ident is exactly 20 bytes long but sprintf adds terminating zero,
so there is one byte written out of array bounds.As a fix use strncpy it
appends \0 only if space allows and its behavior matches virtio spec:

When VIRTIO_BLK_T_GET_ID is issued, the device identifier, up to 20 bytes, is
written to the buffer. The identifier should be interpreted as an ascii string.
It is terminated with \0, unless it is exactly 20 bytes long.

PR: 202298
Reviewed by: br
Differential Revision: https://reviews.freebsd.org/D18852

5 years agoMFC r343298:
Oleksandr Tymoshenko [Sat, 23 Mar 2019 22:44:11 +0000 (22:44 +0000)]
MFC r343298:

[ndis] Fix unregistered use of FPU by NDIS in kernel on amd64

amd64 miniport drivers are allowed to use FPU which triggers "Unregistered use
of FPU in kernel" panic.

Wrap all variants of MSCALL with fpu_kern_enter/fpu_kern_leave.  To reduce
amount of allocations/deallocations done via
fpu_kern_alloc_ctx/fpu_kern_free_ctx maintain cache of fpu_kern_ctx elements.

Based on the patch by Paul B Mahol

PR: 165622
Submitted by: Vlad Movchan <vladislav.movchan@gmail.com>

5 years agoMFC r345170:
Chuck Tuffli [Sat, 23 Mar 2019 16:46:33 +0000 (16:46 +0000)]
MFC r345170:
bhyve(8): Fix bhyve's NVMe Identify Namespace data

Approved by: imp (mentor)

5 years agoMFC r342761:
Chuck Tuffli [Sat, 23 Mar 2019 16:42:05 +0000 (16:42 +0000)]
MFC r342761:
bhyve(8): Fix bhyve's NVMe queue bookkeeping

Approved by: imp (mentor)

5 years agoMFC r342762:
Chuck Tuffli [Sat, 23 Mar 2019 16:30:50 +0000 (16:30 +0000)]
MFC r342762:
bhyve(8): Fix bhyve's NVMe Completion Queue entry values

Approved by: imp (mentor)

5 years agoMFC r345229:
Konstantin Belousov [Sat, 23 Mar 2019 11:51:12 +0000 (11:51 +0000)]
MFC r345229:
proccontrol(1): Add kpti control mode.

5 years agoMFC r345228:
Konstantin Belousov [Sat, 23 Mar 2019 11:47:13 +0000 (11:47 +0000)]
MFC r345228:
amd64 KPTI: add control from procctl(2).

5 years agoMFC r345227:
Konstantin Belousov [Sat, 23 Mar 2019 11:43:41 +0000 (11:43 +0000)]
MFC r345227:
amd64: Add md process flags and first P_MD_PTI flag.

5 years agoMFC r345226:
Konstantin Belousov [Sat, 23 Mar 2019 10:38:28 +0000 (10:38 +0000)]
MFC r345226:
amd64: fix switching to the pmap with pti disabled.

5 years agoMFC r345225:
Konstantin Belousov [Sat, 23 Mar 2019 10:37:26 +0000 (10:37 +0000)]
MFC r345225:
amd64: rewrite cpu_switch.S fragment to reload tss.rsp0 on context switch.

5 years agoMFC r345223:
Kristof Provost [Sat, 23 Mar 2019 07:07:44 +0000 (07:07 +0000)]
MFC r345223:

pf: Rename pfsync bucket lock

Previously the main pfsync lock and the bucket locks shared the same name.
This lead to spurious warnings from WITNESS like this:

    acquiring duplicate lock of same type: "pfsync"
     1st pfsync @ /usr/src/sys/netpfil/pf/if_pfsync.c:1402
     2nd pfsync @ /usr/src/sys/netpfil/pf/if_pfsync.c:1429

It's perfectly okay to grab both the main pfsync lock and a bucket lock at the
same time.

We don't need different names for each bucket lock, because we should always
only acquire a single one of those at a time.

5 years agoMFC 344826:
Marcel Moolenaar [Fri, 22 Mar 2019 23:55:35 +0000 (23:55 +0000)]
MFC 344826:

Round # partitions up to fill the last GPT table sector

Set the number of partitions entries in the GPT header to a
multiple of the number of entries that fit in a sector.

PR: 236238
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D19465

5 years agoMFC 344790:
Marcel Moolenaar [Fri, 22 Mar 2019 23:39:16 +0000 (23:39 +0000)]
MFC 344790:

Revert revision 254095

In revision 254095, gpt_entries is not set to match the on-disk
hdr_entries, but rather is computed based on available space.
There are 2 problems with this:

1.  The GPT backend respects hdr_entries and only reads and writes
    that number of partition entries.  On top of that, CRC32 is
    computed over the table that has hdr_entries elements.  When
    the common code works on what is possibly a larger number, the
    behaviour becomes inconsistent and problematic.  In particular,
    it would be possible to add a new partition that on a reboot
    isn't there anymore.
2.  The calculation of gpt_entries is based on flawed assumptions.
    The GPT specification does not dictate that sectors are layed
    out in a particular way that the available space can be
    determined by looking at LBAs.  In practice, implementations
    do the same thing, because there's no reason to do it any
    other way.  Still, GPT allows certain freedoms that can be
    exploited in some form or shape if the need arises.

PR: 229977
Differential Revision: https://reviews.freebsd.org/D19438

5 years agoMFC r345190:
Konstantin Belousov [Fri, 22 Mar 2019 14:35:15 +0000 (14:35 +0000)]
MFC r345190:
Provide deterministic (and somewhat useful) value for RDPID result,
and for %ecx after RDTSCP.

5 years agoMFC r345080:
Benedict Reuschling [Fri, 22 Mar 2019 06:02:06 +0000 (06:02 +0000)]
MFC r345080:

Extend descriptions and comments about the need to create /etc/pf.conf.

FreeBSD removed the default /etc/pf.conf file in previous releases, but
the documentation kept mentioning it like any other file present in the
system.  Change pf.conf(5) to mention in the description of the
default ruleset location that this file needs to be created manually. Also,
the default rc.conf file had it's comment extended a bit to let people
know that this file does not exist by default.

PR:     231977
Submitted by:     koobs@
Reviewed by:     kp@, 0mp@
Approved by:     kp@
Differential Revision:    https://reviews.freebsd.org/D19530

5 years agoMFC r345366:
Kristof Provost [Thu, 21 Mar 2019 14:17:10 +0000 (14:17 +0000)]
MFC r345366:

pf: Ensure that IP addresses match in ICMP error packets

States in pf(4) let ICMP and ICMP6 packets pass if they have a
packet in their payload that matches an exiting connection.  It was
not checked whether the outer ICMP packet has the same destination
IP as the source IP of the inner protocol packet.  Enforce that
these addresses match, to prevent ICMP packets that do not make
sense.

Reported by: Nicolas Collignon, Corentin Bayet, Eloi Vanderbeken, Luca Moro at Synacktiv
Obtained from: OpenBSD
Security: CVE-2019-5598

5 years agoMFC r345130,r345184: trim(8): add another safety net and more user-friendly
Eugene Grosbein [Thu, 21 Mar 2019 11:23:15 +0000 (11:23 +0000)]
MFC r345130,r345184: trim(8): add another safety net and more user-friendly
error message in verbose mode.

5 years agoMFC r345159:
Emmanuel Vadot [Thu, 21 Mar 2019 01:16:37 +0000 (01:16 +0000)]
MFC r345159:

pkgbase: Use uname as ABI_FILE

uname is always rebuild on FreeBSD so use this as ABI_FILE for pkg when
building pkg for pkgbase.
pkg uses uname too as default ABI_FILE as of commit d8bbf980b7f6f424fb7cc672c23ab2dfc82b6599
https://github.com/freebsd/pkg/commit/d8bbf980b7f6f424fb7cc672c23ab2dfc82b6599

Discussed with: bapt

5 years agoMFC r344559:
Alan Somers [Thu, 21 Mar 2019 00:17:43 +0000 (00:17 +0000)]
MFC r344559:

ifconfig: eliminate trailing whitespace

Eliminate trailing whitespace on inet, inet6, and groups lines. I think the
"list txpower" command will still show some, but I'm not able to test that.

PR: 153731
Reported-by: Nikolay Denev <ndenev@gmail.com>
Differential Revision: https://reviews.freebsd.org/D19004

5 years agoMFC r342747 - zfsboot: support newer ZFS versions
Matt Macy [Wed, 20 Mar 2019 15:37:40 +0000 (15:37 +0000)]
MFC r342747 - zfsboot: support newer ZFS versions

Sponsored by: iX Systems

5 years agoMFC r342793 - selectively disable ZFS without disabling loader
Matt Macy [Wed, 20 Mar 2019 15:34:40 +0000 (15:34 +0000)]
MFC r342793 - selectively disable ZFS without disabling loader

Sponsored by: iX Systems

5 years agoMFC r345246:
Konstantin Belousov [Wed, 20 Mar 2019 13:10:47 +0000 (13:10 +0000)]
MFC r345246:
i386: improve detection of the fast page fault assist.

5 years agoMFC r34505: freebsd-update: restore old exit code when no updates are available
Pietro Cerutti [Wed, 20 Mar 2019 10:09:38 +0000 (10:09 +0000)]
MFC r34505: freebsd-update: restore old exit code when no updates are available
locally

This unbreaks ezjail and iocell, which get into an endless loop trying to
figure out how many times "freebsd-update install" needs to be called.

PR: 229346
Submitted by: Mike Cole <mcole36 at gmail.com>
Approved by: bapt

5 years agoMFC r345087: Use consistent struct stat arg name in stat man page
Ed Maste [Wed, 20 Mar 2019 03:47:12 +0000 (03:47 +0000)]
MFC r345087: Use consistent struct stat arg name in stat man page

stat, lstat, and fstat use `*sb` as the stat struct pointer arg name,
while fstatat previously used `*buf`.

5 years agoMFC r345079:
Cy Schubert [Tue, 19 Mar 2019 19:52:32 +0000 (19:52 +0000)]
MFC r345079:

Fix still installing ipfilter rc.d files even when WITHOUT_IPFILTER
is specified.

When WITHOUT_IPFILTER is specified, delete-old-files fails to delete
the optional rc.d files from above. Fix this.

WITHOUT_IPFILTER fails to delete the ipfilter.5 optional file during
delete-old-files. Fix this.

Reported by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

5 years agoMFC r344479 (by sobomax), r344605:
Konstantin Belousov [Tue, 19 Mar 2019 17:16:37 +0000 (17:16 +0000)]
MFC r344479 (by sobomax), r344605:
Modularize xz.

5 years agoMFC r345078:
Konstantin Belousov [Tue, 19 Mar 2019 17:00:03 +0000 (17:00 +0000)]
MFC r345078:
hwpmc/core: Adopt to upcoming Skylake TSX errata.

5 years agoMFC r344797:
Kristof Provost [Tue, 19 Mar 2019 00:29:18 +0000 (00:29 +0000)]
MFC r344797:

tun tests: Test renaming and destroying a tun interface in a vnet jail

There was a problem destroying renamed tun interfaces in vnet jails. This was
fixed in r344794. Test the previously failing scenario.

PR: 235704

5 years agoMFC r344794:
Kristof Provost [Tue, 19 Mar 2019 00:27:45 +0000 (00:27 +0000)]
MFC r344794:

tun: VIMAGE fix for if_tun cloner

The if_tun cloner is not virtualised, but if_clone_attach() does use a
virtualised list of cloners.
The result is that we can't find the if_tun cloner when we try to remove
a renamed tun interface. Virtualise the cloner, and move the final
cleanup into a sysuninit so that we're sure this happens after all of
the vnet_sysuninits

Note that we need unit numbers to be system-unique (rather than unique
per vnet, as is done by if_clone_simple()). The unit number is used to
create the corresponding /dev/tunX device node, and this node must match
with the interface.
Switch to if_clone_advanced() so that we have control over the unit
numbers.

Reproduction scenario:
jail -c -n foo persist vnet
jexec test ifconfig tun create
jexec test ifconfig tun0 name wg0
jexec test ifconfig wg0 destroy

PR: 235704
Reviewed by: bz, hrs, hselasky
Differential Revision: https://reviews.freebsd.org/D19248

5 years agoMFC: r344757:
Fedor Uporov [Mon, 18 Mar 2019 12:34:13 +0000 (12:34 +0000)]
MFC: r344757:
Fix double free in case of mount error.

Reported by:    Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE
Reported as:    FS-9-EXT3-2: Denial Of Service in nmount-5 (vm_fault_hold)
Reviewed by:    pfg

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

5 years agoMFC: r344752:
Fedor Uporov [Mon, 18 Mar 2019 12:31:07 +0000 (12:31 +0000)]
MFC: r344752:
Add additional on-disk inode checks.

Reviewed by:    pfg

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

5 years agoMFC: r344754:
Fedor Uporov [Mon, 18 Mar 2019 12:26:25 +0000 (12:26 +0000)]
MFC: r344754:
Do not panic if inode bitmap is corrupted.

admbug:         804
Reported by:    Ilja Van Sprundel
Reviewed by:    pfg

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

5 years agoMFC: r344756, r345179:
Fedor Uporov [Mon, 18 Mar 2019 12:22:04 +0000 (12:22 +0000)]
MFC: r344756, r345179:
Do not read the on-disk inode in case of vnode allocation.

Reported by:    Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE
Reported as:    FS-6-EXT2-4: Denial Of Service in mkdir-0 (ext2_mkdir/vn_rdwr)
Reviewed by:    pfg

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

5 years agoMFC: r344755:
Fedor Uporov [Mon, 18 Mar 2019 12:15:58 +0000 (12:15 +0000)]
MFC: r344755:
Fix integer overflow possibility.

Reported by:    Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE
Reported as:    FS-2-EXT2-1: Out-of-Bounds Write in nmount (ext2_vget)
Reviewed by:    pfg

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

5 years agoMFC: r344753:
Fedor Uporov [Mon, 18 Mar 2019 12:09:10 +0000 (12:09 +0000)]
MFC: r344753:
Validate block bitmaps.

Reviewed by:    pfg

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

5 years agoMFC r344751:
Fedor Uporov [Mon, 18 Mar 2019 12:04:43 +0000 (12:04 +0000)]
MFC r344751:
Make superblock reading logic more strict.

Add more on-disk superblock consistency checks to ext2_compute_sb_data() function.
It should decrease the probability of mounting filesystems with corrupted superblock data.

Reviewed by:    pfg

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

5 years agoMFC r345189:
Konstantin Belousov [Mon, 18 Mar 2019 10:25:36 +0000 (10:25 +0000)]
MFC r345189:
Add symbolic name for TSC_AUX MSR address.

5 years agoMFC r345004 (with modification):
Andrey V. Elsukov [Mon, 18 Mar 2019 09:28:53 +0000 (09:28 +0000)]
MFC r345004 (with modification):
  Add IP_FW_NAT64 to codes that ipfw_chk() can return.

  It will be used by upcoming NAT64 changes. We use separate code
  to avoid propagating EACCES error code to user level applications
  when NAT64 consumes a packet.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC

5 years agoMFC r345003:
Andrey V. Elsukov [Mon, 18 Mar 2019 09:21:30 +0000 (09:21 +0000)]
MFC r345003:
  Add NULL pointer check to nat64_output().

  It is possible that a processed packet was originated by local host,
  in this case m->m_pkthdr.rcvif is NULL. Check and set it to V_loif to
  avoid NULL pointer dereference in IP input code, since it is expected
  that packet has valid receiving interface when netisr processes it.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC

5 years agoMFC r344745:
Andriy Voskoboinyk [Mon, 18 Mar 2019 02:56:51 +0000 (02:56 +0000)]
MFC r344745:
rtwn_usb(4): fix Tx instability with RTL8192CU chipsets

PR: 233949

5 years agoMFC r344599:
Mark Johnston [Sun, 17 Mar 2019 20:43:31 +0000 (20:43 +0000)]
MFC r344599:
Fix fasttrap_sig{trap,segv}().

5 years agoMFC r344588:
Mark Johnston [Sun, 17 Mar 2019 20:43:01 +0000 (20:43 +0000)]
MFC r344588:
Remove illumos-specific code from the x86 fasttrap_isa.c.

5 years agoMFC r344670:
Mark Johnston [Sun, 17 Mar 2019 20:41:06 +0000 (20:41 +0000)]
MFC r344670:
Allow FIONBIO and FIOASYNC ioctls on POSIX shm descriptors.

5 years agoMFC r344450, r344452, r344453:
Mark Johnston [Sun, 17 Mar 2019 20:30:27 +0000 (20:30 +0000)]
MFC r344450, r344452, r344453:
Fix a tracepoint lookup race in fasttrap_pid_probe().

5 years agoMFC r345141:
Konstantin Belousov [Sun, 17 Mar 2019 13:02:24 +0000 (13:02 +0000)]
MFC r345141:
mips: remove dead comment and definitions.

5 years agoMFC r344562:
Jason A. Harmening [Sun, 17 Mar 2019 06:05:19 +0000 (06:05 +0000)]
MFC r344562:

FFS: allow sendfile(2) to work with block sizes greater than the page size

Implement ffs_getpages_async(), which when possible calls the asynchronous
flavor of the generic pager's getpages function. When the underlying
block size is larger than the system page size, however, it will invoke
the (synchronous) buffer cache pager, followed by a call to the client
completion routine. This retains true asynchronous completion in the most
common (block size <= page size) case, which is important for the performance
of the new sendfile(2). The behavior in the larger block size case mirrors
the default implementation of VOP_GETPAGES_ASYNC, which most other
filesystems use anyway as they do not override the getpages_async method.

PR: 235708

5 years agoMFC r345089:
Konstantin Belousov [Sat, 16 Mar 2019 10:51:11 +0000 (10:51 +0000)]
MFC r345089:
Some fixes for proccontrol(1) man page.

5 years agoMFC r345075:
Konstantin Belousov [Fri, 15 Mar 2019 14:19:45 +0000 (14:19 +0000)]
MFC r345075:
Add register number, CPUID bits, and print identification for TSX
force abort errata.

5 years agoMFC r345074:
Konstantin Belousov [Fri, 15 Mar 2019 14:18:19 +0000 (14:18 +0000)]
MFC r345074:
Remove useless version check.

5 years agoMFC r341689, r341711, r341712, r341809:
Konstantin Belousov [Fri, 15 Mar 2019 14:16:16 +0000 (14:16 +0000)]
MFC r341689, r341711, r341712, r341809:
Add getfhat(2), fhlink(2), fhlinkat(2), fhreadlink(2) file handle system calls.

To easier potential MFC of the AT_BENEATH feature, some vestiges of it were
left in the merged product but commented out.

Due to a lot of conflicts, it was impossible to split the merge and
regeneration of the syscall tables, because I needed to test the result.
It is fine for stable branch to commit the whole change with the
generated diff.

5 years agoMFC r344921:
Kristof Provost [Fri, 15 Mar 2019 11:01:49 +0000 (11:01 +0000)]
MFC r344921:

pf: Fix DIOCGETSRCNODES

r343295 broke DIOCGETSRCNODES by failing to reset 'nr' after counting the
number of source tracking nodes.
This meant that we never copied the information to userspace, leading to '? ->
?' output from pfctl.

PR: 236368

5 years agoMFC r344748:
Andriy Voskoboinyk [Fri, 15 Mar 2019 08:18:02 +0000 (08:18 +0000)]
MFC r344748:
Allow to build ifconfig(8) without wireless support

The change removes SIOC[GS]IEEE80211 handling from ifconfig(8)
if WITHOUT_WIRELESS_SUPPORT=yes is set in src.conf(5).

Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D19289

5 years agoMFC r345002:
Andriy Voskoboinyk [Fri, 15 Mar 2019 07:34:06 +0000 (07:34 +0000)]
MFC r345002:
iwm(4): use correct channel list source for Intel 3168

Intel 3168 uses another EEPROM section to store channel flags;
port missing bits from iwlwifi to make it work.

PR: 230750, 236235
Tested by: Bert JW Regeer <xistence@0x58.com>

5 years agobump version to reflect MFC of CCM for the benefit of the ZoF port
Matt Macy [Fri, 15 Mar 2019 01:26:10 +0000 (01:26 +0000)]
bump version to reflect MFC of CCM for the benefit of the ZoF port

Sponsored by: iX Systems

5 years agoRevert zfsimpl.c accidentally committed in r345128
Steven Hartland [Thu, 14 Mar 2019 10:06:46 +0000 (10:06 +0000)]
Revert zfsimpl.c accidentally committed in r345128

Revert an unrelated change to zfsimpl.c accidentally committed in r345128.

Sponsored by: Multiplay

5 years agoMFC r344701: Fix incorrect / unused sector_count for identify requests
Steven Hartland [Thu, 14 Mar 2019 10:03:04 +0000 (10:03 +0000)]
MFC r344701: Fix incorrect / unused sector_count for identify requests

Fix unused sector_count for identify requests from camcontrol by changing
to zero which is a more appropriate value when the parameter is unused.

Sponsored by: Multiplay

5 years agoMFC r344873:
Andrey V. Elsukov [Thu, 14 Mar 2019 08:25:28 +0000 (08:25 +0000)]
MFC r344873:
  Fix typo.

5 years agoMFC r344140,r344141,r344142,r344143,r344388,r344547
Sean Eric Fagan [Thu, 14 Mar 2019 02:46:03 +0000 (02:46 +0000)]
MFC r344140,r344141,r344142,r344143,r344388,r344547

r344140:
Add CBC-MAC authentication.

r344141:
Add AES-CCM encryption, and plumb into OCF.

r344142:
Pasting in a source control line missed the last quote.  Fixed.

r344143:
Fix another issue from r344141, having to do with size of a shift amount.
This did not show up in my testing.

r344388:
It turns out that setting the IV length is necessary with CCM in OpenSSL.
This adds that back.

r344547:
Fix another bug introduced during the review process of r344140:
the tag wasn't being computed properly due to chaning a >= comparison
to an == comparison.

5 years agoMFC r344903: Improve entropy for ZFS taskqueue selection.
Alexander Motin [Thu, 14 Mar 2019 00:58:39 +0000 (00:58 +0000)]
MFC r344903: Improve entropy for ZFS taskqueue selection.

I just found that at least on Skylake CPUs cpu_ticks() never returns odd
values, only even, and possibly has even bigger step (176/2?), that makes
its lower bits very bad entropy source, leaving half of taskqueues unused.
Switch to sbinuptime(), closer to upstreams, mitigates the problem by the
rate conversion working as kind of hash function.  In case that is somehow
not enough (timer rate is too low or too divisible) mix in curcpu.

5 years agoMFC r344866: Add respective tunables to few ZFS sysctls.
Alexander Motin [Thu, 14 Mar 2019 00:57:35 +0000 (00:57 +0000)]
MFC r344866: Add respective tunables to few ZFS sysctls.

5 years agoMFC r342880,r343981,r344902: sh: Fix $((-9223372036854775808))
Jilles Tjoelker [Wed, 13 Mar 2019 21:53:10 +0000 (21:53 +0000)]
MFC r342880,r343981,r344902: sh: Fix $((-9223372036854775808))

Since $((9223372036854775808)) overflows, $((-9223372036854775808)) was not
parsed correctly (with x=-9223372036854775808, $((x)) already worked, since
that parses the value with the minus sign in one step). Values further from
zero are still clamped to 9223372036854775807.

Also, allow the full 64 bits in octal and hexadecimal.

5 years agoMFC r344844: Flush stdout after each iteration.
Alexander Motin [Wed, 13 Mar 2019 20:28:48 +0000 (20:28 +0000)]
MFC r344844: Flush stdout after each iteration.

Without this, if output is redirected from the console, it is buffered for
too long, making tool quite unusable.

5 years agoMFC r344636: Refactor command ordering/blocking mechanism in CTL.
Alexander Motin [Wed, 13 Mar 2019 20:27:48 +0000 (20:27 +0000)]
MFC r344636: Refactor command ordering/blocking mechanism in CTL.

Replace long per-LUN queue of blocked commands, scanned on each command
completion and sometimes even twice, causing up to O(n^^2) processing cost,
by much shorter per-command blocked queues, scanned only when respective
command completes, and check only commands before the previous blocker,
reducing cost to O(n).

While there, unblock aborted commands to make them "complete" ASAP to be
removed from the OOA queue and so not waste time ordering other commands
against them.  Aborted commands that were not sent to execution yet should
have no visible side effects, so this is safe and easy optimization now,
comparing to commands already in processing, which are a still pain.

Together those two optimizations should fix quite pathological case, when
due to backend slowness CTL accumulated many thousands of blocked requests,
partially aborted by initiator and so supposedly not even existing, but
still wasting CTL CPU time.

5 years agoMFC r344586: Scrap some debug printf's, unused for years.
Alexander Motin [Wed, 13 Mar 2019 20:26:27 +0000 (20:26 +0000)]
MFC r344586: Scrap some debug printf's, unused for years.

5 years agopf tests: Disable noalias test
Kristof Provost [Tue, 12 Mar 2019 19:03:47 +0000 (19:03 +0000)]
pf tests: Disable noalias test

Direct commit to stable/12 to disable the noalias test. The noalias feature has
not been merged to stable/12 as it is a (small) behaviour change. This means
this test will fail. Disable it.

5 years agoMFC r344818: freebsd-update.8: update example to contemporary versions
Ed Maste [Tue, 12 Mar 2019 17:03:58 +0000 (17:03 +0000)]
MFC r344818: freebsd-update.8: update example to contemporary versions

PR: 235761
Reported by: linimon

5 years agoMFC r343964, r344121, r344128, r344593, r344594:
Konstantin Belousov [Tue, 12 Mar 2019 16:33:44 +0000 (16:33 +0000)]
MFC r343964, r344121, r344128, r344593, r344594:
ASLR.

5 years agoMFC r342952:
Enji Cooper [Mon, 11 Mar 2019 18:17:26 +0000 (18:17 +0000)]
MFC r342952:

Add Linux compatibility support for `SC_NPROCESSORS_{CONF,ONLN}` as `_SC_NPROCESSORS_{CONF,ONLN}`

The goal of this change is to make it easier to use getconf to query
the number of available processors.

Sadly it's unclear per POSIX, which form (with a preceding _ or
lacking it) is correct. I will bring this up on the Austin Group list so
this point is clarified for implementors that might rely on this getconf
variable in future POSIX spec versions.

This is something I noticed when trying to import GoogleTest to FreeBSD
as one of the CI scripts uses this variable on Linux.

Approved by:    emaste (mentor; implicit: https://reviews.freebsd.org/D19527)
Differential Revision: https://reviews.freebsd.org/D19528

5 years agoMFC r344743: Reduce CTL threads priority to about PUSER.
Alexander Motin [Mon, 11 Mar 2019 13:55:47 +0000 (13:55 +0000)]
MFC r344743: Reduce CTL threads priority to about PUSER.

Since in most configurations CTL serves as network service, we found
that this change improves local system interactivity under heavy load.
Priority of main threads is set slightly higher then worker taskqueues
to make them quickly sort incoming requests not creating bottlenecks,
while plenty of worker taskqueues should be less sensitive to latency.

5 years agoMFC r344709:
Guangyuan Yang [Mon, 11 Mar 2019 07:18:40 +0000 (07:18 +0000)]
MFC r344709:

Fix typos and caps for ipfw(8) man page.

PR: 236030
Submitted by: olgeni