]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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

4 years agoRemove dirs empty since r336203
imp [Tue, 10 Sep 2019 17:19:43 +0000 (17:19 +0000)]
Remove dirs empty since r336203

4 years agoRemove directory empty after r266735
imp [Tue, 10 Sep 2019 16:58:19 +0000 (16:58 +0000)]
Remove directory empty after r266735

4 years agoRemove empty directory after r215937
imp [Tue, 10 Sep 2019 16:57:35 +0000 (16:57 +0000)]
Remove empty directory after r215937

4 years agoRemove empty directory after r342871
imp [Tue, 10 Sep 2019 16:56:43 +0000 (16:56 +0000)]
Remove empty directory after r342871

4 years agoRemove empty directory imported with r342935
imp [Tue, 10 Sep 2019 16:53:16 +0000 (16:53 +0000)]
Remove empty directory imported with r342935

4 years agoRemove empty directory imported with r238438
imp [Tue, 10 Sep 2019 16:51:52 +0000 (16:51 +0000)]
Remove empty directory imported with r238438

4 years agoRemove now-empty directory after r288337
imp [Tue, 10 Sep 2019 16:50:38 +0000 (16:50 +0000)]
Remove now-empty directory after r288337

4 years agoRemove now-empty directories after r272458
imp [Tue, 10 Sep 2019 16:48:49 +0000 (16:48 +0000)]
Remove now-empty directories after r272458

4 years agoRemove gateworks directories left over from r336136
imp [Tue, 10 Sep 2019 16:43:05 +0000 (16:43 +0000)]
Remove gateworks directories left over from r336136

4 years agoRemove empty tap/tun modules directories after r347241
imp [Tue, 10 Sep 2019 16:41:00 +0000 (16:41 +0000)]
Remove empty tap/tun modules directories after r347241

4 years agoRemove leftover usr.bin/send-pr after r338042
imp [Tue, 10 Sep 2019 16:40:00 +0000 (16:40 +0000)]
Remove leftover usr.bin/send-pr after r338042

4 years agoRemove empty directory after r342256
imp [Tue, 10 Sep 2019 16:38:52 +0000 (16:38 +0000)]
Remove empty directory after r342256

4 years agoRemove empty directory aftre r336532
imp [Tue, 10 Sep 2019 16:37:32 +0000 (16:37 +0000)]
Remove empty directory aftre r336532

4 years agoRemove more directories left over from nand removal
imp [Tue, 10 Sep 2019 16:36:09 +0000 (16:36 +0000)]
Remove more directories left over from nand removal

4 years agoRemove empty directories after drm removal
imp [Tue, 10 Sep 2019 16:35:31 +0000 (16:35 +0000)]
Remove empty directories after drm removal

4 years agoRemove empty directories left over from nand removal
imp [Tue, 10 Sep 2019 16:30:06 +0000 (16:30 +0000)]
Remove empty directories left over from nand removal

4 years agoAdd R_PPC_IRELATIVE relocation
luporl [Tue, 10 Sep 2019 16:16:05 +0000 (16:16 +0000)]
Add R_PPC_IRELATIVE relocation

Pre-requisite for most ifunc related changes.

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

4 years agolocale: handle day, abday, mon, abmon, am_pm keywords
yuripv [Tue, 10 Sep 2019 15:09:46 +0000 (15:09 +0000)]
locale: handle day, abday, mon, abmon, am_pm keywords

All of these are defined as mandatory by POSIX.

While here, mark all non-standard ones as FreeBSD-only as
other systems (at least, GNU/Linux and illumos) do not handle
them, so we should not encourage their use.

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

4 years agoCallout drain does not have to be followed by a callout stop call.
hselasky [Tue, 10 Sep 2019 14:33:07 +0000 (14:33 +0000)]
Callout drain does not have to be followed by a callout stop call.
Fix bogus code.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoImport libedit 2019-09-10
bapt [Tue, 10 Sep 2019 14:30:10 +0000 (14:30 +0000)]
Import libedit 2019-09-10

Compared to current version in base:
- great improvements on the Unicode support
- full support for filename completion including quoting
  which means we do not need anymore our custom addition)
- Improved readline compatiblity

