]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agotinderbox: Give details about kernel builds.
bdrewery [Wed, 27 Jun 2018 16:57:59 +0000 (16:57 +0000)]
tinderbox: Give details about kernel builds.

This is a bit noisy now but it was silent before leading to
wondering if it was doing anything.

MFC after: 1 week
Suggested by: rpokala
Sponsored by: Dell EMC

5 years agoClang: Only build needed target for bootstrap compiler.
bdrewery [Wed, 27 Jun 2018 16:57:56 +0000 (16:57 +0000)]
Clang: Only build needed target for bootstrap compiler.

This will disable the new LLVM_TARGET_ALL option which will only
enable the required target.

This only impacts the bootstrap compiler in WORLDTMP, not the target compiler
that will be installed.

MFC after: 2 weeks
Reviewed by: sbruno, dim (earlier version)
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D16021

5 years agoAdd LLVM_TARGET_ALL option.
bdrewery [Wed, 27 Jun 2018 16:57:51 +0000 (16:57 +0000)]
Add LLVM_TARGET_ALL option.

LLVM_TARGET_* will auto be set based on LLVM_TARGET_ALL and MK_CLANG.

If LLVM_TARGET_ALL is disabled, during a cross-build, then SYSTEM_COMPILER
and SYSTEM_LINKER are auto disabled.

This option should be used by users rather than the per-arch LLVM_TARGET
options as it is simpler to maintain for them should the supported
target list change.

MFC after: 2 weeks
Reviewed by: sbruno, dim
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D16020

5 years agoUse dependent options to auto enable _SUPPORT and CLANG_FULL options.
bdrewery [Wed, 27 Jun 2018 16:57:47 +0000 (16:57 +0000)]
Use dependent options to auto enable _SUPPORT and CLANG_FULL options.

MFC after: 1 week
Reviewed by: sbruno, dim
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D16018

5 years agoRework check for libclang_rt to see if the needed library exists.
bdrewery [Wed, 27 Jun 2018 16:56:46 +0000 (16:56 +0000)]
Rework check for libclang_rt to see if the needed library exists.

Currently libclang_rt is not provided for cross-building and as such
is not connected to cross-tools.  For building clang once in universe
it is likely that libclang_rt won't exist for the universe toolchain
but even if it did it would not support anything but the native arch.
So explicitly check for support before enabling h_raw.

MFC after: 1 week
Reviewed by: dim
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D16012

5 years agoaudit(4): fix Coverity issues
asomers [Wed, 27 Jun 2018 15:28:09 +0000 (15:28 +0000)]
audit(4): fix Coverity issues

Fix several incorrect buffer size arguments and a file descriptor leak.

Submitted by: aniketp
Reported by: Coverity
CID: 1393489 1393501 1393509 1393510 1393514 1393515 1393516
CID: 1393517 1393518 1393519
MFC after: 2 weeks
X-MFC-With: 335284
X-MFC-With: 335318
X-MFC-With: 335320
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D16000

5 years agoSplit kern_break from sys_break and use it in linuxulator
emaste [Wed, 27 Jun 2018 14:45:13 +0000 (14:45 +0000)]
Split kern_break from sys_break and use it in linuxulator

Previously the linuxulator's linux_brk invoked the FreeBSD sys_break
syscall implementation directly.  Instead, move the bulk of the existing
implementation to kern_break, and call that from both sys_break and
linux_brk.

This also addresses a minor bug in linux_brk in that we now return the
actual (rounded up) break address, rather than the requested value.

Reviewed by: brooks (earlier version)
Sponsored by: Turing Robotic Industries
Differential Revision: https://reviews.freebsd.org/D16019

5 years agocxgbe/cxgbei: Fix harmful typo in the iSCSI offload driver.
np [Wed, 27 Jun 2018 14:29:13 +0000 (14:29 +0000)]
cxgbe/cxgbei: Fix harmful typo in the iSCSI offload driver.

Reported by: gcc8 (via mmacy@)
MFC after: 3 days
Sponsored by: Chelsio Communications

5 years agoImprove the kernel's USB descriptor reading function.
hselasky [Wed, 27 Jun 2018 12:08:12 +0000 (12:08 +0000)]
Improve the kernel's USB descriptor reading function.
Some USB devices does not allow a partial descriptor readout.

Found by: bz@
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoRevert Makefile@335696 that sneaked into the commit.
delphij [Wed, 27 Jun 2018 06:50:24 +0000 (06:50 +0000)]
Revert Makefile@335696 that sneaked into the commit.

X-MFC with: 335696
MFC after: 2 weeks

5 years agoDetect exFAT filesystems and abort if found and tighten BPB sanity
delphij [Wed, 27 Jun 2018 06:49:20 +0000 (06:49 +0000)]
Detect exFAT filesystems and abort if found and tighten BPB sanity
check.

Obtained from: Android https://android-review.googlesource.com/61827
MFC after: 2 weeks

5 years agoRemove devctl_safe_quote since it's now unused.
imp [Wed, 27 Jun 2018 04:11:19 +0000 (04:11 +0000)]
Remove devctl_safe_quote since it's now unused.

