]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
23 months agosound: add patch for Lenovo Legion 5 Intel
Nuno Teixeira [Fri, 16 Sep 2022 13:29:30 +0000 (14:29 +0100)]
sound: add patch for Lenovo Legion 5 Intel

Laptop Legion Lenovo 5 15MH05 (Intel)

Patch to fix the sound on this machine.
It requires sending the speaker and the headphone jack to the same nid.

PR: 265632
Approved by: emaste
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D36511

23 months agobridge.4: describe new MTU behaviour
Kristof Provost [Thu, 15 Sep 2022 06:26:49 +0000 (08:26 +0200)]
bridge.4: describe new MTU behaviour

1865ebfb12 changed if_bridge to have it change the MTU on newly added
interfaces to match the if_bridge MTU, rather than rejecting them for
having an incorrect MTU.

Update the man page to reflect this, as pointed out by woodsb02.

Reviewed by: woodsb02
Differential Revision: https://reviews.freebsd.org/D36481

23 months agouname.1: Clarify the -r option
Gordon Bergling [Fri, 16 Sep 2022 11:27:54 +0000 (13:27 +0200)]
uname.1: Clarify the -r option

It is some times hard to understand the difference between
kernel version and userland version. So clarify the -r option
of uname(1) in terms of a printed kernel version.

While here, add some cross references:

- cross reference freebsd-version(1) in uname(1)
- cross reference freebsd-version(1) and uname(1) in freebsd-update(8)

PR: 265594
Reported by: rwatson
Reviewed by: gbe, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36516

23 months agoarch: armv4 isn't supported either on aarch64 running in aarch32 mode
Warner Losh [Thu, 15 Sep 2022 17:17:12 +0000 (11:17 -0600)]
arch: armv4 isn't supported either on aarch64 running in aarch32 mode

FreeBSD used to support both armv4 and armv5 binaries. All of that
support has been removed from the tree. We have only ever supported
armv6 and armv7 binaries in that mode. Note armv4 here too for
completeness since it flowed better than 'armv5 and earlier' and means
the same thing (FreeBSD never ran on an armv3 or earlier CPU).

Sponsored by: Netflix

23 months agofreebsd32: Make sendmsg match native ABI for unpadded final control message
Jessica Clarke [Thu, 15 Sep 2022 16:16:22 +0000 (17:16 +0100)]
freebsd32: Make sendmsg match native ABI for unpadded final control message

The API says that CMSG_SPACE should be used for msg_controllen, but in
practice the native ABI allows you to only use CMSG_LEN for the final
(typically only) control message, and real-world software does this,
including Wayland. For freebsd32, this is in practice mostly harmless,
since control messages are generally used to carry file descriptors,
which are already 4 bytes in size and thus no padding is needed, but
they can carry other quantities that may not result in an aligned
length. This was discovered after CheriBSD's freebsd64 equivalent was
updated to match the freebsd32 implementation, as that uses 8 byte
alignment which does break the file descriptor use case, and thus
Wayland.

This used to be addressed by aligning buflen before the first iteration,
but that allowed unwanted invalid inputs and was lost in 1b1428dcc82b,
with no safer equivalent put in its place.

Reviewed by: brooks, kib, markj
Obtained from: CheriBSD
Fixes: 1b1428dcc82b ("Fix a TOCTOU vulnerability in freebsd32_copyin_control().")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36554

23 months agoObsoleteFiles: fix some dates in my comments
Gleb Smirnoff [Thu, 15 Sep 2022 16:04:50 +0000 (09:04 -0700)]
ObsoleteFiles: fix some dates in my comments

23 months agostand/efi: Clean the proper files
Guido van Rooij [Thu, 15 Sep 2022 15:10:20 +0000 (09:10 -0600)]
stand/efi: Clean the proper files

Need to clean the specific loader we build, not the generic loader.efi

Reviewed by: imp

23 months agoAdd deprecation notices for OPIE.
Dag-Erling Smørgrav [Thu, 15 Sep 2022 14:21:33 +0000 (16:21 +0200)]
Add deprecation notices for OPIE.

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

23 months agoRetire ISA sound card DMA support
Ed Maste [Fri, 18 Mar 2022 16:22:21 +0000 (12:22 -0400)]
Retire ISA sound card DMA support

As all ISA sound card drivers have been removed sndbuf_dma no longer
serves any purpose.

Reviewed by: mav
Relnotes:  Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34671

23 months agotests/sys/fs: remove mips workaround
Mitchell Horne [Thu, 15 Sep 2022 13:57:43 +0000 (10:57 -0300)]
tests/sys/fs: remove mips workaround

MIPS is gone, so we no longer require this check.

Reviewed by: imp, asomers
Differential Revision: https://reviews.freebsd.org/D36566

23 months agopf tests: require scapy for ether:short_pkt
Mitchell Horne [Thu, 15 Sep 2022 13:57:07 +0000 (10:57 -0300)]
pf tests: require scapy for ether:short_pkt

The pft_ether.py script requires both python and scapy to be installed.
Check for this so we properly skip the test when it is unavailable.

