]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoAnother round of attempting to squelch -Wdeprecated-declarations, which
dim [Tue, 17 Sep 2019 06:07:08 +0000 (06:07 +0000)]
Another round of attempting to squelch -Wdeprecated-declarations, which
has become very trigger-happy with libc++ 9.0.0.

It does not help that gcc's implementation of this warning is even more
trigger-happy, in the sense that it already warns on the declaration
itself, not when you are using it.  This is very annoying with our use
of -Wsystem-headers.  That should really be disabled for gcc.

4 years agoWork around gcc's inability to compile an incomplete type in googletest,
dim [Sat, 14 Sep 2019 19:19:38 +0000 (19:19 +0000)]
Work around gcc's inability to compile an incomplete type in googletest,
leading to hundreds of lines of fairly unreadable error messages.

I don't think we particularly care about the specific source file gcc
dies on, and the many layers of macros and sub-types in googletest make
it very hard to diagnose whether this is a bug in googletest, gcc, clang
or libc++.

4 years agoInstead of disabling gcc's deprecated declaration warnings about e.g.
dim [Sat, 14 Sep 2019 19:16:28 +0000 (19:16 +0000)]
Instead of disabling gcc's deprecated declaration warnings about e.g.
std::auto_ptr in a whole bunch of individual Makefiles, make the warning
globally non-fatal instead.  This is similar to what was done to many
more non-fatal warnings from newer gcc versions.

4 years agoMerge ^/head r352308 through r352318.
dim [Sat, 14 Sep 2019 10:56:17 +0000 (10:56 +0000)]
Merge ^/head r352308 through r352318.

4 years agoRevert commit from upstream llvm trunk (by Hans Wennborg):
dim [Sat, 14 Sep 2019 10:55:33 +0000 (10:55 +0000)]
Revert commit from upstream llvm trunk (by Hans Wennborg):

  Re-commit r357452 (take 3): "SimplifyCFG
  SinkCommonCodeFromPredecessors: Also sink function calls without used
  results (PR41259)"

  Third time's the charm.

  This was reverted in r363220 due to being suspected of an internal
  benchmark regression and a test failure, none of which turned out to
  be caused by this.

As reported in https://bugs.llvm.org/show_bug.cgi?id=43269, this causes
UNREACHABLE errors when compiling if_malo_pci.c for arm and aarch64.

4 years agoApparently DebugInfo/DWARF/DWARFExpression.cpp is always needed, at
dim [Sat, 14 Sep 2019 10:52:20 +0000 (10:52 +0000)]
Apparently DebugInfo/DWARF/DWARFExpression.cpp is always needed, at
least for arm builds.  Add it to the minimum list of sources.

4 years agoApply tentative fix for libedit build error on arm.
dim [Sat, 14 Sep 2019 10:51:18 +0000 (10:51 +0000)]
Apply tentative fix for libedit build error on arm.

4 years agoImprove the description of big5(5)
lwhsu [Sat, 14 Sep 2019 08:15:16 +0000 (08:15 +0000)]
Improve the description of big5(5)

- Fix the statement that big5 is a de facto standard of Traditional Chinese
  text [1]
- Add a BUGS section describes the problem of big5 and suggests use utf8

PR: 189095
Submitted by: Brennan Vincent <brennan@umanwizard.com> [1]
Reviewed by: Ting-Wei Lan <lantw44@gmail.com>
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21622

4 years agolualoader: Add reload-conf loader command
kevans [Sat, 14 Sep 2019 03:38:18 +0000 (03:38 +0000)]
lualoader: Add reload-conf loader command

This command will trigger a reload of the configuration from disk. This is
useful if you've changed currdev from recovery media to local disk as much
as I have over the past ~2 hours and are tired of the extra keystrokes.

This is really just a glorified shortcut, but reload-conf is likely easier
to remember for other people and does save some keystrokes when reloading
the configuration. It is also resilient to the underlying config method
changing interface, but this is unlikely to happen.

MFC after: 1 week

4 years agopowerpc64/powernv: Add opal NVRAM driver for PowerNV systems
jhibbits [Sat, 14 Sep 2019 03:30:34 +0000 (03:30 +0000)]
powerpc64/powernv: Add opal NVRAM driver for PowerNV systems

Add a very basic NVRAM driver for OPAL which can be used by the IBM
powerpc-utils nvram utility, not to be confused with the base nvram utility,
which only operates on powermac_nvram.

The IBM utility handles all partitions itself, treating the nvram device as
a plain store.

An alternative would be to manage partitions in the kernel, and augment the
base nvram utility to deal with different backing stores, but that
complicates the driver significantly.  Instead, present the same interface
IBM's utlity expects, and we get the usage for free.

Tested by: bdragon

4 years agoAdd a "count_until_fail" option to gnop, which says to start failing
chs [Fri, 13 Sep 2019 23:03:56 +0000 (23:03 +0000)]
Add a "count_until_fail" option to gnop, which says to start failing
I/O requests after the given number have been allowed though.

