]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoUpdate to 6.2-20200215
Baptiste Daroussin [Wed, 19 Feb 2020 17:09:08 +0000 (17:09 +0000)]
Update to 6.2-20200215

While I didn't plan another upgrade, This version incorporate fixes from
kevans@ so let's upgrade to it

4 years agoimport ncurses 6.2-20200215
Baptiste Daroussin [Wed, 19 Feb 2020 16:58:06 +0000 (16:58 +0000)]
import ncurses 6.2-20200215

4 years agobridge tests: Remove unneeded 'All rights reserved.'
Kristof Provost [Wed, 19 Feb 2020 16:44:16 +0000 (16:44 +0000)]
bridge tests: Remove unneeded 'All rights reserved.'

The FreeBSD foundation no longer requires this, as per
https://lists.freebsd.org/pipermail/svn-src-all/2019-February/177215.html and
private communications.

Sponsored by: The FreeBSD Foundation

4 years agonanobsd: add WITHOUT_LLVM_COV, akin to WITHOUT_GCOV
Ed Maste [Wed, 19 Feb 2020 16:23:21 +0000 (16:23 +0000)]
nanobsd: add WITHOUT_LLVM_COV, akin to WITHOUT_GCOV

Another case, missed in r358105

4 years agoCirrus-CI: increase timeout to 120m
Ed Maste [Wed, 19 Feb 2020 15:56:40 +0000 (15:56 +0000)]
Cirrus-CI: increase timeout to 120m

For some reason build+package+test time went from about 1h10 to over
1h30 (killed due to timeout prior to completion).

The reason for the increase still needs investigation.

4 years agotruss: fix shm_open2 oversight (BinString -> Name)
Kyle Evans [Wed, 19 Feb 2020 15:12:01 +0000 (15:12 +0000)]
truss: fix shm_open2 oversight (BinString -> Name)

BinString assumes a length in the next argument; Name is more appropriate
for the final argument.

4 years agokdump: decode shm_open2
Kyle Evans [Wed, 19 Feb 2020 14:55:59 +0000 (14:55 +0000)]
kdump: decode shm_open2

This is the kdump counterpart of the truss support added in r358116, and
also a part of D23733. shm_open2 is the successor to shm_open.

Reviewed by: kaktus

4 years agotruss: decode shm_open2
Kyle Evans [Wed, 19 Feb 2020 14:54:33 +0000 (14:54 +0000)]
truss: decode shm_open2

shm_open2 is similar to shm_open, except it also takes shmflags and optional
name to label the anonymous region for, e.g., debugging purposes.

The appropriate support for decoding shmflags was added to libsysdecode in
r358115.

This is a part of D23733.

Reviewed by: kaktus

4 years agolibsysdecode: grab shmflags from sys/mman.h, add decode method
Kyle Evans [Wed, 19 Feb 2020 14:52:32 +0000 (14:52 +0000)]
libsysdecode: grab shmflags from sys/mman.h, add decode method

Any SHM_* flag here is (and likely will continue to be) a shmflag that may
be passed to shm_open2(), with exception to SHM_ANON. This is a prereq to
adding appropriate support to truss/kdump.

Reviewed by: kaktus (slightly earlier version)
Differential Revision: https://reviews.freebsd.org/D23733

4 years agowhereis: remove gnu/libexec from source search paths
Ed Maste [Wed, 19 Feb 2020 14:40:53 +0000 (14:40 +0000)]
whereis: remove gnu/libexec from source search paths

The last subdirectory of gnu/libexec was removed in r85742.

4 years agokdump: decode SHM_ANON as first arg to legacy shm_open(2)
Kyle Evans [Wed, 19 Feb 2020 14:32:55 +0000 (14:32 +0000)]
kdump: decode SHM_ANON as first arg to legacy shm_open(2)

The first argument to shm_open(2) as well as shm_open2(2) may be a path or
SHM_ANON. Decode SHM_ANON, at least- paths will show up as namei results in
kdump output, which may be sufficient; in those cases, we'll have printed an
address.

Future commits will add support for shm_open2() to libsysdecode/truss/kdump.

Reported by: kaktus
MFC after: 3 days

4 years agonanobsd: add WITHOUT_LLVM_COV, akin to WITHOUT_GCOV
Ed Maste [Wed, 19 Feb 2020 14:26:27 +0000 (14:26 +0000)]
nanobsd: add WITHOUT_LLVM_COV, akin to WITHOUT_GCOV

4 years agoAdd a note about some fallouts due to the ncurses update
Baptiste Daroussin [Wed, 19 Feb 2020 14:18:17 +0000 (14:18 +0000)]
Add a note about some fallouts due to the ncurses update

4 years agosrc.conf.5: regen after r358101, WITHOUT_GCOV default
Ed Maste [Wed, 19 Feb 2020 14:16:48 +0000 (14:16 +0000)]
src.conf.5: regen after r358101, WITHOUT_GCOV default

4 years agoMove GCOV option to default NO
Ed Maste [Wed, 19 Feb 2020 14:12:59 +0000 (14:12 +0000)]
Move GCOV option to default NO

GNU gcov will be removed along with GCC 4.2.1 at the end of the month.
Change the default to NO in preparation.

4 years agolib_gen.c now also depends on ncurses_dll.h specify it to prevent some breakage
Baptiste Daroussin [Wed, 19 Feb 2020 14:09:15 +0000 (14:09 +0000)]
lib_gen.c now also depends on ncurses_dll.h specify it to prevent some breakage
if ncurses_dll.h is already present in base while building

4 years agoAdd some HISTORY sections to manpages
Sergio Carlavilla Delgado [Wed, 19 Feb 2020 12:49:49 +0000 (12:49 +0000)]
Add some HISTORY sections to manpages

environ(7) was in AT&T Version 7
ac(8): Add a HISTORY section
sa(8): Add a HISTORY section
sqrt(3): Add the actual sqrt function to the HISTORY section

Obtained from: OpenBSD

