]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoUpdate shlib version to 9.
jkim [Thu, 13 Sep 2018 20:53:51 +0000 (20:53 +0000)]
Update shlib version to 9.

5 years agoUpdate OpenSSL version number.
jkim [Thu, 13 Sep 2018 20:51:19 +0000 (20:51 +0000)]
Update OpenSSL version number.

5 years agoUpdate OpenSSL to 1.1.1.
jkim [Thu, 13 Sep 2018 20:40:51 +0000 (20:40 +0000)]
Update OpenSSL to 1.1.1.

Note it does not update build infrastructure.

5 years agoImport OpenSSL 1.1.1.
jkim [Thu, 13 Sep 2018 19:18:07 +0000 (19:18 +0000)]
Import OpenSSL 1.1.1.

5 years agoSet zfs_arc_meta_strategy to metadata only
vangyzen [Thu, 13 Sep 2018 17:56:48 +0000 (17:56 +0000)]
Set zfs_arc_meta_strategy to metadata only

The previous default of "balanced" appears to have caused pathological
behavior, including very poor performance and 100% CPU load in the
arc_reclaim_thread.

The symptoms appeared when the daily periodic run started.
With this change, the system--and the ARC in particular--behaved
normally during a manual daily periodic run.

From Mark Johnston:  The port of the balanced strategy is incomplete,
since arc_prune_async() is a no-op on FreeBSD.  (This also seems
to imply that r337653 is a no-op.)  After 12 is branched we can
port the remaining bits and consider changing the default back.

Submitted by: markj (essentially)
Reviewed by: markj
Approved by: re (gjb)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17156

5 years ago[ig4] Update list of supported hardware
gonzo [Thu, 13 Sep 2018 17:39:08 +0000 (17:39 +0000)]
[ig4] Update list of supported hardware

Reflect the fact that ig4(4) is not an Intel-specific device but
a driver for Synopsys DesignWare I2C controller that now ships in
AMD systems too.

Approved by: re (kib), rpokala

5 years ago[ig4] Add PCI IDs for I2C controller on Intel Kaby Lake systems
gonzo [Thu, 13 Sep 2018 17:36:55 +0000 (17:36 +0000)]
[ig4] Add PCI IDs for I2C controller on Intel Kaby Lake systems

PR: 221777
Approved by: re (kib)
Submitted by: marc.priggemeyer@gmail.com

5 years agoRemove __DATE__ and __TIME__ from ibdiag_common.c, replacing with
gjb [Thu, 13 Sep 2018 16:41:15 +0000 (16:41 +0000)]
Remove __DATE__ and __TIME__ from ibdiag_common.c, replacing with
the hard-coded string "not available" to ensure reproducible builds.

Discussed with: emaste
Approved by: re (rgrimes)
Sponsored by: The FreeBSD Foundation

5 years agocxgbe/iw_cxgbe: Fix reported build breakage when the kernel
np [Thu, 13 Sep 2018 16:27:21 +0000 (16:27 +0000)]
cxgbe/iw_cxgbe: Fix reported build breakage when the kernel
configuration has "device cxgbe' but no VIMAGE.

Reported by: mav@
Approved by: re@ (kib@)

5 years agoReally fix pam install. Don't commit late at night or you make simple mistakes.
brd [Thu, 13 Sep 2018 16:14:33 +0000 (16:14 +0000)]
Really fix pam install.  Don't commit late at night or you make simple mistakes.

Reported by: dumbbell
Approved by: re (gjb), will (mentor)

5 years agoIf a user skips the pre-world mergemaster, an installworld check
ian [Thu, 13 Sep 2018 15:16:05 +0000 (15:16 +0000)]
If a user skips the pre-world mergemaster, an installworld check
notices the missing ntpd user and refers to UPDATING. This change makes
it more clear which aspect of UPDATING is important for the ntpd change.

PR: 231334
Approved by: re (gjb)

5 years agoregenerate src.conf.5 after r338642 and r338643
emaste [Thu, 13 Sep 2018 14:54:52 +0000 (14:54 +0000)]
regenerate src.conf.5 after r338642 and r338643

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

5 years agodd(1): Correct padding in status=progress
kevans [Thu, 13 Sep 2018 14:54:46 +0000 (14:54 +0000)]
dd(1): Correct padding in status=progress

Output padding is specified via outlen, which is set using the return value
of fprintf. Because it's printing that padding plus a trailing byte, it
grows by one each iteration rather than reflecting actual length.

Additionally, iec was sized improperly for scaling up similarly to si.
Fixing this revealed that the humanize_number(3) call to populate persec
was using the wrong width.

Submitted by: Thomas Hurst <tom@hur.st>
Reviewed by: imp
Approved by: re (kib)
Differential Revision: https://reviews.freebsd.org/D16960

5 years agoamd64: implement ERMS-based memmove, memcpy and memset
mjg [Thu, 13 Sep 2018 14:53:51 +0000 (14:53 +0000)]
amd64: implement ERMS-based memmove, memcpy and memset

Reviewed by: kib
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17124

5 years agoAdd WITHOUT_REPRODUCIBLE_BUILD description
emaste [Thu, 13 Sep 2018 14:53:42 +0000 (14:53 +0000)]
Add WITHOUT_REPRODUCIBLE_BUILD description

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

5 years agoEnable reproducible builds in advance of 12.0-REL
emaste [Thu, 13 Sep 2018 14:52:59 +0000 (14:52 +0000)]
Enable reproducible builds in advance of 12.0-REL

r338642 toggled the REPRODUCIBLE_BUILD knob but missed the
corresponding kern.opts.mk change.

