]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agozfs: use atomic_load_consume_ptr for z_cached_symlink
Mateusz Guzik [Mon, 25 Jan 2021 20:15:19 +0000 (21:15 +0100)]
zfs: use atomic_load_consume_ptr for z_cached_symlink

3 years agovfs: use atomic_load_consume_ptr in vn_load_v_data_smr
Mateusz Guzik [Mon, 25 Jan 2021 20:19:08 +0000 (21:19 +0100)]
vfs: use atomic_load_consume_ptr in vn_load_v_data_smr

3 years agoatomic: add stub atomic_load_consume_ptr
Mateusz Guzik [Mon, 25 Jan 2021 20:09:41 +0000 (21:09 +0100)]
atomic: add stub atomic_load_consume_ptr

3 years agoatomic: make atomic_store_ptr type-aware
Mateusz Guzik [Mon, 25 Jan 2021 19:39:14 +0000 (20:39 +0100)]
atomic: make atomic_store_ptr type-aware

3 years agozfs: fix panics with invariant kernels from zfs_replay_setattr
Mateusz Guzik [Mon, 25 Jan 2021 21:28:05 +0000 (21:28 +0000)]
zfs: fix panics with invariant kernels from zfs_replay_setattr

3 years agoRename kern_mmap_req to kern_mmap
Brooks Davis [Sat, 23 Jan 2021 00:08:59 +0000 (00:08 +0000)]
Rename kern_mmap_req to kern_mmap

Replace all uses of kern_mmap with kern_mmap_req move the old kern_mmap.
Reand rename kern_mmap_req to kern_mmap                                .

The helper saved some code churn initially, but having multiple
interfaces is sub-optimal.

Obtained from: CheriBSD
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D28292

3 years agondis(4): remove as previous announced
Brooks Davis [Mon, 25 Jan 2021 21:45:03 +0000 (21:45 +0000)]
ndis(4): remove as previous announced

nids(4) was a clever idea in the early 2000's when the market was
flooded with 10/100 NICs with Windows-only drivers, but that hasn't been
the case for ages and the driver has had no meaningful maintenance in
ages. It only supports Windows-XP era drivers.

Also remove:
 - ndis support from wpa_supplicant
 - ndiscvt(8)

Reviewed By: emaste, bcr (manpages)
Differential Revision: https://reviews.freebsd.org/D27609

3 years agoDecode NFIT Platform Capabilities.
Alexander Motin [Mon, 25 Jan 2021 21:08:06 +0000 (16:08 -0500)]
Decode NFIT Platform Capabilities.

MFC after: 1 week

3 years agopfctl: FreeBSD now supports DIOCGIFSPEED
Kristof Provost [Sat, 23 Jan 2021 09:37:22 +0000 (10:37 +0100)]
pfctl: FreeBSD now supports DIOCGIFSPEED

There's no need for a special case here to work around the lack of
DIOCGIFSPEED. That was introduced in FreeBSD in
c1aedfcbd9896401f637bc815ba4e51dca107f6f.

Reported by: jmg@
Reviewed by: donner@
Differential Revision: https://reviews.freebsd.org/D28305

3 years agoaltq: Remove unused arguments from altq_attach()
Kristof Provost [Sat, 23 Jan 2021 09:37:13 +0000 (10:37 +0100)]
altq: Remove unused arguments from altq_attach()

Minor cleanup, no functional change.

Reviewed by: donner@
Differential Revision: https://reviews.freebsd.org/D28304

3 years agoaltq tests: Basic ALTQ test
Kristof Provost [Sat, 23 Jan 2021 09:37:03 +0000 (10:37 +0100)]
altq tests: Basic ALTQ test

Activate ALTQ_HFSC, crudely check if it really limits bandwidth as we'd expect.

Reviewed by: donner@
Differential Revision: https://reviews.freebsd.org/D28303

3 years agoAdd FEATURE sysctls for ALTQ disciplines
Kristof Provost [Sat, 23 Jan 2021 09:36:33 +0000 (10:36 +0100)]
Add FEATURE sysctls for ALTQ disciplines

This will allow userspace to more easily figure out if ALTQ is built
into the kernel and what disciplines are supported.

Reviewed by: donner@
Differential Revision: https://reviews.freebsd.org/D28302

3 years agonewvers.sh: add newline at EOF in generated vers.c
Ed Maste [Mon, 25 Jan 2021 19:53:47 +0000 (14:53 -0500)]
newvers.sh: add newline at EOF in generated vers.c

Previously we omitted the newline, which did not cause a functional
issue for the build but resulted in suboptimal output from e.g.
`cat vers.c`.

3 years agocache: assorted cleanups
Mateusz Guzik [Sun, 24 Jan 2021 20:04:01 +0000 (21:04 +0100)]
cache: assorted cleanups

3 years agocache: track calls to cache_symlink_alloc with unsupported size
Mateusz Guzik [Sun, 24 Jan 2021 20:00:03 +0000 (21:00 +0100)]
cache: track calls to cache_symlink_alloc with unsupported size

While here assert on size passed to free.

3 years agodiff: fix incorrectly displaying files as duplicates
Jamie Landeg-Jones [Mon, 25 Jan 2021 17:42:26 +0000 (18:42 +0100)]
diff: fix incorrectly displaying files as duplicates

When diff hits certain access errors, function diffreg() shows the error
message, and then returns to the calling function, which calls
print_status() with the return value.

However, in these cases, the return value isn't changed from the initial
default value of D_SAME.

Normally, print_status() with a value of D_SAME does nothing, so this
works out ok, however, if the "-s" flag is set, a message is displayed
showing identicality:

