]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agonvme: Rename min_page_size to page_size and save mps
Warner Losh [Fri, 15 Apr 2022 20:41:13 +0000 (14:41 -0600)]
nvme: Rename min_page_size to page_size and save mps

The Memory Page Size sets the basic unit of operation for the drive. We
currently set this to the drive's minimum page size, but we could set it
to any page size the drive supports in the future. Replace min_page_size
(it's now unused for that purpose) with page_size to reflect this and
cache the MPS we want to use. Use NVME_MPS_SHIFT to compute page_size.

Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D34868

2 years agonvme: Base maximum data transfer size directly on MPSMIN in cap_hi
Warner Losh [Fri, 15 Apr 2022 20:41:05 +0000 (14:41 -0600)]
nvme: Base maximum data transfer size directly on MPSMIN in cap_hi

Calculate the maxmimum transfer size based on the MPSMIN we have in our
cached copy of cap_hi rather than using min_page_size in the controller.

Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D34867

2 years agonvme: Fix old intel alignment size
Warner Losh [Fri, 15 Apr 2022 20:40:57 +0000 (14:40 -0600)]
nvme: Fix old intel alignment size

The intel raid stripe alignment parameter is based on CAP.MPSMIN, so use
that directly now that we have it available.

Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D34866

2 years agonvme: Define NVME_MPS_SHIFT
Warner Losh [Fri, 15 Apr 2022 20:40:41 +0000 (14:40 -0600)]
nvme: Define NVME_MPS_SHIFT

The memory page size (MPS) is expressed in terms of a 2^(number + 12)
and other items in the system inherit this. Create a define rather than
sprinkling 12 everywehere.

Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D34865

2 years agoacpica: Drop a local patch in favor of an upstream patch
Jung-uk Kim [Fri, 15 Apr 2022 20:29:09 +0000 (16:29 -0400)]
acpica: Drop a local patch in favor of an upstream patch

Use ACPI_ERROR() instead of fprintf().

https://github.com/acpica/acpica/pull/768

2 years agofusefs: validate servers' error values
Alan Somers [Fri, 15 Apr 2022 19:04:24 +0000 (13:04 -0600)]
fusefs: validate servers' error values

Formerly fusefs would pass up the stack any error value returned by the
fuse server.  However, some values aren't valid for userland, but have
special meanings within the kernel.  One of these, EJUSTRETURN, could
cause a kernel page fault if the server returned it in response to
FUSE_LOOKUP.  Fix by validating all errors returned by the server.

Also, fix a data lifetime bug in the FUSE_DESTROY test.

PR: 263220
Reported by: Robert Morris <rtm@lcs.mit.edu>
MFC after: 3 weeks
Sponsored by: Axcient
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D34931

2 years agolpr: remove a.out binary detection
Brooks Davis [Fri, 15 Apr 2022 19:04:41 +0000 (20:04 +0100)]
lpr: remove a.out binary detection

Since the first unattributed commit in 1981, lpr has attempted to
prevent users from printing executables (and in earlier versions
archives). Archive detection was lost in 1992 when lpr gained a
dependency on a.out.h. No corresponding support was added for ELF files
with the full transiation to ELF in 1998, but a.out support has been
dragged forward to and contaminated platforms that never supported
a.out.

While this feature isn't unuseful, preventing the printing of
a single file format we stopped producing ~20 years ago isn't worth
the costs (however minimal).

Reviewed by: gad, imp, emaste
Differential Revision: https://reviews.freebsd.org/D34901

2 years agossh: correct version number (9.0)
Ed Maste [Fri, 15 Apr 2022 16:08:50 +0000 (12:08 -0400)]
ssh: correct version number (9.0)

Reported by: flo
Fixes: 87c1498d1a74 ("ssh: update to OpenSSH v9.0p1")
Sponsored by: The FreeBSD Foundation

2 years agoLinuxKPI: 802.11: improve hw_scan
Bjoern A. Zeeb [Fri, 15 Apr 2022 14:55:40 +0000 (14:55 +0000)]
LinuxKPI: 802.11: improve hw_scan

Initially we were using the IEs from ieee80211_probereq_ie() of net80211
and put them into the common_ies field.  Start by manually building the
per-band and common IE parts as drivers put them back together.
This also involves allocating the req.ie as one buffer for all IEs over
all bands and setting req.ie_len correctly based on how many bytes we
put in.

Manually building per-band scan IEs we still use the net80211 routines
to add IEs to the buffer (mostly).

This is needed by Realtek drivers but will equally used by others.
Realtek would simply panic due to skbs being allocated with the wrong
length.

Longer-term this will help us, e.g., when not supporting VHT on 2Ghz
and we would have to do this anyway.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoLinuxKPI: 802.11: use an sx lock to protect the list of vifs
Bjoern A. Zeeb [Fri, 15 Apr 2022 14:22:43 +0000 (14:22 +0000)]
LinuxKPI: 802.11: use an sx lock to protect the list of vifs

Use an sx lock to protect the list of vifs.  We could use the
linux mutex compat for this but our current implementation may
re-acquire the lock recursively so allow this.  The change is
mainly motivated by the fact that some callers may sleep in the
interator function called.  Recursiveness is needed because we
see find_sta_by_ifaddr() being called from an iterator function
from iterate_interfaces().

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoLinuxKPI: 802.11: start adding rate control to ieee80211_tx_status()
Bjoern A. Zeeb [Fri, 15 Apr 2022 13:39:38 +0000 (13:39 +0000)]
LinuxKPI: 802.11: start adding rate control to ieee80211_tx_status()

Start adding rate control feedback in ieee80211_tx_status() in order
for net80211 to be able to report something back (which may not
yet be the view of the firmware).  iwlwifi is reporting back an MSC 0
even with HT disabled (to be investigated) so we cannot (yet) use
the firmware/driver rate feedback directly.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoLinuxKPI: 802.11: implement ieee80211_probereq_get()
Bjoern A. Zeeb [Fri, 15 Apr 2022 12:53:06 +0000 (12:53 +0000)]
LinuxKPI: 802.11: implement ieee80211_probereq_get()

Implement ieee80211_probereq_get() needed by Realtek drivers.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoLinuxKPI: skbuff: start implementing skb_copy()
Bjoern A. Zeeb [Fri, 15 Apr 2022 12:30:51 +0000 (12:30 +0000)]
LinuxKPI: skbuff: start implementing skb_copy()

Implement skb_copy() with omissions of fragments and possibly other fields
for now.  Should we hit frags at any point a log message will let us know.
For the few cases we need this currently this is enough.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoLinuxKPI: skbuff: dev_kfree_skb_irq() and improvements
Bjoern A. Zeeb [Fri, 15 Apr 2022 12:25:39 +0000 (12:25 +0000)]
LinuxKPI: skbuff: dev_kfree_skb_irq() and improvements

While it is currently unclear if we will have to defer work in
dev_kfree_skb_irq() to call dev_kfree_skb().
We only have one caller which seems to be fine on FreeBSD by calling
it directly for now.

While here shortcut skb_put()/skb_put_data() saving us work if there
are no adjustments to do.
Also adjust the logging in skb_is_gso() to avoid getting spammed by it.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoRemove 12.x ABI compat for kernel dump ioctls
Mitchell Horne [Thu, 14 Apr 2022 22:44:39 +0000 (19:44 -0300)]
Remove 12.x ABI compat for kernel dump ioctls

This code was marked gone_in(14), so it can now be removed.

The only consumer of this interface is dumpon(8). We do not maintain
strict backwards compatibility for this utility because a) it
can't/shouldn't be used from a jail or chroot and b) it is highly
specific interface unique to FreeBSD. The host's (presumably more
up-to-date) copy of dumpon(8) should be used to configure kernel dump
devices.