Approved by:    imp (mentor)
Reviewed by:    rpokala kib 0mp mckusick
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D21593

4 years agoDrivers may pass runt packets to filter. This is okay.
glebius [Fri, 13 Sep 2019 22:36:04 +0000 (22:36 +0000)]
Drivers may pass runt packets to filter. This is okay.

Reviewed by: gallatin

4 years agoMerge ^/head r352105 through r352307.
dim [Fri, 13 Sep 2019 21:15:01 +0000 (21:15 +0000)]
Merge ^/head r352105 through r352307.

4 years agoRearrange libclang_rt Makefile again, and attempt to simplify it.
dim [Fri, 13 Sep 2019 21:03:43 +0000 (21:03 +0000)]
Rearrange libclang_rt Makefile again, and attempt to simplify it.

It turns out that parts of the common sanitizer code still do not
compile for arm and aarch64, at least not on FreeBSD, so for now those
are all limited to amd64, and sometimes i386.

4 years agoInclude <stdint.h> in unwind-arm.h, since it uses uint32_t and uint64_t
dim [Fri, 13 Sep 2019 21:00:19 +0000 (21:00 +0000)]
Include <stdint.h> in unwind-arm.h, since it uses uint32_t and uint64_t
in various declarations.

Otherwise, depending on how unwind-arm.h is included from other source
files, the compiler may complain that uint32_t and uint64_t are unknown
types.

MFC after: 3 days

4 years agoAdd RELNOTES comment for r352304 discussing removing default mlock()
cy [Fri, 13 Sep 2019 20:21:59 +0000 (20:21 +0000)]
Add RELNOTES comment for r352304 discussing removing default mlock()
for ntpd.

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

4 years agoNo longer mlock() ntpd pages by default in memory thus allowing its
cy [Fri, 13 Sep 2019 20:20:05 +0000 (20:20 +0000)]
No longer mlock() ntpd pages by default in memory thus allowing its
pages to page as necessary.

To restore historic BSD behaviour add the following to ntp.conf:
rlimit memlock 32

Discussed on: freebsd-current@ between Sept 6-9, 2019
Reported by: Users using ASLR with stack gap != 0
Reviewed by: ian, kib, rgrimes (all previous versions)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D21581

4 years agoriscv trap_pfault: remove unneeded hold of the process around vm_fault() call.
kib [Fri, 13 Sep 2019 20:17:14 +0000 (20:17 +0000)]
riscv trap_pfault: remove unneeded hold of the process around vm_fault() call.

This is re-appearance of the nop code removed from other arches in r287625.

Reviewed by: alc (as part of the larger patch), markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
DIfferential revision: https://reviews.freebsd.org/D21645

4 years agoAdd support for Intel Stratix 10 platform.
br [Fri, 13 Sep 2019 16:50:57 +0000 (16:50 +0000)]
Add support for Intel Stratix 10 platform.

Intel Stratix 10 SoC includes a quad-core arm64 cluster and FPGA fabric.

This adds support for reconfiguring FPGA.

Accessing FPGA core of this SoC require the level of privilege EL3,
while kernel runs in EL1 (lower) level of privilege.

This provides an Intel service layer interface that uses SMCCC to pass
queries to the secure-monitor (EL3).

Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D21454

4 years agoAdd generic arm/arm64 secure-monitor SMCCC interface and switch
br [Fri, 13 Sep 2019 15:56:33 +0000 (15:56 +0000)]
Add generic arm/arm64 secure-monitor SMCCC interface and switch
PSCI code to use it.

This interface will also be used by Intel Stratix 10 platform.

This was not tested on arm due to lack of PSCI-enabled arm hardware
lying around.

Reviewed by: andrew
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D21439

4 years agovfs: release usecount using fetchadd
mjg [Fri, 13 Sep 2019 15:49:04 +0000 (15:49 +0000)]
vfs: release usecount using fetchadd

1. If we release the last usecount we take ownership of the hold count, which
means the vnode will remain allocated until we vdrop it.
2. If someone else vrefs they will find no usecount and will proceed to add
their own hold count.
3. No code has a problem with v_usecount transitioning to 0 without the
interlock

These facts combined mean we can fetchadd instead of having a cmpset loop.

Reviewed by: kib (previous version)
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21528

4 years agoRemove remnant from the pre LIBADD era
bapt [Fri, 13 Sep 2019 14:51:00 +0000 (14:51 +0000)]
Remove remnant from the pre LIBADD era

4 years agoUpdate libedit to a snapshot from 2019-09-10
bapt [Fri, 13 Sep 2019 06:50:02 +0000 (06:50 +0000)]
Update libedit to a snapshot from 2019-09-10

This version bring many fixes regarding unicode support
It also adds proper support for filename completion (we do not need our custom
patches anymore)
Improves the libreadline compatibility