case D_SAME:
                if (sflag)
                        printf("Files %s%s and %s%s are identical\n",                                                                                                       path1, entry, path2, entry);
                break;

This then produces such results as:

% diff  -s /COPYRIGHT /var/run/rpcbind.sock
diff: /var/run/rpcbind.sock: Operation not supported
Files /COPYRIGHT and /var/run/rpcbind.sock are identical

% diff  -s /COPYRIGHT /etc/master.passwd
diff: /etc/master.passwd: Permission denied
Files /COPYRIGHT and /etc/master.passwd are identical

Create a D_ERROR status which is returned in such cases, and
print_status() then deals with that status seperately from D_SAME

PR: 252614
MFC after: 1 week

3 years agodiff: add a test case for failed -s option
Baptiste Daroussin [Mon, 25 Jan 2021 17:40:12 +0000 (18:40 +0100)]
diff: add a test case for failed -s option

3 years agoifconfig: fix UBSan signed shift error
Alex Richardson [Tue, 19 Jan 2021 11:35:21 +0000 (11:35 +0000)]
ifconfig: fix UBSan signed shift error

Use 1u since UBSan complains about 1 << 31.

3 years agoCreate symlinks to host tools on non-FreeBSD hosts
Alexander Richardson [Mon, 25 Jan 2021 14:18:16 +0000 (14:18 +0000)]
Create symlinks to host tools on non-FreeBSD hosts