Reviewed by: markj, emaste
MFC after: never
Differential Revision: https://reviews.freebsd.org/D34914

2 years agoRemove 11.x ABI compat for kernel dump ioctls
Mitchell Horne [Thu, 14 Apr 2022 22:44:02 +0000 (19:44 -0300)]
Remove 11.x ABI compat for kernel dump ioctls

This code was marked gone_in(13), so its time has passed.

The only consumer of this interface is dumpon(8). We do not maintain
strict backwards compatibility for this utility because a) it
can't/shouldn't be used from a jail or chroot and b) it is highly
specific interface unique to FreeBSD. The host's (presumably more
up-to-date) copy of dumpon(8) should be used to configure kernel dump
devices.

Reviewed by: markj, emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D34913

2 years agossh: apply post-release patch from V_9_0 branch
Ed Maste [Fri, 15 Apr 2022 15:03:08 +0000 (11:03 -0400)]
ssh: apply post-release patch from V_9_0 branch

upstream: clear io_want/io_ready flags at start of poll() cycle;

avoids plausible spin during rekeying if channel io_want flags are reused
across cycles. ok markus@ deraadt@

2 years agoscp: switch to using the SFTP protocol by default
Ed Maste [Thu, 14 Apr 2022 00:50:17 +0000 (20:50 -0400)]
scp: switch to using the SFTP protocol by default

From upstream release notes https://www.openssh.com/txt/release-9.0

This release switches scp(1) from using the legacy scp/rcp protocol
to using the SFTP protocol by default.