Sponsored by: Netflix
Differential Review: https://reviews.freebsd.org/D16026

5 years agopccard: recode to use devctl_safe_quote_sb instead of devctl_safe_quote.
imp [Wed, 27 Jun 2018 04:11:14 +0000 (04:11 +0000)]
pccard: recode to use devctl_safe_quote_sb instead of devctl_safe_quote.

Sponsored by: Netflix
Differential Review: https://reviews.freebsd.org/D16026

5 years agoFix devctl generation for core files.
imp [Wed, 27 Jun 2018 04:11:09 +0000 (04:11 +0000)]
Fix devctl generation for core files.

We have a problem with vn_fullpath_global when the file exists. Work
around it by printing the full path if the core file name starts with /,
or current working directory followed by the filename if not.

Sponsored by: Netflix
Differential Review: https://reviews.freebsd.org/D16026

5 years agoCreate new devctl_safe_quote_sb to copy a source string into a struct
imp [Wed, 27 Jun 2018 04:10:48 +0000 (04:10 +0000)]
Create new devctl_safe_quote_sb to copy a source string into a struct
sbuf to make it safe. Callers are expected to add the " " around it,
if needed.

Sponsored by: Netflix
Differential Review: https://reviews.freebsd.org/D16026

5 years ago- Added myself to committers-src.dot
miwi [Wed, 27 Jun 2018 03:50:11 +0000 (03:50 +0000)]
- Added myself to committers-src.dot

Approved by: araujo (mentor)
Differential Revision: https://reviews.freebsd.org/D16030

5 years agotop(1): increased the maximum length of command shown by "-a"
daichi [Wed, 27 Jun 2018 02:55:30 +0000 (02:55 +0000)]
top(1): increased the maximum length of command shown by "-a"

Reviewed by: eadler
Approved by: gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D16006

5 years agocxgbe(4): Do not leak the filters in the hashfilter table on module
np [Wed, 27 Jun 2018 01:51:17 +0000 (01:51 +0000)]
cxgbe(4): Do not leak the filters in the hashfilter table on module
unload.

MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agopowerd: correct ifdef check for ppc
eadler [Wed, 27 Jun 2018 01:28:09 +0000 (01:28 +0000)]
powerd: correct ifdef check for ppc

Reviewed by: jhibbits

5 years agoPartial revert of r335399 and r335400:
stevek [Tue, 26 Jun 2018 23:28:03 +0000 (23:28 +0000)]
Partial revert of r335399 and r335400:
Unhook the MAC/veriexec, fingerprint handlers, and veriexec modules from
the kernel modules Makefile.

Reviewed by: sjg

5 years agoRevert r335402
stevek [Tue, 26 Jun 2018 23:19:55 +0000 (23:19 +0000)]
Revert r335402

While useful as an example, veriexecctl, as it is, has very little practical
use, since there is nothing ensuring the integrity of the manifest of hashes.
A more appropriate set of utilities will replace it.

5 years agocxgbetool(8): Reject invalid VLAN values.
np [Tue, 26 Jun 2018 21:56:06 +0000 (21:56 +0000)]
cxgbetool(8): Reject invalid VLAN values.

Submitted by: Krishnamraju Eraparaju @ Chelsio
MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agoaudit(4): add tests for the process-control audit class
asomers [Tue, 26 Jun 2018 20:26:57 +0000 (20:26 +0000)]
audit(4): add tests for the process-control audit class

Tested syscalls include rfork(2), chdir(2), fchdir(2), chroot(2),
getresuid(2), getresgid(2), setpriority(2), setgroups(2), setpgrp(2),
setrlimit(2), setlogin(2), mlock(2), munlock(2), minherit(2), rtprio(2),
profil(2), ktrace(2), ptrace(2), fork(2), umask(2), setuid(2), setgid(2),
seteuid(2), and setegid(2).  The last six are only tested in the success
case, either because they're infalliable or a failure is difficult to cause
on-demand.

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15966

5 years ago[libcasper] Use explicit_bzero instead of memset to clear pwd struct
oshogbo [Tue, 26 Jun 2018 19:57:47 +0000 (19:57 +0000)]
[libcasper] Use explicit_bzero instead of memset to clear pwd struct

Submitted by: David Carlier <devnexen@gmail.com>
Differential Revision: https://reviews.freebsd.org/D16015

5 years agoaudit(4): add tests for pipe, posix_openpt, shm_open, and shm_unlink
asomers [Tue, 26 Jun 2018 19:26:07 +0000 (19:26 +0000)]
audit(4): add tests for pipe, posix_openpt, shm_open, and shm_unlink

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15963

5 years agoCorrect linprocfs/linsysfs arch check in r335672
emaste [Tue, 26 Jun 2018 19:13:49 +0000 (19:13 +0000)]
Correct linprocfs/linsysfs arch check in r335672

Pointy hat to: emaste

5 years agoFix file(1) dumpdate reporting for dump(8) files
gonzo [Tue, 26 Jun 2018 18:53:52 +0000 (18:53 +0000)]
Fix file(1) dumpdate reporting for dump(8) files