Note that the same work was done by Yuichiro Naito in
https://reviews.freebsd.org/D21196 the main difference is in this case we have
reimported libedit in contrib to fix a long standing mess in the previous merges
which prevented a proper update workflow. (discussed long ago with pfg@)

The only difference with upstream libedit is we have added a compatibility shim
for the _elf_fn_sh_complete function which we previously added to support quoting
in filename completion and is not needed anymore.
This was added to continue supported old /bin/sh binaries and not break backward
compatibility (as discussed with jilles@)

Reviewed by: Yuichiro Naito <naito.yuichiro_gmail.com>
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D21584

4 years agoInsert proper copyright/license headers
bapt [Fri, 13 Sep 2019 06:36:24 +0000 (06:36 +0000)]
Insert proper copyright/license headers

Those scripts are without copyright and license assignement since their creation
After grabbing information from The various authors and contributors assign
proper license header and copyrights.

This has been reported by yuripv in his work on integrating those in Illumos!

Reported by: yuripv
Discussed with: marino, edwin
MFC after: 3 days

4 years agomtree -O: Fix not descending on hash collisions
bdrewery [Thu, 12 Sep 2019 20:46:46 +0000 (20:46 +0000)]
mtree -O: Fix not descending on hash collisions

MFC after: 2 weeks
Obtained from: NetBSD (nakayama)

4 years ago[jail] removal by jid doesn't trigger pre/post stop scripts
mizhka [Thu, 12 Sep 2019 18:53:29 +0000 (18:53 +0000)]
[jail] removal by jid doesn't trigger pre/post stop scripts

This commit fixes bug: command "jail -r" didn't trigger pre/post stop
commands (and others) defined in config file if jid is specified insted of
name. Also it adds basic tests for usr.sbin/jail to avoid regression.

Reviewed by: jamie, kevans, ray
MFC after:      5 days
Differential Revision: https://reviews.freebsd.org/D21328

4 years agomtree -c: Fix username logic when getlogin(3) fails.
bdrewery [Thu, 12 Sep 2019 18:51:59 +0000 (18:51 +0000)]
mtree -c: Fix username logic when getlogin(3) fails.

Obtained from: NetBSD (Credit to Sascha Wildner with DragonFlyBSD)
MFC after: 2 weeks

4 years agomtree: Fix -f -f not considering type changes.
bdrewery [Thu, 12 Sep 2019 18:44:48 +0000 (18:44 +0000)]
mtree: Fix -f -f not considering type changes.

This only lists the changed type and not other attributes so that it
matches the behavior of -C as done in r66747 for fmtree. The NetBSD
-ff implementation was copied from fmtree.

Reviewed by: imp
MFC after: 2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D21623

4 years ago[Bug 240473] add support of Ralink RT5390R Wireless Card
mizhka [Thu, 12 Sep 2019 18:37:26 +0000 (18:37 +0000)]
[Bug 240473] add support of Ralink RT5390R Wireless Card

This commit adds PCI ID of Ralink RT5390R into ids table of driver ral.
Tests show stability of card during day. Network speed is reasonable (
around several megabytes per second).

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240473
Reported by: zetrotrack000@gmail.com
Reviewed by: ray
Approved by: ray
MFC after: 5 days
Differential Revision:  https://reviews.freebsd.org/D21604

4 years agoarm64: connect Linuxulator to the build
emaste [Thu, 12 Sep 2019 18:14:44 +0000 (18:14 +0000)]
arm64: connect Linuxulator to the build

More work needs to be done, but it is capable of running basic
statically or dynamically linked Linux/arm64 binaries.

Relnotes: Yes
Sponsored by: The FreeBSD Foundation

4 years agoRemove Tagged Command Queuing feature reporting.
mav [Thu, 12 Sep 2019 17:42:37 +0000 (17:42 +0000)]
Remove Tagged Command Queuing feature reporting.

I never saw those devices myself, FreeBSD never supported them, and it is
officially obsolete since ACS-2 specification.

MFC after: 3 days

4 years agoReport Trusted Computing feature set support.
mav [Thu, 12 Sep 2019 17:20:51 +0000 (17:20 +0000)]
Report Trusted Computing feature set support.

It practically means the device is SED.

MFC after: 3 days

4 years agoRemove a redundant NULL pointer check in cpuset_modify_domain().
markj [Thu, 12 Sep 2019 16:47:38 +0000 (16:47 +0000)]
Remove a redundant NULL pointer check in cpuset_modify_domain().

cpuset_getroot() is guaranteed to return a non-NULL pointer.

Reported by: Mark Millard <marklmi@yahoo.com>
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years ago[PPC64] Add ifunc support in libcsu
luporl [Thu, 12 Sep 2019 16:45:07 +0000 (16:45 +0000)]
[PPC64] Add ifunc support in libcsu

When ifuncs are used in statically linked binaries, the C runtime
must perform the needed dynamic relocations, to make calls to ifuncs
work correctly.

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D21070