Legacy scp/rcp performs wildcard expansion of remote filenames (e.g.
"scp host:* .") through the remote shell. This has the side effect of
requiring double quoting of shell meta-characters in file names
included on scp(1) command-lines, otherwise they could be interpreted
as shell commands on the remote side.

This creates one area of potential incompatibility: scp(1) when using
the SFTP protocol no longer requires this finicky and brittle quoting,
and attempts to use it may cause transfers to fail. We consider the
removal of the need for double-quoting shell characters in file names
to be a benefit and do not intend to introduce bug-compatibility for
legacy scp/rcp in scp(1) when using the SFTP protocol.

Another area of potential incompatibility relates to the use of remote
paths relative to other user's home directories, for example -
"scp host:~user/file /tmp". The SFTP protocol has no native way to
expand a ~user path. However, sftp-server(8) in OpenSSH 8.7 and later
support a protocol extension "expand-path@openssh.com" to support
this.

In case of incompatibility, the scp(1) client may be instructed to use
the legacy scp/rcp using the -O flag.

Relnotes: Yes
Sponsored by: The FreeBSD Foundation

2 years agossh: update to OpenSSH v9.0p1
Ed Maste [Fri, 15 Apr 2022 14:41:08 +0000 (10:41 -0400)]
ssh: update to OpenSSH v9.0p1

Release notes are available at https://www.openssh.com/txt/release-9.0

Some highlights:

 * ssh(1), sshd(8): use the hybrid Streamlined NTRU Prime + x25519 key
   exchange method by default ("sntrup761x25519-sha512@openssh.com").
   The NTRU algorithm is believed to resist attacks enabled by future
   quantum computers and is paired with the X25519 ECDH key exchange
   (the previous default) as a backstop against any weaknesses in
   NTRU Prime that may be discovered in the future. The combination
   ensures that the hybrid exchange offers at least as good security
   as the status quo.

 * sftp-server(8): support the "copy-data" extension to allow server-
   side copying of files/data, following the design in
   draft-ietf-secsh-filexfer-extensions-00. bz2948

 * sftp(1): add a "cp" command to allow the sftp client to perform
   server-side file copies.

This commit excludes the scp(1) change to use the SFTP protocol by
default; that change will immediately follow.

MFC after: 1 month
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

2 years agoetc/mtree: Remove tabs
Mark Johnston [Fri, 15 Apr 2022 14:27:22 +0000 (10:27 -0400)]
etc/mtree: Remove tabs

2 years agolibsysdecode: Add regression tests for sysdecode_cap_rights(3)
Mark Johnston [Fri, 15 Apr 2022 14:23:32 +0000 (10:23 -0400)]
libsysdecode: Add regression tests for sysdecode_cap_rights(3)

Reviewed by: jhb, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34900

2 years agolibsysdecode: Include required headers in sysdecode.h
Mark Johnston [Fri, 15 Apr 2022 14:22:29 +0000 (10:22 -0400)]
libsysdecode: Include required headers in sysdecode.h

Make sysdecode.h self-contained rather than forcing all consumers to
include dependencies.  No functional change intended.

Reviewed by: pauamma_gundo.com, jhb, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34899

2 years agodiff3: allow diff3 ed scripts to generate deletions
Tom Jones [Fri, 15 Apr 2022 13:59:14 +0000 (14:59 +0100)]
diff3: allow diff3 ed scripts to generate deletions

diff3 with the -e (ed script flag) can generate line deletions, add
support for deletions and add a test case to exercise this behaviour.
This functionality was unearthed through comparison of bsd diff3 and gnu
diff3 output.

Reviewed by: pstef
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D34912

2 years agoRevert rest of a5970a529c2d95271: use vrefact() when working on fp->f_vnode
Konstantin Belousov [Wed, 13 Apr 2022 23:39:57 +0000 (02:39 +0300)]
Revert rest of a5970a529c2d95271: use vrefact() when working on fp->f_vnode

Now, since O_PATH-opened file descriptors use use references instead
of the hold references, vrefact() chahges from that revision can be
reverted.

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

2 years agosctp: don't keep a pointer to a freed stcb around
Michael Tuexen [Fri, 15 Apr 2022 12:00:00 +0000 (14:00 +0200)]
sctp: don't keep a pointer to a freed stcb around

Reported by: syzbot+b9ef06efdae7cb9ee414@syzkaller.appspotmail.com
Reported by: syzbot+b1e4793e0e6b25b0d510@syzkaller.appspotmail.com
MFC after: 3 days

2 years agosctp: improve locking
Michael Tuexen [Fri, 15 Apr 2022 11:58:45 +0000 (13:58 +0200)]
sctp: improve locking

Hold a refcount while giving up an stcp lock. This issue was
found by running syzkaller.