We want to build the 12.0 release artifacts with reproducible builds
mode enabled. Switch it on in HEAD now to enable testing with upcoming
ALPHA builds. We can revisit the default setting for HEAD after the
branch is created.

This change eliminates the build metadata (user, hostname, timestamp,
etc.) from the kernel and loader.  If the src tree is a git, svn or p4
checkout with changes then the metadata is retained.

The WITHOUT_REPRODUCIBLE_BUILD src.conf(5) knob can be used to revert
to the previous behaviour.

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

5 years agoEnable reproducible builds in advance of 12.0-REL
emaste [Thu, 13 Sep 2018 14:26:53 +0000 (14:26 +0000)]
Enable reproducible builds in advance of 12.0-REL

We want to build the 12.0 release artifacts with reproducible builds
mode enabled. Switch it on in HEAD now to enable testing with upcoming
ALPHA builds. We can revisit the default setting for HEAD after the
branch is created.

This change eliminates the build metadata (user, hostname, timestamp,
etc.) from the kernel and loader.  If the src tree is a git, svn or p4
checkout with changes then the metadata is retained.

The WITHOUT_REPRODUCIBLE_BUILD src.conf(5) knob can be used to revert
to the previous behaviour.

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

5 years agoarm64: Make aw_sid and aw_thermal depend on nvmem
manu [Thu, 13 Sep 2018 14:08:10 +0000 (14:08 +0000)]
arm64: Make aw_sid and aw_thermal depend on nvmem

Both drivers use this interface so add a dependancy on it.
Since awg uses aw_sid for generating the MAC address, make it
depend on both aw_sid and nmvem so when only removing nvmem from
kernel config it will not include this driver.

Reported by: sbruno
Approved by: re (gjb)

5 years agoAdd new option to the geom(8) utility, "-p". It makes it easy to look up
trasz [Thu, 13 Sep 2018 14:06:01 +0000 (14:06 +0000)]
Add new option to the geom(8) utility, "-p".  It makes it easy to look up
the GEOM class instance from the provider name.

Reviewed by: oshogbo, 0mp
Approved by: re (kib)
MFC after: 2 weeks
Relnotes: yes
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17116

5 years agoumount: remove sync(2) call when used with -f
mjg [Thu, 13 Sep 2018 13:57:42 +0000 (13:57 +0000)]
umount: remove sync(2) call when used with -f

It completely unnecessarily iterates over all filesystems and happens
to be executed a lot e.g. by synth.

Reviewed by: kib
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17143

5 years agoFix build after r338621 by avoiding LINKS and installing the link manually.
brd [Thu, 13 Sep 2018 07:48:49 +0000 (07:48 +0000)]
Fix build after r338621 by avoiding LINKS and installing the link manually.

Approved by: re (rgrimes), will (mentor)

5 years agoxen: temporary disable SMAP when forwarding hypercalls from user-space
royger [Thu, 13 Sep 2018 07:15:02 +0000 (07:15 +0000)]
xen: temporary disable SMAP when forwarding hypercalls from user-space

The Xen page-table walker used to resolve the virtual addresses in the
hypercalls will refuse to access user-space pages when SMAP is enabled
unless the AC flag in EFLAGS is set (just like normal hardware with
SMAP support would do).

Since privcmd allows forwarding hypercalls (and buffers) from
user-space into Xen make sure SMAP is temporary disabled for the
duration of the hypercall from user-space.

Approved by: re (gjb)
Sponsored by: Citrix Systems R&D

5 years agoxen: legacy PVH fixes for the new interrupt count
royger [Thu, 13 Sep 2018 07:14:11 +0000 (07:14 +0000)]
xen: legacy PVH fixes for the new interrupt count

Register interrupts using the PIC pic_register_sources method instead
of doing it in apic_setup_io. This is now required, since the internal
interrupt structures are not yet setup when calling apic_setup_io.

Approved by: re (gjb)
Sponsored by: Citrix Systems R&D

5 years agolapic: skip setting intrcnt if lapic is not present
royger [Thu, 13 Sep 2018 07:13:13 +0000 (07:13 +0000)]
lapic: skip setting intrcnt if lapic is not present

Instead of panicking. Legacy PVH mode doesn't provide a lapic, and
since native_lapic_intrcnt is called unconditionally this would cause
the assert to trigger. Change the assert into a continue in order to
take into account the possibility of systems without a lapic.

Reviewed by: jhb
Approved by: re (gjb)
Sponsored by: Citrix Systems R&D
Differential revision: https://reviews.freebsd.org/D17015

5 years agoxen: fix setting legacy PVH vcpu id
royger [Thu, 13 Sep 2018 07:12:16 +0000 (07:12 +0000)]
xen: fix setting legacy PVH vcpu id

The recommended way to obtain the vcpu id is using the cpuid
instruction with a specific leaf value. This leaf value must be
obtained at runtime, and it's done when populating the hypercall page.

Legacy PVH however will get the hypercall page populated by the
hypervisor itself before booting, so the cpuid leaf was not actually
set, thus preventing setting the vcpu id value from cpuid.

Fix this by making sure the cpuid leaf has been probed before
attempting to set the vcpu id.

Approved by: re (gjb)
Sponsored by: Citrix Systems R&D

5 years agoxen: limit the usage of PIRQs to a legacy PVH Dom0
royger [Thu, 13 Sep 2018 07:11:11 +0000 (07:11 +0000)]
xen: limit the usage of PIRQs to a legacy PVH Dom0

That's the only mode in FreeBSD that requires the usage of PIRQs, so
there's no need to attach the PIRQ PIC when running in other modes.

Approved by: re (gjb)
Sponsored by: Citrix Systems R&D