4 years agoUse REFCOUNT_COUNT() to obtain refcount where appropriate.
hselasky [Thu, 12 Sep 2019 16:26:59 +0000 (16:26 +0000)]
Use REFCOUNT_COUNT() to obtain refcount where appropriate.
Refcount waiting will set some flag bits in the refcount value.
Make sure these bits get cleared by using the REFCOUNT_COUNT()
macro to obtain the actual refcount.

Differential Revision: https://reviews.freebsd.org/D21620
Reviewed by: kib@, markj@
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoUse %u instead of %d to print unsigned integer.
hselasky [Thu, 12 Sep 2019 16:20:03 +0000 (16:20 +0000)]
Use %u instead of %d to print unsigned integer.
While at it remove an empty line.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoFix for undefined behaviour.
hselasky [Thu, 12 Sep 2019 15:57:49 +0000 (15:57 +0000)]
Fix for undefined behaviour.
Left shift of 1 by 31 places cannot be represented in type 'int'.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoGet the readline header from the installed header instead of the from the source
bapt [Thu, 12 Sep 2019 15:50:14 +0000 (15:50 +0000)]
Get the readline header from the installed header instead of the from the source
location.

4 years agoGet the readline header from the installed header instead of the from the source
bapt [Thu, 12 Sep 2019 15:46:58 +0000 (15:46 +0000)]
Get the readline header from the installed header instead of the from the source
location.

With newer import of libedit, the path to be able to access readline/readline.h
will also include header which name will conflict with some expected by ntp in
another path and end up breaking the build.

4 years agoRemove useless extra definition of libedit flags
bapt [Thu, 12 Sep 2019 15:44:53 +0000 (15:44 +0000)]
Remove useless extra definition of libedit flags

Note that all the line editor part is done in the libntp

4 years agoSIOCSIFNAME: Do nothing if we're not actually changing
kevans [Thu, 12 Sep 2019 15:36:48 +0000 (15:36 +0000)]
SIOCSIFNAME: Do nothing if we're not actually changing

Instead of throwing EEXIST, just succeed if the name isn't actually
changing. We don't need to trigger departure or any of that because there's
no change from consumers' perspective.

PR: 240539
Reviewed by: brooks
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D21618

4 years agoFollow up r352244: kenv: tighten up assertions
kevans [Thu, 12 Sep 2019 14:34:46 +0000 (14:34 +0000)]
Follow up r352244: kenv: tighten up assertions

As I like to forget: static kenv var formatting is actually such that an
empty environment would be double null bytes. We should make sure that a
non-zero buffer has at least enough for this, though most of the current
usage is with a 4k buffer.

4 years agokenv: assert that an empty static buffer passed in is "empty"
kevans [Thu, 12 Sep 2019 13:51:43 +0000 (13:51 +0000)]
kenv: assert that an empty static buffer passed in is "empty"

Garbage in the passed-in buffer can cause problems if any attempts to read
the kenv are inadvertently made between init_static_kenv and the first
kern_setenv -- assuming there is one.

This is cheap and easy, so do it. This also helps rule out some class of
bugs as one tries to debug; tunables fetch from the static environment up
until SI_SUB_KMEM + 1, and many of these buffers are global ~4k buffers that
rely on BSS clearing while others just grab a page of free memory and use it
(e.g. xen).

4 years agoig4(4): Fix SDA HOLD time set too low on Skylake controllers
wulf [Thu, 12 Sep 2019 12:33:09 +0000 (12:33 +0000)]
ig4(4): Fix SDA HOLD time set too low on Skylake controllers

Execution of "Soft reset" command (IG4_REG_RESETS_SKL) at controller init
stage sets SDA_HOLD register value to 0x0001 which is often too low for
normal operation.

Set SDA_HOLD back to 28 after reset to restore controller functionality.

PR: 240339
Reported by: imp, GregV, et al.
MFC after: 3 days

4 years agoRemove usesless readline compat includes which will reinclude readline.h
bapt [Thu, 12 Sep 2019 08:54:48 +0000 (08:54 +0000)]
Remove usesless readline compat includes which will reinclude readline.h
itself.

This simplifies the upcoming update to newer libedit.

4 years agoImport tzdata 2019c
philip [Thu, 12 Sep 2019 00:19:16 +0000 (00:19 +0000)]
Import tzdata 2019c

Changes: https://github.com/eggert/tz/blob/2019c/NEWS

MFC after: 3 days

4 years agobuf: Add B_INVALONERR flag to discard data
cem [Wed, 11 Sep 2019 21:24:14 +0000 (21:24 +0000)]
buf: Add B_INVALONERR flag to discard data

Setting the B_INVALONERR flag before a synchronous write causes the buf
cache to forcibly invalidate contents if the write fails (BIO_ERROR).

This is intended to be used to allow layers above the buffer cache to make
more informed decisions about when discarding dirty buffers without
successful write is acceptable.