Magic file for dump(8) had this dump and previous dump dates reversed.
Fix order for all three flavours of the dump(8) format.
This fix was committed to upstream repo as magic/Magdir/dump,v 1.17
and will be merged during next vendor import.

PR: 223155
MFC after: 2 weeks

5 years agoUpdate the physical page selection strategy used by vm_page_import() so
alc [Tue, 26 Jun 2018 18:29:56 +0000 (18:29 +0000)]
Update the physical page selection strategy used by vm_page_import() so
that it does not cause rapid fragmentation of the free physical memory.

Reviewed by: jeff, markj (an earlier version)
Differential Revision: https://reviews.freebsd.org/D15976

5 years agogeli attach multiple providers
woodsb02 [Tue, 26 Jun 2018 18:07:16 +0000 (18:07 +0000)]
geli attach multiple providers

Allow attaching of multiple geli providers at once if they use same
passphrase and keyfiles.

This is helpful when the providers being attached are not used for boot,
and therefore the existing code to first try the cached password when
tasting the providers during boot does not apply.

Multiple providers with the same passphrase and keyfiles can be attached
at the same time during system start-up by adding the following to
rc.conf:
  geli_groups="storage backup"
  geli_storage_flags="-k /etc/geli/storage.keys"
  geli_storage_devices="ada0 ada1"
  geli_backup_flags="-j /etc/geli/backup.passfile -k /etc/geli/backup.keys"
  geli_backup_devices="ada2 ada3"

Reviewed by: wblock, delphij, jilles
Approved by: sobomax (src), bcr (doc)
Differential Revision: https://reviews.freebsd.org/D12644

5 years agoBuild linprocfs and linsysfs also on arm64
emaste [Tue, 26 Jun 2018 16:50:41 +0000 (16:50 +0000)]
Build linprocfs and linsysfs also on arm64

Sponsored by: Turing Robotic Industries

5 years agoatomic.9: Add missing MLINK for testandclear, thread_fence routines
cem [Tue, 26 Jun 2018 16:20:19 +0000 (16:20 +0000)]
atomic.9: Add missing MLINK for testandclear, thread_fence routines

Missed in r299912, r326982.

X-MFC-With: r299912, r326982
Sponsored by: Dell EMC Isilon

5 years agoImprove the userspace USB string reading function in LibUSB.
hselasky [Tue, 26 Jun 2018 16:00:16 +0000 (16:00 +0000)]
Improve the userspace USB string reading function in LibUSB.
Some USB devices does not allow a partial descriptor readout.

Found by: bz @
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoxen: obtain vCPU ID from CPUID
royger [Tue, 26 Jun 2018 15:00:54 +0000 (15:00 +0000)]
xen: obtain vCPU ID from CPUID

The Xen vCPU ID can be fetched from the cpuid instead of inferring it
from the ACPI ID.

Sponsored by: Citrix Systems R&D

5 years agoxen: limit the number of hypercall pages to 1
royger [Tue, 26 Jun 2018 14:39:27 +0000 (14:39 +0000)]
xen: limit the number of hypercall pages to 1

The interface already guarantees that the number of hypercall pages is
always going to be 1, see the comment in interface/arch-x86/cpuid.h

Sponsored by: Citrix Systems R&D

5 years agoUse the 'Updating from Source' Handbook section in UPDATING.
gjb [Tue, 26 Jun 2018 14:30:33 +0000 (14:30 +0000)]
Use the 'Updating from Source' Handbook section in UPDATING.

PR: 229345 (related)
Sponsored by: The FreeBSD Foundation

5 years agoxen-netback: fix LOR
royger [Tue, 26 Jun 2018 14:07:11 +0000 (14:07 +0000)]
xen-netback: fix LOR

lock order reversal: (sleepable after non-sleepable)
 1st 0xfffffe00357ff538 xnb_softc (xen netback softc lock) @ /usr/src/sys/dev/xen/netback/netback.c:1069
 2nd 0xffffffff81fdccb0 intrsrc (intrsrc) @ /usr/src/sys/x86/x86/intr_machdep.c:224

There's no need to hold the lock since the cleaning of the interrupt
cannot happen in parallel due to the XNBF_IN_SHUTDOWN flag being set.
Note that the locking in netback needs some improvement or
clarification.

While there also remove a double newline.

Sponsored by:   Citrix Systems R&D

5 years agoAdd missing MLINK.
markj [Tue, 26 Jun 2018 09:30:14 +0000 (09:30 +0000)]
Add missing MLINK.

MFC after: 3 days

5 years agoFix division by zero when reading boot block by postponing division
delphij [Tue, 26 Jun 2018 06:18:59 +0000 (06:18 +0000)]
Fix division by zero when reading boot block by postponing division
until it is necessary and after we validated bytes per sector is non-
zero.

Obtained from: Android https://android-review.googlesource.com/c/platform/external/fsck_msdos/+/36362
MFC after: 2 weeks

5 years agoconfig(8): part of patch disappeared, don't close ifp at the end
kevans [Tue, 26 Jun 2018 04:06:49 +0000 (04:06 +0000)]
config(8): part of patch disappeared, don't close ifp at the end