5 years agoxen: fix initial kenv setup for legacy PVH
royger [Thu, 13 Sep 2018 07:09:41 +0000 (07:09 +0000)]
xen: fix initial kenv setup for legacy PVH

When adding support for the new PVH mode the kenv handling was
switched to use a boot time allocated scratch space, however the
legacy PVH early boot code was not modified to allocate such space.

Approved by: re (gjb)
Sponsored by: Citrix Systems R&D

5 years ago xen: remove xenpv_set_ids
royger [Thu, 13 Sep 2018 07:08:31 +0000 (07:08 +0000)]
 xen: remove xenpv_set_ids

The vcpu_id for legacy PVH mode can be set from the output of cpuid,
so there's no need to have a special function to set it.

Also note that xenpv_set_ids should have been executed only for PV
guests, but was executed for all guests types and vcpu_id was later
fixed up for HVM guests.

Reported by: cperciva
Approved by: re (gjb)
Sponsored by: Citrix Systems R&D

5 years agoxen: fix PV IPI setup
royger [Thu, 13 Sep 2018 07:07:13 +0000 (07:07 +0000)]
xen: fix PV IPI setup

So that it's done when the vcpu_id has been set. For the BSP the
vcpu_id is set at SUB_INTR, while for the APs it's done in
init_secondary_tail that's called at SUB_SMP order FIRST.

Reported and tested by: cperciva
Approved by: re (gjb)
Sponsored by: Citrix Systems R&D
Differential revision: https://reviews.freebsd.org/D17013

5 years agomsi: remove the check that interrupt sources have been added
royger [Thu, 13 Sep 2018 07:05:51 +0000 (07:05 +0000)]
msi: remove the check that interrupt sources have been added

When running as a specific type of Xen guest the hypervisor won't
provide any emulated IO-APICs or legacy PICs at all, thus hitting the
following assert in the MSI code:

panic: Assertion num_io_irqs > 0 failed at /usr/src/sys/x86/x86/msi.c:334
cpuid = 0
time = 1
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffffff826ffa70
vpanic() at vpanic+0x1a3/frame 0xffffffff826ffad0
panic() at panic+0x43/frame 0xffffffff826ffb30
msi_init() at msi_init+0xed/frame 0xffffffff826ffb40
apic_setup_io() at apic_setup_io+0x72/frame 0xffffffff826ffb50
mi_startup() at mi_startup+0x118/frame 0xffffffff826ffb70
start_kernel() at start_kernel+0x10

Fix this by removing the assert in the MSI code, since it's possible
to get to the MSI initialization without having registered any other
interrupt sources.

Reviewed by: jhb
Approved by: re (gjb)
Sponsored by: Citrix Systems R&D
Differential revision: https://reviews.freebsd.org/D17001

5 years agox86bios: use M_NOWAIT with mallocs
royger [Thu, 13 Sep 2018 07:04:00 +0000 (07:04 +0000)]
x86bios: use M_NOWAIT with mallocs

Or else it triggers the following bug:

APIC: CPU 6 has ACPI ID 6
APIC: CPU 7 has ACPI ID 7
panic: vm_wait in early boot
cpuid = 0
time = 1
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffffff826ff8d0
vpanic() at vpanic+0x1a3/frame 0xffffffff826ff930
panic() at panic+0x43/frame 0xffffffff826ff990
vm_wait_domain() at vm_wait_domain+0xf9/frame 0xffffffff826ff9c0
kmem_alloc_contig_domain() at kmem_alloc_contig_domain+0x252/frame 0xffffffff826ffa50
kmem_alloc_contig() at kmem_alloc_contig+0x6c/frame 0xffffffff826ffad0
contigmalloc() at contigmalloc+0x2e/frame 0xffffffff826ffb00
x86bios_modevent() at x86bios_modevent+0x225/frame 0xffffffff826ffb20
module_register_init() at module_register_init+0xc0/frame 0xffffffff826ffb50
mi_startup() at mi_startup+0x118/frame 0xffffffff826ffb70
start_kernel() at start_kernel+0x10

While there also make x86bios_unmap_mem idempotent.

Reviewed by: kib
Approved by: re (gjb)
Sponsored by: Citrix Systems R&D
Differential revision: https://reviews.freebsd.org/D17000

5 years agoMove all pam related config to lib/libpam/
brd [Thu, 13 Sep 2018 04:08:48 +0000 (04:08 +0000)]
Move all pam related config to lib/libpam/

Approved by: re (rgrimes), will (mentor), des
Differential Revision: https://reviews.freebsd.org/D17122

5 years agoFix unlink(1) for files starting with -
emaste [Wed, 12 Sep 2018 19:41:16 +0000 (19:41 +0000)]
Fix unlink(1) for files starting with -

Restore the original behavior of unlink(1), passing the provided filename
directly to unlink(2), handling the first argument being "--" correctly.

This fixes "unlink -foo", broken in r97533.

PR: 228448
Submitted by: Brennan Vincent <brennan@umanwizard.com> (original version)
Submitted by: Yuri Pankov
Reported by: Brennan Vincent <brennan@umanwizard.com>
Reviewed by: emaste, kevans, vangyzen, 0mp
Approved by: re (delphij)
Differential Revision: https://reviews.freebsd.org/D17132

5 years agoFix issues about cancelling USB transfers in LibUSB when the USB device has
hselasky [Wed, 12 Sep 2018 15:06:30 +0000 (15:06 +0000)]
Fix issues about cancelling USB transfers in LibUSB when the USB device has
been detached. When a USB device has been detached the kernel file handle
stops responding to commands. USB applications which continue to run after
the USB device has been detached, depend on LibUSB generated events to tear
down its pending USB transfers. Add code to handle the needed cleanup when
processing the USB transfer(s) fails and prevent new USB transfer(s) from
being submitted.

Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
PR: 231076
MFC after: 1 week
Approved by: re (gjb)
Sponsored by: Mellanox Technologies