As a proof of concept, use in msdosfs to handle failures to mark the on-disk
'dirty' bit during rw mount or ro->rw update.

Extending this to other filesystems is left as future work.

PR: 210316
Reviewed by: kib (with objections)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D21539

4 years agogetsockopt.2: clarify that SO_TIMESTAMP is not 100% reliable
asomers [Wed, 11 Sep 2019 19:48:32 +0000 (19:48 +0000)]
getsockopt.2: clarify that SO_TIMESTAMP is not 100% reliable

When SO_TIMESTAMP is set, the kernel will attempt to attach a timestamp as
ancillary data to each IP datagram that is received on the socket. However,
it may fail, for example due to insufficient memory. In that case the
packet will still be received but not timestamp will be attached.

Reviewed by: kib
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D21607

4 years agofusefs: Fix iosize for FUSE_WRITE in 7.8 compat mode
asomers [Wed, 11 Sep 2019 19:29:40 +0000 (19:29 +0000)]
fusefs: Fix iosize for FUSE_WRITE in 7.8 compat mode

When communicating with a FUSE server that implements version 7.8 (or older)
of the FUSE protocol, the FUSE_WRITE request structure is 16 bytes shorter
than normal. The protocol version check wasn't applied universally, leading
to an extra 16 bytes being sent to such servers. The extra bytes were
allocated and bzero()d, so there was no information disclosure.

Reviewed by: emaste
MFC after: 3 days
MFC-With: r350665
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21557

4 years agoping: Verify whether a datagram timestamp was actually received.
asomers [Wed, 11 Sep 2019 18:54:45 +0000 (18:54 +0000)]
ping: Verify whether a datagram timestamp was actually received.

ping(8) uses SO_TIMESTAMP, which attaches a timestamp to each IP datagram at
the time it's received by the kernel.  Except that occasionally it doesn't.
Add a check to see whether such a timestamp was actually set before trying
to read it.  This fixes segfaults that can happen when the kernel doesn't
attach a timestamp.

The bug has always existed, but prior to r351461 it manifested as an
implausible round-trip-time, not a segfault.

Reported by: pho
MFC after: 3 days
MFC-With: 351461

4 years agoAvoid unneeded call to arc4random() in syncache_add()
gallatin [Wed, 11 Sep 2019 18:48:26 +0000 (18:48 +0000)]
Avoid unneeded call to arc4random() in syncache_add()

Don't call arc4random() unconditionally to initialize sc_iss, and
then when syncookies are enabled, just overwrite it with the
return value from from syncookie_generate(). Instead, only call
arc4random() to initialize sc_iss when syncookies are not
enabled.

Note that on a system under a syn flood attack, arc4random()
becomes quite expensive, and the chacha_poly crypto that it calls
is one of the more expensive things happening on the
system. Removing this unneeded arc4random() call reduces CPU from
about 40% to about 35% in my test scenario (Broadwell Xeon, 6Mpps
syn flood attack).

Reviewed by: rrs, tuxen, bz
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D21591

4 years agoOnly skip problematic test in CI env.
lwhsu [Wed, 11 Sep 2019 18:40:05 +0000 (18:40 +0000)]
Only skip problematic test in CI env.

PR: 237450
Sponsored by: The FreeBSD Foundation

4 years agoping: fix a string in an error message
asomers [Wed, 11 Sep 2019 18:08:40 +0000 (18:08 +0000)]
ping: fix a string in an error message

MFC after: 3 days

4 years agoriscv: Add missing header
kp [Wed, 11 Sep 2019 18:07:15 +0000 (18:07 +0000)]
riscv: Add missing header

r352218 missing an include statement, causing the build to fail.

Submitted by: Nicholas O'Brien (nickisobrien_gmail.com)
Sponsored by: Axiado

4 years agoUpdate comments and ordering in linux*_dummy.c
emaste [Wed, 11 Sep 2019 17:56:48 +0000 (17:56 +0000)]
Update comments and ordering in linux*_dummy.c

- sort alphabetically
- getcpu arrived in Linux 2.6.19
- fanotify_* arrived in 2.6.36

4 years agolinuxulator: add stub arm64 linux_genassym.c
emaste [Wed, 11 Sep 2019 17:29:44 +0000 (17:29 +0000)]
linuxulator: add stub arm64 linux_genassym.c

This will be fleshed out in the future but allows us to build the arm64
linuxulator using the same infrastructure as x86.

4 years agolinuxulator: memfd_create first appeared in Linux 3.17
emaste [Wed, 11 Sep 2019 17:05:49 +0000 (17:05 +0000)]
linuxulator: memfd_create first appeared in Linux 3.17

Reference: http://man7.org/linux/man-pages/man2/memfd_create.2.html