This is unnecessary when cross-building from Linux/macOS.
Additionally, cp -p appears to be broken on macOS Big Sur
(https://openradar.appspot.com/8957219).

For some unknown reason this commit appears to fix
freezes when building on macOS Big Sur.
This also fixes building in docker with volume mounts
with ACLs, since setting the ACL with cp -p fails otherwise.

Obtained From: CheriBSD
Tested By: gnn (macOS Big Sur), Nathaniel Wesley Filardo (docker)
Reviewed By: jrtc27, imp
Differential Revision: https://reviews.freebsd.org/D28267

3 years agoqeueue.h: Add {SLIST,STAILQ,LIST,TAILQ}_END()
Alex Richardson [Mon, 25 Jan 2021 14:11:45 +0000 (14:11 +0000)]
qeueue.h: Add {SLIST,STAILQ,LIST,TAILQ}_END()

We provide these for compat with other queue.h headers since some software
assumes it exists (e.g. the libevent contrib code), but we are not
encouraging their use (NULL should be used instead).

This fixes the following warning (which should arguable be an error since
it results in a function call to an undefined function):

.../contrib/libevent/buffer.c:495:16: warning: implicit declaration of function 'LIST_END' is invalid in C99 [-Wimplicit-function-declaration]
             cbent != LIST_END(&buffer->callbacks);
                      ^
.../contrib/libevent/buffer.c:495:13: warning: comparison between pointer and integer ('struct evbuffer_cb_entry *' and 'int') [-Wpointer-integer-compare]
             cbent != LIST_END(&buffer->callbacks);
             ~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reviewed By: jhb
Differential Revision: https://reviews.freebsd.org/D27151

3 years agoDon't include libarchive fuzz tests by default
Alex Richardson [Mon, 25 Jan 2021 14:03:17 +0000 (14:03 +0000)]
Don't include libarchive fuzz tests by default

These tests are basic fuzz tests that permute input to trigger crashes
rather than regression or unit tests. Additionally, some of them take a
rather long time to run and should probably be run on a dedicated fuzzing
job instead. Moreover, these simple tests use rand() instead of a real
fuzzing tool that generates interesting inputs (e.g. LLVM libFuzzer) so are
unlikely to find anything interesting when run in CI.

This allows removing one BROKEN_TESTS case due to timeouts and speeds up
running tests on emulated platforms such as QEMU.

Reviewed By: lwhsu, mm
Differential Revision: https://reviews.freebsd.org/D27153

3 years agoAdd support for enabling and disabling IFCAP_VLAN_HWTSO via
Hans Petter Selasky [Mon, 25 Jan 2021 10:22:55 +0000 (11:22 +0100)]
Add support for enabling and disabling IFCAP_VLAN_HWTSO via
ifconfig(8) in mlx5en(4).

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agogic_v3: add message based interrupts support
Cyprien Laplace [Sat, 5 Dec 2020 15:47:33 +0000 (10:47 -0500)]
gic_v3: add message based interrupts support

Pull Request: https://github.com/freebsd/freebsd-src/pull/451

3 years agogic_v3: Use 64-bit writes to GICD_IROUTERn
Cyprien Laplace [Thu, 26 Nov 2020 01:17:04 +0000 (20:17 -0500)]
gic_v3: Use 64-bit writes to GICD_IROUTERn

While 32-bit accesses to GICD_IROUTERn are allowed,
this is a 64-bit register.

Pull Request: https://github.com/freebsd/freebsd-src/pull/451

3 years agocontrib/tzdata: import tzdata 2021a
Philip Paeps [Mon, 25 Jan 2021 00:18:14 +0000 (08:18 +0800)]
contrib/tzdata: import tzdata 2021a

Merge commit '4cd7e1071de16a7392b0e466287f13e9e6f2081a'

Changes: https://github.com/eggert/tz/blob/2021a/NEWS

MFC after:      3 days

3 years agoImport tzdata 2021a
Philip Paeps [Mon, 25 Jan 2021 00:11:06 +0000 (08:11 +0800)]
Import tzdata 2021a

3 years agonfs_write(): do not call ncl_pager_setsize() after clearing TDP2_SBPAGES
Konstantin Belousov [Sat, 23 Jan 2021 21:40:07 +0000 (23:40 +0200)]
nfs_write(): do not call ncl_pager_setsize() after clearing TDP2_SBPAGES

This might unnecessary truncate file undoing extension done by the write.

Reported by: Yasuhiro Kimura <yasu@utahime.org>
Reviewed by: rmacklem
Tested by: rmacklem, Yasuhiro Kimura <yasu@utahime.org>
MFC after: 6 days
Sponsored by: The FreeBSD Foundation

3 years agonetmap: simplify parameter passing
Vincenzo Maffione [Sun, 24 Jan 2021 21:59:02 +0000 (21:59 +0000)]
netmap: simplify parameter passing

Changes imported from the netmap github.

3 years agoiflib: netmap: move per-packet operation out of fragments loop
Vincenzo Maffione [Sun, 24 Jan 2021 21:38:59 +0000 (21:38 +0000)]
iflib: netmap: move per-packet operation out of fragments loop

MFC after: 1 week

3 years agoiflib: netmap: add support for NS_MOREFRAG
Vincenzo Maffione [Sun, 24 Jan 2021 21:12:41 +0000 (21:12 +0000)]
iflib: netmap: add support for NS_MOREFRAG

The NS_MOREFRAG flag can be set in a netmap slot to represent a
multi-fragment packet. Only the last fragment of a packet does
not have the flag set. On TX rings, the flag may be set by the
userspace application. The kernel will look at the flag and use it
to properly set up the NIC TX descriptors.
On RX rings, the kernel may set the flag if the packet received
was split across multiple netmap buffers. The userspace application
should look at the flag to know when the packet is complete.

Submitted by: rajesh1.kumar_amd.com
Reviewed by: vmaffione
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27799

3 years agolualoader: improve loader.conf var processing
Kyle Evans [Sun, 24 Jan 2021 19:25:34 +0000 (13:25 -0600)]
lualoader: improve loader.conf var processing

lualoader was previously not processing \ as escapes; this commit fixes
that and does better error checking on the value as well.

Additionally, loader.conf had some odd restrictions on values that make
little sense. Previously, lines like:

kernel=foo

Would simply be discarded with a malformed line complaint you might not
see unless you disable beastie.

lualoader tries to process these as well as it can and manipulates the
environment, while forthloader did minimal processing and constructed a
`set` command to do the heavy lifting instead. The lua approach was
re-envisioned from building a `set` command so that we can appropriately
reset the environment when, for example, boot environments change.

Lift the previous restrictions to allow unquoted values on the right hand
side of an expression.  Note that an unquoted value is effectively:

[A-Za-z0-9-][A-Za-z0-9-_.]*

This commit also stops trying to weirdly limit what it can handle in a
quoted value. Previously it only allowed spaces, alphanumeric, and
punctuation, which is kind of weird. Change it here to grab as much as it
can between two sets of quotes, then let processEnvVar() do the needful and
complain if it finds something malformed looking.

My extremely sophisticated test suite is as follows:

<<EOF
X_01_simple_string="simple"
X_02_escaped_string="s\imple"

X_03_unquoted_val=3
X_04_unquoted_strval=simple_test

X_05_subval="${X_03_unquoted_val}"
X_06_escaped_subval="\${X_03_unquoted_val}"

X_07_embedded="truth${X_03_unquoted_val}"
X_08_escaped_embedded="truth\${X_03_unquoted_val}"

X_09_unknown="${unknown_val}"
X_10_unknown_embedded="truth${unknown_val}"

X_11_crunchy="crunch$unknown_val crunch"
X_12_crunchy="crunch${unknown_val}crunch"

Y_01_badquote="te"lol"
Y_02_eolesc="lol\"
Y_02_noteolesc="lol\\"
Y_03_eolvar="lol$"
Y_03_noteolvar="lol\$"
Y_04_badvar="lol${"

exec="echo Done!"
EOF

Future work may provide a stub loader module in userland so that we can
formally test the loader scripts rather than sketchy setups like the above
in conjunction with the lua-* tools in ^/tools/boot.

3 years agonetgraph/ng_nat: Add RFC 6598/Carrier Grade NAT support
Neel Chauhan [Sun, 24 Jan 2021 19:23:39 +0000 (20:23 +0100)]
netgraph/ng_nat: Add RFC 6598/Carrier Grade NAT support

This extends upon the RFC 6598 support to libalias/ipfw in r357092.

Reviewed By: manpages (bcr), donner, adrian, kp
Approved by: kp (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D23461

3 years agoExclude reserved iSCSI Initiator Task Tag.
Alexander Motin [Sun, 24 Jan 2021 19:23:04 +0000 (14:23 -0500)]
Exclude reserved iSCSI Initiator Task Tag.

RFC 7143 (11.2.1.8):
   An ITT value of 0xffffffff is reserved and MUST NOT be assigned for a
   task by the initiator.  The only instance in which it may be seen on
   the wire is in a target-initiated NOP-In PDU (Section 11.19) and in
   the initiator response to that PDU, if necessary.

MFC after: 1 month

3 years agoExclude reserved iSCSI Target Transfer Tag.
Alexander Motin [Sun, 24 Jan 2021 18:58:29 +0000 (13:58 -0500)]
Exclude reserved iSCSI Target Transfer Tag.

RFC 7143 (11.7.4):
   The Target Transfer Tag values are not specified by this protocol,
   except that the value 0xffffffff is reserved and means that the
   Target Transfer Tag is not supplied.

MFC after: 1 month

3 years agoRegen src.conf.5 after LLD description updates
Ed Maste [Sun, 24 Jan 2021 17:25:04 +0000 (12:25 -0500)]
Regen src.conf.5 after LLD description updates

3 years agoRemove Binutils from src.conf(5) option descriptions
Ed Maste [Sun, 24 Jan 2021 17:22:01 +0000 (12:22 -0500)]
Remove Binutils from src.conf(5) option descriptions

All binutils remnants have been removed before FreeBSD 13.

PR: 252842
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

3 years agocxgbetool: correct utilties typo
Ed Maste [Sun, 24 Jan 2021 15:21:53 +0000 (10:21 -0500)]
cxgbetool: correct utilties typo

3 years agoAdd a manual page for axp(4) / AMD 10G Ethernet driver
Gordon Bergling [Sun, 24 Jan 2021 13:57:16 +0000 (14:57 +0100)]
Add a manual page for axp(4) / AMD 10G Ethernet driver

Submitted by: Rajesh Kumar <rajesh1 dot kumar at amd dot com>
Reviewed by: bcr, brueffer, rpokala
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D27800

3 years agolibc: try to skip memcpy in _gettemp
Mateusz Guzik [Sun, 24 Jan 2021 04:34:22 +0000 (05:34 +0100)]
libc: try to skip memcpy in _gettemp

3 years agolibc: remove open-coded strlen in _gettemp
Mateusz Guzik [Sun, 24 Jan 2021 04:32:46 +0000 (05:32 +0100)]
libc: remove open-coded strlen in _gettemp

3 years agolibc: skip spurious stat in _gettemp
Mateusz Guzik [Sun, 24 Jan 2021 04:15:13 +0000 (05:15 +0100)]
libc: skip spurious stat in _gettemp

It was only done to catch ENOTDIR, but the kernel already returns the
error where appropriate.

3 years agosctp: fix PR-SCTP stats when adding addtional streams
Michael Tuexen [Sat, 23 Jan 2021 23:50:33 +0000 (00:50 +0100)]
sctp: fix PR-SCTP stats when adding addtional streams

MFC after: 1 week

3 years agosctp: improve consistency
Michael Tuexen [Sat, 23 Jan 2021 19:56:45 +0000 (20:56 +0100)]
sctp: improve consistency

No functional change intended.

MFC: 1 week

3 years agoFix cross-build support for Ubuntu 16.04
Jessica Clarke [Sat, 23 Jan 2021 20:59:15 +0000 (20:59 +0000)]
Fix cross-build support for Ubuntu 16.04

Older glibc headers did some very nasty things that have since been
sanitised. We could also fix this by adding a linux/getopt.h wrapper
alongside the existing common/getopt.h that #undef's __need_getopt, but
that seems a little more hacky and complicated.

Reviewed by: arichardson

3 years agohcons: Fix manpage typo
Vladimir Kondratyev [Sat, 23 Jan 2021 19:19:50 +0000 (22:19 +0300)]
hcons: Fix manpage typo

Submitted by: Shunchao Hu <ankohuu_outlook.com>
Reviewed by: wulf, gbe
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D28294

3 years agocache: add back target entry on rename
Mateusz Guzik [Sat, 23 Jan 2021 17:21:42 +0000 (18:21 +0100)]
cache: add back target entry on rename

3 years agonetgraph/ng_source: If queue is full, don't enqueue
Lutz Donnerhacke [Sat, 23 Jan 2021 17:54:47 +0000 (18:54 +0100)]
netgraph/ng_source: If queue is full, don't enqueue

Submitted by: nc
Reviewed by: donner, kp
Approved by: kp (mentor)
Differential Revision: https://reviews.freebsd.org/D23477

3 years agoRevert "Define PNP info after defining driver modules"
Mark Johnston [Sat, 23 Jan 2021 15:55:09 +0000 (10:55 -0500)]
Revert "Define PNP info after defining driver modules"

This reverts commit aa37baf3d7cf51da92fd367476182802e71838ae.

The reverted commit was motivated by a problem observed on stable/12,
but it turns out that a better solution was committed in r348309 but not
MFCed.  So, revert this change since it is unnecessary and not really
correct: it assumes that the order in which module metadata records is
defined determines their order in the output linker set.  While this
seems to hold in my testing, it is not guaranteed.

Reported by: cem
Discussed with: imp
MFC after: 3 days

3 years agoelfctl: Fix type errors.
Konstantin Belousov [Sat, 23 Jan 2021 10:45:51 +0000 (12:45 +0200)]
elfctl: Fix type errors.

Target value for val has uint32_t type, not uint, adjust used constant.
Change val type to unsigned so that left and right sides of comparision
operator do not expose different signed types of same range [*].

Switch to unsigned long long and strtoll(3) so that 0x80000000 is
accepted by conversion function [**].

Reported by: kargl [*]
Noted by: emaste [**]
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28301

3 years agonfs client: block vnode_pager_setsize() calls from nfscl_loadattrcache in nfs_write
Konstantin Belousov [Fri, 22 Jan 2021 21:47:06 +0000 (23:47 +0200)]
nfs client: block vnode_pager_setsize() calls from nfscl_loadattrcache in nfs_write

Otherwise writing thread might wait on sbusy state of the pages which were
busied by itself, similarly to nfs_read().  But also we need to clear
NVNSETSZKSIP flag possibly set by ncl_pager_setsize(), to not undo
extension done by write.

Reported by: bdrewery
Reviewed by: rmacklem
Tested by: pho
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28306

3 years agozfs: add support for lockless symlink lookup
Mateusz Guzik [Sat, 23 Jan 2021 13:46:32 +0000 (13:46 +0000)]
zfs: add support for lockless symlink lookup

Reviewed by: kib (previous version)
Tested by: pho (previous version)
Differential Revision: https://reviews.freebsd.org/D27488

3 years agotmpfs: add support for lockless symlink lookup
Mateusz Guzik [Sat, 23 Jan 2021 13:45:01 +0000 (13:45 +0000)]
tmpfs: add support for lockless symlink lookup

Reviewed by: kib (previous version)
Tested by: pho (previous version)
Differential Revision: https://reviews.freebsd.org/D27488

3 years agoufs: denote lack of support for lockless symlink lookup
Mateusz Guzik [Sat, 23 Jan 2021 13:42:16 +0000 (13:42 +0000)]
ufs: denote lack of support for lockless symlink lookup

It is unclear without investigating if it can be provided without using
extra memory, so for the time being just don't.

3 years agocache: add symlink support to lockless lookup
Mateusz Guzik [Sat, 23 Jan 2021 13:40:48 +0000 (13:40 +0000)]
cache: add symlink support to lockless lookup

Reviewed by: kib (previous version)
Tested by: pho (previous version)
Differential Revision: https://reviews.freebsd.org/D27488

3 years agoaxgbe: fix some link related issues
Vincenzo Maffione [Sat, 23 Jan 2021 13:44:24 +0000 (13:44 +0000)]
axgbe: fix some link related issues

By default, axgbe driver does a receiver reset after predefined number
of retries for the link to come up. However, this receiver reset
doesn't always suffice, due to an hardware issue.
In that case, as a workaround, a complete phy reset is necessary.
This patch introduces a sysctl that can be set to 1 to let the driver
reset the phy completely, rather than just doing receiver reset.
The workaround will be removed once the issue is fixed by means
of firmware update.

This patch also fixes the handling of the direct attach cables
properly.

Submitted by: rajesh1.kumar_amd.com
Differential Revision: https://reviews.freebsd.org/D28266

3 years agoloader: create built in font from bold font face
Toomas Soome [Fri, 22 Jan 2021 11:06:58 +0000 (13:06 +0200)]
loader: create built in font from bold font face

We did replace full version of default font 8x16v with bold, also
use bold version for built in font.

3 years agoelfctl: fix typo from last-minute refactoring
Ed Maste [Fri, 22 Jan 2021 21:23:12 +0000 (16:23 -0500)]
elfctl: fix typo from last-minute refactoring

Reported by: jkim
Fixes: 86f33b5fcf6087bf4439881011b920ff99e6e300

3 years agoelfctl: allow features to be specified by value
Ed Maste [Fri, 22 Jan 2021 17:22:35 +0000 (12:22 -0500)]
elfctl: allow features to be specified by value

This will allow elfctl on older releases to set bits that are not yet
known there, so that the binary will have the correct settings applied
if run on a later FreeBSD version.

PR: 252629 (related)
Suggested by: kib
Reviewed by: gbe (manpage, earlier), kib
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28284

3 years agogdb: only return signal values for powerpc's gdb_cpu_signal()
Mitchell Horne [Fri, 22 Jan 2021 18:56:56 +0000 (14:56 -0400)]
gdb: only return signal values for powerpc's gdb_cpu_signal()

Summary:
The values returned by this function are reported to the gdb client as
the reason for the break in execution, a signal value such as SIGTRAP,
SIGEMT, or SIGSEGV. As such, exact vector numbers can be misidentified.
Return SIGEMT in the default case instead.

Reviewed by: alfredo
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D28046

3 years agojail: fix dangling reference bug from 6754ae2572eb
Jamie Gritton [Fri, 22 Jan 2021 18:56:24 +0000 (10:56 -0800)]
jail: fix dangling reference bug from 6754ae2572eb

The change to use refcounts for pr_uref was mishandled in
prison_proc_free, so killing a jail's last process could add
an extra reference, leaving it an unkillable zombie.

3 years agojail: A jail could be removed without calling OSD methods
Jamie Gritton [Fri, 22 Jan 2021 18:50:10 +0000 (10:50 -0800)]
jail: A jail could be removed without calling OSD methods

Fix a long-standing bug where setting nopersist on a process-less jail
would remove it without calling the the OSD PR_METHOD_REMOVE methods.

3 years agoRegen src.conf after MK_{LIBTHR,LIBPTHREAD} removal
Kyle Evans [Wed, 20 Jan 2021 14:03:21 +0000 (08:03 -0600)]
Regen src.conf after MK_{LIBTHR,LIBPTHREAD} removal

3 years agobuild: remove LIBPTHREAD/LIBTHR build options
Kyle Evans [Wed, 20 Jan 2021 14:01:25 +0000 (08:01 -0600)]
build: remove LIBPTHREAD/LIBTHR build options

WITHOUT_LIBTHR has been broken for a little over five years now, since the
xz 5.2.0 update introduced a hard liblzma dependency on libthr, and building
a useful system without threading support is becoming increasingly more
difficult.

Additionally, in the five plus years that it's been broken more reverse
dependencies have cropped up in libzstd, libsqlite3, and libcrypto (among
others) that make it more and more difficult to reconcile the effort needed
to fix these options.

Remove the broken options.

PR: 252760
Reviewed by: brooks, emaste, kib
Differential Revision: https://reviews.freebsd.org/D28263

3 years agopowerpc64le: don't enable COMPAT_* options in GENERIC64LE
Piotr Kubaj [Fri, 22 Jan 2021 16:39:15 +0000 (17:39 +0100)]
powerpc64le: don't enable COMPAT_* options in GENERIC64LE

Support for powerpc64le appeared in 13, so there's no point to enable COMPAT_* for older releases.

Also disable COMPAT_FREEBSD32, since there's no powerpcle. Since that may change in the future, leave the option commented out.

Approved by: bdragon, jhibbits (on IRC)

3 years agopowerpc: fix build without DDB
Mateusz Guzik [Fri, 22 Jan 2021 14:29:01 +0000 (14:29 +0000)]
powerpc: fix build without DDB

3 years agonewvers.sh: restore reporting branch names
Mateusz Guzik [Fri, 22 Jan 2021 13:00:24 +0000 (13:00 +0000)]
newvers.sh: restore reporting branch names

It got removed arguably without much discussion in the commit which
added gitup support.

3 years agoComplete Steps 5 and 9 from the Committer's guide
Lewis Cook [Fri, 22 Jan 2021 11:22:56 +0000 (11:22 +0000)]
Complete Steps 5 and 9 from the Committer's guide

Summary:
Steps 5 and 9:
 - Update Mentor and Mentee Information
 - Update Ports with Personal Information

Reviewers: tcberner, fernape

Reviewed By: fernape

Subscribers: imp

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

3 years agoRevert "[mips] revert r366664 - flip mips back from -O2 to -O"
Mateusz Guzik [Fri, 22 Jan 2021 10:17:34 +0000 (10:17 +0000)]
Revert "[mips] revert r366664 - flip mips back from -O2 to -O"

This reverts commit bd72252aace382921840ddbceea712b96f4ad242.

The commit at hand breaks the build for all mips targets and does not
have a one-liner fix.

make[5]: "/usr/src/share/mk/sys.mk" line 169: Malformed conditional (${MACHINE_CPUARCH} == "mips" && ${COMPILER_TYPE} == "gcc")

3 years agoarm64: fix typo in file name in GENERIC-MMCCAM-NODEBUG
Mateusz Guzik [Fri, 22 Jan 2021 10:16:57 +0000 (10:16 +0000)]
arm64: fix typo in file name in GENERIC-MMCCAM-NODEBUG

3 years agoCatch up another version bump to 14.0
Li-Wen Hsu [Fri, 22 Jan 2021 09:53:59 +0000 (17:53 +0800)]
Catch up another version bump to 14.0

Reported by: rm

3 years agoarmv8crypto: add AES-GCM support
Oleksandr Tymoshenko [Wed, 13 Jan 2021 06:27:10 +0000 (22:27 -0800)]
armv8crypto: add AES-GCM support

Add support for AES-GCM using OpenSSL's accelerated routines.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D27454
Sponsored by: Ampere Computing
Submitted by: Klara, Inc.

3 years agofix incorrect LLD_VERSION_STRING from previous commit
Glen Barber [Fri, 22 Jan 2021 00:49:30 +0000 (19:49 -0500)]
fix incorrect LLD_VERSION_STRING from previous commit

Reported by: Oliver Pinter
Sponsored by: Rubicon Communications, LLC ("Netgate")

3 years agoBump CURRENT to 14.0
Glen Barber [Fri, 22 Jan 2021 00:10:07 +0000 (19:10 -0500)]
Bump CURRENT to 14.0

This one goes to 14.

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC ("Netgate")

3 years agokvprintf(9): add missing FALLTHROUGH
Marius Strobl [Thu, 21 Jan 2021 23:16:37 +0000 (00:16 +0100)]
kvprintf(9): add missing FALLTHROUGH

Reported by: Coverity
CID: 1005166

3 years agommcsd(4): properly set BIO error when partition switching fails
Marius Strobl [Thu, 21 Jan 2021 23:09:09 +0000 (00:09 +0100)]
mmcsd(4): properly set BIO error when partition switching fails

While at it, remove redundant braces and goto in mmcsd_task().

Reported by: Coverity
CID: 1419639

3 years agosym(4): handle mixed tagged/untagged commands gracefully
Marius Strobl [Thu, 21 Jan 2021 22:48:08 +0000 (23:48 +0100)]
sym(4): handle mixed tagged/untagged commands gracefully

Handle the case of a tagged command arriving when there's an untagged
one still outstanding gracefully instead of panicing.

While at it:
- Replace fancy arithmetics with a simple assignment as busy_itl can
  only ever be either 0 or 1.
- Fix a comment typo in sym_free_ccb().

3 years agosym(4): fix nits reported by Coverity
Marius Strobl [Thu, 21 Jan 2021 22:34:19 +0000 (23:34 +0100)]
sym(4): fix nits reported by Coverity

- In ___dma_getp(), remove dead code. [1]
- In sym_sir_bad_scsi_status(), add missing FALLTHROUGH. [2]

While at it:
- For getbaddrcb(), remove __unused from the nseg argument as it's in
  fact used when compiling with INVARIANTS.
- In sym_int_sir(), ensure in all branches that cp is not NULL before
  using it.

Reported by: Coverity
CID: 1008861 [1], 114996 [2]

3 years agofb_if: remove unused method
Marius Strobl [Sun, 17 Jan 2021 13:31:56 +0000 (14:31 +0100)]
fb_if: remove unused method

Apparently, it never came into play.

3 years agoboot_font(4): remove obsolete font
Marius Strobl [Sun, 17 Jan 2021 13:21:49 +0000 (14:21 +0100)]
boot_font(4): remove obsolete font

It's no longer used since 4e421792ec80df7a5fa82e97dcc3575c3ec6740a
and r325892 respectively.

3 years agoFurther refactor IPv4 interface route creation.
Alexander V. Chernikov [Tue, 19 Jan 2021 23:50:34 +0000 (23:50 +0000)]
Further refactor IPv4 interface route creation.

* Fix bug with /32 aliases introduced in 81728a538d24.
* Explicitly document business logic for IPv4 ifa routes.
* Remove remnants of rtinit()
* Deduplicate ifa->route prefix code by moving it into ia_getrtprefix()
* Deduplicate conditional check for ifa_maintain_loopback_route()  by
 moving into ia_need_loopback_route()
* Remove now-unused flags argument from in_addprefix().

Reviewed by: donner
PR: 252883
Differential Revision: https://reviews.freebsd.org/D28246

3 years agoFix typo in pwait.c introduced in 5bdce6ff546e
Alexander V. Chernikov [Thu, 21 Jan 2021 21:43:27 +0000 (21:43 +0000)]
Fix typo in pwait.c introduced in 5bdce6ff546e

Reported by: kevans

3 years agoRemove deadlock in rc caused by pwait waiting for itself.
Alexander V. Chernikov [Thu, 21 Jan 2021 21:26:15 +0000 (21:26 +0000)]
Remove deadlock in rc caused by pwait waiting for itself.

The following situation can trigger the deadlock:
1) Long time ago a_service was started through rc.d
2) We want to restart a_service and issue service a_service restart
3) rc.subr reads current process PID (via file or process),
   sends TERM signal and runs pwait with PID harvested