5 years agoFix TCP Fast Open for the TCP RACK stack.
tuexen [Wed, 12 Sep 2018 10:27:58 +0000 (10:27 +0000)]
Fix TCP Fast Open for the TCP RACK stack.

* Fix a bug where the SYN handling during established state was
  applied to a front state.
* Move a check for retransmission after the timer handling.
  This was suppressing timer based retransmissions.
* Fix an off-by one byte in the sequence number of retransmissions.
* Apply fixes corresponding to
  https://svnweb.freebsd.org/changeset/base/336934

Reviewed by: rrs@
Approved by: re (kib@)
MFC after: 1 month
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16912

5 years agoFix for backends which doesn't support capsicum.
hselasky [Wed, 12 Sep 2018 10:09:59 +0000 (10:09 +0000)]
Fix for backends which doesn't support capsicum.

Not all libpcap backends use the BPF compatible set
of IOCTLs. For example the mlx5 backend uses libibverbs
which is currently not capsicum compatible.

Disable sandboxing for such backends.

MFC after: 3 days
Discussed with: emaste@
Approved by: re (kib)
Sponsored by: Mellanox Technologies

5 years agoEnable VIMAGE support for RISC-V.
br [Wed, 12 Sep 2018 08:13:54 +0000 (08:13 +0000)]
Enable VIMAGE support for RISC-V.

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

5 years agoUse elf_relocaddr() to find the address for R_RISCV_RELATIVE
br [Wed, 12 Sep 2018 08:12:34 +0000 (08:12 +0000)]
Use elf_relocaddr() to find the address for R_RISCV_RELATIVE
relocation.

elf_relocaddr() has a hook to handle VIMAGE data addresses.

This fixes VIMAGE support for RISC-V when built as a module.

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

5 years agoDon't mark module data as static on RISC-V.
br [Wed, 12 Sep 2018 08:05:33 +0000 (08:05 +0000)]
Don't mark module data as static on RISC-V.

Similar to arm64, riscv compiler uses PC-relative loads/stores,
and with static data compiler does not emit relocations.
In result, kernel module linker has nothing to fix and data accessed
from the wrong location.

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

5 years agoCorrect ELF header parsing code to prevent invalid ELF sections from
gordon [Wed, 12 Sep 2018 04:57:34 +0000 (04:57 +0000)]
Correct ELF header parsing code to prevent invalid ELF sections from
disclosing memory.

Submitted by: markj
Reported by: Thomas Barabosch, Fraunhofer FKIE
Approved by: re (implicit)
Approved by: so
Security: FreeBSD-SA-18:12.elf
Security: CVE-2018-6924
Sponsored by: The FreeBSD Foundation

5 years agoamd64: enable options NUMA in GENERIC and MINIMAL
mjg [Tue, 11 Sep 2018 23:54:31 +0000 (23:54 +0000)]
amd64: enable options NUMA in GENERIC and MINIMAL

Reviewed by: gallatin, cem, scottl
Approved by: re (kib)
Relnotes: yes
Sponsored by: Dell EMC Isilon, Netflix
Differential Revision: https://reviews.freebsd.org/D17059

5 years agoAdd a couple of basic regression tests for SO_REUSEPORT_LB.
markj [Tue, 11 Sep 2018 21:14:07 +0000 (21:14 +0000)]
Add a couple of basic regression tests for SO_REUSEPORT_LB.

Reviewed by: asomers
Approved by: re (kib)
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D17110

5 years agoMFV r338519:
mm [Tue, 11 Sep 2018 20:51:34 +0000 (20:51 +0000)]
MFV r338519:
Update libarchive to 3.3.3

As all important changes have already been merged from libarchive git
this is just version number bump, documentation update and some
polishing for cpio tests. Other source code changes are not relevant to
FreeBSD.

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

5 years agoremove doubled name in objcopy manpage
emaste [Tue, 11 Sep 2018 20:32:57 +0000 (20:32 +0000)]
remove doubled name in objcopy manpage

We generate the installed objcopy man page from ELF Tool Chain's
elfcopy, but the sed expresion used for this ended up producing
"objcopy, objcopy - copy and translate object files".

Instead of replacing the first "elfcopy" with objcopy, just remove it.

Approved by: re (gjb)

5 years agoSwitch reproducible builds to unmodified src tree mode
emaste [Tue, 11 Sep 2018 19:19:07 +0000 (19:19 +0000)]
Switch reproducible builds to unmodified src tree mode

newvers.sh supports two modes for reproducible builds:

 -r    Reproducible build.  Do not embed directory names, user
       names, time stamps or other dynamic information into
       the output file.  This is intended to allow two builds
       done at different times and even by different people on
       different hosts to produce identical output.

 -R    Reproducible build if the tree represents an unmodified
       checkout from a version control system.  Metadata is
       included if the tree is modified.

Switch to the second mode when reproducible builds are enabled.
The value of a reproducible build is much less when building from an
uncontrolled, modified src tree, and -R likely provides the best
compromise in allowing the REPRODUCIBLE_BUILD knob to be enabled by
default for the release.

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

5 years agoix(4), ixv(4): VLAN tag stripping fixes for Amazon EC2 Enhanced Networking
erj [Tue, 11 Sep 2018 18:33:43 +0000 (18:33 +0000)]
ix(4), ixv(4): VLAN tag stripping fixes for Amazon EC2 Enhanced Networking

From Piotr:

ix(4), ixv(4): Add VLAN tag strip check when receiving packets
ixv(4): Fix support for VLAN_HWTAGGING and VLAN_HWFILTER flags

This change will prevent driver from passing VLAN tags when
interface configuration is not expecting them. VF driver will
check for VLAN_HWTAGGING and VLAN_HWFILTER flags and act adequately.

This patch resolves problem occuring on EC2 platforms.

Submitted by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Reported by: cperciva@
Reviewed by: cperciva@, Intel Networking
Approved by: re
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D17061

5 years agocpucontrol: correct typo
emaste [Tue, 11 Sep 2018 17:09:16 +0000 (17:09 +0000)]
cpucontrol: correct typo

There should be no 't' in processort_rev_id.

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

5 years agoAdd u3g ppp.conf entry. It provides some starting point to making
trasz [Tue, 11 Sep 2018 17:05:26 +0000 (17:05 +0000)]
Add u3g ppp.conf entry. It provides some starting point to making
use of u3g(4) dongles, and in many cases can work out of the box.

Reviewed by: hselasky
Approved by: re (gjb)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16974

5 years agoMinor usability improvements to geom(8).
trasz [Tue, 11 Sep 2018 16:46:28 +0000 (16:46 +0000)]
Minor usability improvements to geom(8).

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

5 years agoMake the wait in cfiscsi_offline() interruptible. This is the second half
trasz [Tue, 11 Sep 2018 11:39:59 +0000 (11:39 +0000)]
Make the wait in cfiscsi_offline() interruptible.  This is the second half
of the fix/workaround for the "ctld hanging on reload" problem.

PR: 220175
Reported by: Eugene M. Zheganin <emz at norma.perm.ru>
Tested by: Eugene M. Zheganin <emz at norma.perm.ru>
Approved by: re (kib)
MFC after: 2 weeks
Sponsored by: playkey.net

5 years ago[bcm283x_pwm] Add documentation for the second PWM channel
gonzo [Mon, 10 Sep 2018 22:48:26 +0000 (22:48 +0000)]
[bcm283x_pwm] Add documentation for the second PWM channel

Document sysctls for the second PWM channel added in r335855
Also fix some minor style issues and a typo.

Approved by: re (gjb)
Submitted by: bobf@mrp3.com
Reviewed by: 0mp
Differential Revision: https://reviews.freebsd.org/D17084

5 years agoAdd vt(4) INDEX.fonts
emaste [Mon, 10 Sep 2018 20:46:17 +0000 (20:46 +0000)]
Add vt(4) INDEX.fonts

PR: 231237
Submitted by: Martin <martin.jakob@gmx.com> (original version)
Approved by: re (gjb, kib)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoThrough a combination of insufficient variable initialization and
des [Mon, 10 Sep 2018 19:39:20 +0000 (19:39 +0000)]
Through a combination of insufficient variable initialization and
imprudent reuse of static buffers, the end-of-transfer statistics
displayed when stdout is not a tty always ended up as 0 B / 0 Bps.
Reorganize the code to use caller-provided buffers, tweak the ETA
display a bit, and reduce the visual differences between the tty and
non-tty end-of-transfer displays.

PR: 202424
Approved by: re (gjb@)

5 years agoFix synchronization of LB group access.
markj [Mon, 10 Sep 2018 19:00:29 +0000 (19:00 +0000)]
Fix synchronization of LB group access.

Lookups are protected by an epoch section, so the LB group linkage must
be a CK_LIST rather than a plain LIST.  Furthermore, we were not
deferring LB group frees, so in_pcbremlbgrouphash() could race with
readers and cause a use-after-free.

Reviewed by: sbruno, Johannes Lundberg <johalun0@gmail.com>
Tested by: gallatin
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17031

5 years agoSplit some checks in vm_page_activate() to make it easier to read.
markj [Mon, 10 Sep 2018 18:59:23 +0000 (18:59 +0000)]
Split some checks in vm_page_activate() to make it easier to read.

No functional change intended.

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

5 years agoUpgrade Unbound to 1.7.3. More to follow.
des [Mon, 10 Sep 2018 17:37:34 +0000 (17:37 +0000)]
Upgrade Unbound to 1.7.3.  More to follow.

Approved by: re (kib@)

5 years agoUpgrade Unbound to 1.7.2. More to follow.
des [Mon, 10 Sep 2018 16:56:44 +0000 (16:56 +0000)]
Upgrade Unbound to 1.7.2.  More to follow.

Approved by: re (kib@)

5 years agoUpgrade to OpenSSH 7.8p1.
des [Mon, 10 Sep 2018 16:20:12 +0000 (16:20 +0000)]
Upgrade to OpenSSH 7.8p1.

Approved by: re (kib@)

5 years agoAdd myself to committers-ports.dot
manu [Mon, 10 Sep 2018 15:59:37 +0000 (15:59 +0000)]
Add myself to committers-ports.dot

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

5 years agoCorrect directions for building pxeboot. One needs to cd to src/stand,
imp [Mon, 10 Sep 2018 15:16:33 +0000 (15:16 +0000)]
Correct directions for building pxeboot. One needs to cd to src/stand,
not src/stand/i386 as the directions say.

PR: 231284
Approved by: re@ (gjb)

5 years agogeli init with multiple providers - fix init and fix -B "none"
woodsb02 [Mon, 10 Sep 2018 14:50:34 +0000 (14:50 +0000)]
geli init with multiple providers - fix init and fix -B "none"

Apply some fixes post rS336659, which allowed multiple provders to be
initialized in a single command.
- Fix issue where second and subsequent providers would fail init.
  This was due to the metadata struct being zeroed after the first
  provider init was completed, despite containing common data required
  for subsequent providers.