Upgrading libedit has been a pain in the past, because somehow we never
managed to properly cleanup the tree in lib/libedit and each merge has always
been very painful. After years of fighting give up and refresh a merge from
scrarch properly in contrib.

Note that the switch to this version will be done in another commit.

4 years agoTag import of libedit snapshot 2019-09-10
bapt [Tue, 10 Sep 2019 13:56:36 +0000 (13:56 +0000)]
Tag import of libedit snapshot 2019-09-10

4 years agoUpdate libedit to snapshot 2019-09-10
bapt [Tue, 10 Sep 2019 13:55:44 +0000 (13:55 +0000)]
Update libedit to snapshot 2019-09-10

4 years agoFix build for the platforms where db_expr_t is not long
lwhsu [Tue, 10 Sep 2019 08:51:11 +0000 (08:51 +0000)]
Fix build for the platforms where db_expr_t is not long

Sponsored by: The FreeBSD Foundation

4 years agoFix bad path
bapt [Tue, 10 Sep 2019 08:28:44 +0000 (08:28 +0000)]
Fix bad path

Reported by: zeising

4 years agoStop linking to libl by specifying we do not need yywrap
bapt [Tue, 10 Sep 2019 08:19:46 +0000 (08:19 +0000)]
Stop linking to libl by specifying we do not need yywrap

MFC after: 3 days

4 years agoRemove a blankline wrongly added in r351781
bapt [Tue, 10 Sep 2019 07:56:57 +0000 (07:56 +0000)]
Remove a blankline wrongly added in r351781

4 years agoRemove mklocale(1) and colldef(1) which are deprecated since FreeBSD 11
bapt [Tue, 10 Sep 2019 07:54:49 +0000 (07:54 +0000)]
Remove mklocale(1) and colldef(1) which are deprecated since FreeBSD 11

In FreeBSD 11 along with the rework on the collation, mklocale(1) and colldef(1)
has been replaced by localedef(1) (a note has been added to the manpage to state
it).
mklocale(1) and colldef(1) has been kept around to be able to build older
versions of FreeBSD. None of the version requiring those tools are supported
anymore so it is time to remove them from base

4 years agoIn FreeBSD 11 localedef(1) has replaced the mklocale(1) and colldef(1)
bapt [Tue, 10 Sep 2019 07:47:52 +0000 (07:47 +0000)]
In FreeBSD 11 localedef(1) has replaced the mklocale(1) and colldef(1)
tools to generate the locales data. state it in the libc manpages.

MFC after: 3 days

4 years agoRemove reference to mklocale regarding the nls directory
bapt [Tue, 10 Sep 2019 07:40:45 +0000 (07:40 +0000)]
Remove reference to mklocale regarding the nls directory

mklocale never had anything to do with the content of this directory

MFC after: 3 days

4 years agoStop linking to libl by specifying we do not need yywrap
bapt [Tue, 10 Sep 2019 07:28:27 +0000 (07:28 +0000)]
Stop linking to libl by specifying we do not need yywrap

MFC after: 3 days

4 years agoStop linking to libl by specifying we do not need yywrap
bapt [Tue, 10 Sep 2019 07:26:38 +0000 (07:26 +0000)]
Stop linking to libl by specifying we do not need yywrap

MFC after: 3 days

4 years agoStop linking to libl by specifying we do not need yywrap
bapt [Tue, 10 Sep 2019 07:25:37 +0000 (07:25 +0000)]
Stop linking to libl by specifying we do not need yywrap

MFC after: 3 days

4 years agoStop linking to libl by specifying we do not need yywrap
bapt [Tue, 10 Sep 2019 07:23:01 +0000 (07:23 +0000)]
Stop linking to libl by specifying we do not need yywrap

MFC after: 3 days

4 years agoby specifyng we do not use yywrap we can avoid linking to libl and liby
bapt [Tue, 10 Sep 2019 07:20:32 +0000 (07:20 +0000)]
by specifyng we do not use yywrap we can avoid linking to libl and liby

MFC after: 3 days

4 years agoconfig: do not link against libl, it is not needed
bapt [Tue, 10 Sep 2019 07:14:39 +0000 (07:14 +0000)]
config: do not link against libl, it is not needed

MFC after: 3 days

4 years agoFix 'calendar -a' in several ways.
glebius [Tue, 10 Sep 2019 04:21:48 +0000 (04:21 +0000)]
Fix 'calendar -a' in several ways.