Reviewed by: kp
Fixes: 07ffa50ba075d ("pf tests: test short packets")
Differential Revision: https://reviews.freebsd.org/D36561

23 months agoUpdate SEE ALSO sections for resolver.{3,5} and hosts.5
Gordon Bergling [Thu, 15 Sep 2022 13:24:28 +0000 (15:24 +0200)]
Update SEE ALSO sections for resolver.{3,5} and hosts.5

The mentioned document "Name Server Operations Guide for BIND" is
outdated, so remove it from the SEE ALSO section of hosts.5
and resolver.{3,5}.

PR: 266360
Reported by: Graham Perrin <grahamperrin at FreeBSD dot org>
Reviewed by: karels
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36557

23 months agoqlnxe(4): Fix a typo in a source code comment
Gordon Bergling [Thu, 15 Sep 2022 08:31:05 +0000 (10:31 +0200)]
qlnxe(4): Fix a typo in a source code comment

- s/paramters/parameters/

MFC after: 3 days

23 months agocxgbetool(8): Fix a typo in a source code comment
Gordon Bergling [Thu, 15 Sep 2022 08:29:54 +0000 (10:29 +0200)]
cxgbetool(8): Fix a typo in a source code comment

- s/paramter/parameter/

MFC after: 3 days

23 months agobootptest: Fix a typo in a source code comment
Gordon Bergling [Thu, 15 Sep 2022 08:28:52 +0000 (10:28 +0200)]
bootptest: Fix a typo in a source code comment

- s/avaible/available/

MFC after: 3 days

23 months agosafexcel: Fix a typo in a source code comment
Gordon Bergling [Thu, 15 Sep 2022 08:26:48 +0000 (10:26 +0200)]
safexcel: Fix a typo in a source code comment

- s/paramters/parameters/

MFC after: 3 days

23 months agoflua: Fix a typo in a source code comment
Gordon Bergling [Thu, 15 Sep 2022 08:25:54 +0000 (10:25 +0200)]
flua: Fix a typo in a source code comment

- s/paramter/parameter/

MFC after: 3 days

23 months agokern_jail: Fix a typo in a source code comment
Gordon Bergling [Thu, 15 Sep 2022 08:25:19 +0000 (10:25 +0200)]
kern_jail: Fix a typo in a source code comment

- s/paramter/parameter/

MFC after: 3 days

23 months agonetpfil: Fix some typos in source code comments
Gordon Bergling [Thu, 15 Sep 2022 08:24:00 +0000 (10:24 +0200)]
netpfil: Fix some typos in source code comments

- s/paramter/parameter/
- s/paramters/parameters/

MFC after: 3 days

23 months agoSPDX: Not BSD-4-Clause
Warner Losh [Thu, 15 Sep 2022 03:17:44 +0000 (21:17 -0600)]
SPDX: Not BSD-4-Clause

This license has 4 clauses, and shares some text with the BSD-4-Clause
license. However, it omits the standard disclaimer and has 2 clauses all
its own. Remove this tag, since it was made in error and this doesn't
match the SPDX copy of the BSD-4-Clause license.

Sponsored by: Netflix

23 months agoip_output: always increase "cantfrag" stat if ip_fragment() fails
Gleb Smirnoff [Thu, 15 Sep 2022 02:22:40 +0000 (19:22 -0700)]
ip_output: always increase "cantfrag" stat if ip_fragment() fails

While here, join two unlikely cases into one if clause.

Submitted by: Ivan Rozhuk <rozhuk.im gmail.com>
PR: 265718
Reviewed by: mjg, melifaro
Differential revision: https://reviews.freebsd.org/D36584

23 months agoUnbreak the build after b3ee318b79d54a59190d35b8c76a63a8fb81b903
Mateusz Guzik [Wed, 14 Sep 2022 23:52:05 +0000 (23:52 +0000)]
Unbreak the build after b3ee318b79d54a59190d35b8c76a63a8fb81b903

23 months agovfs: make delmntque return with the interlock held
Mateusz Guzik [Wed, 14 Sep 2022 23:08:08 +0000 (23:08 +0000)]
vfs: make delmntque return with the interlock held

saves on relocking dance -- the lock is taken immediately
afterwards anyway.

23 months agolockf: elide vnode interlock in the common case in lf_purgelocks
Mateusz Guzik [Wed, 14 Sep 2022 23:04:22 +0000 (23:04 +0000)]
lockf: elide vnode interlock in the common case in lf_purgelocks

The interlock was already taken and released when dooming, thus by
API contract locking state cannot be legally installed.

At the same time the state is almost never there to begin with.

23 months agodevfs: stop taking the interlock in devfs_delete
Mateusz Guzik [Wed, 14 Sep 2022 22:51:42 +0000 (22:51 +0000)]
devfs: stop taking the interlock in devfs_delete

It buys nothing now that vhold does not require it.