MFC after: 3 days

2 years agonfscl: Clean up the code by removing unused arguments
Rick Macklem [Thu, 14 Apr 2022 23:15:56 +0000 (16:15 -0700)]
nfscl: Clean up the code by removing unused arguments

The "void *stuff" (also called fstuff and dstuff) argument
was used by the Mac OSX port.  For FreeBSD, this argument
is always NULL, so remove it to clean up the code.

This commit gets rid of "stuff" for nfscl_nget().
Future commits will do the same for other functions.

2 years agocxgbetool(8): User interface to round-robin queue selection via COP.
Navdeep Parhar [Thu, 14 Apr 2022 22:54:13 +0000 (15:54 -0700)]
cxgbetool(8): User interface to round-robin queue selection via COP.

Queue "roundrobin" in a COP rule means the driver should select queues
for new tids in a round-robin manner.

Reviewed by: jhb@
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D34922

2 years agocxgbe/t4_tom: Support for round-robin selection of offload queues.
Navdeep Parhar [Thu, 14 Apr 2022 22:49:58 +0000 (15:49 -0700)]
cxgbe/t4_tom: Support for round-robin selection of offload queues.

A COP (Connection Offload Policy) rule can now specify that the tx
and/or rx queue for a new tid should be selected in a round-robin
manner. There is no change in default behavior.

Reviewed by: jhb@
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D34921

2 years agocxgbe(4): Add support for PPOD_EDRAM feature.
Navdeep Parhar [Thu, 14 Apr 2022 22:43:32 +0000 (15:43 -0700)]
cxgbe(4): Add support for PPOD_EDRAM feature.

The driver queries the firmware to find out if it supports this feature
and enables it if it does. The firmware moves the iSCSI page pod region
to a lower address so that some of it is located in the faster on-chip
memory instead of external DDR.

Reviewed by: jhb@
MFC after: 3 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D34895

2 years agotcp: adding a functionality to define "trace points" so that BB logging can be enable...
Randall Stewart [Thu, 14 Apr 2022 20:07:34 +0000 (16:07 -0400)]
tcp: adding a functionality to define "trace points" so that BB logging can be enabled at specific events.

This commit will add a new concept to rack, tracepoints. A tracepoint
is a defined point inserted into the code (3 are included in this initial patch) that
allows a developer to insert a point that might be of interest. The developer numbers
the point in the tcp_rack.h file and then can use sysctl to enable that (or all) trace
points. A limit is also given to how many BB logged connections will turn on
so that a box is not overrun by BB logging.

Reviewed by: tuexen
Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D34898

2 years agotcp - hpts timing is off when we are above 1200 connections.
Randall Stewart [Thu, 14 Apr 2022 20:04:08 +0000 (16:04 -0400)]
tcp - hpts timing is off when we are above 1200 connections.

HPTS timing begins to go off when we reach the threshold of connections (1200 by default)
where we have any returning syscall or LRO stop finding the oldest hpts thread that
has not run but instead using the CPU it is on. This ends up causing quite a lot of times
where hpts threads may not run for extended periods of time. On top of all that which
causes heartburn if you are pacing in tcp, you also have the fact that where AMD's
podded L3 cache may have sets of 8 CPU's that share a L3, hpts is unaware of this
and thus on amd you can generate a lot of cache misses.

So to fix this we will get rid of the CPU mode, and always use oldest. But also make
HPTS aware of the CPU topology and keep the "oldest" to be within the same L3 cache.
This also works nicely for NUMA as well couple with Drew's earlier NUMA changes.

Reviewed by: glebius, gallatin, tuexen
Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D34916

2 years agosctp: cleanup
Michael Tuexen [Thu, 14 Apr 2022 19:50:10 +0000 (21:50 +0200)]
sctp: cleanup

MFC after: 3 days

2 years agovm: Initialize the transient buffer mapping arena with M_WAITOK
Mark Johnston [Thu, 14 Apr 2022 19:46:14 +0000 (15:46 -0400)]
vm: Initialize the transient buffer mapping arena with M_WAITOK

The wait flag is passed to UMA when allocating boundary tags for the
initial span, and UMA expects either M_WAITOK or M_NOWAIT to be present.

Reported by: cperciva
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agovm: Move the "vm_wait in early boot" assertion to the proper place
Mark Johnston [Thu, 14 Apr 2022 19:45:54 +0000 (15:45 -0400)]
vm: Move the "vm_wait in early boot" assertion to the proper place

The assertion was added in commit 1771e987ca6a.  After that, vm_wait()
and friends were refactored such that the actual sleep happens
elsewhere.  Now the assertion condition is not checked when
vm_wait_doms() is called directly, and it is checked even if we are not
going to sleep (because vm_page_count_min_set(wdoms) is false).