4) a_service process dies very quickly so it's PID becomes available.
   It is possible that while original process was running,
   PID counter overflowed and pwait got assigned a_service's PID.

This patch ignores pid(s) to wait that are equal to pwait PID.

Reported by: Dan McGregor, Boris Lytochkin
Submitted by: Boris Lytochkin <lytboris at gmail.com>
Reviewed By: 0mp
MFC after: 2 weeks
PR: 218598
Differential Revision: https://reviews.freebsd.org/D28240

3 years agomalloc_aligned: roundup allocation size up to next power of two
Konstantin Belousov [Mon, 18 Jan 2021 21:17:21 +0000 (23:17 +0200)]
malloc_aligned: roundup allocation size up to next power of two

to make it use the right aligned zone.

Reported by: melifaro
Reviewed by: alc, markj (previous version)
Discussed with: jrtc27
Tested by: pho (previous version)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28219

3 years agoRestrict supported alignment for malloc_domainset_aligned(9) to PAGE_SIZE.
Konstantin Belousov [Mon, 18 Jan 2021 09:01:23 +0000 (11:01 +0200)]
Restrict supported alignment for malloc_domainset_aligned(9) to PAGE_SIZE.

UMA page_alloc() does not take an alignment, so UMA can only handle
alignment less then page size.