23 months agodevfs: retire the unused DEVFS_DEL_VNLOCKED flag
Mateusz Guzik [Wed, 14 Sep 2022 22:47:53 +0000 (22:47 +0000)]
devfs: retire the unused DEVFS_DEL_VNLOCKED flag

23 months agodomains: rewrite documentation to describe present state
Gleb Smirnoff [Wed, 14 Sep 2022 21:11:40 +0000 (14:11 -0700)]
domains: rewrite documentation to describe present state

Reviewed by: debdrup, pauamma
Differential revision: https://reviews.freebsd.org/D36513

23 months agovfs: retire the V_MNTREF flag
Mateusz Guzik [Sat, 10 Sep 2022 20:13:19 +0000 (22:13 +0200)]
vfs: retire the V_MNTREF flag

Reviewed by: kib, mckusick
Differential Revision: https://reviews.freebsd.org/D36521

23 months agovfs: stop using the V_MNTREF flag
Mateusz Guzik [Sat, 10 Sep 2022 20:12:08 +0000 (22:12 +0200)]
vfs: stop using the V_MNTREF flag

Reviewed by: kib, mckusick
Differential Revision: https://reviews.freebsd.org/D36521

23 months agoufs: stop using the V_MNTREF flag
Mateusz Guzik [Sat, 10 Sep 2022 20:11:42 +0000 (22:11 +0200)]
ufs: stop using the V_MNTREF flag

Reviewed by: kib, mckusick
Differential Revision: https://reviews.freebsd.org/D36521

23 months agoufs: try to elide the interlock in ufs_itimes
Mateusz Guzik [Mon, 12 Sep 2022 23:20:59 +0000 (23:20 +0000)]
ufs: try to elide the interlock in ufs_itimes

Reviewed by: kib, mckusick
Differential Revision: https://reviews.freebsd.org/D36522

23 months agoufs: always call ufs_itimes on close
Mateusz Guzik [Mon, 12 Sep 2022 23:19:42 +0000 (23:19 +0000)]
ufs: always call ufs_itimes on close

While here dedup code with fifo.

Reviewed by: kib, mckusick
Differential Revision: https://reviews.freebsd.org/D36522

23 months agobsdinstall: fix a couple stragglers in whitelabeling the scripts
Brad Davis [Wed, 14 Sep 2022 17:04:07 +0000 (11:04 -0600)]
bsdinstall: fix a couple stragglers in whitelabeling the scripts

PR: 265797
Reviewed by: allanjude, asiciliano
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D36235

23 months agoi386: explain the handshake between copyout_fast.s and page fault handler
Konstantin Belousov [Fri, 9 Sep 2022 20:44:48 +0000 (23:44 +0300)]
i386: explain the handshake between copyout_fast.s and page fault handler

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

23 months agoi386: lower register's pressure on copyout_fast
Konstantin Belousov [Fri, 9 Sep 2022 20:38:57 +0000 (23:38 +0300)]
i386: lower register's pressure on copyout_fast

Do not require that %ebx contains idlePTD AKA %kcr3.  This also
simplifies KBI contract between copyout_fast and page handler.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

23 months agoi386 copyout/in_fast: handle page fault from KVA access
Konstantin Belousov [Thu, 8 Sep 2022 20:15:32 +0000 (23:15 +0300)]
i386 copyout/in_fast: handle page fault from KVA access

by delegating the work to the slow path.

Some kernel memory, like pipe buffers, is pageable.  We must not enable
interrupts, and consequently, preemption, while in critical section in
the fast copyout path, because we use pcpu buffers.  If page fault
occurs while copying from the pcpu copyout_buf to kernel memory, abort
fast path and delegate work to the slow implementation.

In collaboration with: pho, tijl
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

23 months agoi386: check that trap() and syscall() run on the thread kstack
Konstantin Belousov [Wed, 7 Sep 2022 20:13:35 +0000 (23:13 +0300)]
i386: check that trap() and syscall() run on the thread kstack

and not on the trampoline stack.  This is a useful way to ensure that
we did not enabled interrupts while on user %cr3 or trampoline stack.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

23 months agoi386 copyout_fast: do not use trampstk for temporal data, reduce ucr3 region
Konstantin Belousov [Mon, 5 Sep 2022 07:06:15 +0000 (10:06 +0300)]
i386 copyout_fast: do not use trampstk for temporal data, reduce ucr3 region

This simplifies code a lot.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

23 months agoi386 double fault: %ebx printout was missed
Konstantin Belousov [Mon, 5 Sep 2022 07:52:46 +0000 (10:52 +0300)]
i386 double fault: %ebx printout was missed

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

23 months agoip_reass: use correct comparison in ipreass_callout()
Gleb Smirnoff [Wed, 14 Sep 2022 15:32:07 +0000 (08:32 -0700)]
ip_reass: use correct comparison in ipreass_callout()

Reported-by: syzbot+55415dc73f9b89b87fce@syzkaller.appspotmail.com

23 months agonxprtc: Fix timing issue with register access.
Tetsuya Uemura [Wed, 14 Sep 2022 13:34:15 +0000 (07:34 -0600)]
nxprtc: Fix timing issue with register access.