Reviewed by: alc, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34909

2 years agosysent: regen after 52a1d90c8bfe, posix_fadvise in capmode
Ed Maste [Thu, 14 Apr 2022 19:17:07 +0000 (15:17 -0400)]
sysent: regen after 52a1d90c8bfe, posix_fadvise in capmode

2 years agoAllow posix_fadvise in capability mode
Ed Maste [Wed, 13 Apr 2022 22:36:03 +0000 (18:36 -0400)]
Allow posix_fadvise in capability mode

posix_fadvise operates only on a provided fd.  Noted by
Mathieu <sigsys@gmail.com> in review D34761.

No new CAP_ rights are added for posix_fadvise(), as 'advice' in
general only influences when I/O happens; the fd must have existing
CAP_ rights for actual data access.

Reviewed by: markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34903

2 years agogenet: fix problems with interface down/up
Mike Karels [Mon, 11 Apr 2022 19:44:49 +0000 (14:44 -0500)]
genet: fix problems with interface down/up

The genet interface did not resume operation correctly after doing
ifconfig down then up.  The down/reset procedure did not clear the
RUNNING flag, and did not reset enough of the hardware state.  This
patch is modeled on OpenBSD code, with a call to gen_reset added
to reset the controller completely.  Regularize the parameter to
gen_dma_disable() while here.

PR:             263091
Submitted by: jiahali@blackberry.com

2 years agopfctl: fix recursive printing of rules
Matteo Riondato [Wed, 13 Apr 2022 07:38:44 +0000 (09:38 +0200)]
pfctl: fix recursive printing of rules

When asked to print rules recursively, correctly recurse for anchors
included in pf.conf with "anchorname/*".

PR: 262590
Reviewed by: kp
MFC after: 3 weeks

2 years agoDisable building kcov test on powerpcspe
Li-Wen Hsu [Thu, 14 Apr 2022 15:03:00 +0000 (23:03 +0800)]
Disable building kcov test on powerpcspe

It's also 32-bit and lacks support for the needed atomic operations.

Sponsored by: The FreeBSD Foundation

2 years agolibedit: import version of 2022-04-11
Baptiste Daroussin [Thu, 14 Apr 2022 14:46:47 +0000 (16:46 +0200)]
libedit: import version of 2022-04-11

It includes improvements in the libreadline compatibility and a change
from pstef@ which fixes filename autocompletion for strings like a\)b

2 years agolibedit: import version 2022-04-11
Baptiste Daroussin [Thu, 14 Apr 2022 14:41:01 +0000 (16:41 +0200)]
libedit: import version 2022-04-11

2 years agoupdate to 2022-03-22
Baptiste Daroussin [Thu, 14 Apr 2022 14:15:47 +0000 (16:15 +0200)]
update to 2022-03-22

2 years agowpa: Correctly call pcap_next_ex()
Cy Schubert [Thu, 14 Apr 2022 01:45:49 +0000 (18:45 -0700)]
wpa: Correctly call pcap_next_ex()

The second argument to pcap_next_ex() is a pointer to a pointer.
Not a pointer. This fixes a wpa_supplicent SIGSEGV.

PR: 263266
Reported by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
Fixes: 6e5d01124fd4dd57899ddd9260c76dbb43543aa7
MFC: immediately

2 years agotime(3): Refine history in the manual page
Gordon Bergling [Thu, 14 Apr 2022 08:04:14 +0000 (10:04 +0200)]
time(3): Refine history in the manual page

The time() system call first appeared in Version 1 AT&T UNIX.  Through
the Version 3 AT&T UNIX, it returned 60 Hz ticks since an epoch that
changed occasionally, because it was a 32-bit value that overflowed in a
little over 2 years.

In Version 4 AT&T UNIX the granularity of the return value was reduced to
whole seconds, delaying the aforementioned overflow until 2038.

Version 7 AT&T UNIX introduced the ftime() system call, which returned
time at a millisecond level, though retained the gtime() system call
(exposed as time() in userland).  time() could have been implemented as a
wrapper around ftime(), but that wasn't done.

4.1cBSD implemented a higher-precision time function gettimeofday() to
replace ftime() and reimplemented time() in terms of that.

Since FreeBSD 9 the implementation of time() uses
clock_gettime(CLOCK_SECOND) instead of gettimeofday() for performance
reasons.

With most valuable input from Warner (imp@).

Reviewed by: 0mp, jilles, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D34751

2 years agocxgbe(4): Fix control flow issues reported by Coverity.
Navdeep Parhar [Thu, 14 Apr 2022 07:17:36 +0000 (00:17 -0700)]
cxgbe(4): Fix control flow issues reported by Coverity.

