]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoDisable kernels_autodetect on installation media
kevans [Thu, 11 Oct 2018 17:18:49 +0000 (17:18 +0000)]
Disable kernels_autodetect on installation media

This feature is disabled on install media as these generally won't have any
interesting kernels to be listed other than the default kernel, so the
potential performance penalty in these situations likely isn't worth it.

Approved by: re (kib)

5 years agoEnable lualoader's kernel autodetection, disabled on install media
kevans [Thu, 11 Oct 2018 17:17:54 +0000 (17:17 +0000)]
Enable lualoader's kernel autodetection, disabled on install media

As documented in loader.conf(5), kernels_autodetect="YES" will cause the
Lua scripts to effectively scan /boot for directories with a "kernel" file
inside, to be listed in the loader menu.

Approved by: re (kib)

5 years agolualoader: Provide a 'menu' command to redraw the menu at the loader prompt
kevans [Thu, 11 Oct 2018 17:16:39 +0000 (17:16 +0000)]
lualoader: Provide a 'menu' command to redraw the menu at the loader prompt

Reported by: allanjude
Approved by: re (kib)

5 years agolibusb(3): Update the link to the libusb homepage.
0mp [Thu, 11 Oct 2018 13:58:51 +0000 (13:58 +0000)]
libusb(3): Update the link to the libusb homepage.

While here, pet mandoc & igor.

Reviewed by: bcr, hselasky
Approved by: re (kib), krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D17516

5 years agolld: set sh_link and sh_info for .rela.plt sections
emaste [Thu, 11 Oct 2018 13:19:17 +0000 (13:19 +0000)]
lld: set sh_link and sh_info for .rela.plt sections

ELF spec says that for SHT_REL and SHT_RELA sh_link should reference the
associated string table and sh_info should reference the "section to
which the relocation applies."  ELF Tool Chain's elfcopy / strip use
this (in part) to control whether or not the relocation entry is copied
to the output.

LLVM PR 37538 https://bugs.llvm.org/show_bug.cgi?id=37538

Approved by: re (kib)
Obtained from: llvm r344226 (backported for 6.0)

5 years agoRegenerate: remove GOST, enable DANE-TA now that we have OpenSSL 1.1.1.
des [Thu, 11 Oct 2018 08:14:31 +0000 (08:14 +0000)]
Regenerate: remove GOST, enable DANE-TA now that we have OpenSSL 1.1.1.

Approved by: re (gjb)

5 years agoLoader GELI support, like lua loader, seems to be broken on PowerPC as
nwhitehorn [Thu, 11 Oct 2018 00:54:39 +0000 (00:54 +0000)]
Loader GELI support, like lua loader, seems to be broken on PowerPC as
well as on SPARC64 and can cause boot failures even when no encrypted
disks are present. Presumably, the reasons, while unknown, are the same
and most-likely are the result of some endian-unsafe code. Pending
finding the actual problem, extend the blacklist entry for these parts
of loader on SPARC to also cover all PowerPC platforms.

Approved by: re (kib)

5 years agoPull in a follow-on commit to resolve a deadlock in ZFS sequential
allanjude [Wed, 10 Oct 2018 22:59:15 +0000 (22:59 +0000)]
Pull in a follow-on commit to resolve a deadlock in ZFS sequential
resilver (r334844)

MFV/ZoL: Fix deadlock in IO pipeline

commit a76f3d0437e5e974f0f748f8735af3539443b388
Author: Brian Behlendorf <behlendorf1@llnl.gov>
Date:   Fri Mar 16 16:46:06 2018 -0700

    Fix deadlock in IO pipeline

    In vdev_queue_aggregate() the zio_execute() bypass should not be
    called under the vdev queue lock.  This can result in a deadlock
    as shown in the stack traces below.

    Drop the vdev queue lock then walk the parents of the aggregate IO
    to determine the list of component IOs to be bypassed.  This can
    be done safely without holding the io_lock since the new aggregate
    IO has not yet been returned and its parents cannot change.

    ---  THREAD 1 ---
    arc_read()
      zio_nowait()
        zio_vdev_io_start()
          vdev_queue_io() <--- mutex_enter(vq->vq_lock)
            vdev_queue_io_to_issue()
              vdev_queue_aggregate()
                zio_execute()
            vdev_queue_io_to_issue()
              vdev_queue_aggregate()
                zio_execute()
                  zio_vdev_io_assess()
                    zio_wait_for_children() <- mutex_enter(zio->io_lock)

    --- THREAD 2 --- (inverse order)
    arc_read()
      zio_change_priority() <- mutex_enter(zio->zio_lock)
        vdev_queue_change_io_priority() <- mutex_enter(vq->vq_lock)

Reviewed-by: Tom Caputi <tcaputi@datto.com>
Reviewed-by: Don Brady <don.brady@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reported by: ZFS Leadership Meeting
Reviewed by: mav
Approved by: re (kib)
Obtained from: ZFS-on-Linux
MFC after: 2 weeks
Sponsored by: Klara Systems
Differential Revision: https://reviews.freebsd.org/D17495

5 years agoAdd missing sysctls for tuning vdev queue depths for new I/O types
allanjude [Wed, 10 Oct 2018 22:55:31 +0000 (22:55 +0000)]
Add missing sysctls for tuning vdev queue depths for new I/O types

This connects new tunables that were added but not exposed in:
r329502 (zpool remove)
r337007 (zpool initialize)

Reviewed by: avg
Approved by: re (kib)
MFC after: 2 weeks
Sponsored by: Klara Systems
Differential Revision: https://reviews.freebsd.org/D17494

5 years agoTry harder to sanitize the environment before running configure.
des [Wed, 10 Oct 2018 22:29:06 +0000 (22:29 +0000)]
Try harder to sanitize the environment before running configure.
Remove a workaround for older Unbound versions that used sbrk.

Approved by: re (gjb)