o Do not run any iconv() processing in -a. The locale of root user is not
  what is desired by most of the users who receive their calendar mail.
  Just assume that users store their calendars in a format that is readable
  to them. This fixes regression from r344340.
o fork() and setusercontext(LOGIN_SETALL) for every user. This makes LANG
  set inside a calendar file mostly excessive, as we will pick up user's
  login class LANG.
o This also executes complex function cal() that parses user owned files
  with appropriate user privileges.
  Previously it was run with privileges dropped only temporary for execution
  of cal(), and fully dropped only before invoking sendmail (see r22473).

Reviewed by: bapt (older version of patch)

4 years agoRemove pointless playing with LC_TIME, which should have been done in r205821.
glebius [Tue, 10 Sep 2019 04:01:41 +0000 (04:01 +0000)]
Remove pointless playing with LC_TIME, which should have been done in r205821.

4 years agoAppease Clang false-positive Werrors in r352112
cem [Tue, 10 Sep 2019 01:56:47 +0000 (01:56 +0000)]
Appease Clang false-positive Werrors in r352112

Reported by: bcran

4 years agoddb(4): Add 'show route <dest>' and 'show routetable [<af>]'
cem [Mon, 9 Sep 2019 22:54:27 +0000 (22:54 +0000)]
ddb(4): Add 'show route <dest>' and 'show routetable [<af>]'

These commands show the route resolved for a specified destination, or
print out the entire routing table for a given address family (or all
families, if none is explicitly provided).

Discussed with: emaste
Differential Revision: https://reviews.freebsd.org/D21510

4 years agoInitialize page/subpage in case of `modepage -d`.
mav [Mon, 9 Sep 2019 22:08:22 +0000 (22:08 +0000)]
Initialize page/subpage in case of `modepage -d`.

Previously without -m parameter it worked mostly by concodence.

While there, make page/subpage values validation more strict.

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

4 years agoChange synchonization rules for vm_page reference counting.
markj [Mon, 9 Sep 2019 21:32:42 +0000 (21:32 +0000)]
Change synchonization rules for vm_page reference counting.

There are several mechanisms by which a vm_page reference is held,
preventing the page from being freed back to the page allocator.  In
particular, holding the page's object lock is sufficient to prevent the
page from being freed; holding the busy lock or a wiring is sufficent as
well.  These references are protected by the page lock, which must
therefore be acquired for many per-page operations.  This results in
false sharing since the page locks are external to the vm_page
structures themselves and each lock protects multiple structures.

Transition to using an atomically updated per-page reference counter.
The object's reference is counted using a flag bit in the counter.  A
second flag bit is used to atomically block new references via
pmap_extract_and_hold() while removing managed mappings of a page.
Thus, the reference count of a page is guaranteed not to increase if the
page is unbusied, unmapped, and the object's write lock is held.  As
a consequence of this, the page lock no longer protects a page's
identity; operations which move pages between objects are now
synchronized solely by the objects' locks.

The vm_page_wire() and vm_page_unwire() KPIs are changed.  The former
requires that either the object lock or the busy lock is held.  The
latter no longer has a return value and may free the page if it releases
the last reference to that page.  vm_page_unwire_noq() behaves the same
as before; the caller is responsible for checking its return value and
freeing or enqueuing the page as appropriate.  vm_page_wire_mapped() is
introduced for use in pmap_extract_and_hold().  It fails if the page is
concurrently being unmapped, typically triggering a fallback to the
fault handler.  vm_page_wire() no longer requires the page lock and
vm_page_unwire() now internally acquires the page lock when releasing
the last wiring of a page (since the page lock still protects a page's
queue state).  In particular, synchronization details are no longer
leaked into the caller.

The change excises the page lock from several frequently executed code
paths.  In particular, vm_object_terminate() no longer bounces between
page locks as it releases an object's pages, and direct I/O and
sendfile(SF_NOCACHE) completions no longer require the page lock.  In
these latter cases we now get linear scalability in the common scenario
where different threads are operating on different files.

__FreeBSD_version is bumped.  The DRM ports have been updated to
accomodate the KPI changes.

Reviewed by: jeff (earlier version)
Tested by: gallatin (earlier version), pho
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20486