CID 1487932:  Control flow issues  (NESTING_INDENT_MISMATCH).
The macro on this line expands into multiple statements, only the first
of which is nested within the preceding parent while the rest are not.
9828                    ulp_region(RX_TLS_KEY);

Reported by: Coverity (CID 1487932)
Fixes: f88b31885c4 cxgbe(4): meminfo should get the TLS region's limits from the hardware.
MFC after: 3 days
Sponsored by: Chelsio Communications

2 years agoRevert "drm2: Fix a typo in a source code comment"
Gordon Bergling [Thu, 14 Apr 2022 07:01:29 +0000 (09:01 +0200)]
Revert "drm2: Fix a typo in a source code comment"

This reverts commit 5158cf0a382eb9079e1851f86293f37a1cf25f5b.

2 years agostress2: Permanently disable disruptive tests
Peter Holm [Thu, 14 Apr 2022 04:57:24 +0000 (06:57 +0200)]
stress2: Permanently disable disruptive tests

2 years agoMostly revert a5970a529c2d95271: Make files opened with O_PATH to not block non-force...
Konstantin Belousov [Wed, 13 Apr 2022 00:47:45 +0000 (03:47 +0300)]
Mostly revert a5970a529c2d95271: Make files opened with O_PATH to not block non-forced unmount

Problem is that open(O_PATH) on nullfs -o nocache is broken then,
because there is no reference on the vnode after the open syscall exits.

Reported and tested by: ambrisko
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

2 years agopowerpc mpc85xx: Remove unused variables.
John Baldwin [Wed, 13 Apr 2022 23:08:24 +0000 (16:08 -0700)]
powerpc mpc85xx: Remove unused variables.

2 years agopowerpc: Use __diagused for variables only used in KASSERT().
John Baldwin [Wed, 13 Apr 2022 23:08:23 +0000 (16:08 -0700)]
powerpc: Use __diagused for variables only used in KASSERT().

2 years agoad7417: Avoid an unused but set warning when compiled with NO_SYSCTL_DESCR.
John Baldwin [Wed, 13 Apr 2022 23:08:23 +0000 (16:08 -0700)]
ad7417: Avoid an unused but set warning when compiled with NO_SYSCTL_DESCR.

Use a ternary operator for the description string passed to
SYSCTL_ADD_PROC instead of a helper variable.

2 years agodpaa: Remove unused variables.
John Baldwin [Wed, 13 Apr 2022 23:08:23 +0000 (16:08 -0700)]
dpaa: Remove unused variables.

2 years agodivert_packet: ip is only used for SCTP.
John Baldwin [Wed, 13 Apr 2022 23:08:23 +0000 (16:08 -0700)]
divert_packet: ip is only used for SCTP.

2 years agoin_pcballoc: error is only used for IPSEC or MAC.
John Baldwin [Wed, 13 Apr 2022 23:08:23 +0000 (16:08 -0700)]
in_pcballoc: error is only used for IPSEC or MAC.

2 years agokern: Move variables only used for MAC under #ifdef MAC.
John Baldwin [Wed, 13 Apr 2022 23:08:23 +0000 (16:08 -0700)]
kern: Move variables only used for MAC under #ifdef MAC.

2 years agoriscv: Use __diagused for variables only used in KASSERT().
John Baldwin [Wed, 13 Apr 2022 23:08:23 +0000 (16:08 -0700)]
riscv: Use __diagused for variables only used in KASSERT().

2 years agoxdma: Inline variables with simple values used once in a KASSERT().
John Baldwin [Wed, 13 Apr 2022 23:08:23 +0000 (16:08 -0700)]
xdma: Inline variables with simple values used once in a KASSERT().

2 years agoi386 getmemsize: Use __diagused for a variable only used in KASSERT().
John Baldwin [Wed, 13 Apr 2022 23:08:23 +0000 (16:08 -0700)]
i386 getmemsize: Use __diagused for a variable only used in KASSERT().

2 years agoarm64 rk_pcie: Use __diagused for a variable only used in KASSERT().
John Baldwin [Wed, 13 Apr 2022 23:08:23 +0000 (16:08 -0700)]
arm64 rk_pcie: Use __diagused for a variable only used in KASSERT().

2 years agovnic: Use __diagused for variables only used in KASSERT().
John Baldwin [Wed, 13 Apr 2022 23:08:23 +0000 (16:08 -0700)]
vnic: Use __diagused for variables only used in KASSERT().

2 years agosched_ule: Inline value of ts in sched_thread_priority.
John Baldwin [Wed, 13 Apr 2022 23:08:23 +0000 (16:08 -0700)]
sched_ule: Inline value of ts in sched_thread_priority.