4 years agolinuxulator: seccomp syscall first appeared in Linux 3.17
emaste [Wed, 11 Sep 2019 17:04:13 +0000 (17:04 +0000)]
linuxulator: seccomp syscall first appeared in Linux 3.17

Reference: http://man7.org/linux/man-pages/man2/seccomp.2.html

4 years agoAvoid the use of the non-portable -D argument to ls.
brooks [Wed, 11 Sep 2019 17:01:31 +0000 (17:01 +0000)]
Avoid the use of the non-portable -D argument to ls.

This was used to store the mtime of the source file in a commment in a
generated header file.  This is of little-to-no diagnostic value and
the result doesn't even end up in the source tree.

Reported by: arichardson
Reviewed by: arichardson
MFC after: 1 days
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D21605

4 years agoTemporarily skip flakey test case sys.kern.ptrace_test.ptrace__getppid
lwhsu [Wed, 11 Sep 2019 16:24:03 +0000 (16:24 +0000)]
Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__getppid

PR: 240510
Sponsored by: The FreeBSD Foundation

4 years agoriscv: Small fix to CPU compatibility identification
kp [Wed, 11 Sep 2019 16:16:53 +0000 (16:16 +0000)]
riscv: Small fix to CPU compatibility identification

fdt_is_compatible_strict() inspects the first compatible property.
We need to inspect the following properties for 'riscv'.
ofw_bus_node_is_compatible() does a recursive search.

This patch fixes "Can't find CPU" error message when bootverbose = true.

Submitted by: Nicholas O'Brien (nickisobrien_gmail.com)
Reviewed by: philip, kp
Sponsored by: Axiado
Differential Revision: https://reviews.freebsd.org/D21576

4 years agolocale: initialize variables to make gcc happy
yuripv [Wed, 11 Sep 2019 16:00:03 +0000 (16:00 +0000)]
locale: initialize variables to make gcc happy

Reported by: jenkins

4 years agoWith the recent commit of ktls, we no longer have a
rrs [Wed, 11 Sep 2019 15:41:36 +0000 (15:41 +0000)]
With the recent commit of ktls, we no longer have a
sb_tls_flags, its just the sb_flags. Also the ratelimit
code, now that the defintion is in sockbuf.h, does not
need the ktls.h file (or its predecessor).

Sponsored by: Netflix Inc

4 years agolocale: more output fixes
yuripv [Wed, 11 Sep 2019 15:39:28 +0000 (15:39 +0000)]
locale: more output fixes

- make abday, day, abmon, mon, am_pm output quoting match linux
- workaround localeconv() issue for mon_grouping and grouping (PR172215)
- for other values not available in default locale, output -1 instead of
  127 (CHAR_MAX) as returned by localeconv()

With these changes, output of `locale` and `locale -k` for all keywords
specified by POSIX exactly matches the linux one.

PR: 237752
Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D21599

4 years agofw_stub.awk: use @generated tag in generated files
emaste [Wed, 11 Sep 2019 13:35:22 +0000 (13:35 +0000)]
fw_stub.awk: use @generated tag in generated files

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

4 years agoAssume all the short args have optional args so allocate space for the
imp [Wed, 11 Sep 2019 13:34:19 +0000 (13:34 +0000)]
Assume all the short args have optional args so allocate space for the
':'. It's slightly wasteful, but much easier (and the savings in bytes
at runtime would be tiny, but the code to do it larger).

Submitted by: Sebastian Huber

4 years agobectl(8): Add a "check" command
kevans [Wed, 11 Sep 2019 13:27:10 +0000 (13:27 +0000)]
bectl(8): Add a "check" command