5 years agoconfig(8): Flip the order of concatenation for `hints` and `env`
kevans [Tue, 26 Jun 2018 04:02:25 +0000 (04:02 +0000)]
config(8): Flip the order of concatenation for `hints` and `env`

As previously noted, kernel's processing of these means that the first
appearance of a hint/variable wins. Flipping the order of concatenation
means that later variables override earlier variables, as expected when one
does:

hints x
hints y

Where perhaps x is:

hint.aw_sid.0.disable=1

and y is:

hint.aw_sid.0.disable=0

The expectation would be that a later appearing variable would override an
earlier appearing variable, such as with `device`/`nodevice`, device.hints,
and other similarly structured data files.

5 years agoconfig(8): Make 'env' files consistent with other file-accepting options
kevans [Tue, 26 Jun 2018 03:56:10 +0000 (03:56 +0000)]
config(8): Make 'env' files consistent with other file-accepting options

Previously, only one 'env' file could be specified. Later 'env' directives
would overwrite earlier 'env' directives. This is inconsistent with every
other file-accepting directives which process files in order, including
hints.

A caveat applies to both hints and env that isn't mentioned: they're
concatenated in the order of appearance, so they're not actually applied in
the way one might think by supplying:

hints x
hints y

Hints in x will take precedence over same-name hints in y due to how
the kernel processes them, stopping at the first line that matches the hint
we're searching for. Future work will flip the order of concatenation so
that later files may still properly override earlier files.

In practice, this likely doesn't matter at all due to the nature of the
beast.

5 years agoconfig(8): Set envmode if we accept an envvar
kevans [Tue, 26 Jun 2018 02:05:45 +0000 (02:05 +0000)]
config(8): Set envmode if we accept an envvar

X-MFC-With: r335642

5 years agoUse buf + strategy rather than bypassing geom_vfs layer
imp [Tue, 26 Jun 2018 00:39:38 +0000 (00:39 +0000)]
Use buf + strategy rather than bypassing geom_vfs layer

The reference counting that's done in the geom_vfs layer to prevent
delivery of requests to defunct devices only works if all requests go
through that layer. UFS was bypassing that layer for BIO_DELETE requests,
sending them to the geom_consumer directly with g_io_request. Allocate
a buf, fill it in, and call strategy on it instead.

Submitted by: Chuck Silvers
Reviewed by: scottl, imp, kirk
Sponsored by: Netflix
Differential: https://reviews.freebsd.org/D15456

5 years agoMake cpu_set_syscall_retval common between the existing FreeBSD ABI and
andrew [Mon, 25 Jun 2018 22:36:25 +0000 (22:36 +0000)]
Make cpu_set_syscall_retval common between the existing FreeBSD ABI and
the Linuxulator. We need to translate error values onto Linux errno values
and return them to userspace when a syscall fails. We also need to preserve
x1 as all registers are preserved other than the return value.

Reviewed by: emaste
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D16008

5 years agoExpose stopped cpu contexts to ddb on PowerPC
jhibbits [Mon, 25 Jun 2018 22:05:33 +0000 (22:05 +0000)]
Expose stopped cpu contexts to ddb on PowerPC

Summary: In r220638, stoppcbs started being tracked. This never got exposed to
ddb though, so kdb_thr_ctx() didn't know how to look them up.

This allows switching to threads on stopped CPUs in kdb.

Submitted by: Brandon Bergren <git_bdragon.rkt0.net>
Differential Revision: https://reviews.freebsd.org/D15986

5 years agoAdd a file missed in r335645.
brd [Mon, 25 Jun 2018 21:54:39 +0000 (21:54 +0000)]
Add a file missed in r335645.

Approved by: brooks, allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D15360

5 years agolinux64: add arm64 linuxulator build details
emaste [Mon, 25 Jun 2018 20:33:04 +0000 (20:33 +0000)]
linux64: add arm64 linuxulator build details

The arm64 linuxulator needs different arguments for the objcopy
invocation used to build the linux VDSO.  These arguments are both arch-
and OS-dependent, so I did not try to use some common setting for them.

Reviewed by: imp
Sponsored by: Turing Robotic Industries
Differential Revision: https://reviews.freebsd.org/D16011

5 years agoNormalize the g(eom,cache,part,...) build.
brooks [Mon, 25 Jun 2018 19:55:15 +0000 (19:55 +0000)]
Normalize the g(eom,cache,part,...) build.

Rather then combining hardlink creation for the geom(8) binary with
shared library build, move libraries to src/lib/geom so they are
built and installed normally.  Create a common Makefile.classes
which is included by both lib/geom/Makefile and sbin/geom/Makefile
so the symlink and libraries stay in sync.

The relocation of libraries allows libraries to be build for 32-bit
compat.  This also reduces the number of non-standard builds in
the system.

This commit is not sufficent to run a 32-bit /sbin/geom on a 64-bit
system out of the box as it will look in the wrong place for libraries
unless GEOM_LIBRARY_PATH is set appropriatly in the environment.

Reviewed by: bdrewery
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15360

5 years agoQuiet unused fn warning for linuxulator w/o legacy syscalls
emaste [Mon, 25 Jun 2018 19:24:50 +0000 (19:24 +0000)]
Quiet unused fn warning for linuxulator w/o legacy syscalls