This avoids a set but unused warning in kernels without SMP where
TDQ_CPU() doesn't use its argument.

2 years agoata-fsl: Remove unused variable.
John Baldwin [Wed, 13 Apr 2022 23:08:23 +0000 (16:08 -0700)]
ata-fsl: Remove unused variable.

2 years agoarm freescale: Remove unused variables.
John Baldwin [Wed, 13 Apr 2022 23:08:22 +0000 (16:08 -0700)]
arm freescale: Remove unused variables.

2 years agoarm sp804: Remove unused variables.
John Baldwin [Wed, 13 Apr 2022 23:08:22 +0000 (16:08 -0700)]
arm sp804: Remove unused variables.

2 years agoarm vybrid: #if 0 variables only used under #if 0.
John Baldwin [Wed, 13 Apr 2022 23:08:22 +0000 (16:08 -0700)]
arm vybrid: #if 0 variables only used under #if 0.

2 years agodrm2: Remove unused variables.
John Baldwin [Wed, 13 Apr 2022 23:08:22 +0000 (16:08 -0700)]
drm2: Remove unused variables.

2 years agoif_mvneta: Use __diagused for a variable only used in KASSERT().
John Baldwin [Wed, 13 Apr 2022 23:08:22 +0000 (16:08 -0700)]
if_mvneta: Use __diagused for a variable only used in KASSERT().

2 years agoxdma pl330: Remove unused variables.
John Baldwin [Wed, 13 Apr 2022 23:08:22 +0000 (16:08 -0700)]
xdma pl330: Remove unused variables.

2 years agogpio tca6416: Remove unused variable.
John Baldwin [Wed, 13 Apr 2022 23:08:22 +0000 (16:08 -0700)]
gpio tca6416: Remove unused variable.

2 years agoflash: Remove unused variables.
John Baldwin [Wed, 13 Apr 2022 23:08:22 +0000 (16:08 -0700)]
flash: Remove unused variables.

2 years agohwpmc: Use __diagused for variables only used in KASSERT().
John Baldwin [Wed, 13 Apr 2022 23:08:22 +0000 (16:08 -0700)]
hwpmc: Use __diagused for variables only used in KASSERT().

2 years agolinuxkpi: Use an inline function for the _ioremap_attr stub.
John Baldwin [Wed, 13 Apr 2022 23:08:22 +0000 (16:08 -0700)]
linuxkpi: Use an inline function for the _ioremap_attr stub.

This "consumes" variables passed to ioremap*() avoiding set but unused
warnings.

2 years agoarm: Use __diagused for variables only used in KASSERT().
John Baldwin [Wed, 13 Apr 2022 23:08:22 +0000 (16:08 -0700)]
arm: Use __diagused for variables only used in KASSERT().

2 years agobcm2835_systimer: Remove unused variable.
John Baldwin [Wed, 13 Apr 2022 23:08:22 +0000 (16:08 -0700)]
bcm2835_systimer: Remove unused variable.

2 years agosched_4bsd: ts is only used in sched_bind for SMP.
John Baldwin [Wed, 13 Apr 2022 23:08:22 +0000 (16:08 -0700)]
sched_4bsd: ts is only used in sched_bind for SMP.

2 years agoarm dbg: Use PCPU_GET(cpuid) directly in assertions.
John Baldwin [Wed, 13 Apr 2022 23:08:21 +0000 (16:08 -0700)]
arm dbg: Use PCPU_GET(cpuid) directly in assertions.

2 years agoipsec_encap: setdf is only used for INET.
John Baldwin [Wed, 13 Apr 2022 23:08:21 +0000 (16:08 -0700)]
ipsec_encap: setdf is only used for INET.

2 years agoTCP sysctl handlers: fin and lin are only used for INET.
John Baldwin [Wed, 13 Apr 2022 23:08:21 +0000 (16:08 -0700)]
TCP sysctl handlers: fin and lin are only used for INET.

2 years agotcp_log_vain/addrs: Use a const pointer for the IPv4 header.
John Baldwin [Wed, 13 Apr 2022 23:08:21 +0000 (16:08 -0700)]
tcp_log_vain/addrs: Use a const pointer for the IPv4 header.

The pointer to the IPv6 header was already const.

2 years agotcp_log_addr: ip is only used for INET.
John Baldwin [Wed, 13 Apr 2022 23:08:21 +0000 (16:08 -0700)]
tcp_log_addr: ip is only used for INET.

2 years agoipfw: icmp6_type is only used for INET6.
John Baldwin [Wed, 13 Apr 2022 23:08:21 +0000 (16:08 -0700)]
ipfw: icmp6_type is only used for INET6.