This command simply returns 0 at the moment and explicitly takes no
arguments. This should be used by utilities wanting to see if bectl can
operate on the system they're running, or with a specific root (`bectl -r`).
It may grow more checks than "will libbe successfully init" in the future,
but for now this is enough as that checks for the dataset mounted at "/" and
that it looks capable of being a BE root (e.g. it's not a top-level dataset)

bectl commands can now specify if they want to be silent, and this will turn
off libbe_print_on_error so they can control the output as needed. This is
already used in `bectl check`, and may be turned on in the future for some
other commands where libbe errors are better suppressed as the failure mode
may be obvious.

Requested by: David Fullard
MFC after: 3 days

4 years agolinux: add trivial renameat2 implementation
emaste [Wed, 11 Sep 2019 13:01:59 +0000 (13:01 +0000)]
linux: add trivial renameat2 implementation

Just return EINVAL if flags != 0.  The Linux man page documents one
case of EINVAL as "The filesystem does not support one of the flags in
flags."

After r351723 userland binaries will try using new system calls.

Reported by: mjg
Reviewed by: mjg, trasz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21590

4 years agoregen linuxulator sysent after r352208
emaste [Wed, 11 Sep 2019 12:58:53 +0000 (12:58 +0000)]
regen linuxulator sysent after r352208

4 years agomake linux_renameat2 args consistent with linux_renameat
emaste [Wed, 11 Sep 2019 12:58:06 +0000 (12:58 +0000)]
make linux_renameat2 args consistent with linux_renameat

Use 'dfd' consistently for a directory fd.

4 years agoUse true and false when dealing with bool type in the LinuxKPI.
hselasky [Wed, 11 Sep 2019 08:24:47 +0000 (08:24 +0000)]
Use true and false when dealing with bool type in the LinuxKPI.
No functional change.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoFix synchronous work drain issue in the LinuxKPI.
hselasky [Wed, 11 Sep 2019 08:20:13 +0000 (08:20 +0000)]
Fix synchronous work drain issue in the LinuxKPI.

A work callback may restart itself. Loop in the drain function to see if the
work has been rescheduled and stop the subsequent reschedules, if any.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoFix broken DECLARE_TASKLET() macro after r347852.
hselasky [Wed, 11 Sep 2019 07:53:49 +0000 (07:53 +0000)]
Fix broken DECLARE_TASKLET() macro after r347852.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoReadd _el_fn_sh_complete for backward compatibility
bapt [Wed, 11 Sep 2019 07:03:17 +0000 (07:03 +0000)]
Readd _el_fn_sh_complete for backward compatibility

This function is not needed anymore, it allows old sh binary to continue
to run and avoid breaking backward compatibility.
Note that is now just calls the regular _el_fn_complete which does a proper
job at quoting.

Discussed with: jilles

4 years agoFix assumptions of only one device per SES slot.
mav [Wed, 11 Sep 2019 03:25:30 +0000 (03:25 +0000)]
Fix assumptions of only one device per SES slot.

It is typical to have one, but no longer true for multi-actuator HDDs
with separate LUN for each actuator.

MFC after: 4 days
Sponsored by: iXsystems, Inc.

4 years agoRemove struct ata_res_pass16, unneeded after r352082.
mav [Tue, 10 Sep 2019 23:51:46 +0000 (23:51 +0000)]
Remove struct ata_res_pass16, unneeded after r352082.

MFC after: 4 days

4 years ago- fix a minor typo
jgh [Tue, 10 Sep 2019 22:44:09 +0000 (22:44 +0000)]
- fix a minor typo

PR: 240447
Submitted by: brigadir15@gmail.com
MFC after: 1 week

4 years agoRemove unnecessary entries from the previous commit.
jkim [Tue, 10 Sep 2019 22:24:42 +0000 (22:24 +0000)]
Remove unnecessary entries from the previous commit.

4 years agoIn am335x_dmtpps, use a spin mutex to interlock between PPS capture and PPS
ian [Tue, 10 Sep 2019 22:08:34 +0000 (22:08 +0000)]
In am335x_dmtpps, use a spin mutex to interlock between PPS capture and PPS
ioctl(2) handling.  This allows doing the pps_event() work in the polling
routine, instead of using a taskqueue task to do that work.

Also, add PNPINFO, and switch to using make_dev_s() to create the cdev.

Using a spin mutex and calling pps_event() from the polling function works
around the situation which requires more than 2 sets of timecounter
timehands in a single-core system to get reliable PPS capture.  That problem
would happen when a single-core system is idle in cpu_idle() then gets woken
up with an event timer event which was scheduled to handle a hardclock tick.
That processing path would end up calling tc_windup 3 or 4 times between
when the tc polling function was called and when the taskqueue task would
eventually run, and with only two sets of timehands, the th_generation count
would always be too old to allow the captured PPS data to be used.

4 years agoloader: vidconsole should set LINES and COLUMNS
tsoome [Tue, 10 Sep 2019 21:53:42 +0000 (21:53 +0000)]
loader: vidconsole should set LINES and COLUMNS

Set LINES and COLUMNS based on terminal dimensions.

4 years agolualoader: Revert to ASCII menu frame for serial console
kevans [Tue, 10 Sep 2019 21:30:38 +0000 (21:30 +0000)]
lualoader: Revert to ASCII menu frame for serial console

The box drawing characters we use aren't necessarily safe with a serial
console; for instance, in the report by npn@, these were causing his xterm
to send back a sequence that lua picked up as input and halted the boot.
This is less than ideal.

Fallback to ASCII frames for console with 'comconsole' in it.  This is a
partial revert r338108 by imp@ -- instead of removing the menu entirely and
disabling color/cursor sequences, just reverting the default frame to ASCII
is enough to not break in this setup.

Reported by: npn
Triaged and recommended by: tsoome

4 years agoMerge OpenSSL 1.1.1d.
jkim [Tue, 10 Sep 2019 21:08:17 +0000 (21:08 +0000)]
Merge OpenSSL 1.1.1d.

4 years agognop: Fix initial value for the wdelayprob
oshogbo [Tue, 10 Sep 2019 20:27:44 +0000 (20:27 +0000)]
gnop: Fix initial value for the wdelayprob

Reported by: Chuck Silvers <chuq@chuq.com>

4 years agocache: avoid excessive relocking on entry removal during lookup
mjg [Tue, 10 Sep 2019 20:19:29 +0000 (20:19 +0000)]
cache: avoid excessive relocking on entry removal during lookup

Due to lock ordering issues (bucket lock held, vnode locks wanted) the code
starts with trylocking which in face of contention often fails. Prior to
the change it would loop back with a possible yield.

Instead note we know what locks are needed and can take them in the right
order, avoiding retries. Then we can safely re-lookup and see if the entry
we are looking for is still there.

On a 104-way box poudriere would result in constant retries during an 11h
run as seen in the vfs.cache.zap_and_exit_bucket_fail counter.

before: 408866592
after :         0

However, a new stat reports:
vfs.cache.zap_and_exit_bucket_relock_success: 32638

Note this is only a bandaid over current design issues.

Tested by: pho
Sponsored by: The FreeBSD Foundation

4 years agocache: change the formula for calculating lock array sizes
mjg [Tue, 10 Sep 2019 20:11:00 +0000 (20:11 +0000)]
cache: change the formula for calculating lock array sizes

It used to be mp_ncpus * 64, but this gives unnecessarily big values for small
machines and at the same time constraints bigger ones. In particular this helps
on a 104-way box for which the count is now doubled.

While here make cache_purgevfs less likely. Currently it is not efficient in
face of contention due to lock ordering issues. These are fixable but not worth
it at the moment.

Sponsored by: The FreeBSD Foundation

4 years agocache: assorted cleanups
mjg [Tue, 10 Sep 2019 20:08:24 +0000 (20:08 +0000)]
cache: assorted cleanups

Sponsored by: The FreeBSD Foundation

4 years agoReplace redundant code with a few new vm_page_grab facilities:
jeff [Tue, 10 Sep 2019 19:08:01 +0000 (19:08 +0000)]
Replace redundant code with a few new vm_page_grab facilities:
 - VM_ALLOC_NOCREAT will grab without creating a page.
 - vm_page_grab_valid() will grab and page in if necessary.
 - vm_page_busy_acquire() automates some busy acquire loops.

Discussed with: alc, kib, markj
Tested by: pho (part of larger branch)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D21546

4 years agoAdd powerpc support to libkvm probe function
luporl [Tue, 10 Sep 2019 18:46:32 +0000 (18:46 +0000)]
Add powerpc support to libkvm probe function

PowerPC kernels are of DYN type, instead of EXEC.

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D21583

4 years agoUse the sleepq lock rather than the page lock to protect against wakeup
jeff [Tue, 10 Sep 2019 18:27:45 +0000 (18:27 +0000)]
Use the sleepq lock rather than the page lock to protect against wakeup
races with page busy state.  The object lock is still used as an interlock
to ensure that the identity stays valid.  Most callers should use
vm_page_sleep_if_busy() to handle the locking particulars.

Reviewed by: alc, kib, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D21255

4 years agoRemove dirs (and their now-empty parents) empty since r344779
imp [Tue, 10 Sep 2019 17:51:22 +0000 (17:51 +0000)]
Remove dirs (and their now-empty parents) empty since r344779

4 years agoRemove dir empty since r327952
imp [Tue, 10 Sep 2019 17:50:00 +0000 (17:50 +0000)]
Remove dir empty since r327952

4 years agoRemove dir empty since r314564
imp [Tue, 10 Sep 2019 17:49:18 +0000 (17:49 +0000)]
Remove dir empty since r314564

4 years agoRemove dirs empty since r280031
imp [Tue, 10 Sep 2019 17:47:38 +0000 (17:47 +0000)]
Remove dirs empty since r280031

4 years agoRemove dir empty since r276851
imp [Tue, 10 Sep 2019 17:46:30 +0000 (17:46 +0000)]
Remove dir empty since r276851

4 years agoImport OpenSSL 1.1.1d.
jkim [Tue, 10 Sep 2019 17:40:53 +0000 (17:40 +0000)]
Import OpenSSL 1.1.1d.

4 years agoRemove empty directory after r297894
imp [Tue, 10 Sep 2019 17:31:06 +0000 (17:31 +0000)]
Remove empty directory after r297894

4 years agoRemove empty dir after r342815 (pt 2, oops)
imp [Tue, 10 Sep 2019 17:30:05 +0000 (17:30 +0000)]
Remove empty dir after r342815 (pt 2, oops)

4 years agoRemove empty dir after r288683
imp [Tue, 10 Sep 2019 17:26:46 +0000 (17:26 +0000)]
Remove empty dir after r288683

4 years agoRemove empty dir after r342815
imp [Tue, 10 Sep 2019 17:26:20 +0000 (17:26 +0000)]
Remove empty dir after r342815

4 years agoRemove dir empty since r214734
imp [Tue, 10 Sep 2019 17:20:24 +0000 (17:20 +0000)]
Remove dir empty since r214734