My Adafruit PCF8523 RTC on either RPi2B or RPi3B+ failed to work around
80 ~ 90 % of boot-ups, by printing the following log lines.

nxprtc0: <NXP PCF8523 RTC> at addr 0xd0 on iicbus0
nxprtc0: cannot set up timer
Warning: no time-of-day clock registered, system time will not be set accurately

This is due to pcf8523_start_timer(sc) returned non-zero in
nxprtc_start() due to a register read failure of PCF8523_R_TMR_A_FREQ or
PCF8523_R_TMR_CLKOUT or a failure to program a new value.

The pause_sbt("nxpbat") sleep was too short and caused the register
access failures.

PR: 266093

23 months agoCapitalize title like in all other titles.
Jens Schweikhardt [Wed, 14 Sep 2022 11:42:43 +0000 (13:42 +0200)]
Capitalize title like in all other titles.

23 months agoCorrect typos: s/mit Aksenten/mit Akzenten
Jens Schweikhardt [Wed, 14 Sep 2022 09:53:44 +0000 (11:53 +0200)]
Correct typos: s/mit Aksenten/mit Akzenten

23 months agogetaddrinfo(3): A typo fixed
Maxim Konovalov [Wed, 14 Sep 2022 05:08:45 +0000 (05:08 +0000)]
getaddrinfo(3): A typo fixed

PR: 266403

23 months agovfs: plug spurious error checks in namei
Mateusz Guzik [Tue, 13 Sep 2022 23:18:30 +0000 (23:18 +0000)]
vfs: plug spurious error checks in namei

error is guaranteed 0 at that point

23 months agoFix mergemaster(8) breakage in the 6ad780caa.
Maxim Sobolev [Tue, 13 Sep 2022 20:36:22 +0000 (13:36 -0700)]
Fix mergemaster(8) breakage in the 6ad780caa.

Split out termcap.small generation into its own Makefile under
etc/termcap, so it's properly executed by the underlying command:

  make 'SUBDIR_OVERRIDE=etc' everything

Reported by: gbe
MFC after: 1 month

23 months agoUpdate capsicum-test to eab7a83b05becf64439b4b256b3d756b353fbbbb
Ed Maste [Tue, 13 Sep 2022 17:39:02 +0000 (13:39 -0400)]
Update capsicum-test to eab7a83b05becf64439b4b256b3d756b353fbbbb

23 months agoriscv: Add da9063_pmic and da9063_rtc to GENERIC and NOTES
Jessica Clarke [Tue, 13 Sep 2022 16:46:28 +0000 (17:46 +0100)]
riscv: Add da9063_pmic and da9063_rtc to GENERIC and NOTES

This is the PMIC on SiFive's HiFive Unmatched; add it and the RTC child
device driver so we have a working RTC.

Reviewed by: mhorne, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36201

23 months agoda9063_rtc: Add new driver for the Dialog Semiconductor DA9063 RTC
Jessica Clarke [Tue, 13 Sep 2022 16:46:21 +0000 (17:46 +0100)]
da9063_rtc: Add new driver for the Dialog Semiconductor DA9063 RTC

This is a simple RTC present in the PMIC, supporting 1s precision.

This is the PMIC on SiFive's HiFive Unmatched.

Reviewed by: mhorne, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36200

23 months agoda9063_iic: Add new driver for the Dialog Semiconductor DA9063 PMIC
Jessica Clarke [Tue, 13 Sep 2022 16:46:09 +0000 (17:46 +0100)]
da9063_iic: Add new driver for the Dialog Semiconductor DA9063 PMIC

This is an MFD with regulators, an RTC and a watchdog, among other
things. This adds the necessary infrastructure for specific children to
be added.

Note that the PMIC can also be attached via SPI, not just I2C, and so
the interface is abstracted. No SPI implementation is added, however.

This is the PMIC on SiFive's HiFive Unmatched.

Reviewed by: manu, mhorne
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36199

23 months agohda: add patch for Framework laptop v2 headphone jack
Pavel Timofeev [Sun, 28 Aug 2022 23:31:40 +0000 (19:31 -0400)]
hda: add patch for Framework laptop v2 headphone jack

Fix headphone (12th gen Intel laptops) and mic jack (both 11th and
12th gen) switching.

PR: 262579
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36354

23 months agopax: name all supported formats.
Dag-Erling Smørgrav [Tue, 13 Sep 2022 16:12:57 +0000 (18:12 +0200)]
pax: name all supported formats.

Sponsored by: Klara, Inc.

23 months agopax: comment typo fixes from NetBSD / OpenBSD.
Dag-Erling Smørgrav [Tue, 13 Sep 2022 15:58:59 +0000 (17:58 +0200)]
pax: comment typo fixes from NetBSD / OpenBSD.

Sponsored by: Klara, Inc.

23 months agopax: remove 4.4BSD compatibility
Dag-Erling Smørgrav [Tue, 13 Sep 2022 14:26:54 +0000 (16:26 +0200)]
pax: remove 4.4BSD compatibility