- Fix issue where -B "none" would still result in the metadata being
  backed-up if multiple providers had been specified. This was due to
  the backupfile of "none" being incorrectly made unique for each
  provider by appending "-<prov>".

Approved by: asomers
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17096

5 years agoAllow dhclient and ping to build WITHOUT_DYNAMICROOT
emaste [Sun, 9 Sep 2018 17:26:44 +0000 (17:26 +0000)]
Allow dhclient and ping to build WITHOUT_DYNAMICROOT

dhclient and ping normally use libcasper services.  These are not
available in statically-linked binaries, so when WITHOUT_DYNAMICROOT is
set disable libcasper use, as with rescue builds.  Also emit a warning
as it's undesirable to build this way.

Reported by: Michael Dexter
Reviewed by: rgrimes
Tested by: Michael Dexter
Approved by: re (kib)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17074

5 years agorandom(4): Squash non-error timeout codes from tsleep(9).
delphij [Sun, 9 Sep 2018 17:12:31 +0000 (17:12 +0000)]
random(4): Squash non-error timeout codes from tsleep(9).

In both scenarios a timeout (EWOULDBLOCK) is considered as a
normal condition and the error should not pop up to upper layers.

PR: 231181
Submitted by: cem
Reported by: lev
Reviewed by: vangyzen, markm, delphij
Approved by: re (kib)
Approved by: secteam (delphij)
Differential Revision: https://reviews.freebsd.org/D17049

5 years agoIntroduce and use sgid_index in CM requests in ibcore.
hselasky [Sun, 9 Sep 2018 07:20:15 +0000 (07:20 +0000)]
Introduce and use sgid_index in CM requests in ibcore.

For RoCE, when CM requests are received for RC and UD connections,
netdevice of the incoming request is unavailable. Because of that CM
requests are always forwarded to init_net namespace.

Now that we have the GID index available, introduce SGID index in
incoming CM requests and refer to the netdevice of it.

While at it fix some incorrect uses of init_net and make sure
the rdma_create_id() function stores the VNET it is passed.

Based on linux commit:
cee104334c98dd04e9dd4d9a4fa4784f7f6aada9

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

5 years agolibsa: validate tftp_makereq() after we did reset the read
tsoome [Sun, 9 Sep 2018 06:30:15 +0000 (06:30 +0000)]
libsa: validate tftp_makereq() after we did reset the read

The name check referred in the comment is not the only possible error source,
we need to validate the result.

Reviewed by: allanjude
Approved by: re (kib)
Differential Revision: https://reviews.freebsd.org/D17081

5 years agoFix the 32-bit arm build.
markj [Sat, 8 Sep 2018 23:39:26 +0000 (23:39 +0000)]
Fix the 32-bit arm build.

X-MFC with:     r338537
Approved by: re (rgrimes)
Sponsored by: The FreeBSD Foundation

5 years agoExclude the EFI framebuffer from phys_avail[] on arm64.
markj [Sat, 8 Sep 2018 21:52:44 +0000 (21:52 +0000)]
Exclude the EFI framebuffer from phys_avail[] on arm64.

On the ThunderX the region occupied by the framebuffer is included in
the EFI map, so explicitly add it to the set of regions that aren't
managed by the physical memory allocator.

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

5 years agoBump MAX_HWCNT and MAX_EXCNT.
markj [Sat, 8 Sep 2018 21:51:47 +0000 (21:51 +0000)]
Bump MAX_HWCNT and MAX_EXCNT.

These limits are hit on the ThunderX.  Also make
arm_physmem_exclude_region() panic rather than fail silently if the
limit on excluded regions is reached.

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

5 years agoRelax an assertion in vm_pqbatch_process_page().
markj [Sat, 8 Sep 2018 21:49:43 +0000 (21:49 +0000)]
Relax an assertion in vm_pqbatch_process_page().

While executing vm_pqbatch_process_page(m), m->queue may change to
PQ_NONE if the page daemon is concurrently freeing the page.  In this
case m's queue state flags must be clear, so vm_pqbatch_process_page()
will be a no-op, but the race could cause spurious assertion failures.
Correct the assertion which assumed that m->queue's value does not
change while the page queue lock is held.

Reviewed by: alc, kib
Reported and tested by: pho
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17027

5 years agolibsa: memory leak in tftp_open()
tsoome [Sat, 8 Sep 2018 19:17:22 +0000 (19:17 +0000)]
libsa: memory leak in tftp_open()

tftpfile is allocated just above and needs to be freed.

Reviewed by: imp
Approved by: re (kib)
Differential Revision: https://reviews.freebsd.org/D17058

5 years agointelspi: don't leak spibus children on detach.
kib [Sat, 8 Sep 2018 18:57:29 +0000 (18:57 +0000)]
intelspi: don't leak spibus children on detach.

Submitted by: Yuri Pankov
MFC after: 1 week
Approved by: re (gjb)
Differential revision: https://reviews.freebsd.org/D17076

5 years agoImprove handling of the EFI map types[] array.
kib [Sat, 8 Sep 2018 18:57:05 +0000 (18:57 +0000)]
Improve handling of the EFI map types[] array.

Use nitems(), do not assume EFI_MD_TYPE_ contiguous allocation, in
particular, switch to use designated array initializers.