4 years agoReverse the referenced tables.
crees [Mon, 9 Sep 2019 20:48:12 +0000 (20:48 +0000)]
Reverse the referenced tables.

If ipv4_prefer is specified, Section 10.3 is relevant.
If ipv6_prefer is specified, Section  2.1 is relevant.

This change makes the corresponding options/sections 'respective'

PR: docs/234249
Submitted by: David Fiander <david@fiander.info>

4 years agoAdd one more error message to r352082.
mav [Mon, 9 Sep 2019 19:00:37 +0000 (19:00 +0000)]
Add one more error message to r352082.

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

4 years agoRemove obsolete WITHOUT names that are no longer in the system.
imp [Mon, 9 Sep 2019 18:46:28 +0000 (18:46 +0000)]
Remove obsolete WITHOUT names that are no longer in the system.

Noticed by: swills@

4 years agoThese should have been removed when we removed atmel port before 12.
imp [Mon, 9 Sep 2019 18:45:52 +0000 (18:45 +0000)]
These should have been removed when we removed atmel port before 12.

4 years agomsdosfsmount.h: fix ifdef comment
emaste [Mon, 9 Sep 2019 18:35:17 +0000 (18:35 +0000)]
msdosfsmount.h: fix ifdef comment

4 years agocompiler-rt: use 64-bit time_t for all FreeBSD archs except i386
emaste [Mon, 9 Sep 2019 18:33:15 +0000 (18:33 +0000)]
compiler-rt: use 64-bit time_t for all FreeBSD archs except i386

Obtained from: LLVM r370756

4 years agocompiler-rt: use more __sanitizer_time_t on FreeBSD
emaste [Mon, 9 Sep 2019 18:32:29 +0000 (18:32 +0000)]
compiler-rt: use more __sanitizer_time_t on FreeBSD

A few structs were using long for time_t members.

Obtained from: LLVM r370755

4 years agobectl(8): initialize reverse earlier
kevans [Mon, 9 Sep 2019 18:17:30 +0000 (18:17 +0000)]
bectl(8): initialize reverse earlier

This turns into a warning in GCC 4.2 that 'reverse' may be used
uninitialized in this function. While I don't immediately see where it's
deciding this from (there's only two paths that make column != NULL, and
they both set reverse), initializing reverse earlier is good for clarity.

MFC after: 3 days

4 years agoFix number of problems found while testing on SAT devices.
mav [Mon, 9 Sep 2019 17:36:29 +0000 (17:36 +0000)]
Fix number of problems found while testing on SAT devices.

 - Remove incomplete and dangerous ata_res decoding from ata_do_cmd().
Instead switch all functions that need the result to use get_ata_status(),
doing the same, but more careful, also reducing code duplication.
 - Made get_ata_status() to also decode fixed format sense.  In many cases
it is still not enough to make it useful, since it can only report results
of 28-bit command, but it is slightly better then nothing.
 - Organize error reporting in ata_do_cmd(), so that if caller specified
AP_FLAG_CHK_COND, it is responsible for command errors (non-ioctl ones).
 - Make HPA/AMA errors not fatal for `identify` subcommand.
 - Fix reprobe() not being called on HPA/AMA when in quiet mode.
 - Remove not very useful messages from `format` and `sanitize` commands
with -y flag.  Once they started, they often can't be stopped any way.

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

4 years agoddb(4): Add some support for lexing IPv6 addresses
cem [Mon, 9 Sep 2019 16:32:23 +0000 (16:32 +0000)]
ddb(4): Add some support for lexing IPv6 addresses

Allow commands to specify that (hex) numbers may start with A-F, by adding
the DRT_HEX flag for db_read_token_flags().  As before, numbers containing
invalid digits for the current radix are rejected.

Also, lex ':' and '::' tokens as tCOLON and tCOLONCOLON respectively.

There is a mild conflict here with lexed "identifiers" (tIDENT): ddb
identifiers may contain arbitrary colons, and the ddb lexer is greedy.  So
the identifier lex will swallow any colons it finds inside identifiers, and
consumers are still unable to expect the token sequence 'tIDENT tCOLON'.
That limitation does not matter for IPv6 addresses, because the lexer always
attempts to lex numbers before identifiers.

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