5 years agoFix a minor typo in loader.conf(5).
gjb [Wed, 10 Oct 2018 20:25:41 +0000 (20:25 +0000)]
Fix a minor typo in loader.conf(5).

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

5 years agoAdd graphics/drm-legacy-kmod and graphics/drm-stable-kmod to the
gjb [Wed, 10 Oct 2018 19:57:10 +0000 (19:57 +0000)]
Add graphics/drm-legacy-kmod and graphics/drm-stable-kmod to the
list of packages to include on the dvd installer.

Approved by: re (marius, rgrimes)
Sponsored by: The FreeBSD Foundation

5 years agoResolve a hang in ZFS during vnode reclaimation
allanjude [Wed, 10 Oct 2018 19:39:47 +0000 (19:39 +0000)]
Resolve a hang in ZFS during vnode reclaimation

This is caused by a deadlock between zil_commit() and zfs_zget()

Add a way for zfs_zget() to break out of the retry loop in the common case

PR: 229614
Reported by: grembo, Andreas Sommer, many others
Tested by: Andreas Sommer, Vicki Pfau
Reviewed by: avg (no objection)
Approved by: re (gjb)
MFC after: 2 months
Sponsored by: Klara Systems
Differential Revision: https://reviews.freebsd.org/D17460

5 years agoRemove extra thread_exit() call left after r329802.
mav [Wed, 10 Oct 2018 16:34:53 +0000 (16:34 +0000)]
Remove extra thread_exit() call left after r329802.

spa_condense_indirect_thread() is no longer a thread function, but just
a callback for new zthr KPI.

Submitted by: allanjude
Approved by: re (gjb)
MFC after: 3 days

5 years agoUpdate Armada 38x UART device tree binding
mw [Wed, 10 Oct 2018 10:34:17 +0000 (10:34 +0000)]
Update Armada 38x UART device tree binding

Recent changes in Linux updated Marvell Armada 38x
UART compatible string. As a result the FreeBSD driver
(uart_dev_snps) does not probe. This commit fixes the
situation, however not applying any functional modification
to the driver methods.

Approved by: re (kib)
Obtained from: Semihalf

5 years agoUpgrade to 1.8.1.
des [Wed, 10 Oct 2018 08:53:47 +0000 (08:53 +0000)]
Upgrade to 1.8.1.

Approved by: re (kib)

5 years agoImproved substitution logic for Unbound man pages.
des [Wed, 10 Oct 2018 08:20:14 +0000 (08:20 +0000)]
Improved substitution logic for Unbound man pages.

Approved by: re (kib)

5 years agoUpdate Makefile for 1.8.0, apologies for the breakage.
des [Wed, 10 Oct 2018 08:19:11 +0000 (08:19 +0000)]
Update Makefile for 1.8.0, apologies for the breakage.

Approved by: re (kib)

5 years agoUpgrade Unbound to 1.8.0. More to follow.
des [Wed, 10 Oct 2018 07:55:06 +0000 (07:55 +0000)]
Upgrade Unbound to 1.8.0.  More to follow.

Approved by: re (kib)

5 years agoAdd myself to committers-src.dot and calendar.freebsd.
yuripv [Wed, 10 Oct 2018 00:20:40 +0000 (00:20 +0000)]
Add myself to committers-src.dot and calendar.freebsd.

Approved by: re (gjb), kib (mentor)

5 years agoDon't include the broken riscv64sf TARGET_ARCH in universe.
brooks [Tue, 9 Oct 2018 22:22:15 +0000 (22:22 +0000)]
Don't include the broken riscv64sf TARGET_ARCH in universe.

riscv64sf has been broken due to duplicate symbols for months and
degrades the quality of universe builds.  Remove it until this is
resolved leaving a comment to it is not re-added.

PR: 232085
Reviewed by: emaste
Approved by: re (gjb, kib)
Sponsored by: DARPA, AFRL

5 years agoUpdate head from ALPHA8 to ALPHA9 as part of the 12.0-RELEASE
gjb [Tue, 9 Oct 2018 21:54:58 +0000 (21:54 +0000)]
Update head from ALPHA8 to ALPHA9 as part of the 12.0-RELEASE
cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoMerge the remainder of the projects/openssl111 branch to head.
gjb [Tue, 9 Oct 2018 21:28:26 +0000 (21:28 +0000)]
Merge the remainder of the projects/openssl111 branch to head.

- Update OpenSSL to version 1.1.1.
- Update Kerberos/Heimdal API for OpenSSL 1.1.1 compatibility.
- Bump __FreeBSD_version.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

5 years agoRegenerated assorted syscall related files after:
brooks [Tue, 9 Oct 2018 20:42:17 +0000 (20:42 +0000)]
Regenerated assorted syscall related files after:
 - r327895: Implement 'domainset'...
 - r329876: Use linux types for linux-specific syscalls

Diff generated with:
find . -name syscalls.conf | xargs dirname | \
    xargs -n1 -I DIR make -C DIR sysent

Approved by: re (kib)
Sponsored by: DARPA, AFRL

5 years agoUse mbuf defines to construct csum offload masks rather than literals
shurd [Tue, 9 Oct 2018 20:16:19 +0000 (20:16 +0000)]
Use mbuf defines to construct csum offload masks rather than literals

Reviewed by: erj
Approved by: re (rgrimes)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D17442

5 years agoFix portability issues with the Capsicum patch committed in r339216:
des [Tue, 9 Oct 2018 19:27:42 +0000 (19:27 +0000)]
Fix portability issues with the Capsicum patch committed in r339216:

- Wrap access to pw_change and pw_expire in the appropriate #ifdefs.
- Wrap calls to login_cap(3) API in appropriate #ifdefs.
- Add wrapper for transferring time_t, which is still only 32 bits wide
  on FreeBSD i386.
- Use a temporary variable to deserialize size_t.

Approved by: re (gjb)

5 years agoUpdate ACPICA to 20181003.
jkim [Tue, 9 Oct 2018 18:40:36 +0000 (18:40 +0000)]
Update ACPICA to 20181003.