Sponsored by: Klara, Inc.

23 months agonetgraph(4): Don't process NGQF_MESG items in NET_EPOCH context.
Aleksandr Fedorov [Tue, 13 Sep 2022 14:15:23 +0000 (17:15 +0300)]
netgraph(4): Don't process NGQF_MESG items in NET_EPOCH context.

Netgraph has two main types of message items:

- NGQF_DATA items are used for data processing. This is a hot path that
should be called from a NET_EPOCH context.

- NGQF_MESG items are used for node configuration. There are many places
in netgraph(4) where processing the NGQF_MESG item can call sections of code
that are forbidden in the NET_EPOCH context.

All item types can be queued and then processed using ngthread().
But ngthread() is unconditionally enter in the NET_EPOCH section for all types.
This causes panic/deadlocks when processing NGQF_MESG elements.

Reported by: mjg
Reviewed by: glebius, vmaffione (mentor)
Tested by: mjg, afedorov
Approved by: glebius, vmaffione (mentor)
Sponsored by: vstack.com
Differential Revision: https://reviews.freebsd.org/D36496

23 months agotcp: make CUBIC the default congestion control mechanism.
Richard Scheffenegger [Tue, 13 Sep 2022 10:01:53 +0000 (12:01 +0200)]
tcp: make CUBIC the default congestion control mechanism.

This changes the default TCP Congestion Control (CC) to CUBIC.
For small, transactional exchanges (e.g. web objects <15kB), this
will not have a material effect. However, for long duration data
transfers, CUBIC allocates a slightly higher fraction of the
available bandwidth, when competing against NewReno CC.

Reviewed By: tuexen, mav, #transport, guest-ccui, emaste
Relnotes: Yes
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D36537

23 months agotcp: Make all references to CUBIC uppercase
Richard Scheffenegger [Tue, 13 Sep 2022 09:59:09 +0000 (11:59 +0200)]
tcp: Make all references to CUBIC uppercase

Consistently refer to the CUBIC congestion control
mechanism in uppercase throughout all comments.

No functional change.

Reviewed By: #transport, tuexen, mav, guest-ccui, emaste
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D36547

23 months agosetkey.8: Improve direction descriptions
Bram Ton [Tue, 13 Sep 2022 11:16:48 +0000 (13:16 +0200)]
setkey.8: Improve direction descriptions

Be more precise in the definition of policy directions
and policy levels.

PR: 250177
Reported by: Bram Ton <bram at cbbg dot nl>
Reviewed by: gbe, ae
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26719

23 months agobhyve: Fix build when BHYVE_SNAPSHOT is set
Filipe da Silva Santos [Tue, 13 Sep 2022 06:30:41 +0000 (08:30 +0200)]
bhyve: Fix build when BHYVE_SNAPSHOT is set

Fixes: 9cc9abf409cc ("bhyve: create all vcpus on startup")
Sponsored by: Beckhoff Automation GmbH & Co. KG
X-MFC-With: 9cc9abf409cc

23 months agorb_tree: pass parent to RB_INSERT_COLOR
Doug Moore [Tue, 13 Sep 2022 06:11:47 +0000 (01:11 -0500)]
rb_tree: pass parent to RB_INSERT_COLOR

Change RB_COLOR_INSERT to take a parent parameter, to avoid looking up
a value already available. Make adjustments to a linux rbtree header,
which invokes it.

Reviewed by: alc, hselasky
Differential Revision: https://reviews.freebsd.org/D36114

23 months agoqcom_qup: compilation fixes
Adrian Chadd [Mon, 12 Sep 2022 02:35:02 +0000 (19:35 -0700)]
qcom_qup: compilation fixes

Fix compilation warning/errors - in this instance we do need the register
IO.

Reviewed by: imp

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

23 months agoqcom_tlmm: use return code instead of always returning true.
Adrian Chadd [Mon, 12 Sep 2022 02:33:48 +0000 (19:33 -0700)]
qcom_tlmm: use return code instead of always returning true.

This was failing due to unused/ignored return values; so just use them.

Reviewed by: imp

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

23 months agoqcom_clk: compilation fixes
Adrian Chadd [Mon, 12 Sep 2022 02:33:18 +0000 (19:33 -0700)]
qcom_clk: compilation fixes

* remove dead code
* mark enabled as unused, happens if debugging isn't enabled
* log the enabled state if debugging is enabled

Reviewed by: imp

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

23 months agoipq4018: remove write-only variables in USB ehci/xhci bus glue
Adrian Chadd [Mon, 12 Sep 2022 02:32:29 +0000 (19:32 -0700)]
ipq4018: remove write-only variables in USB ehci/xhci bus glue

Changes in compilers / warnings/errors caused this to stop compiling.
Delete the write-only code.

Reviewed by: imp

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

23 months agoqcom_gcc: fix the parent clock to work again
Adrian Chadd [Mon, 12 Sep 2022 02:31:23 +0000 (19:31 -0700)]
qcom_gcc: fix the parent clock to work again