Noted by: alc
Reviewed by: alc, markj (previous version)
Discussed with: jrtc27
Tested by: pho (previous version)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28219

3 years agoFix manpage markup in 2c8bb126de56ce49637ad752e78957d9ebafba02
Allan Jude [Thu, 21 Jan 2021 20:32:15 +0000 (20:32 +0000)]
Fix manpage markup in 2c8bb126de56ce49637ad752e78957d9ebafba02

3 years agobhyve: Add missing man page section on the nodelete block-device-option
Allan Jude [Thu, 21 Jan 2021 17:17:57 +0000 (17:17 +0000)]
bhyve: Add missing man page section on the nodelete block-device-option

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D28272

3 years agolibcasper/cap_grp tests: Reset the group database handle
Mark Johnston [Thu, 21 Jan 2021 19:30:19 +0000 (14:30 -0500)]
libcasper/cap_grp tests: Reset the group database handle

Some tests verify that the capgrp capability does not permit calls to
setgrent(3), but all tests need to ensure that they reset the
capability's group database handle, otherwise the local process and
casper process will be out of sync.

The cap_pwd tests already handle this.

Sponsored by: The FreeBSD Foundation
MFC after: 1 month

3 years agolibc/nss: Ensure that setgroupent(3) actually works as advertised
Mark Johnston [Thu, 21 Jan 2021 19:30:19 +0000 (14:30 -0500)]
libc/nss: Ensure that setgroupent(3) actually works as advertised