Approved by: re (gjb)

5 years agoSwitch ntp's embedded libevent to 2.1.18
emaste [Tue, 9 Oct 2018 18:35:45 +0000 (18:35 +0000)]
Switch ntp's embedded libevent to 2.1.18

For OpenSSL 1.1.1 compatibility.

In Makefile.inc1 add (to the existing similar cases) a hack to handle
dependencies across the migration.

Reviewed by: jhb
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation.
Differential Revision: https://reviews.freebsd.org/D17481

5 years agoUpdate sendmail to work with the OpenSSL 1.1 API.
jhb [Tue, 9 Oct 2018 17:44:25 +0000 (17:44 +0000)]
Update sendmail to work with the OpenSSL 1.1 API.

Submitted by: jkim
Approved by: re (gjb), gshapiro
Obtained from: ports/mail/sendmail/files/patch-tls.c

5 years agoRegenerate ssh_namespace.h for OpenSSL 1.1.1 update
emaste [Tue, 9 Oct 2018 17:29:31 +0000 (17:29 +0000)]
Regenerate ssh_namespace.h for OpenSSL 1.1.1 update

5 years agoUpdate Apache Serf to 1.3.9 to support OpenSSL 1.1.1.
jhb [Tue, 9 Oct 2018 15:28:06 +0000 (15:28 +0000)]
Update Apache Serf to 1.3.9 to support OpenSSL 1.1.1.

Approved by: re (rgrimes)

5 years agoMFH r338661 through r339253.
gjb [Tue, 9 Oct 2018 14:27:55 +0000 (14:27 +0000)]
MFH r338661 through r339253.

Sponsored by: The FreeBSD Foundation

5 years agolibevent: eliminate in-tree usage of arc4random_addrandom
emaste [Tue, 9 Oct 2018 14:27:40 +0000 (14:27 +0000)]
libevent: eliminate in-tree usage of arc4random_addrandom

Apply r338059 to newly-added libevent 2.1.18.

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

5 years agoCopy libevent sources to contrib
emaste [Tue, 9 Oct 2018 14:05:11 +0000 (14:05 +0000)]
Copy libevent sources to contrib

To replace the libevent embedded in ntp, for OpenSSL 1.1.1 compat.

Approved by: re (gjb)

5 years agoThere are three places where we return from a function which entered an
jtl [Tue, 9 Oct 2018 13:26:06 +0000 (13:26 +0000)]
There are three places where we return from a function which entered an
epoch section without exiting that epoch section. This is bad for two
reasons: the epoch section won't exit, and we will leave the epoch tracker
from the stack on the epoch list.

Fix the epoch leak by making sure we exit epoch sections before returning.

Reviewed by: ae, gallatin, mmacy
Approved by: re (gjb, kib)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D17450