Sponsored by: Turing Robotic Industries

5 years agoconfig(8): Add `envvar` support
kevans [Mon, 25 Jun 2018 17:17:47 +0000 (17:17 +0000)]
config(8): Add `envvar` support

envvar allows adding individual environment variables to the kernel's static
environment without the overhead of pulling in a full file. envvar in a
config looks like:

envvar some_var=5

All envvar-provided variables will be added after the env file is processed,
so envvar keys that exist in the previous env will be overwritten by
whatever value is set here in the kernel configuration directly.

As an aside, envvar lines are intentionally tokenized differently from
basically every other line. We used a named state when ENVVAR is encountered
to gobble up the rest of the line, which will later be cleaned and validated
in post-processing by sanitize_envline. This turns out to be the simplest
and cleanest way to allow the flexibility that kenv does while not
compromising on silly hacks.

Reviewed by: ian (also contributor of sanitize_envline rewrite)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D15962

5 years agoFix a stack overflow in mount_smbfs when hostname is too long.
brooks [Mon, 25 Jun 2018 16:42:49 +0000 (16:42 +0000)]
Fix a stack overflow in mount_smbfs when hostname is too long.

The local hostname was blindly copied into the to the nn_name array.
When the hostname exceeded 16 bytes, it would overflow.  Truncate the
hostname to 15 bytes plus a 0 terminator which is the "workstation name"
suffix.

Use defensive strlcpy() when filling nn_name in all cases.

PR: 228354
Reported by: donald.buchholz@intel.com
Reviewed by: jpaetzel,  ian (prior version)
Discussed with: Security Officer (gtetlow)
MFC after: 3 days
Security: Stack overflow with the hostname.
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15936

5 years agoInitial arm64 linuxulator linux_sysvec
emaste [Mon, 25 Jun 2018 14:12:33 +0000 (14:12 +0000)]
Initial arm64 linuxulator linux_sysvec

This is sufficient to run Linux arm64 'hello world' and other simple
binaries.

Reviewed by: andrew
Sponsored by: Turing Robotic Industries
Differential Revision: https://reviews.freebsd.org/D15834

5 years agorusers: modernize a bit
eadler [Mon, 25 Jun 2018 11:44:56 +0000 (11:44 +0000)]
rusers: modernize a bit

5 years agorup: compile with WARNS=6
eadler [Mon, 25 Jun 2018 11:44:53 +0000 (11:44 +0000)]
rup: compile with WARNS=6

5 years agousers(1): Use capsicum helpers for users
eadler [Mon, 25 Jun 2018 11:44:41 +0000 (11:44 +0000)]
users(1): Use capsicum helpers for users

In doing so also fix the libcasper.h header to work in C++.

5 years agoDo not leave stray qword on top of stack for interrupts and exceptions
kib [Mon, 25 Jun 2018 11:29:04 +0000 (11:29 +0000)]
Do not leave stray qword on top of stack for interrupts and exceptions
without error code.  Doing so it mis-aligned the stack.

Since the only consumer of the SSE instructions with the alignment
requirements is AES-NI module, and since the FPU context cannot be
accessed in interrupts, the only situation where the alignment matter
are the compat32 syscalls, as reported in the PR.

PR: 229222
Reported and tested by:  dewayne@heuristicsystems.com.au
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoDo not access ISA timer if BIOS reports that there is no legacy
kib [Mon, 25 Jun 2018 11:24:26 +0000 (11:24 +0000)]
Do not access ISA timer if BIOS reports that there is no legacy
devices present.

On at least one machine where it would matter since the ISA timer is
power gated when booted in the UEFI mode, BIOS still reports that the
legacy devices are present.  That is, user still have to manually
disable TSC calibration on such machines.  Hopefully it will be more
useful in the future.

Discussed with: Ben Widawsky <benjamin.widawsky@intel.com>
Reviewed by: royger
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D16004
MFC after: 1 week

5 years agoFix compilation.
kib [Mon, 25 Jun 2018 11:12:21 +0000 (11:12 +0000)]
Fix compilation.

Pointy hat to: me
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoProvide a helper function acpi_get_fadt_bootflags() to fetch the FADT
kib [Mon, 25 Jun 2018 11:01:12 +0000 (11:01 +0000)]
Provide a helper function acpi_get_fadt_bootflags() to fetch the FADT
x86 boot flags.

Reviewed by: royger
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D16004
MFC after: 1 week

5 years agoAlways initialize the ignore local variable.
kib [Mon, 25 Jun 2018 10:52:41 +0000 (10:52 +0000)]
Always initialize the ignore local variable.

Reviewed by: royger
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D16004

5 years agovt: add option to ignore NO_VGA flag in ACPI
royger [Mon, 25 Jun 2018 09:39:16 +0000 (09:39 +0000)]
vt: add option to ignore NO_VGA flag in ACPI

To workaround buggy firmware that sets this flag when there's actually
a VGA present.

Reported and tested by: Yasuhiro KIMURA <yasu@utahime.org>
Sponsored by: Citrix Systems R&D
Reviewed by: kib
Differential revision: https://reviews.freebsd.org/D16003