Because the "files" and "compat" implementations failed to set the
"stayopen", keyed lookups would close the database handle, contrary to
the purpose of setgroupent(3).  setpassent(3)'s implementation does not
have this bug.

PR: 165527
Submitted by: Andrey Simonenko
MFC after: 1 month

3 years agolibc/nss tests: Add regression tests for commit 55444c823e1f
Mark Johnston [Thu, 21 Jan 2021 19:30:19 +0000 (14:30 -0500)]
libc/nss tests: Add regression tests for commit 55444c823e1f

PR: 252094
Sponsored by: The FreeBSD Foundation
MFC after: 1 month

3 years agolibc/nss: Restore iterator state when doing passwd/group lookups
Mark Johnston [Thu, 21 Jan 2021 19:30:19 +0000 (14:30 -0500)]
libc/nss: Restore iterator state when doing passwd/group lookups

The getpwent(3) and getgrent(3) implementations maintain some internal
iterator state.  Interleaved calls to functions which do passwd/group
lookups using a key, such as getpwnam(3), would in some cases clobber
this state, causing a subsequent getpwent() or getgrent() call to
restart iteration from the beginning of the database or to terminate
early.  This is particularly troublesome in programming environments
where execution of green threads is interleaved within a single OS
thread.

Take care to restore any iterator state following a keyed lookup.  The
"files" provider for the passwd database was already handling this
correctly, but "compat" was not, and both providers had this problem
when accessing the group database.