Submitted by: gbergling@gmail.com
Approved by: bcr@(mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23693

4 years agoDon't release xbusy on kmem pages. After lockless page lookup we will not
Jeff Roberson [Wed, 19 Feb 2020 09:10:11 +0000 (09:10 +0000)]
Don't release xbusy on kmem pages.  After lockless page lookup we will not
be able to guarantee that they can be racquired without blocking.

Reviewed by: kib
Discussed with: markj
Differential Revision: https://reviews.freebsd.org/D23506

4 years agoEliminate some unnecessary uses of UMA_ZONE_VM. Only zones involved in
Jeff Roberson [Wed, 19 Feb 2020 08:17:27 +0000 (08:17 +0000)]
Eliminate some unnecessary uses of UMA_ZONE_VM.  Only zones involved in
virtual address or physical page allocation need to be marked with this
flag.

Reviewed by: markj
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D23712

4 years agoType validating smr protected pointer accessors.
Jeff Roberson [Wed, 19 Feb 2020 08:15:20 +0000 (08:15 +0000)]
Type validating smr protected pointer accessors.

This API is intended to provide some measure of safety with SMR
protected pointers.  A struct wrapper provides type checking and
a guarantee that all access is mediated by the API unless abused.  All
modifying functions take an assert as an argument to guarantee that
the required synchronization is present.

Reviewed by: kib, markj, mjg
Differential Revision: https://reviews.freebsd.org/D23711

4 years agoAdd _BIX (Battery Information Extended) object support.
Hiroki Sato [Wed, 19 Feb 2020 06:28:55 +0000 (06:28 +0000)]
Add _BIX (Battery Information Extended) object support.

ACPI Control Method Batteries have a _BIF and/or _BIX object which
provide static properties of the battery.  FreeBSD acpi_cmbat module
supported _BIF object only, which was deprecated as of ACPI 4.0.
_BIX is an extended version of _BIF defined in ACPI 4.0 or later.

As of writing, _BIX has two revisions.  One is in ACPI 4.0 (rev.0) and
another is in ACPI 6.0 (rev.1).  It seems that hardware vendors still
stick to _BIF only or _BIX rev.0 + _BIF for the maximum compatibility.
Microsoft requires _BIX rev.0 for Windows machines, so there are some
laptop machines with _BIX rev.0 only. In this case, FreeBSD does not
recognize the battery information.

After this change, the acpi_cmbat module gets battery information from
_BIX or _BIF object and internally uses _BIX rev.1 data structure as
the primary information store in the kernel.  ACPIIO_BATT_GET_BI[FX]
returns an acpi_bi[fx] structure built by using information obtained
from a _BIF or a _BIX object found on the system.  The revision number
field can be used to check which field is available.  The acpiconf(8)
utility will show additional information if _BIX is available.

Although ABIs of ACPIIO_BATT_* were changed, the existing APIs for
userland utilities are not changed and the backward-compatible ABIs
are provided.  This means that older versions of acpiconf(8) can also
work with the new kernel. The (union acpi_battery_ioctl_arg) was
padded to 256 byte long to avoid another ABI change in the future.
A _BIX object with its revision number >1 will be treated as
compatible with the rev.1 _BIX format.

Reviewed by: takawata
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23728

4 years agopowerpc: unconditionally mark SLB zones UMA_ZONE_CONTIG
Ryan Libby [Wed, 19 Feb 2020 04:46:41 +0000 (04:46 +0000)]
powerpc: unconditionally mark SLB zones UMA_ZONE_CONTIG

PR: 244118
Reported by: Francis Little <oggy at farscape.co.uk>
Tested by: Francis Little, Mark Millard <marklmi at yahoo.com>
Reviewed by: markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D23729

4 years agopowerpc/amigaone: Fix license header formatting on cpld files
Justin Hibbits [Wed, 19 Feb 2020 03:39:11 +0000 (03:39 +0000)]
powerpc/amigaone: Fix license header formatting on cpld files

This should've been fixed before initial commit, but wasn't.  Not even sure
how it happened in the first place.

4 years agocaroot pkg: pass through the pkg -r rootdir as DESTDIR
Kyle Evans [Wed, 19 Feb 2020 02:35:43 +0000 (02:35 +0000)]
caroot pkg: pass through the pkg -r rootdir as DESTDIR

If we're trying to bootstrap a different root with pkgbase, we should be
doing the right thing with caroot.

4 years agocertctl(8): switch to install(1) to fix DESTDIR support
Kyle Evans [Wed, 19 Feb 2020 02:34:56 +0000 (02:34 +0000)]
certctl(8): switch to install(1) to fix DESTDIR support

"Oops" - ln(1) is fine and dandy, but when you're using DESTDIR...it's not-
the path will almost certainly be invalid once the root you've just
installed to is relocated, perhaps to /.

Switch to install(1) using `-l rs` to calculate the relative symlink between
the two, which should work just fine in all cases.

MFC after: 1 week

4 years ago[skip ci] delete obsolete comment in fusefs tests
Alan Somers [Wed, 19 Feb 2020 01:51:01 +0000 (01:51 +0000)]
[skip ci] delete obsolete comment in fusefs tests

It should've been deleted by r349436

MFC after: 2 weeks

4 years agocxgbe(4): Congestion drops are maintained per E-channel and not per
Navdeep Parhar [Wed, 19 Feb 2020 00:48:58 +0000 (00:48 +0000)]
cxgbe(4): Congestion drops are maintained per E-channel and not per
buffer group.

This fixes a bug where congestion drops on port 1 of a T6 card would
incorrectly be counted as drops on port 0.

MFC after: 1 week
Sponsored by: Chelsio Communications

4 years agoAdditional KASSERTs to ensure the consistency of the soft updates
Kirk McKusick [Tue, 18 Feb 2020 23:56:23 +0000 (23:56 +0000)]
Additional KASSERTs to ensure the consistency of the soft updates
indirdep structure. No functional change.

Tested by:    Peter Holm (as part of a larger patch)
Sponsored by: Netflix

4 years agoEpochify SCTP.
Michael Tuexen [Tue, 18 Feb 2020 21:25:17 +0000 (21:25 +0000)]
Epochify SCTP.

4 years agocxgbe/iw_cxgbe: correctly enforce the max reg_mr depth.
Navdeep Parhar [Tue, 18 Feb 2020 20:43:10 +0000 (20:43 +0000)]
cxgbe/iw_cxgbe: correctly enforce the max reg_mr depth.

Reported by: Andrew Zhu @ Netapp
Obtained from: Chelsio Communications
MFC after: 1 week
Sponsored by: Chelsio Communications

4 years agoUse NET_TASK_INIT() and NET_GROUPTASK_INIT() for drivers that process
Hans Petter Selasky [Tue, 18 Feb 2020 19:53:36 +0000 (19:53 +0000)]
Use NET_TASK_INIT() and NET_GROUPTASK_INIT() for drivers that process
incoming packets in taskqueue context.

This patch extends r357772.

Differential Revision: https://reviews.freebsd.org/D23742
Reviewed by: glebius@
Sponsored by: Mellanox Technologies

4 years agoRemove unused function.
Michael Tuexen [Tue, 18 Feb 2020 19:41:55 +0000 (19:41 +0000)]
Remove unused function.

4 years agoFix the following -Werror warning from clang 10.0.0:
Dimitry Andric [Tue, 18 Feb 2020 17:55:24 +0000 (17:55 +0000)]
Fix the following -Werror warning from clang 10.0.0:

sys/arm/allwinner/clkng/aw_clk_mipi.c:144:6: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                                        m++;
                                        ^
sys/arm/allwinner/clkng/aw_clk_mipi.c:142:5: note: previous statement is here
                                if (best == *fout)
                                ^

Move the increment operations into the for loop headers instead.

Discussed with: manu
MFC after: 3 days

4 years agoAdd a EXT2FS-specific implementation for lseek(SEEK_DATA).
Fedor Uporov [Tue, 18 Feb 2020 16:39:57 +0000 (16:39 +0000)]
Add a EXT2FS-specific implementation for lseek(SEEK_DATA).

The lseek(SEEK_DATA) optimization logic could be simply borrowed from ufs side.
See, https://reviews.freebsd.org/D19599.

Reviewed by:    pfg
MFC after:      1 week

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

4 years agoremove old perl entries from ObsoleteFiles.inc
Ed Maste [Tue, 18 Feb 2020 16:37:48 +0000 (16:37 +0000)]
remove old perl entries from ObsoleteFiles.inc

Each entry in ObsoleteFiles.inc adds to the time `make delete-old` and
friends take to run.  Perl was removed from the FreeBSD base system a
very long time ago (FreeBSD 5); source updates have not been supported
from that version for years.

Perl was a single component responsible for thousands of entries so
provides significant benefit with little effort/investigation required.
We could still use a more comprehensive cleanup to remove old entries.

Also add an UPDATING note (with wordsmithing by imp) indicating that
`make delete-old` is required along each step of a source upgrade from
an old, unsupported release.

Discussed with: imp
Sponsored by: The FreeBSD Foundation

4 years agoip6_output: update comments.
Bjoern A. Zeeb [Tue, 18 Feb 2020 11:28:00 +0000 (11:28 +0000)]
ip6_output: update comments.

Clear up some comments and improve to panic messages.

No functional changes.

MFC after: 3 days

4 years agoThis commit makes significant changes to pam_login_access(8) to bring it
Cy Schubert [Tue, 18 Feb 2020 11:27:08 +0000 (11:27 +0000)]
This commit makes significant changes to pam_login_access(8) to bring it
up to par with the Linux pam_access(8).

Like the Linux pam_access(8) our pam_login_access(8) is a service module
for pam(3) that allows a administrator to limit access from specified
remote hosts or terminals. Unlike the Linux pam_access, pam_login_access
is missing some features which are added by this commit:

Access file can now be specified. The default remains /etc/access.conf.
The syntax is consistent with Linux pam_access.

By default usernames are matched. If the username fails to match a match
against a group name is attempted. The new nodefgroup module option will
only match a username and no attempt to match a group name is made.
Group names must be specified in brackets, "()" when nodefgroup is
specified. Otherwise the old backward compatible behavior is used.
This is consistent with Linux pam_access.

A new field separator module option allows the replacement of the default
colon (:) with any other character. This facilitates potential future
specification of X displays. This is also consistent with Linux pam_access.

A new list separator module option to replace the default space/comma/tab
with another character. This too is consistent with Linux pam_access.

Linux pam_access options not implemented in this commit are the debug
and audit options. These will be implemented at a later date.

Reviewed by: bjk, bcr (for manpages)
Approved by: des (blanket, implicit)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D23198

4 years agostrchr() returns a pointer not an int.
Cy Schubert [Tue, 18 Feb 2020 11:27:05 +0000 (11:27 +0000)]
strchr() returns a pointer not an int.

Reported by: bjk
Approved by: des (blanket, implicit)
MFC after: 3 days

4 years agoAdd missing SYNOPSIS section.
Cy Schubert [Tue, 18 Feb 2020 11:27:02 +0000 (11:27 +0000)]
Add missing SYNOPSIS section.

Reported by: ports/textproc/igor
MFC after: 3 days

4 years agoThere is no pam(8) man page, it is pam(3).
Cy Schubert [Tue, 18 Feb 2020 11:26:59 +0000 (11:26 +0000)]
There is no pam(8) man page, it is pam(3).

Approved by: des (implicit, blanket)
MFC after: 3 days

4 years agoWhen pam_login_access(5) fails to match a username it attempts to
Cy Schubert [Tue, 18 Feb 2020 11:26:56 +0000 (11:26 +0000)]
When pam_login_access(5) fails to match a username it attempts to
match the primary group a user belongs to. This commit extends the
match to secondary groups a user belongs to as well, just as the Linux
pam_access(5) does.

Approved by: des (implicit, blanket)

4 years agoThe words ALL, LOCAL, and EXCEPT have special meaning and are documented
Cy Schubert [Tue, 18 Feb 2020 11:26:52 +0000 (11:26 +0000)]
The words ALL, LOCAL, and EXCEPT have special meaning and are documented
as in the login.access(5) man page. However strcasecmp() is used to compare
for these special strings. Because of this User accounts and groups with
the corresponding lowercase names are misintrepreted to have special
whereas they should not.

This commit fixes this, conforming to the man page and to how the Linux
pam_access(8) handles these special words.

Approved by: des (implicit, blanket)

4 years agoAs with ipf(8), give ippool(8) the ability to load IP pools from multiple
Cy Schubert [Tue, 18 Feb 2020 11:26:49 +0000 (11:26 +0000)]
As with ipf(8), give ippool(8) the ability to load IP pools from multiple
files. This allows for loading, during the same invocation of ippool, of
multiple sources of input using multiple tools to concurrently maintain the
files such as fail2ban, macro preprocessors, and manually.

MFC after: 1 week

4 years agoUpdate ncurses to 20200118
Baptiste Daroussin [Tue, 18 Feb 2020 08:11:52 +0000 (08:11 +0000)]
Update ncurses to 20200118

Among the changes from before:
- Add support for extended colors on widechar version
- Enable ncurses extended functions
- Enable version 2 of the extended mouse support
- Enable SCREEN extensions

Modification that differs from upstream:
- _nc_delink_entries used to be exposed and was turn static,
  turn it back as dynamic to not break abi
- Adapt our old termcap.c to modern ncurses

MFC after: 3 weeks

4 years agoUse 0x5c for the scan code 0x7d.
Hiroki Sato [Tue, 18 Feb 2020 01:50:44 +0000 (01:50 +0000)]
Use 0x5c for the scan code 0x7d.

Japanese keyboards traditionally use 0x5c for
both Japanese yen sign key and backslash key.
While a Japanese yen sign is depicted on the keytop,
most of Japanese expect that the scan code 0x7d gives
a backslash (0x5c), not a Japanese yen sign (0xa5).

This is because JIS X 0201 encoding (aka ISO/IEC 646-JA,
an extended version of ASCII which is very popular
in Japan) has Japanese yen sign at 0x5c and
no backslash.  On the other hand, ISO/IEC 8859-1
has Japanese yen sign at 0xa5.  This difference has
caused a confusion after Unicode became popular since
ISO/IEC 10646 adopted 8859-1 for the plane 0.

MFC after: 1 week

4 years agoamd64: keep PTE bitmasks in sync with target pmap during pv reclaim
Chuck Silvers [Tue, 18 Feb 2020 00:02:20 +0000 (00:02 +0000)]
amd64: keep PTE bitmasks in sync with target pmap during pv reclaim

in reclaim_pv_chunk_domain(), when we switch to a new target pmap from which
we are trying to reclaim a pv chunk, always update the current PTE bitmasks
to match.

Reviewed by: kib, markj
Approved by: imp (mentor)
Sponsored by: Netflix

4 years agoReally skip the tests in capsicum tests
Li-Wen Hsu [Mon, 17 Feb 2020 20:25:33 +0000 (20:25 +0000)]
Really skip the tests in capsicum tests

Sponsored by: The FreeBSD Foundation

4 years agoMerge r358042 from the clang1000-import branch:
Dimitry Andric [Mon, 17 Feb 2020 20:24:21 +0000 (20:24 +0000)]
Merge r358042 from the clang1000-import branch:

Add casts and L suffixes to libc quad support, to work around various
-Werror warnings from clang 10.0.0, such as:

lib/libc/quad/fixdfdi.c:57:12: error: implicit conversion from 'long long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion]
                if (x >= QUAD_MAX)
                      ~~ ^~~~~~~~
/usr/obj/usr/src/powerpc.powerpc/tmp/usr/include/sys/limits.h:89:19: note: expanded from macro 'QUAD_MAX'
#define QUAD_MAX        (__QUAD_MAX)    /* max value for a quad_t */
                         ^~~~~~~~~~
/usr/obj/usr/src/powerpc.powerpc/tmp/usr/include/machine/_limits.h:91:20: note: expanded from macro '__QUAD_MAX'
#define __QUAD_MAX      __LLONG_MAX     /* max value for a quad_t */
                        ^~~~~~~~~~~
/usr/obj/usr/src/powerpc.powerpc/tmp/usr/include/machine/_limits.h:75:21: note: expanded from macro '__LLONG_MAX'
#define __LLONG_MAX     0x7fffffffffffffffLL    /* max value for a long long */
                        ^~~~~~~~~~~~~~~~~~~~

and many instances of:

lib/libc/quad/fixunsdfdi.c:73:17: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
        toppart = (x - ONE_HALF) / ONE;
                       ^~~~~~~~
lib/libc/quad/fixunsdfdi.c:45:19: note: expanded from macro 'ONE_HALF'
#define ONE_HALF        (ONE_FOURTH * 2.0)
                         ^~~~~~~~~~
lib/libc/quad/fixunsdfdi.c:44:23: note: expanded from macro 'ONE_FOURTH'
#define ONE_FOURTH      (1 << (LONG_BITS - 2))
                           ^  ~~~~~~~~~~~~~~~
lib/libc/quad/fixunsdfdi.c:73:29: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
        toppart = (x - ONE_HALF) / ONE;
                                   ^~~
lib/libc/quad/fixunsdfdi.c:46:15: note: expanded from macro 'ONE'
#define ONE             (ONE_FOURTH * 4.0)
                         ^~~~~~~~~~
lib/libc/quad/fixunsdfdi.c:44:23: note: expanded from macro 'ONE_FOURTH'
#define ONE_FOURTH      (1 << (LONG_BITS - 2))
                           ^  ~~~~~~~~~~~~~~~

MFC after: 3 days

4 years agoMerge r358034 from the clang1000-import branch:
Dimitry Andric [Mon, 17 Feb 2020 20:23:26 +0000 (20:23 +0000)]
Merge r358034 from the clang1000-import branch:

Disable new clang 10.0.0 warnings about misleading indentation in
sys/contrib/ncsw/Peripherals/FM/fman_ncsw.c.

This is horribly formatted contributed code, and fixing it is not worth
the effort.

MFC after: 3 days

4 years agoMerge r358030 from the clang1000-import branch:
Dimitry Andric [Mon, 17 Feb 2020 20:22:10 +0000 (20:22 +0000)]
Merge r358030 from the clang1000-import branch:

Work around new clang 10.0.0 -Werror warning:

sys/arm/allwinner/aw_cir.c:208:41: error: converting the result of '<<' to a boolean; did you mean '((1 & 255) << 23) != 0'? [-Werror,-Wint-in-bool-context]
        active_delay = (AW_IR_ACTIVE_T + 1) * (AW_IR_ACTIVE_T_C ? 128 : 1);
                                               ^
sys/arm/allwinner/aw_cir.c:130:39: note: expanded from macro 'AW_IR_ACTIVE_T_C'
#define AW_IR_ACTIVE_T_C                ((1 & 0xff) << 23)
                                                    ^

Add the != 0 part to indicate that we indeed want to compare against
zero.

MFC after: 3 days

4 years agoAdd casts and L suffixes to libc quad support, to work around various
Dimitry Andric [Mon, 17 Feb 2020 20:14:59 +0000 (20:14 +0000)]
Add casts and L suffixes to libc quad support, to work around various
-Werror warnings from clang 10.0.0, such as:

lib/libc/quad/fixdfdi.c:57:12: error: implicit conversion from 'long long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion]
                if (x >= QUAD_MAX)
                      ~~ ^~~~~~~~
/usr/obj/usr/src/powerpc.powerpc/tmp/usr/include/sys/limits.h:89:19: note: expanded from macro 'QUAD_MAX'
#define QUAD_MAX        (__QUAD_MAX)    /* max value for a quad_t */
                         ^~~~~~~~~~
/usr/obj/usr/src/powerpc.powerpc/tmp/usr/include/machine/_limits.h:91:20: note: expanded from macro '__QUAD_MAX'
#define __QUAD_MAX      __LLONG_MAX     /* max value for a quad_t */
                        ^~~~~~~~~~~
/usr/obj/usr/src/powerpc.powerpc/tmp/usr/include/machine/_limits.h:75:21: note: expanded from macro '__LLONG_MAX'
#define __LLONG_MAX     0x7fffffffffffffffLL    /* max value for a long long */
                        ^~~~~~~~~~~~~~~~~~~~

and many instances of:

lib/libc/quad/fixunsdfdi.c:73:17: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
        toppart = (x - ONE_HALF) / ONE;
                       ^~~~~~~~
lib/libc/quad/fixunsdfdi.c:45:19: note: expanded from macro 'ONE_HALF'
#define ONE_HALF        (ONE_FOURTH * 2.0)
                         ^~~~~~~~~~
lib/libc/quad/fixunsdfdi.c:44:23: note: expanded from macro 'ONE_FOURTH'
#define ONE_FOURTH      (1 << (LONG_BITS - 2))
                           ^  ~~~~~~~~~~~~~~~
lib/libc/quad/fixunsdfdi.c:73:29: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
        toppart = (x - ONE_HALF) / ONE;
                                   ^~~
lib/libc/quad/fixunsdfdi.c:46:15: note: expanded from macro 'ONE'
#define ONE             (ONE_FOURTH * 4.0)
                         ^~~~~~~~~~
lib/libc/quad/fixunsdfdi.c:44:23: note: expanded from macro 'ONE_FOURTH'
#define ONE_FOURTH      (1 << (LONG_BITS - 2))
                           ^  ~~~~~~~~~~~~~~~

4 years agoFix syntax error from r357647. Adjust a variable name to make the use more
Scott Long [Mon, 17 Feb 2020 20:12:34 +0000 (20:12 +0000)]
Fix syntax error from r357647.  Adjust a variable name to make the use more
clear.

Reported by: dim

4 years agoDisable new clang 10.0.0 warnings about misleading indentation in
Dimitry Andric [Mon, 17 Feb 2020 19:20:47 +0000 (19:20 +0000)]
Disable new clang 10.0.0 warnings about misleading indentation in
sys/contrib/ncsw/Peripherals/FM/fman_ncsw.c.

This is horribly formatted contributed code, and fixing it is not worth
the effort.

4 years agoWork around riscv buildworld failure where it cannot link the final
Dimitry Andric [Mon, 17 Feb 2020 18:51:52 +0000 (18:51 +0000)]
Work around riscv buildworld failure where it cannot link the final
clang binary, with:

ld: error: undefined symbol: llvm::EnableABIBreakingChecks
>>> referenced by PlistDiagnostics.cpp
>>>               PlistDiagnostics.o:(.sdata+0x0) in archive /usr/obj/usr/src/riscv.riscv64/lib/clang/libclang/libclang.a
[... many more like this ...]

4 years agoWork around new clang 10.0.0 -Werror warning:
Dimitry Andric [Mon, 17 Feb 2020 18:37:15 +0000 (18:37 +0000)]
Work around new clang 10.0.0 -Werror warning:

sys/arm/allwinner/aw_cir.c:208:41: error: converting the result of '<<' to a boolean; did you mean '((1 & 255) << 23) != 0'? [-Werror,-Wint-in-bool-context]
        active_delay = (AW_IR_ACTIVE_T + 1) * (AW_IR_ACTIVE_T_C ? 128 : 1);
                                               ^
sys/arm/allwinner/aw_cir.c:130:39: note: expanded from macro 'AW_IR_ACTIVE_T_C'
#define AW_IR_ACTIVE_T_C                ((1 & 0xff) << 23)
                                                    ^

Add the != 0 part to indicate that we indeed want to compare against
zero.

4 years agoTentatively apply D23730:
Dimitry Andric [Mon, 17 Feb 2020 18:31:32 +0000 (18:31 +0000)]
Tentatively apply D23730:

Fix compile errors in altera_sdcard_io.c after r357647

Summary:
After rS357647, building universe results in compilation errors for
_.mips.BERI_DE4_SDROOT:

```
sys/dev/altera/sdcard/altera_sdcard_io.c: In function 'altera_sdcard_io_start_internal':
sys/dev/altera/sdcard/altera_sdcard_io.c:299:13: error: '*bp' is a pointer; did you mean to use '->'?
  switch (*bp->bio_cmd) {
             ^~
             ->
sys/dev/altera/sdcard/altera_sdcard_io.c:301:38: error: '*bp' is a pointer; did you mean to use '->'?
   altera_sdcard_write_cmd_arg(sc, *bp->bio_pblkno *
                                      ^~
                                      ->
sys/dev/altera/sdcard/altera_sdcard_io.c:307:42: error: '*bp' is a pointer; did you mean to use '->'?
   altera_sdcard_write_rxtx_buffer(sc, *bp->bio_data,
                                          ^~
                                          ->
sys/dev/altera/sdcard/altera_sdcard_io.c:308:10: error: '*bp' is a pointer; did you mean to use '->'?
       *bp->bio_bcount);
          ^~
          ->
sys/dev/altera/sdcard/altera_sdcard_io.c:309:38: error: '*bp' is a pointer; did you mean to use '->'?
   altera_sdcard_write_cmd_arg(sc, *bp->bio_pblkno *
                                      ^~
                                      ->
sys/dev/altera/sdcard/altera_sdcard_io.c: In function 'altera_sdcard_io_start':
sys/dev/altera/sdcard/altera_sdcard_io.c:336:20: error: incompatible types when assigning to type 'struct bio *' from type 'struct bio'
  sc->as_currentbio = *bp;
                    ^
```

The first few are because `->` has a higher precedence than `*`, so the
expressions should use `(*bp)->foo` instead.  I also renamed the
variable to `bpp` to make it clearer that it is a pointer-to-pointer.

The last one is because `sc->as_currentbio` is already a `struct bio *`,
there is no need to dereference `bp` there.

Last but not least, I would really suggest rewriting the
`altera_sdcard_io_start_internal()` function to just return success or
failure, so the caller can decide to set `bp` to NULL.

4 years agoFix the non-default stream schedulers such that do not interleave
Michael Tuexen [Mon, 17 Feb 2020 18:05:03 +0000 (18:05 +0000)]
Fix the non-default stream schedulers such that do not interleave
user messages when it is now allowed.

Thanks to Christian Wright for reporting the issue for the userland
stack and providing a fix for the priority scheduler.

MFC after: 1 week

4 years agoUse EARLY_DRIVER_MODULE in the acpi bus.
Andrew Turner [Mon, 17 Feb 2020 15:32:21 +0000 (15:32 +0000)]
Use EARLY_DRIVER_MODULE in the acpi bus.

We need this to use EARLY_DRIVER_MODULE in child drivers on arm64. This
should be a no-op on x86 as it has DRIVER_MODULE in the nexus driver making
all later drivers attach in the last pass.

Reviewed by: imp
MFC after: 1 month
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D23717

4 years agoRemove swblk_t.
Mark Johnston [Mon, 17 Feb 2020 15:11:07 +0000 (15:11 +0000)]
Remove swblk_t.

It was used only to store the bounds of each swap device.  However,
since swblk_t is a signed 32-bit int and daddr_t is a signed 64-bit
int, swp_pager_isondev() may return an invalid result if swap devices
are repeatedly added and removed and sw_end for a device ends up
becoming a negative number.

Note that the removed comment about maximum swap size still applies.

Reviewed by: jeff, kib
Tested by: pho
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23666

4 years agoFix a swap block allocation race.
Mark Johnston [Mon, 17 Feb 2020 15:10:41 +0000 (15:10 +0000)]
Fix a swap block allocation race.

putpages' allocation of swap blocks is done under the global sw_dev
lock.  Previously it would drop that lock before inserting the allocated
blocks into the object's trie, creating a window in which swap blocks
are allocated but are not visible to swapoff.  This can cause
swp_pager_strategy() to fail and panic the system.

Fix the problem bluntly, by allocating swap blocks under the object
lock.

Reviewed by: jeff, kib
Tested by: pho
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23665

4 years agoFix object locking races in swapoff(2).
Mark Johnston [Mon, 17 Feb 2020 15:09:40 +0000 (15:09 +0000)]
Fix object locking races in swapoff(2).

swap_pager_swapoff_object()'s goal is to allocate pages for all valid
swap blocks belonging to the object, for which there is no resident
page.  If the page corresponding to a block is already resident and
valid, the block can simply be discarded.

The existing implementation tries to minimize the number of I/Os used.
For each cluster of swap blocks, it finds maximal runs of valid swap
blocks not resident in memory, and valid resident pages.  During this
processing, the object lock may be dropped in several places: when
calling getpages, or when blocking on a busy page in
vm_page_grab_pages().  While the lock is dropped, another thread may
free swap blocks, causing getpages to page in stale data.

Fix the problem following a suggestion from Jeff: use getpages'
readahead capability to perform clustering rather than doing it
ourselves.  The simplies the code a bit without reintroducing the old
behaviour of performing one I/O per page.

Reviewed by: jeff
Reported by: dhw, gallatin
Tested by: pho
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23664

4 years agoDon't use uninitialised stack memory if the sysctl variable
Michael Tuexen [Mon, 17 Feb 2020 14:54:21 +0000 (14:54 +0000)]
Don't use uninitialised stack memory if the sysctl variable
net.inet.tcp.hostcache.enable is set to 0.
The bug resulted in using possibly a too small MSS value or wrong
initial retransmission timer settings. Possibly the value used
for ssthresh was also wrong.

Submitted by: Richard Scheffenegger
Reviewed by: Cheng Cui, rgrimes@, tuexen@
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23687

4 years agopciconf: List names of all known extended PCIe capabilities.
Konstantin Belousov [Mon, 17 Feb 2020 13:31:30 +0000 (13:31 +0000)]
pciconf: List names of all known extended PCIe capabilities.

Some ids are redundand because the list_ecaps() function decodes them
by explicit switch case.  But listing them all makes it easier to not
miss ecaps, while not changing the functionality.

Initial submission by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

4 years agoFix typo.
Konstantin Belousov [Mon, 17 Feb 2020 13:26:36 +0000 (13:26 +0000)]
Fix typo.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

4 years agoPartially revert VNET change and expand VNET structure.
Bjoern A. Zeeb [Mon, 17 Feb 2020 11:08:50 +0000 (11:08 +0000)]
Partially revert VNET change and expand VNET structure.

Revert parts of r353274 replacing vnet_state with a shutdown flag.

Not having the state flag for the current SI_SUB_* makes it harder to debug
kernel or module panics related to VNET bringup or teardown.
Not having the state also does not allow us to check for other dependency
levels between components, e.g. for moving interfaces.

Expand the VNET structure with the new boolean flag indicating that we are
doing a shutdown of a given vnet and update the vnet magic cookie for the
change.

Update libkvm to compile with a bool in the kernel struct.

Bump __FreeBSD_version for (external) module builds to more easily detect
the change.

Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23097

4 years agoFix kernel panic while trying to read multicast stream.
Hans Petter Selasky [Mon, 17 Feb 2020 09:46:32 +0000 (09:46 +0000)]
Fix kernel panic while trying to read multicast stream.

When VIMAGE is enabled make sure the "m_pkthdr.rcvif" pointer is set
for all mbufs being input by the IGMP/MLD6 code. Else there will be a
NULL-pointer dereference in the netisr code when trying to set the
VNET based on the incoming mbuf. Add an assert to catch this when
queueing mbufs on a netisr to make debugging of similar cases easier.

Found by: Vladislav V. Prodan
PR: 244002
Reviewed by: bz@
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoAdd a simple accessor that returns the bytes of memory consumed by a zone.
Jeff Roberson [Mon, 17 Feb 2020 01:59:55 +0000 (01:59 +0000)]
Add a simple accessor that returns the bytes of memory consumed by a zone.

4 years agoRefactor _vm_page_busy_sleep to reduce the delta between the various
Jeff Roberson [Mon, 17 Feb 2020 01:08:00 +0000 (01:08 +0000)]
Refactor _vm_page_busy_sleep to reduce the delta between the various
sleep routines and introduce a variant that supports lockless sleep.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D23612

4 years agoUMA has become more particular about zone types. Use the right allocator
Jeff Roberson [Mon, 17 Feb 2020 01:06:18 +0000 (01:06 +0000)]
UMA has become more particular about zone types.  Use the right allocator
calls in uma_zwait().

4 years agoAdd rudamentary support for UFS to probe whether a block device supports the
Scott Long [Sun, 16 Feb 2020 23:10:59 +0000 (23:10 +0000)]
Add rudamentary support for UFS to probe whether a block device supports the
BIO_SPEEDUP command.  Add complimentary support to the CAM periphs that
support it.  This is a redo of r357710.

4 years agorefcount: update comments about fencing when releasing counts after r357989
Mateusz Guzik [Sun, 16 Feb 2020 18:20:09 +0000 (18:20 +0000)]
refcount: update comments about fencing when releasing counts after r357989

Requested by: kib
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D23719

4 years agoTemporarily skip flakey test case sys.netinet.fibs_test.udp_dontroute6 in CI
Li-Wen Hsu [Sun, 16 Feb 2020 17:55:32 +0000 (17:55 +0000)]
Temporarily skip flakey test case sys.netinet.fibs_test.udp_dontroute6 in CI

PR: 244172
Sponsored by: The FreeBSD Foundation

4 years agoTemporarily skip flakey test case sys.netinet6.frag6.frag6_07.frag6_07 in CI
Li-Wen Hsu [Sun, 16 Feb 2020 17:36:16 +0000 (17:36 +0000)]
Temporarily skip flakey test case sys.netinet6.frag6.frag6_07.frag6_07 in CI

PR: 244170
Sponsored by: The FreeBSD Foundation

4 years agoMark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (5 of many)
Pawel Biernacki [Sun, 16 Feb 2020 17:11:54 +0000 (17:11 +0000)]
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (5 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked). Use it in
preparation for a general review of all nodes.
This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Reviewed by: imp, kib
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D23633

4 years agoTemporarily skip sys.net.if_lagg_test.lacp_linkstate_destroy_stress on i386 CI
Li-Wen Hsu [Sun, 16 Feb 2020 16:49:29 +0000 (16:49 +0000)]
Temporarily skip sys.net.if_lagg_test.lacp_linkstate_destroy_stress on i386 CI

It panics kernel

PR: 244168
Sponsored by: The FreeBSD Foundation

4 years agoFix build of some modules for some kernel configs.
Konstantin Belousov [Sun, 16 Feb 2020 15:43:28 +0000 (15:43 +0000)]
Fix build of some modules for some kernel configs.

Namely, vmm.ko cannot be compiled without 'option SMP', the code uses
IPIs and LAPIC.
Recently systrace was forced over any configs, check for KDTRACE_HOOK
before compiling the dtrace/ modules.

Reviewed by: markj
Discussed with: mjg
Tested by: se (previous version)
Sponsored by: The FreeBSD Foundation (kib)
Differential revision: https://reviews.freebsd.org/D23699

4 years agoTemporarily skip flakey test in sys.capsicum.capsicum-test.main:
Li-Wen Hsu [Sun, 16 Feb 2020 14:33:55 +0000 (14:33 +0000)]
Temporarily skip flakey test in sys.capsicum.capsicum-test.main:

PipePdfork.WildcardWait

PR: 244165
Sponsored by: The FreeBSD Foundation

4 years agoMerge ^/head r357966 through r357999.
Dimitry Andric [Sun, 16 Feb 2020 13:23:54 +0000 (13:23 +0000)]
Merge ^/head r357966 through r357999.

4 years agoMerge commit 62654cab7 from llvm git (by me):
Dimitry Andric [Sun, 16 Feb 2020 13:22:36 +0000 (13:22 +0000)]
Merge commit 62654cab7 from llvm git (by me):

  Restore functionality of --sysroot on FreeBSD after b18cb9c47

  After b18cb9c47, clang would sometimes prefer the host C++ includes
  (e.g. in /usr/include/c++/v1) before those specified via --sysroot.
  While this behavior may be desirable on Linux, it is not so on
  FreeBSD, where we make extensive use of --sysroot during the build of
  the base system.  In that case, clang must *not* search outside the
  sysroot, except for its own internal headers.

  Add an override addLibCxxIncludePaths() to restore the old behavior,
  which is to simply append /usr/include/c++/v1 to the specified
  sysroot.  While here, apply clang-format to the FreeBSD specific
  toolchain files.

  Fixes PR44923.

4 years agobridge: Basic test case
Kristof Provost [Sun, 16 Feb 2020 13:16:40 +0000 (13:16 +0000)]
bridge: Basic test case

Very basic bridge test: Set up two jails and test that they can pass IPv4
traffic over the bridge.

Reviewed by: melifaro, philip
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23697

4 years agoTemporarily skip failing sys.net.if_lagg_test.witness on i386 CI
Li-Wen Hsu [Sun, 16 Feb 2020 11:16:05 +0000 (11:16 +0000)]
Temporarily skip failing sys.net.if_lagg_test.witness on i386 CI

PR: 244163
Sponsored by: The FreeBSD Foundation

4 years agoRemove trailing whitespace
Li-Wen Hsu [Sun, 16 Feb 2020 10:59:32 +0000 (10:59 +0000)]
Remove trailing whitespace

Sponsored by: The FreeBSD Foundation

4 years agoRemove trailing whitespace
Li-Wen Hsu [Sun, 16 Feb 2020 10:57:42 +0000 (10:57 +0000)]
Remove trailing whitespace

Sponsored by: The FreeBSD Foundation

4 years agovfs: fix vlrureclaim ->v_object access
Mateusz Guzik [Sun, 16 Feb 2020 03:33:34 +0000 (03:33 +0000)]
vfs: fix vlrureclaim ->v_object access

The routine was checking for ->v_type == VBAD. Since vgone drops the interlock
early sets this type at the end of the process of dooming a vnode, this opens
a time window where it can clear the pointer while the inerlock-holders is
accessing it.

Another note is that the code was:
   (vp->v_object != NULL &&
   vp->v_object->resident_page_count > trigger)

With the compiler being fully allowed to emit another read to get the pointer,
and in fact it did on the kernel used by pho.

Use atomic_load_ptr and remember the result.

Note that this depends on type-safety of vm_object.

Reported by: pho

4 years agovfs: check early for VCHR in vput_final to short-circuit in the common case
Mateusz Guzik [Sun, 16 Feb 2020 03:16:28 +0000 (03:16 +0000)]
vfs: check early for VCHR in vput_final to short-circuit in the common case

Otherwise the compiler inlines v_decr_devcount which keps getting jumped over
in the common case of not dealing with a device.

4 years agorefcount: add missing release fence to refcount_release_if_gt
Mateusz Guzik [Sun, 16 Feb 2020 03:14:55 +0000 (03:14 +0000)]
refcount: add missing release fence to refcount_release_if_gt

The CPU succeeding in releasing the not last reference can still have pending
stores to the object protected by the affected counter. This opens a time
window where another CPU can release the last reference and free the object,
resulting in use-after-free. On top of that this prevents the compiler from
generating more accesses to the object regardless of how atomic_fcmpset_rel_int
is implemented (of course as long as it provides the release semantic).

Reviewed by: markj

4 years agoSlightly restructure uma_zalloc* to generate better code from clang and
Jeff Roberson [Sun, 16 Feb 2020 01:07:19 +0000 (01:07 +0000)]
Slightly restructure uma_zalloc* to generate better code from clang and
reduce duplication among zalloc functions.

Reviewed by: markj
Discussed with: mjg
Differential Revision: https://reviews.freebsd.org/D23672

4 years agoAdd zfree to zero allocation before free
Matt Macy [Sun, 16 Feb 2020 00:12:53 +0000 (00:12 +0000)]
Add zfree to zero allocation before free

Key and cookie management typically wants to
avoid information leaks by explicitly zeroing
before free. This routine simplifies that by
permitting consumers to do so without carrying
the size around.

Reviewed by: jeff@, jhb@
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D22790

4 years agoAdd chacha20poly1305 support to crypto build
Matt Macy [Sun, 16 Feb 2020 00:03:09 +0000 (00:03 +0000)]
Add chacha20poly1305 support to crypto build

This is a dependency for in-kernel wireguard.

Reviewed by: cem@
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D23689

4 years agoAdd pthread_peekjoin_np(3).
Konstantin Belousov [Sat, 15 Feb 2020 23:25:39 +0000 (23:25 +0000)]
Add pthread_peekjoin_np(3).

The function allows to peek at the thread exit status and even see
return value, without joining (and thus finally destroying) the target
thread.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation (kib)
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D23676

4 years agosem_remove(): fix the loop that compacts sem array on semaphores removal.
Konstantin Belousov [Sat, 15 Feb 2020 23:19:23 +0000 (23:19 +0000)]
sem_remove(): fix the loop that compacts sem array on semaphores removal.

As written now, it copies random kernel memory from beyond the bounds
of the array.

Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation (kib)
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D23694

4 years agosem_remove(): add some asserts.
Konstantin Belousov [Sat, 15 Feb 2020 23:18:02 +0000 (23:18 +0000)]
sem_remove(): add some asserts.

Assert that sema[idx] allocation from sem[] is sane.
Also assert that sem_mtx is owned, it protects the SEM_ALLOC flag.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation (kib)
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D23694

4 years agoUse designated initializers for seminfo.
Konstantin Belousov [Sat, 15 Feb 2020 23:15:42 +0000 (23:15 +0000)]
Use designated initializers for seminfo.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation (kib)
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D23694

4 years agoufs: use faster lockgmr entry points in ffs_lock
Mateusz Guzik [Sat, 15 Feb 2020 21:48:48 +0000 (21:48 +0000)]
ufs: use faster lockgmr entry points in ffs_lock

4 years agocommitters-ports.dot: add myself as a ports committer
Kyle Evans [Sat, 15 Feb 2020 21:21:13 +0000 (21:21 +0000)]
committers-ports.dot: add myself as a ports committer

4 years agofetch(3): don't leak sockshost on failure
Kyle Evans [Sat, 15 Feb 2020 19:47:49 +0000 (19:47 +0000)]
fetch(3): don't leak sockshost on failure

fetch_socks5_getenv will allocate memory for the host (or set it to NULL) in
all cases through the function; the caller is responsible for freeing it if
we end up allocating.

While I'm here, I've eliminated a label that just jumps to the next line...

4 years agofetch(3): fix regression in IPv6:port spec from r357977
Kyle Evans [Sat, 15 Feb 2020 19:39:50 +0000 (19:39 +0000)]
fetch(3): fix regression in IPv6:port spec from r357977

In case the port was specified, we never actually populated *host. Do so
now.

Pointy hat: kevans

4 years agofetch(3): move bits of fetch_socks5_getenv around
Kyle Evans [Sat, 15 Feb 2020 19:31:40 +0000 (19:31 +0000)]
fetch(3): move bits of fetch_socks5_getenv around

This commit separates out port parsing and validation from grabbing the host
from the env var. The only related bit really is that we need to be more
specific with the delimiter in the IPv6 case.

4 years agoMerge r357970 from the clang1000-import branch:
Dimitry Andric [Sat, 15 Feb 2020 19:15:24 +0000 (19:15 +0000)]
Merge r357970 from the clang1000-import branch:

Fix the following -Werror warning from clang 10.0.0 in hptmv(4):

sys/dev/hptmv/ioctl.c:240:4: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                        _vbus_p=pArray->pVBus;
                        ^
sys/dev/hptmv/ioctl.c:237:10: note: previous statement is here
                if(!mIsArray(pArray))
                ^

This is because the return statement after the if statement was not
indented.  (Note that this file has been idented assuming 4-space tabs.)

MFC after: 3 days

4 years agorandom(6): Re-add undocumented support for floating point denominators
Conrad Meyer [Sat, 15 Feb 2020 19:13:37 +0000 (19:13 +0000)]
random(6): Re-add undocumented support for floating point denominators

And document it in the manual page.

PR: 244139
Submitted by: Keith White <kwhite AT site.uottawa.ca> (earlier version)