5 years agoFix spelling of "reclamation".
ed [Mon, 25 Jun 2018 06:57:10 +0000 (06:57 +0000)]
Fix spelling of "reclamation".

5 years agodhclient: recorrect __progname to getprogname()
eadler [Mon, 25 Jun 2018 01:29:54 +0000 (01:29 +0000)]
dhclient: recorrect __progname to getprogname()

A more correct way to modernize code that uses __progname is to just
replace each occurance of it with a call to getprogname(3)

Reported by: ian
Reviewed by: imp

5 years ago[rpi] Fix compatiblity with upstream DTB for RPi 3B and 3B+
gonzo [Sun, 24 Jun 2018 23:19:31 +0000 (23:19 +0000)]
[rpi] Fix compatiblity with upstream DTB for RPi 3B and 3B+

Upstream dtb switched to using brcm,bcm2837 for platform
compatibility string. Patch platfrom and cpufreq compatiblity
data accordingly.

Submitted by: Sylvain Garrigues <sylgar@gmail.com>
Tested by: db@
Differential Revision: https://reviews.freebsd.org/D15998

5 years agoEnable TCP_FASTOPEN by default for FreeBSD 12.
sbruno [Sun, 24 Jun 2018 21:46:29 +0000 (21:46 +0000)]
Enable TCP_FASTOPEN by default for FreeBSD 12.

Submitted by: kbowling
Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D15959

5 years agoReap unused variable and assignment that had no effect. Noted by cross
sbruno [Sun, 24 Jun 2018 21:36:37 +0000 (21:36 +0000)]
Reap unused variable and assignment that had no effect.  Noted by cross
compiling with gcc on mips.

Reviewed by: mmacy

5 years agoAssuming that the intent (from the white space) is that the fprintf()
sbruno [Sun, 24 Jun 2018 21:19:08 +0000 (21:19 +0000)]
Assuming that the intent (from the white space) is that the fprintf()
be executed in the if() conditional.  If its not supposed to be printed
inside the conditional, then the braces should be removed and the extra
tabs on the fprintf() should be removed.

Noted by cross compilation with gcc-mips.

5 years agocheck-password.4th(8): Fix manual [in]accuracy
dteske [Sun, 24 Jun 2018 19:29:29 +0000 (19:29 +0000)]
check-password.4th(8): Fix manual [in]accuracy

SVN r280384 updated the maximum password length from 16 bytes to 255. The
manual was not updated to reflect this. Found while working on kern/207069.

MFC after: 3 days
X-MFC-to: stable/11 stable/10
Sponsored by: Smule, Inc.

5 years agoDon't use generic PCI_VENDOR and PCI_PRODUCT macros. Prefix them with
imp [Sun, 24 Jun 2018 19:01:01 +0000 (19:01 +0000)]
Don't use generic PCI_VENDOR and PCI_PRODUCT macros. Prefix them with
BKTR_ to avoid possible conflicts.

5 years agofix assert and conditionally allow mutexes to be held across epoch_wait_preempt
mmacy [Sun, 24 Jun 2018 18:57:06 +0000 (18:57 +0000)]
fix assert and conditionally allow mutexes to be held across epoch_wait_preempt

5 years agobhyve/vmrun.sh: make -L functional.
kib [Sun, 24 Jun 2018 15:22:38 +0000 (15:22 +0000)]
bhyve/vmrun.sh: make -L functional.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

5 years agodhclient: build with WARNS=6
eadler [Sun, 24 Jun 2018 13:23:27 +0000 (13:23 +0000)]
dhclient: build with WARNS=6

- add static in a number of places
- initialize __progname rather than rely on magical extern values
- use nitems() instead of manually spelling it out
- unshadow 'idi'
- teach 'error' that it is '__dead2'
- add missing 'break'

5 years agotop(1): increase field with width for W/CPU column
eadler [Sun, 24 Jun 2018 13:14:04 +0000 (13:14 +0000)]
top(1): increase field with width for W/CPU column

This allows 3 digit CPU columns to look nice

Reported by: feld

5 years agovm: stop passing M_ZERO when allocating radix nodes
mjg [Sun, 24 Jun 2018 13:08:05 +0000 (13:08 +0000)]
vm: stop passing M_ZERO when allocating radix nodes

Allocation explicitely initialized the 3 leading fields. The rest is an
array which is supposed to be NULL-ed prior to deallocation.

Delegate zeroing to the infrequently called object initializator.

This gets rid of one of the most common memset consumers.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D15989

5 years agoMakefiles: remove outdated comments
eadler [Sun, 24 Jun 2018 09:39:40 +0000 (09:39 +0000)]
Makefiles: remove outdated comments

5 years agonewfs: clean up warnings
eadler [Sun, 24 Jun 2018 05:40:42 +0000 (05:40 +0000)]
newfs: clean up warnings

- remove param: unused since r95357.
- correct definition of usage
- add explicit fallthrough notice. The existing one doesn't work with
our selection of "implicit-fallthrough" strictness.

This results in WARNS=6 building on amd64, but not other arches