Rename it to match the clock-output-names field in the device
tree.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36531

23 months agovfs: make NDVALIDATE private to vfs_lookup.c
Mateusz Guzik [Mon, 12 Sep 2022 22:49:47 +0000 (22:49 +0000)]
vfs: make NDVALIDATE private to vfs_lookup.c

it is not used elsewhere.

23 months agocxgbe(4): Add knob to control congestion behavior for TOE queues.
Navdeep Parhar [Fri, 9 Sep 2022 22:21:18 +0000 (15:21 -0700)]
cxgbe(4): Add knob to control congestion behavior for TOE queues.

hw.cxgbe.ofld_cong_drop works just like hw.cxgbe.cong_drop but for TOE
rx queues.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

23 months agocxgbe(4): Add another setting to the knob that controls congestion.
Navdeep Parhar [Fri, 9 Sep 2022 22:16:22 +0000 (15:16 -0700)]
cxgbe(4): Add another setting to the knob that controls congestion.

hw.cxgbe.cong_drop=2 will generate backpressure *and* drop frames for
queues that are congested.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

23 months agocxgbe(4): Specify the ingress queue's type when creating it.
Navdeep Parhar [Thu, 8 Sep 2022 18:47:38 +0000 (11:47 -0700)]
cxgbe(4): Specify the ingress queue's type when creating it.

The firmware takes the type into account when setting up the PCIe
channel for the queue.

MFC after: 1 week
Sponsored by: Chelsio Communications

23 months agosiftr: spell PFIL_PASS correctly.
Dag-Erling Smørgrav [Mon, 12 Sep 2022 17:05:35 +0000 (19:05 +0200)]
siftr: spell PFIL_PASS correctly.

Sponsored by: NetApp
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D36539

23 months agopf tests: syncookie limits test
Kristof Provost [Thu, 8 Sep 2022 16:34:12 +0000 (18:34 +0200)]
pf tests: syncookie limits test

Test that we can successfuly set syncookie high/low watermarks for very
low or very high state limits.

Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D36498

23 months agolibpfctl: improve syncookie watermark calculation
Kristof Provost [Thu, 8 Sep 2022 16:32:02 +0000 (18:32 +0200)]
libpfctl: improve syncookie watermark calculation

Ensure that we always pass sane limits for the high and low watermark
values.
This is especially important if users do something silly, like set the
state limit to 1. In that case we wound up calculating 0/0 as a limit,
which gets rejected by the kernel.

While here also shift the calculation to use uint64_t, so we don't end
up with overflows (and subsequently higher low than high values) with
very large state limits.

Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D36497

23 months agoarm: add dwc3/xhci as build options for ARM
Adrian Chadd [Sun, 11 Sep 2022 23:57:52 +0000 (16:57 -0700)]
arm: add dwc3/xhci as build options for ARM

Summary:
This mirrors the recentish changes to armv8; the ipq4018 port uses
dwc3 + xhci and thus needs this.

Subscribers: imp, andrew

Reviewed by: imp

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

23 months agousbhid(4): Increase probe priority to BUS_PROBE_DEFAULT + 1
Vladimir Kondratyev [Sun, 11 Sep 2022 09:04:34 +0000 (12:04 +0300)]
usbhid(4): Increase probe priority to BUS_PROBE_DEFAULT + 1

usbhid(4) vs other USB HID drivers precedence is determined by
hw.usb.usbhid.enable loader tunable and HID quirk subsystem rather
than by device_probe() return value. Raise priority high enough to
always give usbhid(4) a possible chance to attach.

Fixes usbhid(4) attachment on USB device hotplug.

Reported by: Ivan Quitschal <tezeka_AT_hotmail_DOT_com>
MFC after: 1 week

23 months agopmap: don't recompute mpte during promotion
Alan Cox [Fri, 9 Sep 2022 23:34:58 +0000 (18:34 -0500)]
pmap: don't recompute mpte during promotion

When attempting to promote 4KB user-space mappings to a 2MB user-space
mapping, the address of the struct vm_page representing the page table
page that contains the 4KB mappings is already known to the caller.
Pass that address to the promotion function rather than making the
promotion function recompute it, which on arm64 entails iteration over
the vm_phys_segs array by PHYS_TO_VM_PAGE().  And, while I'm here,
eliminate unnecessary arithmetic from the calculation of the first PTE's
address on arm64.

MFC after: 1 week

23 months agovfs.typenumhash: fix sysctl description
Allan Jude [Sat, 10 Sep 2022 22:47:51 +0000 (22:47 +0000)]
vfs.typenumhash: fix sysctl description

a string continuation was missing a space, resulting in two works
being smushed together.

Sponsored by: Klara, Inc.

23 months agoFixup build after recent getsock changes
Mateusz Guzik [Sat, 10 Sep 2022 20:40:32 +0000 (20:40 +0000)]
Fixup build after recent getsock changes

23 months agoda.4: Don't document softtimeout
Warner Losh [Sat, 10 Sep 2022 16:55:24 +0000 (10:55 -0600)]
da.4: Don't document softtimeout