Reviewed by: jhb (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (gjb)

5 years agoRemove strings from OptionalObsoleteFiles.inc
emaste [Fri, 7 Sep 2018 23:12:17 +0000 (23:12 +0000)]
Remove strings from OptionalObsoleteFiles.inc

Since r326030 strings is installed unconditionally so should not be
removed when WITHOUT_TOOLCHAIN is set.

Reported by: Dan McGregor
Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

5 years agoSpecify the correct resource type in teardown paths.
markj [Fri, 7 Sep 2018 21:12:37 +0000 (21:12 +0000)]
Specify the correct resource type in teardown paths.

Submitted by: Yuri Pankov <yuripv@yuripv.net>
Approved by: re (kib)
MFC after: 1 week

5 years agoUse ratecheck(9) in in_pcbinslbgrouphash().
markj [Fri, 7 Sep 2018 21:11:41 +0000 (21:11 +0000)]
Use ratecheck(9) in in_pcbinslbgrouphash().

Reviewed by: bz, Johannes Lundberg <johalun0@gmail.com>
Approved by: re (kib)
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D17065

5 years agoImplement get network interface by params function in ipoib.
hselasky [Fri, 7 Sep 2018 18:05:09 +0000 (18:05 +0000)]
Implement get network interface by params function in ipoib.

Also fix the validate_ipv4_net_dev() and validate_ipv6_net_dev() functions
which had source and destination addresses swapped, and didn't set the
scope ID for IPv6 link-local addresses.

This allows applications like krping to work using IPoIB devices.

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

5 years agoIncrease size of working imgfile from 250MB to 4GB
rgrimes [Fri, 7 Sep 2018 15:52:20 +0000 (15:52 +0000)]
Increase size of working imgfile from 250MB to 4GB

Submitted by: dexter
Approved by: re(gjb), phk (mentor)
MFC after: 3 days

5 years agoRemove rsync to phk's server
rgrimes [Fri, 7 Sep 2018 15:48:01 +0000 (15:48 +0000)]
Remove rsync to phk's server

Submitted by: dexter
Approved by: re(gjb), phk (mentor)
MFC after: 3 days

5 years agoTeach sysctl(8) about the Persistent memory type.
kib [Fri, 7 Sep 2018 15:09:56 +0000 (15:09 +0000)]
Teach sysctl(8) about the Persistent memory type.

Add PersistentMemory to the list of sysctl's known memory types
when decoding an EFI memory map.

Submitted by: D Scott Phillips <d.scott.phillips@intel.com>
MFC after: 1 week
Approved by: re (rgrimes)

5 years agoTrim whitespace.
kib [Fri, 7 Sep 2018 14:37:44 +0000 (14:37 +0000)]
Trim whitespace.

Approved by: re (gjb)

5 years agoUpdate head from ALPHA4 to ALPHA5 as part of the 12.0-RELEASE
gjb [Fri, 7 Sep 2018 00:00:31 +0000 (00:00 +0000)]
Update head from ALPHA4 to ALPHA5 as part of the 12.0-RELEASE
cycle.

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

5 years agoThe Call For Testing had no reports of operational problems and
mckusick [Thu, 6 Sep 2018 23:28:35 +0000 (23:28 +0000)]
The Call For Testing had no reports of operational problems and
found that performance was no worse and usually better when running
with TRIM consolidation. Performance improvement was most noticable
when multiple large files are released in a short period of time.

Thus, TRIM consolidation is being enabled by default. Should
operational problems be found, it can be disabled using the command
`sysctl vfs.ffs.dotrimcons=0'. This variable can also be set as a
tunable if early disabling is necessary.

Approved by:  re (gjb)
Sponsored by: Netflix

5 years agoAvoid uninitialized read of ext_csd.
marius [Thu, 6 Sep 2018 21:24:14 +0000 (21:24 +0000)]
Avoid uninitialized read of ext_csd.

Reported by:    Coverity
CID:            1395275
Approved by: re (gjb, kib)

5 years ago- Explicitly compare a pointer to NULL. The __builtin_expect() of clang
marius [Thu, 6 Sep 2018 21:09:54 +0000 (21:09 +0000)]
- Explicitly compare a pointer to NULL. The __builtin_expect() of clang
  3.4.1 otherwise isn't able to cope with the expression.
- Fix a nearby whitespace bug.

Approved by: re (gjb, kib)

5 years agobhyve: Use MAP_GUARD when mapping guest memory ranges.
jhb [Thu, 6 Sep 2018 20:29:40 +0000 (20:29 +0000)]
bhyve: Use MAP_GUARD when mapping guest memory ranges.

Instead of relying on PROT_NONE mappings with MAP_ANON, use MAP_GUARD
to reserve address space around guest memory ranges including the
guard ranges of address space around mappings.

Submitted by: Shawn Webb
Reviewed by: araujo
Approved by: re (rgrimes)
MFC after: 1 month
Sponsored by: HardendBSD and G2, Inc
Differential Revision: https://reviews.freebsd.org/D16822

5 years agoUse the correct terminology.
markj [Thu, 6 Sep 2018 20:02:19 +0000 (20:02 +0000)]
Use the correct terminology.

Reported by:    kib
Approved by: re (gjb)
Differential revision:  https://reviews.freebsd.org/D16191

5 years agoThe inp_lle field to struct inpcb, along with two "valid" flags
bz [Thu, 6 Sep 2018 19:55:40 +0000 (19:55 +0000)]
The inp_lle field to struct inpcb, along with two "valid" flags
for the rt and lle cache were added in r191129 (2009).
To my best knowledge they have never been used and route caching
has converted the inp_rt field from that commit to inp_route
rendering this field and these flags obsolete.

Convert the pointer into a spare pointer to not change the size of
the structure anymore (and to have a spare pointer) and mark the
two fields as unused.

Reviewed by: markj, karels
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17062

5 years agoamd64: depessimize copyinstr_smap
mjg [Thu, 6 Sep 2018 19:42:40 +0000 (19:42 +0000)]
amd64: depessimize copyinstr_smap

The stac/clac combo around each byte copy is causing a measurable
slowdown in benchmarks. Do it only before and after all data is
copied. While here reorder the code to avoid a forward branch in
the common case.

Note the copying loop (originating from copyinstr) is avoidably slow
and will be fixed later.

Reviewed by: kib
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17063

5 years agoAvoid resource deadlocks when one domain has exhausted its memory. Attempt
markj [Thu, 6 Sep 2018 19:28:52 +0000 (19:28 +0000)]
Avoid resource deadlocks when one domain has exhausted its memory. Attempt
other allowed domains if the requested domain is below the minimum paging
threshold.  Block in fork only if all domains available to the forking
thread are below the severe threshold rather than any.

Submitted by: jeff
Reported by: mjg
Reviewed by: alc, kib, markj
Approved by: re (rgrimes)
Differential Revision: https://reviews.freebsd.org/D16191

5 years agoRe-enable kernel modules for the MALTA64EL kernel configuration.
jhb [Thu, 6 Sep 2018 19:21:31 +0000 (19:21 +0000)]
Re-enable kernel modules for the MALTA64EL kernel configuration.

Update the BOOTSTRAPPING check for libelf to require the fix for
mips64el object files committed in r338478 and re-enable kernel
modules in the MALTA64EL config file.

Reviewed by: emaste
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17054

5 years agoClean up iflib sysctls
shurd [Thu, 6 Sep 2018 18:51:52 +0000 (18:51 +0000)]
Clean up iflib sysctls

Remove sysctls:
txq_drain_encapfail - now a duplicate of encap_txd_encap_fail
intr_link - was never incremented
intr_msix - was never incremented
rx_zero_len - was never incremented

The following were not incremented in all code-paths that apply:
m_pullups, mbuf_defrag, rxd_flush, tx_encap, rx_intr_enables, tx_frees,
encap_txd_encap_fail.

Fixes:
Replace the broken collapse_pkthdr() implementation with an MPASS().
fl_refills and fl_refills_large were not incremented when using netmap.

Reviewed by: gallatin
Approved by: re (marius)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D16733

5 years agoAdd device_attach and device_detach events to man page.
bwidawsk [Thu, 6 Sep 2018 18:45:31 +0000 (18:45 +0000)]
Add device_attach and device_detach events to man page.

Approved by: bcr, emaste (mentor), imp, jhb
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17052

5 years agoAdd MPLS LSP-echo (RFC8029, March 2017) port.
obrien [Thu, 6 Sep 2018 18:34:11 +0000 (18:34 +0000)]
Add MPLS LSP-echo (RFC8029, March 2017) port.

Reviewed by: stevek
Approved by: re(gjb)
Obtained from: Juniper Networks

5 years agoFix the GIC ACPI cross reference value.
andrew [Thu, 6 Sep 2018 17:25:50 +0000 (17:25 +0000)]
Fix the GIC ACPI cross reference value.

To support INTRNG with ACPI we need to set a non-zero cross reference value
for the interrupt controller. The GICv3 driver already had this value set,
however it was missed in the GICv2 driver. Fix this by setting xref to the
correct value.

Approved by: re (gjb)

5 years agoRemove the check that the Arm generic interrupt controller variant is
andrew [Thu, 6 Sep 2018 17:25:01 +0000 (17:25 +0000)]
Remove the check that the Arm generic interrupt controller variant is
non-zero. This is the case on qemu, so remove it to allow us to boot there.
This change is needed to boot on qemu with ACPI.

Approved by: re (gjb)

5 years agopowerpc64: Add initial support for HTM (kABI)
leitao [Thu, 6 Sep 2018 17:07:21 +0000 (17:07 +0000)]
powerpc64: Add initial support for HTM (kABI)

This patch adds the very initial support for HTM that might come at FreeBSD
version 12.1. This basic support defines a new kABI, so, we do not need to change
it later during 12.1 time frame, when the full implementation will come.

Reviewed by: jhibbits
Approved by: re(marius), jhibbits (mentor)
Differential Revision: https://reviews.freebsd.org/D16889

5 years agoRemove vm_page_remque().
markj [Thu, 6 Sep 2018 16:17:45 +0000 (16:17 +0000)]
Remove vm_page_remque().

Testing m->queue != PQ_NONE is not sufficient; see the commit log
message for r338276.  As of r332974 vm_page_dequeue() handles
already-dequeued pages, so just replace vm_page_remque() calls with
vm_page_dequeue() calls.

Reviewed by: kib
Tested by: pho
Approved by: re (marius)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17025

5 years agoMake tcp_hpts.c compile a LINT kernel with options RSS and PCBGROUPS added by
bz [Thu, 6 Sep 2018 16:11:24 +0000 (16:11 +0000)]
Make tcp_hpts.c compile a LINT kernel with options RSS and PCBGROUPS added by
adding the missing include files and changing a the type of cpuid which
would otherwise cause a false comparison with NETISR_CPUID_NONE.

Reviewed by: rrs
Approved by: re (marius)
Differential Revision: https://reviews.freebsd.org/D16891

5 years agoMove etc/crontab to usr.sbin/cron/cron/
brd [Thu, 6 Sep 2018 14:55:54 +0000 (14:55 +0000)]
Move etc/crontab to usr.sbin/cron/cron/

Approved by: re (gjb), will (mentor)
Differential Revision: https://reviews.freebsd.org/D16786

5 years agoDefine sctp probes only when SCTP is configured.
markj [Thu, 6 Sep 2018 14:15:03 +0000 (14:15 +0000)]
Define sctp probes only when SCTP is configured.

Otherwise the "depends_on provider" guard in sctp.d does not work as
intended.

Reported by: mjg
Reviewed by: tuexen
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17057