5 years agoFix a comment; the ntp leaplist file is updated periodically, but not weekly
ian [Sun, 24 Jun 2018 03:31:23 +0000 (03:31 +0000)]
Fix a comment; the ntp leaplist file is updated periodically, but not weekly
(it's only updated when a check shows it's within 30 days of expiring).

PR: 207138

5 years agoModernize usage of "restrict" keyword in ntp.conf
ian [Sun, 24 Jun 2018 03:29:00 +0000 (03:29 +0000)]
Modernize usage of "restrict" keyword in ntp.conf

It is no longer necessary to specify a -4/-6 flag on any ntp.conf
keyword.  The address type is inferred from the address itself as
necessary.  "restrict default" statements always apply to both address
families regardless of any -4/-6 flag that may be present.

So this change just tidies up our default config by removing the redundant
restrict -6 statement and comment, and by removing the -6 flag from the
restrict keyword that allows access from localhost.

This change was inspired by the patches provided in PRs 201803 and 210245,
and included some contrib/ntp code inspection to verify that the -4/-6
keywords are basically no-ops in all contexts now.

PR: 201803 210245
Differential Revision: https://reviews.freebsd.org/D15974

5 years agoRetrieve the bus clock speed and mode (polarity/phase) from the child device
ian [Sat, 23 Jun 2018 23:44:36 +0000 (23:44 +0000)]
Retrieve the bus clock speed and mode (polarity/phase) from the child device
and set up the hardware accordingly on each transfer.  This replaces the old
configuration done via sysctl, and allows both fdt configuration data and
userland control via the spigen device to work.

Submitted by: Bob Frazier
Differential Revision: https://reviews.freebsd.org/D15031

5 years agoAdd an example for displaying the manufacturer and size info from a
ian [Sat, 23 Jun 2018 23:08:25 +0000 (23:08 +0000)]
Add an example for displaying the manufacturer and size info from a
standard spiflash chip.