5 years agofollowing "Setup, Conventions, and Traditions" (Committer's Guide);
egypcio [Tue, 9 Oct 2018 07:22:14 +0000 (07:22 +0000)]
following "Setup, Conventions, and Traditions" (Committer's Guide);

5. share/misc/committers-ports.dot
  * reflecting my privileges only for ports/, with mentors' entries;
  * did test it with dot (graphics/graphviz) to check accent support.
9. usr.bin/calendar/calendars/calendar.freebsd
  * added birth date + place.

'calendar.freebsd' offers UTF-8, so I added my entry using proper accents.

Reviewed by: rene (mentor)
Approved by: re (gjb), araujo (mentor), beat (mentor)
Differential Revision: https://reviews.freebsd.org/D17469

5 years agoopenssh: regenerate ssh-namespace.h after r339213 and r339216
emaste [Tue, 9 Oct 2018 03:11:59 +0000 (03:11 +0000)]
openssh: regenerate ssh-namespace.h after r339213 and r339216

Reported by: des
Approved by: re (rgrimes)

5 years agoFix the pNFS server's reporting of disk space usage for the "#<path>" case.
rmacklem [Tue, 9 Oct 2018 01:10:50 +0000 (01:10 +0000)]
Fix the pNFS server's reporting of disk space usage for the "#<path>" case.

The pNFS server would report the total disk space used and free for all
of the DSs, even when certain DSs are assigned to the file system via
the "#<path>" suffix used in the "nfsd -p" option argument.
This patch fixes this case. It only reports usage for the file system
that the argument vnode resides on. This is consistent with the non-pNFS
NFSv4 server. In NFSv4 it is possible to have subtrees on other file
systems, but these are not included in the usage information for NFSv4.

Approved by: re (gjb)

5 years agocrypto: Don't limit to TLSv1 only
jhb [Mon, 8 Oct 2018 23:23:09 +0000 (23:23 +0000)]
crypto: Don't limit to TLSv1 only

Approved by: re (rgrimes, gjb)
Obtained from: upstream commit e94f50bbbe7318eec5b6b165ff73d94bbc9d20b0

5 years agoFix the distribution path for -ALPHA builds, which are under
gjb [Mon, 8 Oct 2018 19:48:58 +0000 (19:48 +0000)]
Fix the distribution path for -ALPHA builds, which are under
the snapshots directory, not releases.

Reported by: David Marec david.marec _at_ davenulle _dot_ org
Approved by: re (rgrimes)
Sponsored by: The FreeBSD Foundation

5 years agoFix a mismerge from head to projects/openssl111.
gjb [Mon, 8 Oct 2018 19:39:05 +0000 (19:39 +0000)]
Fix a mismerge from head to projects/openssl111.

r339213 was cherry-picked back to head from the project branch, which
caused a conflict.  This commit properly records the mergeinfo from
head.

r339205 was missed, and r339214 is required for reintegration.

Sponsored by: The FreeBSD Foundation

5 years agoAdd support for relocations in RISC-V kernel modules to kldxref.
jhb [Mon, 8 Oct 2018 19:15:58 +0000 (19:15 +0000)]
Add support for relocations in RISC-V kernel modules to kldxref.

Reviewed by: br, markj
Approved by: re (gjb)
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D17415

5 years agoDisallow zero day of month from strptime("%d").
kib [Mon, 8 Oct 2018 18:45:40 +0000 (18:45 +0000)]
Disallow zero day of month from strptime("%d").

It is required by POSIX, specified in our man page, and followed by
Linux.

PR: 232072
Reported by: miguel_tete17@hotmail.com
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week

5 years agoMFH r339206-r339212, r339215-r339239
gjb [Mon, 8 Oct 2018 18:06:40 +0000 (18:06 +0000)]
MFH r339206-r339212, r339215-r339239

Sponsored by: The FreeBSD Foundation

5 years agoFix r336951 mismerge -- use of uninitialized variable.
mav [Mon, 8 Oct 2018 15:19:03 +0000 (15:19 +0000)]
Fix r336951 mismerge -- use of uninitialized variable.

Reported by: tsoome
Approved by: re (gjb)
MFC after: 3 days

5 years agoMFV r339226 (peter): Record merge of serf-1.3.9.
gjb [Mon, 8 Oct 2018 15:16:04 +0000 (15:16 +0000)]
MFV r339226 (peter): Record merge of serf-1.3.9.

Sponsored by: The FreeBSD Foundation

5 years agoAdd missing steering rules for virtual function, VF, in mlx4en(4) driver.
hselasky [Mon, 8 Oct 2018 14:52:21 +0000 (14:52 +0000)]
Add missing steering rules for virtual function, VF, in mlx4en(4) driver.

When acting as a VF it is required to add steering rules for all unicast
addresses. Even if promiscious mode is selected. Else incoming data packets
will be dropped.

MFC after: 3 days
Approved by: re (gjb)
Sponsored by: Mellanox Technologies

5 years agoVendor import serf-1.3.9 (now Apache serf)
peter [Mon, 8 Oct 2018 08:12:28 +0000 (08:12 +0000)]
Vendor import serf-1.3.9 (now Apache serf)

5 years agoem/igb: Do not print link state messages
vangyzen [Mon, 8 Oct 2018 01:28:46 +0000 (01:28 +0000)]
em/igb:  Do not print link state messages

These messages are totally redundant with the iflib messages.
They're also not very useful, since they don't include the
interface name.

Discussed with: shurd
Approved by: re (rgrimes)
Sponsored by: Dell EMC Isilon

5 years agoTeach truss how to display shm_open(2), shm_unlink(2)
allanjude [Sun, 7 Oct 2018 19:50:44 +0000 (19:50 +0000)]
Teach truss how to display shm_open(2), shm_unlink(2)

Submitted by: Thomas Munro <munro@ip9.org>
Reviewed by: tuexen, kib
Approved by: re (rgrimes)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D17457

5 years agoAddress the warning regarding duplicate option 'GEOM_PART_GPT' when
tuexen [Sun, 7 Oct 2018 15:54:13 +0000 (15:54 +0000)]
Address the warning regarding duplicate option 'GEOM_PART_GPT' when
configuring kernels for i386, amd64, and arm64.
The 'GEOM_PART_GPT' option was added to the DEFAULTS configuration
in r337967.

Approved by: re (kib@)
Reviewed by: ler@
Differential Revision: https://reviews.freebsd.org/D17458
Sponsored by: Netflix, Inc.

5 years agolualoader: Honor boot_* variables at lua init
kevans [Sun, 7 Oct 2018 15:28:50 +0000 (15:28 +0000)]
lualoader: Honor boot_* variables at lua init

For non-UEFI systems, boot.config(5) may have -s or -v specified for
single-user and verbose boot respectively. These were not being properly
taken into account and reflected in the "Boot Options" submenu. When we
initialize core.lua, we'll record boot_single and boot_verbose as we do ACPI
and consider these the system defaults.

Reported by: David Wolfskill <david@catwhisker.org>
Approved by: re (kib)

5 years agoAvoid truncating unrecognised parameters when reporting them.
tuexen [Sun, 7 Oct 2018 15:13:47 +0000 (15:13 +0000)]
Avoid truncating unrecognised parameters when reporting them.
This resulted in sending malformed packets.

Approved by: re (kib@)
MFC after: 1 week

5 years agoEnable TCP Fast Open support for PPC platforms.
tuexen [Sun, 7 Oct 2018 12:56:05 +0000 (12:56 +0000)]
Enable TCP Fast Open support for PPC platforms.

Reviewed by: kbowling@, andreast@
Approved by: re (kib@)
Differential Revision: https://reviews.freebsd.org/D17407

5 years agoEnsure that the ips_localout counter is incremented for
tuexen [Sun, 7 Oct 2018 11:26:15 +0000 (11:26 +0000)]
Ensure that the ips_localout counter is incremented for
locally generated SCTP packets sent over IPv4. This make
the behaviour consistent with IPv6.

Reviewed by: ae@, bz@, jtl@
Approved by: re (kib@)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17406

5 years agolualoader: Create a module blacklist, add DRM modules to it
kevans [Sun, 7 Oct 2018 01:53:43 +0000 (01:53 +0000)]
lualoader: Create a module blacklist, add DRM modules to it

This is a step in the process of easing migration into the new world order
of DRM drivers. Strongly encourage users towards loading DRM modules via
rc.conf(5) instead of loader.conf(5) by failing the load from loader(8).
Users so inclined may wipe out the blacklist via module_blacklist="" in
loader.conf(5), and it is expected that these modules will eventually be
removed from the blacklist. They may still be loaded as dependencies of
other modules or explicitly via the loader prompt, but this should not be a
major problem.

Approved by: re (rgrimes)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16914

5 years agosshd: address capsicum issues
emaste [Sat, 6 Oct 2018 21:32:55 +0000 (21:32 +0000)]
sshd: address capsicum issues

* Add a wrapper to proxy login_getpwclass(3) as it is not allowed in
  capability mode.
* Cache timezone data via caph_cache_tzdata() as we cannot access the
  timezone file.
* Reverse resolve hostname before entering capability mode.

PR: 231172
Submitted by: naito.yuichiro@gmail.com
Reviewed by: cem, des
Approved by: re (rgrimes)
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D17128

5 years agopowerpc/pseries: EOI interrupts in XICS by setting lowest priority
jhibbits [Sat, 6 Oct 2018 18:51:49 +0000 (18:51 +0000)]
powerpc/pseries: EOI interrupts in XICS by setting lowest priority

Discussing with Benjamin Herrenschmidt, OPAL_INT_GET_XIRR masks the
returned priority, so must be resumed before more interrupts can be
handled at this priority.  Since there are only two priorities used in
FreeBSD, we know that the previous priority in an EOI will always be
0xff (lowest priority).

Reviewed by: nwhitehorn
Approved by: re(rgrimes)
Differential Revision: https://reviews.freebsd.org/D17361

5 years agoRemove BUGS section from nscd.conf(5) man page. This was missed in r339194.
trasz [Sat, 6 Oct 2018 17:40:14 +0000 (17:40 +0000)]
Remove BUGS section from nscd.conf(5) man page.  This was missed in r339194.

Approved by: re (rgrimes)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoopenssh: cherry-pick OpenSSL 1.1.1 compatibility
emaste [Sat, 6 Oct 2018 14:38:34 +0000 (14:38 +0000)]
openssh: cherry-pick OpenSSL 1.1.1 compatibility

Compatibility with existing OpenSSL versions is maintained.

Upstream commits:
482d23bcac upstream: hold our collective noses and use the openssl-1.1.x
48f54b9d12 adapt -portable to OpenSSL 1.1x API
86e0a9f3d2 upstream: use only openssl-1.1.x API here too
a3fd8074e2 upstream: missed a bit of openssl-1.0.x API in this unittest
cce8cbe0ed Fix openssl-1.1 fallout for --without-openssl.

Trivial conflicts in sshkey.c and test_sshkey.c were resolved.

Connect libressl-api-compat.c to the build, and regenerate config.h

Reviewed by: des
Approved by: re (rgrimes)
MFC after: 2 seeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17444

5 years agopowerpc64/powernv: Don't mask MSIs in OPAL
jhibbits [Sat, 6 Oct 2018 03:20:26 +0000 (03:20 +0000)]
powerpc64/powernv: Don't mask MSIs in OPAL

Summary:
Discussing with Benjamin Herrenschmidt, MSIs, and edge-triggered
interrupts in general, must not be masked in XICS and XIVE, else
subsequent interrupts may be ignored.

Testing locally on my Talos II (single CPU, 18-core POWER9), NVMe now
works with MSI, improving read throughput by ~70% (900MB/s -> 1.67GB/s,
with 64MB block size) over INTx interrupts, and snd_hda(4) now will
actually play music with MSI.  Previously, snd_hda(4) would not receive
interrupts, timing out, and declaring the channels dead.

This has also been tested by Kevin Bowling, and others, with great
success.  Kevin reported NVMe unusable on his Talos II prior to this
patch.

Reviewed by: nwhitehorn, kbowling
Approved by: re(rgrimes)
Differential Revision: https://reviews.freebsd.org/D17356

5 years agoFix the test prohibiting jails from sharing IP addresses.
jamie [Sat, 6 Oct 2018 02:10:32 +0000 (02:10 +0000)]
Fix the test prohibiting jails from sharing IP addresses.

It's not supposed to be legal for two jails to contain the same IP address,
unless both jails contain only that one address.  This is the behavior
documented in jail(8), and is there to prevent confusion when multiple
jails are listening on IADDR_ANY.

VIMAGE jails (now the default for GENERIC kernels) test this correctly,
but non-VIMAGE jails have been performing an incomplete test when nested
jails are used.

Approved by: re@ (kib@)
MFC after: 5 days

5 years agolibcrypto: have buildinf.h depend on Makefile
emaste [Fri, 5 Oct 2018 20:49:54 +0000 (20:49 +0000)]
libcrypto: have buildinf.h depend on Makefile

So that it will be regenerated after Makefile changes affecting the
file's content - specifically, the OpenSSL 1.1.1 update adds a DATE
macro which did not exist previously.

Sponsored by: The FreeBSD Foundation

5 years agoFix information about $firewall_myservices
dbaio [Fri, 5 Oct 2018 20:35:43 +0000 (20:35 +0000)]
Fix information about $firewall_myservices

After r273201 it is supported "/{udp,tcp,proto}" suffix into
$firewall_myservices, and in the rc.conf the information is outdated.

Reviewed by: bcr, rgrimes
Approved by: re (gjb), doc (bcr), src (rgrimes)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17338

5 years agoFix igb corrupting checksums with BPF and VLAN
shurd [Fri, 5 Oct 2018 20:16:20 +0000 (20:16 +0000)]
Fix igb corrupting checksums with BPF and VLAN

When using a vlan with igb and the vlanhwcsum option, any mbufs which
already had the TCP, UDP, or SCTP checksum calculated and therefore don't
have the CSUM_[IP|IP6]_[TCP|UDP|SCTP] bits set in the csum_flags field would
have the L4 checksum corrupted by the hardware.

This was caused by the driver setting E1000_TXD_POPTS_TXSM any time a
checksum bit was set OR a vlan tag was present.

The patched driver only sets E1000_TXD_POPTS_TXSM when an offload is
requested.

PR: 231416
Reported by: pi
Approved by: re (gjb)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D17404

5 years agoamd64: import updated kernel memset to libc
mjg [Fri, 5 Oct 2018 19:27:42 +0000 (19:27 +0000)]
amd64: import updated kernel memset to libc

See r339205 for details.

An unused ERMS support is retained in the macro. It will be activated
after ifunc support lands.

Reviewed by:    kib
Approved by:    re (gjb)
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17405

5 years agoamd64: make memset less slow with mov
mjg [Fri, 5 Oct 2018 19:25:09 +0000 (19:25 +0000)]
amd64: make memset less slow with mov

rep stos has a high startup time even on modern microarchitectures like
Skylake. Intel optimization manuals discuss how for small sizes it is
beneficial to go for streaming stores. Since those cannot be used without
extra penalty in the kernel I investigated performance impact of just
regular movs.

The patch below implements a very simple scheme: a 32-byte loop followed
by filling in the remainder of at most 31 bytes. It has a 256 breaking
point on which it falls back to rep stos. It provides a significant win
over the current primitive on several machines I tested (both Intel and
AMD). A 64-byte loop did not provide any benefit even for multiple of 64
sizes.

See the review for benchmark data.

Reviewed by: kib
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17398

5 years agoMFH r338661 through r339200.
gjb [Fri, 5 Oct 2018 17:53:47 +0000 (17:53 +0000)]
MFH r338661 through r339200.

Sponsored by: The FreeBSD Foundation

5 years agolualoader: Don't draw loader menu with autoboot_delay=-1
kevans [Fri, 5 Oct 2018 17:07:10 +0000 (17:07 +0000)]
lualoader: Don't draw loader menu with autoboot_delay=-1

This was mostly a cosmetic issue. autoboot_delay=-1 is documented to bypass
the loader menu and immediately execute the boot command, but lualoader
would draw the menu and immediately execute the boot command. No interaction
was possible with the menu.

The fix lifts autoboot_delay processing out of menu.autoboot, which now
takes a delay and does nothing if no delay is specified. This lines up with
my expectations of menu.autoboot's usage from a third party, which may
want more control over the process than the default behavior.

PR: 231610
Approved by: re (gjb)

5 years agoDocument signal handling in blacklistd(8).
lidl [Fri, 5 Oct 2018 16:52:21 +0000 (16:52 +0000)]
Document signal handling in blacklistd(8).

Reviewed by: bcr@, 0mp@
Approved by: re (gjb@)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17423

5 years agoUpdate the existing heimdal implementation for OpenSSL 1.1.
jhb [Fri, 5 Oct 2018 16:35:24 +0000 (16:35 +0000)]
Update the existing heimdal implementation for OpenSSL 1.1.

Existing work is underway to import a newer version of heimdal, but
this patchset gets us to a fully working tree to enable more wide
spread testing of OpenSSL 1.1 for now.

I've also enabled WARNS=1 for kerberos (which is the reason for the
change in libroken).  Having -Werror enabled was useful during the
1.1 updates and we probably should have warnings enabled by default
for kerberos anyway.

This passes make tinderbox, and I have also done some very light
runtime testing on amd64.

Reviewed by: bjk, jkim, emaste
Differential Revision: https://reviews.freebsd.org/D17276

5 years agoAdd sysctls for dbuf metadata cache variables added in r336959.
mav [Fri, 5 Oct 2018 16:05:59 +0000 (16:05 +0000)]
Add sysctls for dbuf metadata cache variables added in r336959.

Approved by: re (gjb)
MFC after: 1 week

5 years agoConvert UDP length to host byte order
thj [Fri, 5 Oct 2018 12:51:30 +0000 (12:51 +0000)]
Convert UDP length to host byte order

When getting the number of bytes to checksum make sure to convert the UDP
length to host byte order when the entire header is not in the first mbuf.

Reviewed by: jtl, tuexen, ae
Approved by: re (gjb), jtl (mentor)
Differential Revision:  https://reviews.freebsd.org/D17357

5 years agoRemove the BUGS section of nscd(8) man page. According to bushman@'s
trasz [Fri, 5 Oct 2018 12:08:32 +0000 (12:08 +0000)]
Remove the BUGS section of nscd(8) man page.  According to bushman@'s
reponse quoted in PR, he no longer maintains it.

PR: 210590
Approved by: re (kib)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agobsdinstall(8): Fix a typo.
0mp [Fri, 5 Oct 2018 08:17:29 +0000 (08:17 +0000)]
bsdinstall(8): Fix a typo.

Reported by: Jose Luis Duran
Reviewed by: bcr
Approved by: re (gjb), krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D17409

5 years agoMODULE_PNP_INFO(9): Fix a grammar mistake.
0mp [Fri, 5 Oct 2018 08:00:45 +0000 (08:00 +0000)]
MODULE_PNP_INFO(9): Fix a grammar mistake.

Reported by: ak
Reviewed by: imp, Yuri Pankov <yuripv@yuripv.net>
Approved by: re (gjb), krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D17403

5 years agohwpmc: Refactor sample ring buffer handling to fix races
mmacy [Fri, 5 Oct 2018 05:55:56 +0000 (05:55 +0000)]
hwpmc: Refactor sample ring buffer handling to fix races

Refactor sample ring buffer ring handling to make it more robust to
long running callchain collection handling

r338112 introduced a (now fixed) regression that exposed a number of race
conditions within the management of the sample buffers. This
simplifies the handling and moves the decision to overwrite a
callchain sample that has taken too long out of the NMI in to the
hardlock handler. With this change the problem no longer shows up as a
ring corruption but as the code spending all of its time in callchain
collection.

- Makes the producer / consumer index incrementing monotonic, making it
  easier (for me at least) to reason about.
- Moves the decision to overwrite a sample from NMI context to interrupt
  context where we can enforce serialization.
- Puts a time limit on waiting to collect a user callchain - putting a
  bound on head-of-line blocking causing samples to be dropped
- Removes the flush routine which was previously needed to purge
  dangling references to the pmc from the sample buffers but now is only
  a source of a race condition on unload.

Previously one could lock up or crash HEAD by running:
pmcstat -S inst_retired.any_p -T and then hitting ^C

After this change it is no longer possible.

PR: 231793
Reviewed by: markj@
Approved by: re (gjb@)
Differential Revision: https://reviews.freebsd.org/D17011

5 years agoeliminate locking surrounding ui_vmsize and swap reserve by using atomics
mmacy [Fri, 5 Oct 2018 05:50:56 +0000 (05:50 +0000)]
eliminate locking surrounding ui_vmsize and swap reserve by using atomics

Change swap_reserve and swap_total to be in units of pages so that
swap reservations can be done using only atomics instead of using a single
global mutex for swap_reserve and a single mutex for all processes running
under the same uid for uid accounting.

Results in mmap speed up and a 70% increase in brk calls / second.

Reviewed by: alc@, markj@, kib@
Approved by: re (delphij@)
Differential Revision: https://reviews.freebsd.org/D16273

5 years agoRevert r339174: Move 32-bit compat support for FIODGNAME to the right place.
brooks [Thu, 4 Oct 2018 23:55:03 +0000 (23:55 +0000)]
Revert r339174: Move 32-bit compat support for FIODGNAME to the right place.

A case was missed in this commit which breaks sshing into a 32-bit sshd
on a 64-bit system.

Approved by: re (gjb)

5 years agoHold a write lock across udp_notify()
rstone [Thu, 4 Oct 2018 22:03:58 +0000 (22:03 +0000)]
Hold a write lock across udp_notify()

With the new route cache feature udp_notify() will modify the inp when it
needs to invalidate the route cache.  Ensure that we hold a write lock on
the inp before calling the function to ensure that multiple threads don't
race while trying to invalidate the cache (which previously lead to a page
fault).

Differential Revision: https://reviews.freebsd.org/D17246
Reviewed by: sbruno, bz, karels
Sponsored by: Dell EMC Isilon
Approved by: re (gjb)

5 years agoReduce NL_ARGMAX to 4096 to match Linux.
brooks [Thu, 4 Oct 2018 21:55:58 +0000 (21:55 +0000)]
Reduce NL_ARGMAX to 4096 to match Linux.

NL_ARGMAX is the maximum number of positional arguments supported by
printf(3). Prior to r308145 it was declared as 99 and not enforced.
r308145 added enforcement and increased the value to 64k.

Unfortunately, development versions of PostgreSQL used the system
definition to allocate and zero an NL_ARGMAX * 4 sized array on the
stack of its snprintf implementation with measurable performance
impacts. This has been fixed in new PostgreSQL versions, but it is
possible that other programs suffer from this problem.

A value of 4096 puts us on par with Linux and is certainly large enough
for any reasonable program.

Reviewed by: mjg
Reported by: mjg
Approved by: re (gjb)
Differential revision: https://reviews.freebsd.org/D17387
Differential revision: https://reviews.freebsd.org/D8286

5 years agoamd64: hide non-erms jump label under non-erms copyin/copyout
mjg [Thu, 4 Oct 2018 20:01:48 +0000 (20:01 +0000)]
amd64: hide non-erms jump label under non-erms copyin/copyout

This change is a no-op in terms of semantics, but has a side effect
of removing a perfectly useless nop sled for CPUs with ERMS.

Approved by: re (gjb)
Sponsored by:   The FreeBSD Foundation

5 years ago[ig4] style(9) clean-up
gonzo [Thu, 4 Oct 2018 19:54:47 +0000 (19:54 +0000)]
[ig4] style(9) clean-up

Submitted by: Rajesh Kumar <rajfbsd@gmail.com>
Approved by: re (gjb, kib)

5 years agocrt: switch to standard note type definitions from elf_common.h
emaste [Thu, 4 Oct 2018 17:35:32 +0000 (17:35 +0000)]
crt: switch to standard note type definitions from elf_common.h

This makes it easier to grep the source tree for these notes, and
ensures that they will remain in sync.

Reviewed by: kib
Approved by: re (gjb)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17408

5 years agobsdinstall(8): Document ZFS installation scripting.
0mp [Thu, 4 Oct 2018 09:28:40 +0000 (09:28 +0000)]
bsdinstall(8): Document ZFS installation scripting.

- Extend the bsdinstall(8) man page with ZFS installation scripting
  details. [1]
- Extend the bsdinstall(8) man page with the description of all the ZFS
  variables involved in a scripted installation of ZFS-based systems. [1]
- Extend the SCRIPTING section with an example for a ZFS-based scripted
  installation. [1]
- Create a new section explaining how ZFS datasets must be written into
  a variable to get them set on the final system. [1]

While here:
- Add Roberto to the copyrights for recognition as changes to the manual
  page are huge.
- Use "Dq" for default values.
- Use sysrc(8) instead of echo in examples.

Submitted by: Roberto Fernandez Cueto <roberfern@gmail.com> [1]
Reviewed by: dteske
Approved by: re (gjb), krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D14169

5 years agoRemove invalid comments and correct some typos.
pjd [Thu, 4 Oct 2018 05:57:27 +0000 (05:57 +0000)]
Remove invalid comments and correct some typos.

Approved by: re (kib)

5 years agoWhen the adist_free list is empty and we lose connection to the receiver we
pjd [Thu, 4 Oct 2018 05:54:57 +0000 (05:54 +0000)]
When the adist_free list is empty and we lose connection to the receiver we
move all elements from the adist_send and adist_recv lists back onto the
adist_free list, but we don't wake consumers waitings for the adist_free list
to become non-empty. This can lead to the sender process stopping audit trail
files distribution and waiting forever.

Fix the problem by adding the missing wakeup.

While here slow down spinning on CPU in case of a short race in
sender_disconnect() and add an explaination when it can occur.

PR: 201953
Reported by: peter
Approved by: re (kib)

5 years agoWhen we look for a new trail file there might be a race between find trail
pjd [Thu, 4 Oct 2018 05:48:09 +0000 (05:48 +0000)]
When we look for a new trail file there might be a race between find trail
file name and opening it. This race was not properly handled, because we were
copying new name before checking for openat(2) error and when we were trying
again we were starting with the next trail file. This could result in skipping
distribution of such a trail file.

Fix this problem by checking for ENOENT first (only for .not_terminated files)
and then updating (or not) tr_filename before restarting the search.

PR: 200139
Reported by: peter
Approved by: re (kib)

5 years agoFix the hardware.{txt,html} build in the release/Makefile 'reldoc'
gjb [Thu, 4 Oct 2018 01:46:56 +0000 (01:46 +0000)]
Fix the hardware.{txt,html} build in the release/Makefile 'reldoc'
target.

The doc/share/mk/doc.commands.mk sets SVN to /usr/local/bin/svn
by default, which is not necessarily installed by the documentation
project textproc/docproj port.

Ensure SVN can be evaluated properly to include the hardware pages
by iterating through /usr/local/bin and /usr/bin and looking for
both svn and svnlite binaries, and pass the SVN variable explicitly
through env(1) in the reldoc target to avoid failures if it does not
exist.

Approved by: re (rgrimes)
Sponsored by: The FreeBSD Foundation

5 years agoMove 32-bit compat support for FIODGNAME to the right place.
brooks [Wed, 3 Oct 2018 20:39:48 +0000 (20:39 +0000)]
Move 32-bit compat support for FIODGNAME to the right place.

ioctl(2) commands only have meaning in the context of a file descriptor
so translating them in the syscall layer is incorrect.

The new handler users an accessor to retrieve/construct a pointer from
the last member of the passed structure and relies on type punning to
access the other member which requires no translation.

Reviewed by: kib
Approved by: re (rgrimes, gjb)
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Review: https://reviews.freebsd.org/D17388

5 years agoSet the default loader for powerpc64 back to to forth too.
andreast [Wed, 3 Oct 2018 19:09:09 +0000 (19:09 +0000)]
Set the default loader for powerpc64 back to to forth too.
The commit from r338893 covered only the powerpc build.

Approved by: re (kib)

5 years agoIn PR 227259, a user is reporting that they have code which is using
glebius [Wed, 3 Oct 2018 17:40:04 +0000 (17:40 +0000)]
In PR 227259, a user is reporting that they have code which is using
shutdown() to wakeup another thread blocked on a stream listen socket.
This code is failing, while it used to work on FreeBSD 10 and still
works on Linux.

It seems reasonable to add another exception to support something users are
actually doing, which used to work on FreeBSD 10, and still works on Linux.
And, it seems like it should be acceptable to POSIX, as we still return
ENOTCONN.

This patch is different to what had been committed to stable/11, since
code around listening sockets is different. Patch in D15019 is written
by jtl@, slightly modified by me.

PR: 227259
Obtained from: jtl
Approved by: re (kib)
Differential Revision:  D15019

5 years agoopenssh: connect libressl-api-compat.c and regen config.h
emaste [Wed, 3 Oct 2018 16:38:36 +0000 (16:38 +0000)]
openssh: connect libressl-api-compat.c and regen config.h

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

5 years agoopenssh: cherry-pick OpenSSL 1.1.1 compatibility
emaste [Wed, 3 Oct 2018 16:11:13 +0000 (16:11 +0000)]
openssh: cherry-pick OpenSSL 1.1.1 compatibility

Upstream commits:
482d23bcac upstream: hold our collective noses and use the openssl-1.1.x
48f54b9d12 adapt -portable to OpenSSL 1.1x API
86e0a9f3d2 upstream: use only openssl-1.1.x API here too
a3fd8074e2 upstream: missed a bit of openssl-1.0.x API in this unittest
cce8cbe0ed Fix openssl-1.1 fallout for --without-openssl.

Trivial conflicts in sshkey.c and test_sshkey.c were resolved.

Discussed with: des

5 years agoopenssh: add openbsd-compat/libressl-api-compat.c
emaste [Wed, 3 Oct 2018 16:06:17 +0000 (16:06 +0000)]
openssh: add openbsd-compat/libressl-api-compat.c

Missed in migrating changeset from git to svn for r338811

Reported by: jhb

5 years agoFix an inverted test in ucode_load_ap().
markj [Wed, 3 Oct 2018 14:20:43 +0000 (14:20 +0000)]
Fix an inverted test in ucode_load_ap().

This caused microcode to be updated only on the BSP if hyperthreading
was disabled, typically resulting in a hang or reset.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

5 years agoUse strlcpy() instead of strncpy().
tuexen [Wed, 3 Oct 2018 07:35:16 +0000 (07:35 +0000)]
Use strlcpy() instead of strncpy().

Approved by:            re (kib@)
CID: 13959801395981
X-MFC with: r339012
MFC after:              1 week

5 years agoMove 32-bit compat support for CDIOREADTOCENTRYS to the right place.
brooks [Tue, 2 Oct 2018 23:23:56 +0000 (23:23 +0000)]
Move 32-bit compat support for CDIOREADTOCENTRYS to the right place.

ioctl(2) commands only have meaning in the context of a file descriptor
so translating them in the syscall layer is incorrect.

The new handler users an accessor to retrieve/construct a pointer from
the last member of the passed structure and relies on type punning to
access the other members which require no translation.

Reviewed by: kib (prior version), jhb
Approved by: re (rgrimes)
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Review: https://reviews.freebsd.org/D17378

5 years agoUpdate obsolete files list for OpenSSL 1.1.1.
jhb [Tue, 2 Oct 2018 21:40:57 +0000 (21:40 +0000)]
Update obsolete files list for OpenSSL 1.1.1.

This will need a real date once this is merged to head.

One weird thing to note: the 32-bit engines get dumped into /usr/lib32
rather than /usr/lib32/engines, and I bet the 32-bit libcrypto.so i
looking for the .so files in the wrong place.  We should probably fix
both of those at some point.

Reviewed by: emaste, jkim
Differential Revision: https://reviews.freebsd.org/D17384

5 years agoUse nda(4) on powerpc64
kbowling [Tue, 2 Oct 2018 21:36:00 +0000 (21:36 +0000)]
Use nda(4) on powerpc64

Approved by: re@ (kib), krion (mentor), imp
Differential Revision: https://reviews.freebsd.org/D17368