PR: 252094
Submitted by: Viktor Dukhovni <ietf-dane@dukhovni.org>
MFC after: 1 month

3 years agolibc/nss tests: Fix getpw and getgr single-pass tests
Mark Johnston [Thu, 21 Jan 2021 19:30:19 +0000 (14:30 -0500)]
libc/nss tests: Fix getpw and getgr single-pass tests

Some NSS regression tests for getgrent(3) and getpwent(3) were not
testing anything because the test incorrectly requested creation of a
database snapshot.

Sponsored by: The FreeBSD Foundation
MFC after: 1 month

3 years agolibc/nss tests: Style
Mark Johnston [Thu, 21 Jan 2021 19:30:18 +0000 (14:30 -0500)]
libc/nss tests: Style

Sponsored by: The FreeBSD Foundation
MFC after: 1 month

3 years agoDefine PNP info after defining driver modules
Mark Johnston [Thu, 21 Jan 2021 19:30:18 +0000 (14:30 -0500)]
Define PNP info after defining driver modules

PNP info definitions currently have an unfortunate requirement in that
they must follow the associated module definition in the module metadata
linker set.  Otherwise devmatch can segfault while processing the linker
hints file since kldxref maintains the order in the linker set.

A number of drivers violate this requirement.  In some cases this can
cause devmatch(8) to segfault when processing the linker hints file.
Work around the problem for now simply by adjusting the drivers.