2 years agomlx5: fs_tcp is only used for INET or INET6.
John Baldwin [Wed, 13 Apr 2022 23:08:21 +0000 (16:08 -0700)]
mlx5: fs_tcp is only used for INET or INET6.

2 years agosctp: #ifdef INET-only and INET6-only variables.
John Baldwin [Wed, 13 Apr 2022 23:08:21 +0000 (16:08 -0700)]
sctp: #ifdef INET-only and INET6-only variables.

Duplicating the SCTP_PCB_FLAGS_BOUND_V6 check made the #ifdef's
simpler than applying #ifdef's directly to the original code.  Modern
compilers should cache the result rather than testing the flag twice.

2 years agoinfiniband_resolve_addr: ih is only used for INET or INET6.
John Baldwin [Wed, 13 Apr 2022 23:08:21 +0000 (16:08 -0700)]
infiniband_resolve_addr: ih is only used for INET or INET6.

2 years agong_netflow: Move various variables under INET || INET6.
John Baldwin [Wed, 13 Apr 2022 23:08:21 +0000 (16:08 -0700)]
ng_netflow: Move various variables under INET || INET6.

2 years agoether_resolve_addr: eh is only used for INET or INET6.
John Baldwin [Wed, 13 Apr 2022 23:08:21 +0000 (16:08 -0700)]
ether_resolve_addr: eh is only used for INET or INET6.

2 years agovtnet: offset is only used for INET or INET6.
John Baldwin [Wed, 13 Apr 2022 23:08:21 +0000 (16:08 -0700)]
vtnet: offset is only used for INET or INET6.

2 years agovlan: ifa is only used under #ifdef INET.
John Baldwin [Wed, 13 Apr 2022 23:08:21 +0000 (16:08 -0700)]
vlan: ifa is only used under #ifdef INET.

2 years agozfs: Disable -Wunused-but-set-variable for dnode.c.
John Baldwin [Wed, 13 Apr 2022 23:08:20 +0000 (16:08 -0700)]
zfs: Disable -Wunused-but-set-variable for dnode.c.

dn is only used by DNODE_VERIFY (conditional on ZFS_DEBUG) in
dnode_special_open.

2 years agousb: Add a __usbdebug_used for variables only used under #ifdef USB_DEBUG.
John Baldwin [Wed, 13 Apr 2022 23:08:20 +0000 (16:08 -0700)]
usb: Add a __usbdebug_used for variables only used under #ifdef USB_DEBUG.

Use it for various variables only used in DPRINTF debug traces
conditional on USB_DEBUG.

2 years agousb: Use __diagused for variables only used in KASSERT().
John Baldwin [Wed, 13 Apr 2022 23:08:20 +0000 (16:08 -0700)]
usb: Use __diagused for variables only used in KASSERT().

2 years agounionfs: Use __diagused for a variable only used in KASSERT().
John Baldwin [Wed, 13 Apr 2022 23:08:20 +0000 (16:08 -0700)]
unionfs: Use __diagused for a variable only used in KASSERT().

2 years agosfxge: Use __diagused for variables only used in KASSERT().
John Baldwin [Wed, 13 Apr 2022 23:08:20 +0000 (16:08 -0700)]
sfxge: Use __diagused for variables only used in KASSERT().

2 years agosdhci_card_task: d is only used in the non-MMCCAM case.
John Baldwin [Wed, 13 Apr 2022 23:08:20 +0000 (16:08 -0700)]
sdhci_card_task: d is only used in the non-MMCCAM case.

2 years agopf: Use __diagused for variables only used in KASSERT().
John Baldwin [Wed, 13 Apr 2022 23:08:20 +0000 (16:08 -0700)]
pf: Use __diagused for variables only used in KASSERT().

2 years agonvdimm: Inline value of variable used once in an assertion.
John Baldwin [Wed, 13 Apr 2022 23:08:20 +0000 (16:08 -0700)]
nvdimm: Inline value of variable used once in an assertion.

2 years agolpt: Mark ppbus in lptout unused.
John Baldwin [Wed, 13 Apr 2022 23:08:20 +0000 (16:08 -0700)]
lpt: Mark ppbus in lptout unused.

It is used both in an assertion under INVARIANTS as well as in a
custom debug trace.

2 years agohyperv: Use __diagused for a variable only used in KASSERT().
John Baldwin [Wed, 13 Apr 2022 23:08:20 +0000 (16:08 -0700)]
hyperv: Use __diagused for a variable only used in KASSERT().

2 years agobhnd: Use __diagused for a variable only used in a KASSERT().
John Baldwin [Wed, 13 Apr 2022 23:08:20 +0000 (16:08 -0700)]
bhnd: Use __diagused for a variable only used in a KASSERT().