kern.cam.da.default_softtimeout currently does nothing. It sets a value
in the CCB that SIMs could look at, only none do. Leave it undocumented
until it actually does something. It was introduced to allow a 'soft
recovery' to be started when things were taking too long in the SIM by
not scheduling new I/O, or other measures the SIM knew would help when
it seemed like things were getting 'backed up'. No SIM in the FreeBSD
tree implements this and scsi_da doesn't use it other than to pass it
down, so best remove it from the documentation until it does something.

Sponsored by: Netflix
Fixes: 53af9c235f5d
Reviewed by: gbe
Differential Review: https://reviews.freebsd.org/D36518

23 months agoRemove fflag argument from getsock_cap
Mateusz Guzik [Sat, 10 Sep 2022 19:45:24 +0000 (19:45 +0000)]
Remove fflag argument from getsock_cap

Interested callers can obtain in other own easily enough
and there is no reason to branch on it.

23 months agoAdd getsock
Mateusz Guzik [Wed, 7 Sep 2022 15:41:55 +0000 (15:41 +0000)]
Add getsock

All but one consumers of getsock_cap only pass 4 arguments.
Take advantage of it.

23 months agoAdd branch prediction hints to getsock_cap
Mateusz Guzik [Sat, 10 Sep 2022 19:41:34 +0000 (19:41 +0000)]
Add branch prediction hints to getsock_cap

23 months agoiscsi(4): Remove a double word in a source code comment
Gordon Bergling [Sat, 10 Sep 2022 11:04:42 +0000 (13:04 +0200)]
iscsi(4): Remove a double word in a source code comment

 - s/to to/to/

MFC after: 3 days

23 months agoisp: Remove a double word in the driver manual
Gordon Bergling [Sat, 10 Sep 2022 11:03:38 +0000 (13:03 +0200)]
isp: Remove a double word in the driver manual

 - s/to to/to/

MFC after: 3 days

23 months agonetinet6: Remove a double word in a source code comment
Gordon Bergling [Sat, 10 Sep 2022 11:01:44 +0000 (13:01 +0200)]
netinet6: Remove a double word in a source code comment

 - s/to to/to/

MFC after: 3 days

23 months agoocs_fc(4): Remove double words in source code comments
Gordon Bergling [Sat, 10 Sep 2022 11:00:23 +0000 (13:00 +0200)]
ocs_fc(4): Remove double words in source code comments

 - s/to to/to/

MFC after: 3 days

23 months agomsun: Remove a double word in a source code comment
Gordon Bergling [Sat, 10 Sep 2022 10:59:10 +0000 (12:59 +0200)]
msun: Remove a double word in a source code comment

 - s/to to/to/

MFC after: 3 days

23 months agomk: Remove a double word in a comment
Gordon Bergling [Sat, 10 Sep 2022 10:57:55 +0000 (12:57 +0200)]
mk: Remove a double word in a comment

 - s/to to/to/

MFC after: 3 days

23 months agoipf-howto: Remove a double word
Gordon Bergling [Sat, 10 Sep 2022 10:56:48 +0000 (12:56 +0200)]
ipf-howto: Remove a double word

 - s/to to/to/

MFC after: 3 days

23 months agotools: Remove a double words
Gordon Bergling [Sat, 10 Sep 2022 10:54:33 +0000 (12:54 +0200)]
tools: Remove a double words

 - s/to to/to/
 - s/to to/to do/ in an error message

MFC after: 3 days

23 months agostress2: Remove double words in comments
Gordon Bergling [Sat, 10 Sep 2022 10:52:50 +0000 (12:52 +0200)]
stress2: Remove double words in comments

 - s/to to/to/

 MFC after:3 days

23 months agoregression-netinet: Remove a double word in a source code comment
Gordon Bergling [Sat, 10 Sep 2022 10:52:01 +0000 (12:52 +0200)]
regression-netinet: Remove a double word in a source code comment

 - s/to to/to/

 MFC after: 3 days

23 months agoarm64: allwinner: aw_r_intc: Add A64 and H6 compatible.
Peter Jeremy [Sat, 10 Sep 2022 10:36:22 +0000 (20:36 +1000)]
arm64: allwinner: aw_r_intc: Add A64 and H6 compatible.

This fixes booting the Pine H64 with a 5.13 DTS.

Suggested by: manu@

23 months agoip_reass: optimize ipreass_drain_vnet()
Gleb Smirnoff [Sat, 10 Sep 2022 09:11:39 +0000 (02:11 -0700)]
ip_reass: optimize ipreass_drain_vnet()

- Call ipreass_reschedule() only once per slot [1]
- Aggregate stats and update them once

Suggested by: jtl [1]

23 months agoip_reass: make stray callout assertion more verbose
Gleb Smirnoff [Sat, 10 Sep 2022 09:11:39 +0000 (02:11 -0700)]
ip_reass: make stray callout assertion more verbose

Syzcaller hits this assertion, but can't find reproducer.  I also never
seen it hit in my testing.  Try to get more information via syzcaller.