5 years agoAdd spi-max-frequency properties to all spigen nodes. This is a required
ian [Sat, 23 Jun 2018 22:55:22 +0000 (22:55 +0000)]
Add spi-max-frequency properties to all spigen nodes.  This is a required
property for spi devices, although in the spigen case it's expected that
the speed will be overridden at runtime via the ioctl interface.  A very
conservative 500khz speed is used (I've never seen a spi device that
couldn't run at 1mhz).

5 years agotop(1): Restructure printing of process states
eadler [Sat, 23 Jun 2018 22:45:22 +0000 (22:45 +0000)]
top(1): Restructure printing of process states

This avoids the need to have separate buffers and calls to sprintf for
various calls.

5 years agotop(1): Convert process listing to sbuf too
eadler [Sat, 23 Jun 2018 22:45:20 +0000 (22:45 +0000)]
top(1): Convert process listing to sbuf too

This also fixes -mio with 'T' set (thread-id instead of process-id).

This can go further by removing the existing sprintf, and using sbuf
directly. This will be done in a followup commit.

5 years agotop(1): Use basename instead of a homegrown alternative
eadler [Sat, 23 Jun 2018 22:45:18 +0000 (22:45 +0000)]
top(1): Use basename instead of a homegrown alternative

5 years agoDocument libcasper_service.
oshogbo [Sat, 23 Jun 2018 20:12:30 +0000 (20:12 +0000)]
Document libcasper_service.

Reviewed by: bcr@
Differential Revision: https://reviews.freebsd.org/D15766

5 years agoDocument multi variants of *prop_alloc functions
gonzo [Sat, 23 Jun 2018 20:05:07 +0000 (20:05 +0000)]
Document multi variants of *prop_alloc functions

Add documentation and symlinks for OF_getprop_alloc_multi
and OF_getencprop_alloc_multi functions.

Also while here fix copy-pasted .Dt value and add one more
failure condition for OF_getencprop_alloc.

5 years agoBump .Dd value after r335585
gonzo [Sat, 23 Jun 2018 19:30:29 +0000 (19:30 +0000)]
Bump .Dd value after r335585

5 years agoFix invalid OF_getencprop_alloc usage in fdt_pinctrl(9)
gonzo [Sat, 23 Jun 2018 19:01:05 +0000 (19:01 +0000)]
Fix invalid OF_getencprop_alloc usage in fdt_pinctrl(9)

r332341 introduced OF_getencprop_alloc_multi that should be used
instead of OF_getencprop_alloc to get multi-cell properties.
Fix example to reflect this change.

5 years agoaesni(4): Fix {de,en}crypt operations that allocated a buffer
cem [Sat, 23 Jun 2018 18:20:17 +0000 (18:20 +0000)]
aesni(4): Fix {de,en}crypt operations that allocated a buffer

aesni(4) allocates a contiguous buffer for the data it processes if the
provided input was not already virtually contiguous, and copies the input
there.  It performs encryption or decryption in-place.

r324037 removed the logic that then copied the processed data back to the
user-provided input buffer, breaking {de,enc}crypt for mbuf chains or
iovecs with more than a single descriptor.

PR: 228094 (probably, not confirmed)
Submitted by: Sean Fagan <kithrup AT me.com>
Reported by: Emeric POUPON <emeric.poupon AT stormshield.eu>
X-MFC-With: 324037
Security: could result in plaintext being output by "encrypt"
operation

5 years agoaesni(4): Support CRD_F_KEY_EXPLICIT OCF mode
cem [Sat, 23 Jun 2018 17:24:19 +0000 (17:24 +0000)]
aesni(4): Support CRD_F_KEY_EXPLICIT OCF mode

PR: 227788
Reported by: eadler@

5 years agoaw_mmc: Fix style(9) after r335476
manu [Sat, 23 Jun 2018 15:05:21 +0000 (15:05 +0000)]
aw_mmc: Fix style(9) after r335476

5 years agoallwinner: clkng: Correct mux width and flags
manu [Sat, 23 Jun 2018 15:03:54 +0000 (15:03 +0000)]
allwinner: clkng: Correct mux width and flags

The test for checking if the clock have a mux was inverted and the mask
to calculate the parent index was wrong was wrong too.
It means that upon creation the incorrect parent was resolved as the current
one and upon reparent the switch was never made.

Pointy hat (lots of them): manu

5 years agoRe-count available PV entries after reclaiming a PV chunk.
markj [Sat, 23 Jun 2018 10:41:52 +0000 (10:41 +0000)]
Re-count available PV entries after reclaiming a PV chunk.

The call to reclaim_pv_chunk() in reserve_pv_entries() may free a
PV chunk with free entries belonging to the current pmap.  In this
case we must account for the free entries that were reclaimed, or
reserve_pv_entries() may return without having reserved the requested
number of entries.

Reviewed by: alc, kib
Tested by: pho (previous version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D15911

5 years agoSort uma_zone fields according to 64 byte cache line with adjacent line
jeff [Sat, 23 Jun 2018 08:10:09 +0000 (08:10 +0000)]
Sort uma_zone fields according to 64 byte cache line with adjacent line
prefetch on 64bit architectures.  Prior to this, two lines were needed
for the fast path and each line may fetch an unused adjacent neighbor.
 - Move fields used by the fast path into a single line.
 - Move constants into the adjacent line which is mostly used for
   the spare bucket alloc 'medium path'.
 - Unpad the mtx which is only used by the fast path and place it in
   a line with rarely used data.  This aligns the cachelines better and
   eliminates 128 bytes of wasted space.

This gives a 45% improvement on a will-it-scale test on a 24 core machine.

Reviewed by: mmacy

5 years agoepoch(9): Don't trigger taskq enqueue before the grouptaskqs are setup
mmacy [Sat, 23 Jun 2018 07:14:08 +0000 (07:14 +0000)]
epoch(9): Don't trigger taskq enqueue before the grouptaskqs are setup

If EARLY_AP_STARTUP is not defined it is possible for an epoch to be
allocated prior to it being possible to call epoch_call without
issue.

Based on patch by andrew@

PR: 229014
Reported by: andrew

5 years agoRevert r334843, and partially revert r335180.
glebius [Sat, 23 Jun 2018 06:53:53 +0000 (06:53 +0000)]
Revert r334843, and partially revert r335180.

tcp_outflags[] were defined since 4BSD and are defined nowadays in
all its descendants. Removing them breaks third party application.

5 years agotop(1): show CPU state breakdown on first run
eadler [Sat, 23 Jun 2018 03:17:11 +0000 (03:17 +0000)]
top(1): show CPU state breakdown on first run

There is no documented reason for this not to be shown on the first run.
I can't find any good reason, and it breaks batch mode.

PR: 218889
Submitted by: "Jeremy C. Reed" <reed@reedmedia.net>

5 years agoUse 'mv -f' in rc.d/ntpd to avoid spuriously halting the boot.
ian [Sat, 23 Jun 2018 02:42:08 +0000 (02:42 +0000)]
Use 'mv -f' in rc.d/ntpd to avoid spuriously halting the boot.

The final 'mv' to install a fetched leap-list file can fail (due to a
readonly fs, or schg flags, for example), and that leads to mv(1)
prompting the user, stopping the boot process.  Instead, use mv -f
to supress the prompting, and if verbose mode is on, emit a warning
that the existing file cannot be replaced.

PR: 219255

5 years agopowerpc64: Fix stack setup in dbtrap
jhibbits [Sat, 23 Jun 2018 01:42:34 +0000 (01:42 +0000)]
powerpc64: Fix stack setup in dbtrap

r330610 relocated the DMAP from the base of memory to the base of the fourth
quadrant of memory.  This broke synthetic traps, such as KDB forced
breakpoints.  Use GET_TOCBASE() so the DMAP offset is handled.

Submitted by: git_bdragon.rkt0.net
Differential Revision: https://reviews.freebsd.org/D15973

5 years agoSet the slotid and ND_HASSLOTID flag for NFSv4.1 sequenced operations.
rmacklem [Sat, 23 Jun 2018 00:48:45 +0000 (00:48 +0000)]
Set the slotid and ND_HASSLOTID flag for NFSv4.1 sequenced operations.

Most NFSv4.1 compound RPCs start with a Sequence operation. For these
cases, save the slotid and note that it is saved by setting ND_HASSLOTID.
This is used by r335568 to free up the session slot and disable it.

MFC after: 2 weeks