Reviewed by: imp
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D28260

3 years agonewvers.sh: avoid bare git invocation
Ed Maste [Thu, 21 Jan 2021 15:00:20 +0000 (10:00 -0500)]
newvers.sh: avoid bare git invocation

git may not be in the path, and $git_cmd includes some commandline
arguments.

Reported by: mjg
Tested by: mjg

3 years agoiflib: Fix a NULL pointer deref
Andrew Gallatin [Thu, 21 Jan 2021 14:45:15 +0000 (09:45 -0500)]
iflib: Fix a NULL pointer deref

rxd_frag_to_sd() have pf_rv parameter as NULL with the current
code. This patch fixes the NULL pointer dereference in that
case thus avoiding a possible panic.

Submitted by: rajesh1.kumar at amd.com
Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D28115

3 years agox86: switch vdso TSC timecounter to RDTSCP on AMD Zen CPUs
Konstantin Belousov [Thu, 21 Jan 2021 12:54:28 +0000 (14:54 +0200)]
x86: switch vdso TSC timecounter to RDTSCP on AMD Zen CPUs

Reported by: many
Tested by: gallatin, mikael, rhurlin
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 years agox86: switch kernel TSC timecounter to RDTSCP on AMD Zen CPUs
Konstantin Belousov [Thu, 21 Jan 2021 12:53:15 +0000 (14:53 +0200)]
x86: switch kernel TSC timecounter to RDTSCP on AMD Zen CPUs

Reported by: many
Tested by: gallatin, mikael, rhurlin
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 years agoelf: add some definitions for i386 and amd64 relocations
Konstantin Belousov [Sun, 17 Jan 2021 07:03:31 +0000 (09:03 +0200)]
elf: add some definitions for i386 and amd64 relocations

I believe that rtld does not need to implement them, they are mostly for
the static linker.  'Mostly' because for amd64 our kernel linker loads
object files, and amd64 relocation types could be observed.

Defines were taken from glibc sources.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28205

3 years agoRemove FirstBurstLength limit for software iSCSI.
Alexander Motin [Thu, 21 Jan 2021 02:33:14 +0000 (21:33 -0500)]
Remove FirstBurstLength limit for software iSCSI.

For hardware offload solicited data may potentially be handled more
efficiently than unsolicited due to direct data placement.  Or there
can be some unsolicited write buffering limitations.  It may create
situations where FirstBurstLength limit is really useful.

Software driver though has no those factors, having to do memcopy()
any way and having no so hard limit on the temporary storage.  Same
time more active use of unsolicited transfers allows to avoid some
of Ready To Transfer (R2T) PDU round-trip times and processing.

This change effectively doubles from 64KB to 128KB the maximum size
of write command that can be transferred within one link RTT.  Tests
of (64KB, 128KB] QD1 writes mixed with simultaneous QD8 reads over
the same connection, increasing RTT, shows almost double write speed
and half latency, while we should be able to afford few megabytes of
RAM for additional buffering on a target these days.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

3 years agopkgbase: allow update-packages for first-run of packaging
Kyle Evans [Mon, 18 Jan 2021 20:11:58 +0000 (14:11 -0600)]
pkgbase: allow update-packages for first-run of packaging

If ${REPODIR}/${PKG_ABI} does not exist when we begin real-update-packages,
skip the comparison with the non-existent previous repository and just
finish the repo off. This allows external scripts to just assume they can
run `update-packages` rather than figuring out if they'd previously run
`packages` for this Version/Arch combo.

PKG_VERSION_FROM_DIR was added so that we could perhaps detect the three
distinct cases:

1.) If the repo has not yet been created, PKG_VERSION_FROM_DIR will be
  empty.
2.) If the repo is in some intermediate state between created and fully
  initialized, PKG_VERSION_FROM_DIR may point to the ABI directory.
3.) If the repo is fully initialized, then PKG_VERSION_FROM_DIR points to
  the latest build to compare to.

Option #2 is explicitly unhandled at the moment, but this is no different
than it was before.

Reviewed-by: manu
Differential-Revision: https://reviews.freebsd.org/D28229