23 months agoda.4: Add some sysctl descriptions
Felix Johnson [Sat, 10 Sep 2022 07:44:08 +0000 (09:44 +0200)]
da.4: Add some sysctl descriptions

Add descriptions for the following sysctl's:

- kern.cam.da.default_softtimeout
- kern.cam.da.disable_wp_protection
- kern.cam.da.enable_biospeedup
- kern.cam.da.enable_uma_ccbs
- kern.cam.da.poll_period
- kern.cam.da.send_ordered

While here, fix some mandocs warnings.

PR: 258727
Reported by: Felix Johnson <felix dot the dot red at gmail dot com>
Reviewed by: debdrup, pauamma, gbe
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D32278

23 months agoifnet(9): Duplicates for IFCAP_TOE flags removed.
Maxim Konovalov [Sat, 10 Sep 2022 01:35:34 +0000 (01:35 +0000)]
ifnet(9): Duplicates for IFCAP_TOE flags removed.

PR: 266330

23 months agostand: Add driver interface docs
Warner Losh [Fri, 9 Sep 2022 23:22:09 +0000 (17:22 -0600)]
stand: Add driver interface docs

Add some rather bare-bones driver interface docs.

Sponsored by: Netflix
Suggestions by: rpokala
Reviewed by: pauamma
Differential Revision: https://reviews.freebsd.org/D35912

23 months agoHandle NULL return from localtime(3) in ls(1) and find(1)
Kirk McKusick [Fri, 9 Sep 2022 21:29:53 +0000 (14:29 -0700)]
Handle NULL return from localtime(3) in ls(1) and find(1)

The ls(1) (with -l option) and find(1) (with -ls option) utilties
segment fault when operating on files with very large modification
times. A recent disk corruption set a spurious bit in the mtime
field of one of my files to 0x8000000630b0167 (576460753965089127)
which is in year 18,266,940,962. I discovered the problem when
running fsck_ffs(8) which uses ctime(3) to convert it to a readable
format. Ctime cannot fit the year into its four character field, so
returns ??? ??? ?? ??:??:?? ???? (typically Thu Nov 24 18:22:48 2021).

With the filesystem mounted, I used `ls -l' to see how it would
report the modification time and it segment faulted. The find(1)
program also segment faulted (see script below). Both these utilities
call the localtime(3) function to decode the modification time.
Localtime(3) returns a pointer to a struct tm (which breaks things
out into its component pieces: year, month, day, hour, minute,
second). The ls(1) and find(1) utilities then print out the date
based on the appropriate fields in the returned tm structure.

Although not documented in the localtime(3) manual page, localtime(3)
returns a NULL pointer if the passed in time translates to a year
that will not fit in an "int" (which if "int" is 32-bits cannot
hold the year 18,266,940,962). Since ls(1) and find(1) do not check
for a NULL struct tm * return from localtime(3), they segment fault
when they try to dereference it.

When localtime(3) returns NULL, the attached patches produce a date
string of "bad date val". This string is chosen because it has the
same number of characters (12) and white spaces (2) as the usual
date string, for example "Sep 3 22:06" or "May 15 2017".

The most recent ANSI standard for localtime(3) does say that localtime(3)
can return NULL (see https://pubs.opengroup.org/onlinepubs/9699919799/
and enter localtime in the search box). Our localtime(3) man page should
be updated to indicate that NULL is a possible return. More importantly,
there are over 100 uses of localtime(3) in the FreeBSD source tree (see
Differential Revision D36474 for the list). Most do not check for a NULL
return from localtime(3).

Reported by:  Peter Holm
Reviewed by:  kib, Chuck Silvers, Warner Losh
MFC after:    2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36474

23 months agoLinuxKPI: 80211 (+net80211): update and cleanup headers
Bjoern A. Zeeb [Fri, 9 Sep 2022 18:40:23 +0000 (18:40 +0000)]
LinuxKPI: 80211 (+net80211): update and cleanup headers

Fix types for various struct fields (initially added as int).

Move structs and inline functions logically together, e.g., for wowlan.
Add more skeleton functions and #defines needed for iwlwifi d3.c
in the future.

Add struct ieee80211_vht_cap (without "_ie") to net80211 and remove
duplicate definitions in LinuxKPI headers now using net80211 structs.
For now leave ieee80211_ie_vhtcap in net80211.  I am not sure yet if we
actually need it as such.  That'll be cleaned up with more VHT updates
in net80211 in the future.

No functional changes in currently compiled code intended.

Try to implement ieee80211_action_contains_tpc() as I ran into it with
an older iwlwifi chipset.  This depends on c994352a8841eb453.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

23 months agopf: remove pf_bcmp_state_key
Mateusz Guzik [Fri, 9 Sep 2022 17:16:58 +0000 (17:16 +0000)]
pf: remove pf_bcmp_state_key

Clang 14 performs the optimisation on its own, thus the custom code is
no longer needed.

Sponsored by: Rubicon Communications, LLC ("Netgate")