4 years agoddb(4): Enhance lexer functionality for specialized commands
cem [Mon, 9 Sep 2019 16:31:14 +0000 (16:31 +0000)]
ddb(4): Enhance lexer functionality for specialized commands

Add a db_read_token_flags() variant of db_read_token() with configurable
parameters.

Allow specifying an explicit radix for tNUMBER lexing.  It overrides the
default inference and db_radix setting.

Also provide the option of yielding any lexed whitespace (tWSPACE) (instead
of ignoring it).  This is useful for whitespace-sensitive CS_OWN commands.

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

4 years agocsu: Add the riscv .init call sequence
kp [Mon, 9 Sep 2019 16:25:09 +0000 (16:25 +0000)]
csu: Add the riscv .init call sequence

Reviewed by: br
Sponsored by: Axiado
Differential Revision: https://reviews.freebsd.org/D21537

4 years agoOnly update SACK/DSACK lists when a non-empty segment was received.
tuexen [Mon, 9 Sep 2019 16:07:47 +0000 (16:07 +0000)]
Only update SACK/DSACK lists when a non-empty segment was received.
This fixes hitting a KASSERT with a valid packet exchange.

Reviewed by: rrs@, Richard Scheffenegger
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D21567

4 years agoriscv: Ensure that BSS is 8-byte aligned
kp [Mon, 9 Sep 2019 15:57:24 +0000 (15:57 +0000)]
riscv: Ensure that BSS is 8-byte aligned

This makes clearing it (from locore.S) work without misaligned accesses
(which can trap to machine mode, and be slow).

Reviewed by: br
Sponsored by: Axiado
Differential Revision: https://reviews.freebsd.org/D21538

4 years agom4: import from OpenBSD
bapt [Mon, 9 Sep 2019 15:37:40 +0000 (15:37 +0000)]
m4: import from OpenBSD

By deraadt@

mkstemp() returns -1 on failure

Obtained from: OpenBSD

4 years agom4: import from OpenBSD
bapt [Mon, 9 Sep 2019 15:35:34 +0000 (15:35 +0000)]
m4: import from OpenBSD

patch by espie@

replace sloppy parsing of numeric values with strtonum (incr, decr, divert)

still use integers, so use the natural bounds for these.

POSIX says m4 should error when these use non numeric values, and now they
do.

okay millert@

Obtained from: OpenBSD

4 years agom4: import patch from OpenBSD
bapt [Mon, 9 Sep 2019 15:28:22 +0000 (15:28 +0000)]
m4: import patch from OpenBSD

by espie@
ifelse is special, fix argv parsing to avoid segfault

problem noticed by Matthew Green (netbsd), slightly different fix
so that argc counting makes more sense.

we might want to warn on wrong number of parameters later, but this is
somewhat inconsistent depending on the builtin right now.

okay millert@

Obtained from: OpenBSD

4 years agom4: import patch from OpenBSD
bapt [Mon, 9 Sep 2019 15:24:48 +0000 (15:24 +0000)]
m4: import patch from OpenBSD

Use waitpid()/EINTR idiom for the specific pid, rather than generic wait()

Patch by: deraadt@

Obtained from: OpenBSD

4 years agoImport from OpenBSD a patch which eliminates the link with -ly or -ly
bapt [Mon, 9 Sep 2019 15:20:19 +0000 (15:20 +0000)]
Import from OpenBSD a patch which eliminates the link with -ly or -ly

patch by ibara@

Obtained from: OpenBSD

4 years agoImport from OpenBSD: -E flag
bapt [Mon, 9 Sep 2019 15:18:04 +0000 (15:18 +0000)]
Import from OpenBSD: -E flag

Add -E flag (make warnings fatal), following the behavior of GNU m4 1.4.9+

Help and direction millert@ espie@ anton@ deraadt@

ok espie@

Obtained from: OpenBSD

4 years agoci-qemu-test: if firmware is not available, hint at pkg to install
emaste [Mon, 9 Sep 2019 14:51:25 +0000 (14:51 +0000)]
ci-qemu-test: if firmware is not available, hint at pkg to install

uefi-edk2-qemu-x86_64 provides the firmware ci-qemu-test.sh expects to
use.

Sponsored by: The FreeBSD Foundation