]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
20 months agocontrib/tzdata: import tzdata 2022d
Philip Paeps [Sun, 25 Sep 2022 05:50:36 +0000 (13:50 +0800)]
contrib/tzdata: import tzdata 2022d

Changes: https://github.com/eggert/tz/blob/2022d/NEWS

The /usr/share/zoneinfo/SystemV directory has been empty on FreeBSD
since 2006.  The upstream source file was removed in 2020.  Also stop
passing yearisdate to zic(8).  This has not been necessary for years.
The script has been removed upstream since 2020.

(cherry picked from commit 1576451a39487b982c961f32bbab71c71890dc0c)
(cherry picked from commit da038df8c92b71060965bdc5dc400db54de35587)
(cherry picked from commit 57338837aef51923ebafc3656e38d4be5c50a60d)

20 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)

(cherry picked from commit 927f8d8bbbed70f6c88d05c19b5b366f8e7532c9)

20 months agopfctl: fix recrusive printing of anchors
Kristof Provost [Thu, 1 Sep 2022 08:16:24 +0000 (10:16 +0200)]
pfctl: fix recrusive printing of anchors

Fix a couple of problems with printing of anchors, in particular recursive
printing, both of inline anchors and when requested explicitly with a '*'
in the anchor.
- Correct recursive printing of wildcard anchors (recurse into child anchors
rather than rules, which don't exist)
- Print multi-part anchor paths correctly (pr6065)
- Fix comments and prevent users from specifying multi-component names for
inline anchors.

tested by phessler
ok henning

Also fix the relevant pfctl test case to reflect the new (and now
correct) behaviour).

MFC after: 3 weeks
Obtained from: OpenBSD (mcbride, f9a568a27c740528301ca3419316c85a9fc7f1de)
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D36416

(cherry picked from commit 585a5ed0bef4a0b874c8fa495ae53901799759c3)

20 months agosqlite3: Vendor import of sqlite3 3.39.3
Cy Schubert [Tue, 20 Sep 2022 03:07:59 +0000 (20:07 -0700)]
sqlite3: Vendor import of sqlite3 3.39.3

Changes at https://www.sqlite.org/releaselog/3_39_3.html.

Obtained from:  https://www.sqlite.org/2022/sqlite-autoconf-3390300.tar.gz

(cherry picked from commit 51952914523c5a447395f2d9dbd410cb2b28e72c)

20 months agocpuset(9): Refer to CPU_SETSIZE not MAXCPU
Brooks Davis [Fri, 23 Sep 2022 20:20:52 +0000 (21:20 +0100)]
cpuset(9): Refer to CPU_SETSIZE not MAXCPU

The maximum CPU number of a cpuset_t is determined by CPU_SETSIZE. In
the kernel this is MAXCPU, but in userspace it is CPU_MAXSIZE unless
CPU_SETSIZE is defined before including sys/_cpuset.h. CPU_MAXSIZE is
256 and in userspace MAXCPU is generally 1 because it being set to a
larger MD value is gated on SMP being defined (not generally the case in
userspace).

Reported by: Nathaniel Wesley Filardo <nwfilardo@gmail.com>
Reviewed by: cem, jhb
Differential Revision: https://reviews.freebsd.org/D36679

(cherry picked from commit 8232a1eddadd6e70ce7bee085344b182517d44a7)

20 months agoDeprecate telnet daemon
Brooks Davis [Wed, 21 Sep 2022 15:17:04 +0000 (16:17 +0100)]
Deprecate telnet daemon

The telnetd codebase is old, unmaintained, and has a number of quality
issues.  Users wishing to provide telnetd service should find a
maintained implementation.  The telnet client is NOT deprecated as it
is lower risk.

Reviewed by: pauamma, kevans, kp, melifaro
Differential Revision: https://reviews.freebsd.org/D36619

(cherry picked from commit 24e1824e4646237c5ab8e63f59fa38e076f18ba7)

20 months agodma: use canonical getline() loop
Ed Maste [Thu, 3 Feb 2022 18:51:06 +0000 (13:51 -0500)]
dma: use canonical getline() loop

getline() returns -1 on erorr or EOF, so use that condition instead of
feof() and check that there was no error after the loop exits.

Reviewed by: bapt, kevans (both earlier)
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34159

(cherry picked from commit d21e71efce3963b068ccaa807a099b591dc220e9)

20 months agoigc: Don't start in promiscious mode by default
Hubert Mazur [Fri, 16 Sep 2022 11:37:12 +0000 (13:37 +0200)]
igc: Don't start in promiscious mode by default

The igc driver always sets the promiscious mode during initialization,
ignoring what is set in ifp.
Fix this by checking the interface flags and setting mode appropriately.

Reviewed by: grehan
Obtained from: Semihalf
Sponsored by: Stormshield
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36591

(cherry picked from commit 55760984d56bb1a4c6bc8040ae022353667258e2)

20 months agortld-elf/libmap.c: correct comment
Konstantin Belousov [Sun, 18 Sep 2022 22:16:52 +0000 (01:16 +0300)]
rtld-elf/libmap.c: correct comment

(cherry picked from commit 1251cf8a30ac496e8c672948dabb9291a17ad71a)

20 months agortld-elf/libmap.h: style declarations
Konstantin Belousov [Sun, 18 Sep 2022 22:06:33 +0000 (01:06 +0300)]
rtld-elf/libmap.h: style declarations

(cherry picked from commit 1fd4dec26e6e31cfe14c849d3b88d8f37560a70d)

20 months agortld-elf/libmap.h: add include guard
Konstantin Belousov [Sun, 18 Sep 2022 22:05:06 +0000 (01:05 +0300)]
rtld-elf/libmap.h: add include guard

(cherry picked from commit 3aed5ddb8b25af59ffe4f1d50f0d13e49a01e816)

20 months agotcp: fix cwnd restricted SACK retransmission loop
Richard Scheffenegger [Thu, 22 Sep 2022 10:55:25 +0000 (12:55 +0200)]
tcp: fix cwnd restricted SACK retransmission loop

While doing the initial SACK retransmission segment while heavily cwnd
constrained, tcp_ouput can erroneously send out the entire sendbuffer
again. This may happen after an retransmission timeout, which resets
snd_nxt to snd_una while the SACK scoreboard is still populated.

Reviewed By: tuexen, #transport
PR: 264257
PR: 263445
PR: 260393
MFC after: 3 days
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D36637

(cherry picked from commit a743fc8826fa348b09d219632594c537f8e5690e)

20 months agotcp: send ACKs when requested
Michael Tuexen [Thu, 22 Sep 2022 10:12:11 +0000 (12:12 +0200)]
tcp: send ACKs when requested

When doing Limited Transmit send an ACK when needed by the protocol
processing (like sending ACKs with a DSACK block).

PR: 264257
PR: 263445
PR: 260393
Reviewed by: rscheff@
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D36631

(cherry picked from commit 5ae83e0d871bc7cbe4dcc9a33d37eb689e631efe)

20 months agotcp: fix computation of offset
Michael Tuexen [Mon, 19 Sep 2022 10:42:43 +0000 (12:42 +0200)]
tcp: fix computation of offset

Only update the offset if actually retransmitting from the
scoreboard. If not done correctly, this may result in
trying to (re)-transmit data not being being in the socket
buffe and therefore resulting in a panic.

PR: 264257
PR: 263445
PR: 260393
Reviewed by: rscheff@
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D36626

(cherry picked from commit 6d9e911fbadf3b409802a211c1dae9b47cb5a2b8)

20 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
Differential Revision: https://reviews.freebsd.org/D36557

(cherry picked from commit 0090d18235269cc5f9582712a42fb5641d5b6f71)

20 months agoman5/{hosts,resolver}.5: note that IPv6 addresses are allowed.
Ceri Davies [Tue, 25 May 2021 15:16:24 +0000 (16:16 +0100)]
man5/{hosts,resolver}.5: note that IPv6 addresses are allowed.

The patch in the PR largely no longer applied due to age, but
thanks to Evgeniy Khramtsov for the patches in the PR.

PR: 120024
Reported by: bcran
Approved by: blackend (mentor)
Obtained from: Evgeniy Khramtsov <evgeniy@khramtsov.org> (partly)

(cherry picked from commit a23b08cf98d92ff82adeebc84673e9bd3cd0a6da)

20 months agoman: Remove obsolete info from hosts man page
Warner Losh [Thu, 11 Mar 2021 18:46:10 +0000 (11:46 -0700)]
man: Remove obsolete info from hosts man page

The NIC no longer provides a host database, and hasn't for quite some
time. Remove that paragraph, it's not been relevant for many years. Also, hosts
appeared in 4.1c, not 4.2, so correct that too.

Noticed by: Henry Bent

(cherry picked from commit c22076b5283970908e74b3abece53efc4670e87d)

20 months agoBump .Dd for recently modified manual pages
Fernando Apesteguía [Mon, 27 Jun 2022 16:11:24 +0000 (18:11 +0200)]
Bump .Dd for recently modified manual pages

During the removal of named(8) references, some pages were modified but their
.Dd where not updated accordingly.

Reported by: lwhsu@
Fixes: 942e234d868d

(cherry picked from commit 4a3c598f352064cc4d2de588bf0058a7417f2402)

20 months agogetnetent(3): Add missing reentrant functions
Fernando Apesteguía [Fri, 21 May 2021 15:25:25 +0000 (17:25 +0200)]
getnetent(3): Add missing reentrant functions

Add documentation for gethostbyname_r, gethostbyname2_r and gethostbyaddr_r

Create proper MLINKs for the new functions.

PR: 249154
Reported by: asomers@
Approved by: manpages (0mp@), Pau Amma
Differential Revision:  https://reviews.freebsd.org/D30469

(cherry picked from commit dc68997328ec6cec41ad3b818c1846c8217e0c68)

20 months agoRemove references to named(8)
Fernando Apesteguía [Wed, 22 Jun 2022 16:39:30 +0000 (18:39 +0200)]
Remove references to named(8)

named(8) hasn't been in base for some time. Remove all references to it in
manual pages.

Approved by: manpages (Pau Amma)
Differential Revision: https://reviews.freebsd.org/D35586

(cherry picked from commit 942e234d868ddc64a11b6af0ee78d47ccb44de1f)

20 months agoctime.3: Add a note about a possible return value of localtime(3)
Gordon Bergling [Fri, 16 Sep 2022 18:38:58 +0000 (20:38 +0200)]
ctime.3: Add a note about a possible return value of localtime(3)

The localtime(3) function returns a NULL pointer, if the passed in-time
translates to a year that will not fit in an integer type. It is stricly
recommended to check the return value to avoid garage output.

Reported by: mckusick
Reviewed by: mckusick, imp, rpokala
Differential Revision: https://reviews.freebsd.org/D36515

(cherry picked from commit 30cfb3c8ee3d3fc79644541207c81d20c72176ce)

20 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
Differential Revision: https://reviews.freebsd.org/D36516

(cherry picked from commit 8f98a937ed726399b89e87e95769a9adc809281a)

20 months agoMFV 66082b6c88b9: libbsdxml (expat) 2.4.9
Xin LI [Wed, 21 Sep 2022 06:54:38 +0000 (23:54 -0700)]
MFV 66082b6c88b9: libbsdxml (expat) 2.4.9

(cherry picked from commit 71f0c44a045421bed4f27fefdb3caf30e1b54fe4)

20 months agorc.d/var_run: Add needed "shutdown" keyword
Cy Schubert [Tue, 20 Sep 2022 18:44:11 +0000 (11:44 -0700)]
rc.d/var_run: Add needed "shutdown" keyword

The "shutdown" keyword invokes rcorder with the -k flag, for rc scripts
with the keyword at shutdown.

Reported by: bdrewery
Fixes: 27b9777c28b4

(cherry picked from commit b77b3099685f27fa1da89cb5b8f376bef87b05ec)

20 months agomsun: correct comment
Steve Kargl [Mon, 19 Sep 2022 18:38:48 +0000 (21:38 +0300)]
msun: correct comment

PR: 266503

(cherry picked from commit 620d855faca136d661a86dfa4cf74dd4f8794740)

20 months agodevstat: Remove DTrace io probes lacking a BIO reference
Mark Johnston [Mon, 29 Aug 2022 17:22:36 +0000 (13:22 -0400)]
devstat: Remove DTrace io probes lacking a BIO reference

The io:::start and end probes trace individual I/O requests.

Also remove the unimplemented wait-start and wait-done probes.

PR: 266098

(cherry picked from commit 32faf071bd54c0e2e1ac07700f7ea5a3d6fa8d51)

20 months agoLinuxKPI: netdev: expose napi state
Bjoern A. Zeeb [Wed, 7 Sep 2022 23:35:41 +0000 (23:35 +0000)]
LinuxKPI: netdev: expose napi state

There are drivers directly accessing napi->state testing for bits
(NAPI_STATE_SCHED encountered so far).  Rename the internal _flags
struct field to state and expose our internal state flag bits along
with the one official aliased.

As I left in a comment, I wished Linux would hide these accesses
behind inline functions or by other means and not public expose
the implementation details.

(cherry picked from commit ac07a3b8b6ec14059136f87a1aba0bf4e3333361)

20 months agonet80211: update (parts of) Action field categories
Bjoern A. Zeeb [Wed, 7 Sep 2022 23:28:13 +0000 (23:28 +0000)]
net80211: update (parts of) Action field categories

Update to the full list of action field category values based on
802.11-2020 with 11ax extensions and remove one value Reserved nowadays.
While here annotate them with descriptions.

Also add Spectrum Management and Radio Measurement action field values
needed in LinuxKPI.

No functional changes.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit c994352a8841eb4533c587bc524f2d1de659a20a)

20 months agoLinuxKPI, dev: 80211 update mac80211 KPI
Bjoern A. Zeeb [Wed, 7 Sep 2022 23:38:54 +0000 (23:38 +0000)]
LinuxKPI, dev: 80211 update mac80211 KPI

Update the mac80211 ops KPI for (*conf_tx), (*assign_vif_chanctx),
(*unassign_vif_chanctx), (*start_ap), and (*stop_ap), as well as
ieee80211_beacon_get_tim() and ieee80211_beacon_get_template().

Update in-tree drivers iwlwifi and rtw88 accordingly based on upstream
changes (as well as out-of-tree ones).  This was triggered by trying to
synchronize more drivers to a common state.

(cherry picked from commit 549198b1ab95139fb26470cf22ce894907c361b8)

20 months agoLinuxKPI: firmware: add request_partial_firmware_into_buf()
Bjoern A. Zeeb [Wed, 7 Sep 2022 23:33:45 +0000 (23:33 +0000)]
LinuxKPI: firmware: add request_partial_firmware_into_buf()

A (so far out-of-tree) driver update needs
request_partial_firmware_into_buf().  Given we load the full .ko file
using firmware(9) just do that and copy the requeste data into the
buffer (rather than poissibly only reading portions of the firmware
file).

(cherry picked from commit fb3c549738bfed0607d95120e5dbf03a62e61b49)

20 months agoLinuxKPI: 80211: add ieee80211_stop_tx_ba_session()
Bjoern A. Zeeb [Fri, 9 Sep 2022 16:30:00 +0000 (16:30 +0000)]
LinuxKPI: 80211: add ieee80211_stop_tx_ba_session()

rtw89 needs ieee80211_stop_tx_ba_session().
Add the skeleton function for now so we can implement BA functions all
together.

(cherry picked from commit d6d687daaa4531c4a84b82cde46c9906c3c02f55)

20 months agonet80211: update (parts of) frame types and subtypes and annotate
Bjoern A. Zeeb [Wed, 31 Aug 2022 22:26:28 +0000 (22:26 +0000)]
net80211: update (parts of) frame types and subtypes and annotate

Update to the full list of frame type and subtype values based on
802.11-2020 with 11ax and 11ay extensions. This includes the 4th type
"Extension" (IEEE80211_FC0_TYPE_EXT).
While here annotate them with descriptions which should help matching
names (as at times things get confusing with LinuxKPI).
Also remove some 802.11-1997 values Reserved nowadays.

No functional changes.

Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D36410

(cherry picked from commit fb47649ebc5a667739e8bd834b993af3c8d1b89f)

20 months agoLinuxKPI: 80211 / iwlwifi: improve queue management
Bjoern A. Zeeb [Mon, 5 Sep 2022 21:03:03 +0000 (21:03 +0000)]
LinuxKPI: 80211 / iwlwifi: improve queue management

For one initialise vif->hw_queues later set in lkpi_80211_txq_tx_one()
for drivers using them.  This may still need slightly more cleanup once
we get QUEUE_CONTROL-supporting drivers into the tree.

For the other rework and improve how we deal with tid/ac/txq in
lkpi_80211_txq_tx_one() and cleanup old comments and unused code.
This seems to reduce (remove) "Invalid TXQ id" reports from iwlwifi.
(The assumption is that the frame(s) triggering this WARN_ONCE or the
added FreeBSD specific logging were sent with lkpi_80211_mo_tx()).

Adjust the one logging from e674ddec0b4138274539587fe9336b577ff1242a
to IWL_DEBUG_TX so that now this is fixed it is also not always logged
anymore but leave it in case we need to further debug queues in the
future.

Tested by: pstef, Kevin Oberman (rkoberman gmail.com)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit e3a0b1202bf63f4b412e02eb6edc0fb1f64313de)

20 months agoiwlwifi: add FreeBSD specific debugging
Bjoern A. Zeeb [Wed, 17 Aug 2022 16:11:47 +0000 (16:11 +0000)]
iwlwifi: add FreeBSD specific debugging

"Invalid TXQ id" and "Queue <n> is stuck <x> <y>" are two errors seen
more commonly by FreeBSD users.  Try to gather some extra data the
"easy way" adding more error logging for these situations in the hope
to find a clue or at least do more targetd debugging in the future.
Note that for one of the errors the Linux Intel driver has a TODO to
print register data.  If that will show up in future versions of the
driver this may also help.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit e674ddec0b4138274539587fe9336b577ff1242a)

20 months agonet80211: simplify an #ifdef INET/INET6 block
Bjoern A. Zeeb [Wed, 31 Aug 2022 22:35:42 +0000 (22:35 +0000)]
net80211: simplify an #ifdef INET/INET6 block

I got lost in the #ifdef #endif here so I changed the code to a
switch block with two non-overlapping #ifdef parts and a default
which makes it a lot easier to read.

No functional changes.

Sponsored by: The FreeBSD Foundation
Reviewed by: (zlei.huang gmail.com)
Differential Revision: https://reviews.freebsd.org/D36411

(cherry picked from commit 8def06d5afdcd8020a039b1de994cfe6ad18229e)

20 months agonet80211 / drivers: rename to IEEE80211_FC0_SUBTYPE_QOS_DATA
Bjoern A. Zeeb [Wed, 31 Aug 2022 22:19:32 +0000 (22:19 +0000)]
net80211 / drivers: rename to IEEE80211_FC0_SUBTYPE_QOS_DATA

Going through the Frame (Sub)types the "QOS Data" being called "QOS"
scheme leads to a naming conflict for QOS_CFPOLL and QOS_CFACKPOLL
(if added).   Rename QOS* to QOS_DATA* to avoid the conflict and
to also better match the standards name.

No functional changes intended.

Sponsored by: The FreeBSD Foundation
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D36409

(cherry picked from commit c9b7e9df18e413a27bbddd776315a595255453f1)

20 months agoLinuxKPI: 80211: improve linuxkpi_ieee80211_get_tid()
Bjoern A. Zeeb [Mon, 5 Sep 2022 20:57:17 +0000 (20:57 +0000)]
LinuxKPI: 80211: improve linuxkpi_ieee80211_get_tid()

Continue what was started in 26a36948331bd08d9afaddfc0da724eacdb953dd
in iwlwifi and extend out internal implementation of
linuxkpi_ieee80211_get_tid() by an argument as to whether "no-QoS"
answers are acceptable.  For the LinuxKPI ieee80211_get_tid() set
this to false as the Linux derived drivers seem to do extra checks
for the QoS-Data frame before acquiring the tid.
Add KASSERTs to enforce the extra argument.
This allows us to use the net80211 variant in LinuxKPI for other
means explicitly documenting that we do accept a IEEE80211_NONQOS_TID.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit ec190d91500676614feaf6456084369325ddcaa0)

20 months agoiwlwifi: move an ieee80211_get_tid() call
Bjoern A. Zeeb [Wed, 31 Aug 2022 23:01:36 +0000 (23:01 +0000)]
iwlwifi: move an ieee80211_get_tid() call

Introduce a local change.  It seems ieee80211_get_tid() does not deal
with non-dataqos packets unlike net80211's ieee80211_gettid().
Gernally all calls in Linux drivers to ieee80211_get_tid() seem to
be proceeded by an ieee80211_is_data_qos() check.

Moving the ieee80211_get_tid() has no difference in the result, but
(a) saves us the call if we do not need it due to an earlier return,
and (b) allows us to put an assert into the LinuxKPI ieee80211_get_tid()
implementation to avoid accidentally returning random frame header data
in case of a missing earlier ieee80211_is_data_qos() check in (future/
other) drivers.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 26a36948331bd08d9afaddfc0da724eacdb953dd)

20 months agoLinuxKPI: 80211: scanning code updates
Bjoern A. Zeeb [Sat, 3 Sep 2022 23:40:51 +0000 (23:40 +0000)]
LinuxKPI: 80211: scanning code updates

For consistency rename LKPI_SCAN_RUNNING adding a LHW_ prefix.
Add a local flag LKPI_LHW_SCAN_HW mirroring the net80211
IEEE80211_FEXT_SCAN_OFFLOAD flag.
Slightly simplify the code.
Overload (*ic_scan_curchan) and (*ic_scan_mindwell) so that we can
call the net80211 implementation in case of software scan but skip it
in case of full-offload scans.
Also add a bandaid to our (*ic_set_channel) implementation to not siwtch
channels if we have an active hw_scan running.

Obtained from: bz/wireless-dev
Sponsored by: The FreeBSD Foundation (partially)

(cherry picked from commit a486fbbd7876bed81d738a32274953c89906edb5)

20 months agoLinuxKPI: 80211: implement (*get_antenna) and set ic_[rt]xstream
Bjoern A. Zeeb [Sat, 3 Sep 2022 23:11:05 +0000 (23:11 +0000)]
LinuxKPI: 80211: implement (*get_antenna) and set ic_[rt]xstream

Implement the mac80211 (*get_antenna) call and after checking any
antenna information present query the current configuration on startup
(both informations should be identical at this point in theory).
Both the wiphy variables and function call report a bitmask not a count.
Count the bits for net80211 for as long as we get away with just a
number in ic_[rt]xstream.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 527687a9e30aef2e5e0c0c5b5e64e6059f1a37a4)

20 months agoLinuxKPI: 80211: make HW_CRYPTO compileable again
Bjoern A. Zeeb [Sat, 3 Sep 2022 22:51:16 +0000 (22:51 +0000)]
LinuxKPI: 80211: make HW_CRYPTO compileable again

Rename TRY_HW_CRYPTO to LKPI_80211_HW_CRYPTO for consitency and make
it compileable again in case someone wants to sit down and make it
work.  It's probably not too much to do.  Otherwise I might eventually
get around to it.

Obtained from: bz/wireless-dev
Sponsored by: The FreeBSD Foundation

(cherry picked from commit b35f6cd066128f8cf0b7f3125529f59dd8ba3059)

20 months agoLinuxKPI: extend kfifo to be usable
Bjoern A. Zeeb [Sat, 16 Jul 2022 00:36:55 +0000 (00:36 +0000)]
LinuxKPI: extend kfifo to be usable

Implement some basic kfifo pieces as needed by drivers.

Reviewed by: wulf, hselasky
Differential Revision: https://reviews.freebsd.org/D35829

(cherry picked from commit 4a7e8c7bd40bc39b3e247df069fa913f0197ea01)

20 months agoLinuxKPI 802.11: change type of bssid in struct ieee80211_bss_conf
Bjoern A. Zeeb [Sat, 27 Aug 2022 14:48:09 +0000 (14:48 +0000)]
LinuxKPI 802.11: change type of bssid in struct ieee80211_bss_conf

Enabling other driver code found that the bssid in
struct ieee80211_bss_conf is not an array but expected to be
a const pointer (const, != NULL checks).
Adjust accordingly in the header and in the LinuxKPI compat code.
There initialization now needs to be a static array always present
as we need a value before we will have a BSS (node in scan_to_auth)
as the mac80211 driver (*handlers) are expecting the pointer to be
not NULL (copying without checks).
This is a pre-req to enable d3 (CONFIG_PM[_SLEEP]) in the future.

Tested by: Tomoaki AOKI (junchoon dec.sakura.ne.jp)
Tested by: Berislav Purgar (bpurgar gmail.com)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit caaa79c3f8c692b9822df74a2dc0a37e4ab33a3b)

20 months agonet80211: consistently use the IEEE80211_M_ memory related options
Bjoern A. Zeeb [Wed, 17 Aug 2022 18:33:08 +0000 (18:33 +0000)]
net80211: consistently use the IEEE80211_M_ memory related options

Replace a malloc() by IEEE80211_MALLOC().
For malloc flags even in the local ieee80211_freebsd.c there was a mix
of both versions M_ and IEEE80211_M_.
Consistently use the IEEE80211_M_ malloc options everywhere.
If the field is changed for malloc, it'll also be changed for the
other accessor functions taking a "how" field to avoid any confusion.

Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D36249

(cherry picked from commit bd29f81763aa9cac74c75b663c2cf46723f05528)

20 months agonet80211: LinuxKPI 802.11: harmonize IEEE80211_VHT_MCS_*
Bjoern A. Zeeb [Wed, 17 Aug 2022 21:59:07 +0000 (21:59 +0000)]
net80211: LinuxKPI 802.11: harmonize IEEE80211_VHT_MCS_*

Rather than defining the same values in two places and having to do
conflict resulution on the name in LKPI, change the defines to an
enum in net80211.  In addition to de-duplication this also gives us
value checks in certain cases.

Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D36250

(cherry picked from commit 8d371164898141673ad3bfe6ee771931569e07d2)

20 months agonet80211: ieee80211_ies_expand() add extra length check
Bjoern A. Zeeb [Wed, 17 Aug 2022 16:48:37 +0000 (16:48 +0000)]
net80211: ieee80211_ies_expand() add extra length check

Make sure the given IE length fits into the total length left when
parsing through the information elements.  In theory I would say
discard everything if there is an error but that proves hard with
the current code.

Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D36245

(cherry picked from commit 9d2ba51806c32e7ea8ad83439cb48df91575b5bf)

20 months agoiwlwifi firmware: update to -73 / newer builds for 9xxx
Bjoern A. Zeeb [Sun, 31 Jul 2022 00:36:23 +0000 (00:36 +0000)]
iwlwifi firmware:  update to -73 / newer builds for 9xxx

Update iwlwifi 22000 firmware to -73 and rebuilds for 9000/9260.
Update the driver to accept the newer version.

Firmware was obtained from linux-firmware at
150864a4d73e8c448eb1e2c68e65f07635fe1a66.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 13a7663c521ac3541756aa1157dcfce9f0ce78e8)

20 months agortw88: correct a typo in man page
Andres Ramirez [Sun, 7 Aug 2022 23:06:28 +0000 (23:06 +0000)]
rtw88: correct a typo in man page

s/mmeory/memory/

(cherry picked from commit 13e9d624f2f4741e40ff7b8395d7173f319f548d)

20 months agoLinuxKPI: 802.11 header updates
Bjoern A. Zeeb [Fri, 29 Jul 2022 15:23:49 +0000 (15:23 +0000)]
LinuxKPI: 802.11 header updates
LinuxKPI: 802.11: add missing linuxkpi_cfg80211_bss_flush()

While working on new and updates to drivers more structs, fields,
functions, .. were found, had to be shuffled around, ..
Some of these are (so far still dummy) functions or not properly
typed fields.  The IEEE80211_HE_ constants are all still dummy.
This was msotly as a start to make new (out-of-tree) things compile.

Sponsored by: The FreeBSD Foundation (minor VHT/chan width bits)

Add the missing implementation of linuxkpi_cfg80211_bss_flush().
without this we get unresolved symbols and drivers won't load.

Reported by: eduardo, Berislav Purgar (bpurgar gmail.com)

(cherry picked from commit b0f73768220e945deebebefc4a2d63ae6a3bfe19)
(cherry picked from commit d8dd6b329e4653a2aca308102187797d44afc2c4)

20 months agonet80211: change order in ieee80211_vhtchanflags()
Bjoern A. Zeeb [Fri, 29 Jul 2022 00:18:48 +0000 (00:18 +0000)]
net80211: change order in ieee80211_vhtchanflags()

While 80P80 is less likely to be used, VHT160 (a single contiguous
width) is harder to acquire but also preferable so return that first.

Sponsored by: The FreeBSD Foundation
Reviewed by:    adrian
Differential Revision: https://reviews.freebsd.org/D35977

(cherry picked from commit 195733401f431622df3185897cd04c1aeb113e0d)

20 months agonet80211: add VHT5G and VHT2G checks/return to media_status
Bjoern A. Zeeb [Fri, 29 Jul 2022 00:10:34 +0000 (00:10 +0000)]
net80211: add VHT5G and VHT2G checks/return to media_status

Add the fields for VHT (2Ghz and 5Ghz) to report back by media_status
so we actually have a chance to get the right information.

Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D35977

(cherry picked from commit 656d0e8fa92ad72626808479d0935814425ee78d)

20 months agoLinuxKPI: skbuff: sort list header and add new (dummy) functions
Bjoern A. Zeeb [Fri, 29 Jul 2022 15:21:48 +0000 (15:21 +0000)]
LinuxKPI: skbuff: sort list header and add new (dummy) functions

While working on new and updates to drivers more skbuff changes
came up.  Sort out the list/prev/next header problem and add more
(so far dummy) functions needed.

(cherry picked from commit 89c32dafa560fe0e0259f14185ceefbcee3dcec6)

20 months agonet80211: correct IEEE80211_FEXT_BITS
Bjoern A. Zeeb [Fri, 29 Jul 2022 00:03:37 +0000 (00:03 +0000)]
net80211: correct IEEE80211_FEXT_BITS

Correct IEEE80211_FEXT_BITS adding the missed one and move the later
one further.  This will actually make VHT to show.

Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D35977

(cherry picked from commit 463d6125e7bff6504099f34e4fe7aa0a68166e6e)

20 months agonet80211: radiotap: add one more define for HE
Bjoern A. Zeeb [Thu, 28 Jul 2022 23:56:07 +0000 (23:56 +0000)]
net80211: radiotap:  add one more define for HE

Add one more define for HE radiotap used by a driver.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D35977

(cherry picked from commit c7a8db6a8556b1a99e94f010bdf3485a5f3fdd32)

20 months agonet80211: improve DDB output.
Bjoern A. Zeeb [Fri, 29 Jul 2022 00:05:51 +0000 (00:05 +0000)]
net80211: improve DDB output.

Start adding more fields to DDB output related to VHT (11ac) and
mark COM, VAP, and STA more explicitly to make show all vaps /..
more readable.

Sponsored by: The FreeBSD Foundaton
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D35977

(cherry picked from commit 5c9f992919eee6771dd15da278228e5f3bcee7b6)

20 months agonet80211: add more 802.11ac Element IDs
Bjoern A. Zeeb [Thu, 28 Jul 2022 23:59:08 +0000 (23:59 +0000)]
net80211: add more 802.11ac Element IDs

Add more Element IDs for VHT (11ac) to complete the current list
and we can use them if/as needed.

Sposnored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D35977

(cherry picked from commit a78be09e4d1aa8a2117f71d96093d4884c211903)

20 months agonet80211: VHT correct check/option in ieee80211_vht_adjust_channel()
Bjoern A. Zeeb [Fri, 29 Jul 2022 00:12:34 +0000 (00:12 +0000)]
net80211: VHT correct check/option in ieee80211_vht_adjust_channel()

In ieee80211_vht_adjust_channel() we have to check for all possible
IEEE80211_FVHT_VHT* options using the mask rather than just checking
for IEEE80211_FVHT_VHT;  ieee80211_vhtchanflags() (contrary to its
HT counterpart) only returns the "highest" flag nor or-ing them together
with the base flag.  For the moment this seems to make sense as with
more width options we'd add a pyramid.

Later on, in the same function when we get VHT160 actually go and look
for VHT160 and not VHT80.

Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D35977

(cherry picked from commit dc32c7133921a34f3144a4b5fc4f7c1f6cddbd1f)

20 months agoLinuxKPI 802.11/iwlwifi/rtw88: update KPI
Bjoern A. Zeeb [Thu, 28 Jul 2022 23:39:03 +0000 (23:39 +0000)]
LinuxKPI 802.11/iwlwifi/rtw88: update KPI

Upgrade the argument of (*bss_info_changed) mac80211 ops function call
from 32 to 64 bit.
Add an extra argument to ieee80211_beacon_get_template().

Both changes are needed in order to keep other out-of-tree drivers in
synch and to move forward.

The driver changes were extracted from Linux wireless-testing
7b7090b4c6a906cc7c3e2a460335f705b93f4506 and
6e8912a503759bb8f1f01c5b761d0d45815fa6de.

Sponsored by: The FreBSD Foundation

(cherry picked from commit 467d3e2e8aa3157794d0c7adc7884b1c4a5535c1)

20 months agoUSB: add 2 (3) more device IDs for rtw88-usb devices and a quirk
Bjoern A. Zeeb [Wed, 7 Sep 2022 23:48:59 +0000 (23:48 +0000)]
USB: add 2 (3) more device IDs for rtw88-usb devices and a quirk

Add DLink DWA-182 rev D1 and generic Realtek RTW8821CU entry found on
a Tenda U10 USB WLAN Stick, AC 650 Mbps (and possibly more devices).
The latter first presents itself as a CD device with Windows drivers
(useless on FreeBSD) first so add a quirk for that we get the wireless
device right away.

While here sort some other Realtek entries by DeviceID.

(cherry picked from commit b3b6a959c85af3aabbde3ef2b80dbd4bf5b6f5a7)

20 months agoifconfig: print interface name on SIOCIFCREATE2 error
Bjoern A. Zeeb [Tue, 6 Sep 2022 13:09:39 +0000 (13:09 +0000)]
ifconfig: print interface name on SIOCIFCREATE2 error

We have repeatedly gotten reports of unclassified SIOCIFCREATE2 errors
(usually "Device not configured").  This can happen if there is
configuration for interfaces in rc.conf which do not (yet) exist and
we try to configure.  I can, e.g., provoke this by configuring wlan
interfaces with their physical interface not installed.
In order to cut support (guesswork) down print the name of the
interface to be configured with the error message.
Hopefully this will help us in the future to improve other configuration
or driver problems.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit ac606903a800bc4ce80bc6fa1374b45efcdb7014)

20 months agods1307: add support for the EPSON RX-8035SA I2C RTC
Mathew McBride [Sat, 23 Jul 2022 00:29:16 +0000 (00:29 +0000)]
ds1307: add support for the EPSON RX-8035SA I2C RTC

The EPSON RX-8035SA I2C RTC has a similar time register layout to the
ds1307 family, with some minor differences in bit positions, polarity
and control registers.  Further generalize ds1307 to make it easier
to add more compatible chips and add support for the EPSON RX-8035SA.

Sponsored by: Traverse Technologies
Differential Revision: https://reviews.freebsd.org/D35837

(cherry picked from commit 2486b446db8270a7d6dc7f3c6df0a88c4745b527)

20 months agoXHCI: remove a self-assignment
Bjoern A. Zeeb [Sun, 7 Aug 2022 22:46:55 +0000 (22:46 +0000)]
XHCI: remove a self-assignment

x = x is an unneeded operation, remove it.
The value is read and assigned above for real.

(cherry picked from commit d3ef3c4cf818b1aac6a51402ec27b6762d9feb1f)

20 months agolocal_unbound: rc: allow to overwrite pid file path
Bjoern A. Zeeb [Thu, 11 Aug 2022 14:32:06 +0000 (14:32 +0000)]
local_unbound: rc: allow to overwrite pid file path

Certain configurations need to use a different path for pidfile.
Allow rc.conf to overwrite it.

Reviewed by: cy, 0mp
Differential Revision: https://reviews.freebsd.org/D36141

(cherry picked from commit e1963173708504ecd2ee5c441a9428a046af54f4)

20 months agoarm/gic: fix a KASSERT in arm_gic_reserve_msi_range()
Bjoern A. Zeeb [Mon, 22 Aug 2022 11:51:37 +0000 (11:51 +0000)]
arm/gic: fix a KASSERT in arm_gic_reserve_msi_range()

Fix the off-by-one in the KASSERT in arm_gic_reserve_msi_range()
allowing the MSIs being allocated at the end of the IRQ range.

Reported by: bz
Submitted by: andrew
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D36291

(cherry picked from commit 11d08e7e8d6ca4de0852b2998593a295b04cb567)

20 months agoUse the cached dc zva length in arm64 memset
Andrew Turner [Wed, 7 Sep 2022 11:43:16 +0000 (12:43 +0100)]
Use the cached dc zva length in arm64 memset

On boot we cache the length the 'dc zva' instruction will zero. Use
this in the memset function to decide when to use it. As the cached
value is in .bss it will be zero on boot so memset is safe to use
before the value has been read.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 7d90ce7cae63a8121da0acc3ce36a713a98d6033)

20 months agoImport the arm64 Cortex Strings memset into the kernel
Andrew Turner [Wed, 7 Sep 2022 11:41:13 +0000 (12:41 +0100)]
Import the arm64 Cortex Strings memset into the kernel

Bring in the last version of the optimized memset from the Cortex
Strings library that didn't use the VFP registers. While here clean up
to use the ENTRY/EDIT macros.

This is imported from:
https://git.linaro.org/toolchain/cortex-strings.git/tree/src/aarch64/memset.S?id=bc654e7a594385071b42db3c9c94bd0fd5fe0da5

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 949bc17cf28bb0a21b4688f1effad01de63d3318)

20 months agoImport an optimized arm64 memcmp into the kernel
Andrew Turner [Wed, 7 Sep 2022 11:12:30 +0000 (12:12 +0100)]
Import an optimized arm64 memcmp into the kernel

Bring in a version of the Arm Optimized Routines memcpy from before
the VFP registers were used.

Imported with modification from:
https://github.com/ARM-software/optimized-routines/blob/e823e3abf5f89ecb/string/aarch64/memcmp.S

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 51a1bf7ba7eb79c760161a2054c113978dce38cb)

20 months agoUpdate the arm64 kernel memcpy/memmove
Andrew Turner [Wed, 7 Sep 2022 09:51:21 +0000 (10:51 +0100)]
Update the arm64 kernel memcpy/memmove

Bring in the latest Arm Optimized Routines memcpy/memmove into the
arm64 kernel. As these functions have been merged in the current
version remove the now unneeded memmove.S.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 01e478d9559566e666a7b758ede219ed23d9a833)

20 months agoDecode the arm64 ID_AA64ISAR1_EL1 register
Andrew Turner [Tue, 28 Jun 2022 13:39:03 +0000 (13:39 +0000)]
Decode the arm64 ID_AA64ISAR1_EL1 register

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35627

(cherry picked from commit a8fac0ce78542781cf2ac7e97569416ec0e795a4)

20 months agoFix the IV length in the armv8 AES GCM code
Andrew Turner [Wed, 31 Aug 2022 14:55:19 +0000 (15:55 +0100)]
Fix the IV length in the armv8 AES GCM code

Reviewed by: cem, delphij
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36403

(cherry picked from commit 7c4cfece6b7cc9733610b99682be5e9f11f31fc3)

20 months agoStore mpidr as a 64-bit value on arm64
Andrew Turner [Thu, 25 Aug 2022 08:28:28 +0000 (08:28 +0000)]
Store mpidr as a 64-bit value on arm64

The mpidr register is 64 bit on arm64 and 32 bit on arm. Fix this by
extending the arm64 definition to include the top 32 bits.

To preserve KBI when MFCing split the value into two 32 bit values.
This will be cleaned up later only on main.

Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36346

(cherry picked from commit 544f047f894046a68c373f55ddd072e91bcfbf38)

20 months agoMerge the common parts of the SMCCC handlers
Andrew Turner [Mon, 22 Aug 2022 17:09:28 +0000 (18:09 +0100)]
Merge the common parts of the SMCCC handlers

To simplify adding new handlers merge the common parts of the functions
used to call into the arm SMCCC firmware.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36297

(cherry picked from commit 48a7e53db78293ba2723cecfb3a3d5d23ea8e44d)

20 months agoAdd an IDC only arm64 icache sync function
Andrew Turner [Mon, 22 Aug 2022 17:02:13 +0000 (18:02 +0100)]
Add an IDC only arm64 icache sync function

When the IDC flag is set in the cache type register we don't need to
clean the data cache to the point of unification. Previously we
supported this flag being set only when the DIC flags was also set.
Add a new handler for when this is not the case.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation, Ampere (hardware)
Differential Revision: https://reviews.freebsd.org/D36296

(cherry picked from commit 7a060a8895b8e6c1cd0afded15da27c373eb0de9)

20 months agoDisable promotion on pcpu memory on arm64
Andrew Turner [Fri, 29 Apr 2022 09:30:38 +0000 (10:30 +0100)]
Disable promotion on pcpu memory on arm64

We need to be careful to not promote or demote the memory containing
the per-CPU structures as the exception handlers will dereference it
so any time it's invalid may cause recursive exceptions.

Add a new pmap function to set a flag in the pte marking memory that
cannot be promoted or demoted and use it to mark pcpu memory.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35434

(cherry picked from commit e3917bb256dea63945b5bef7fe2b792a280fcafe)

20 months agoarm64: Implement final level only TLB invalidations
Alan Cox [Wed, 29 Dec 2021 07:50:05 +0000 (01:50 -0600)]
arm64: Implement final level only TLB invalidations

A feature of arm64's instruction for TLB invalidation is the ability
to determine whether cached intermediate entries, i.e., L{0,1,2}_TABLE
entries, are invalidated in addition to the final entry, e.g., an
L3_PAGE entry.

Update pmap_invalidate_{page,range}() to support both types of
invalidation, allowing the caller to determine which type of
invalidation is performed.

Update the callers to request the appropriate type of invalidation.

Eliminate redundant TLB invalidations in pmap_abort_ptp() and
pmap_remove_l3_range().

Add a comment to pmap_invalidate_all() making clear that it always
invalidates entries at all levels.

As expected, these changes result in a tiny yet measurable
performance improvement.

Reviewed by: kib, markj
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D33705

(cherry picked from commit 4ccd6c137f5b53361efe54b78b815c7902258572)

20 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

(cherry picked from commit 2eddd8ebf96a83fdb01d1a7e45e2d652aa05f4b8)

20 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

(cherry picked from commit cbbf5227955d871d74556d4e83656a003aa9e334)

20 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

(cherry picked from commit 49587b8fb4d12166d30efb7111d32f4606a1e73b)

20 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

(cherry picked from commit fd25c62278cea3492a14abadc190f43da5f74224)

20 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

(cherry picked from commit 53133503740398fbfc770dfdf4d7e123075a241f)

20 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

(cherry picked from commit 7078e0e2c2b0a86020a8bc46a32437ea4cf859b2)

20 months agolibc: add test case for qsort_b(3)
Xin LI [Wed, 7 Sep 2022 06:11:46 +0000 (23:11 -0700)]
libc: add test case for qsort_b(3)

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

(cherry picked from commit c65e42dbde4198ce46aef7ddac061390abe672dc)
(cherry picked from commit 4385a9f851bbbb88a4310ebfa929dfab01b6fc4d)

20 months agomount_nfs.8: Update for NFSv4 use of "nolockd"
Rick Macklem [Wed, 7 Sep 2022 21:07:20 +0000 (14:07 -0700)]
mount_nfs.8: Update for NFSv4 use of "nolockd"

Commit 33721eb991d8 enabled use of "nolockd" for
NFSv4 mounts.  This was done primarily to allow its
use with the "intr" mount option.

This patch updates the man page for this.

This is a content change.

(cherry picked from commit 9b436906fa10b8bec4f7c231b389ed9ef5b2acad)

20 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
Differential Revision: https://reviews.freebsd.org/D26719

(cherry picked from commit 06bfd0b9143b0409b1b343976ca1d6f41f796423)

20 months agoMFV: less v608
Xin LI [Tue, 6 Sep 2022 05:52:39 +0000 (22:52 -0700)]
MFV: less v608

Relnotes: yes
(cherry picked from commit 95270f73baf6fa95ae529bc2eb6a61f5c79f32c0)

20 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

(cherry picked from commit d88dc1b0b9af4de5ecbe0cdae1cea6055c8c9ec8)

20 months agotcp: tcp6_connect() requires net epoch
Gleb Smirnoff [Mon, 5 Sep 2022 17:15:19 +0000 (10:15 -0700)]
tcp: tcp6_connect() requires net epoch

PR: 262663
Reported & tested by: dch

(cherry picked from commit 0773b44e829421a806a89087009b294f16ee51fd)

20 months agorb_tree: avoid extra reads in rebalancing
Doug Moore [Mon, 29 Aug 2022 16:11:31 +0000 (11:11 -0500)]
rb_tree: avoid extra reads in rebalancing

In RB_INSERT_COLOR and RB_REMOVE_COLOR, avoid reading a parent pointer
from memory, and then reading the left-color bit from memory, and then
reading the right-color bit from memory, since they're all in the same
field. The compiler can't infer that only the first read is really
necessary, so write the code in a way so that it doesn't have to.

Drop RB_RED_LEFT and RB_RED_RIGHT macros that reach into memory to get
those bits.  Drop RB_COLOR, the only thing left using RB_RED_LEFT and
RB_RED_RIGHT after the other changes, and go straight to DIAGNOSTIC
code in subr_stats to implement RB_COLOR for its single, dubious use
there.

Reviewed by: alc
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D36353

(cherry picked from commit 5d91386826d0f360d87ce3f39c9ebf266f149325)

20 months agonfscl: Allow "nolockd" to work for NFSv4 mounts
Rick Macklem [Sun, 4 Sep 2022 20:09:33 +0000 (13:09 -0700)]
nfscl: Allow "nolockd" to work for NFSv4 mounts

Commit 40ada74ee1da modified the NFSv4.1/4.2 client so
that it would issue a DestroySession to the server when
all session slots are marked bad.  This handles the
case where session slots get broken when "intr" or "soft"
NFSv4 fairly well.1/4.2 mounts are done.

There are two other cases where having an NFSv4.1/4.2
RPC attempt terminate without completion can leave
state in a non-determinate condition.

One is file locking RPCs.  If the "nolockd" option is
used, this avoids file locking RPCs by doing locking
locally within the client.

The other is Open locks, but since all FreeBSD Open
locks are done with OPEN_SHARE_DENY_NONE, the locking
state for these should not be critical.

This patch enables use of "nolockd" for NFSv4 mounts,
so that it can be combined with "intr" and/or "soft",
making the latter more usable.

Use of "intr" or "soft" NFSv4 mounts are still not
recommended, but when combined with "nolockd" should
now work fairly well.

A man page update will be done as a separate commit.

(cherry picked from commit 33721eb991d868dbcad4726872d95ddd8f04ec27)

20 months agorb_tree: fine-tune RB_REMOVE
Doug Moore [Sun, 28 Aug 2022 05:43:49 +0000 (00:43 -0500)]
rb_tree: fine-tune RB_REMOVE

Improve RB_REMOVE by reading the fields of the removed node only once,
and by not writing to the removed node.

Reviewed by: kib
Discussed with: markj
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D36288

(cherry picked from commit 5886089ecfc3a7c77bbdf9e95cbf14112f592c50)

20 months agostand: i386: take into account disk sector size for blk calculation
Kyle Evans [Thu, 8 Sep 2022 00:35:06 +0000 (19:35 -0500)]
stand: i386: take into account disk sector size for blk calculation

disk_blocks assumes BIOSDISK_SECSIZE, but the media may not be using
it.  In particular, bioscd on Parallels presents a 2K sector size, so
we end up with a short disk_blocks and subsequent validation fails when
trying to read /boot/lua.

PR: 233098
Reviewed by: imp, tsoome

(cherry picked from commit 72291cee075d9ef1a608b2a67762b44e024cc0d4)

20 months agoarm64, riscv: size boot stacks appropriately
Kyle Evans [Wed, 7 Sep 2022 02:11:30 +0000 (21:11 -0500)]
arm64, riscv: size boot stacks appropriately

In 8db2e8fd16c4 ("Remove the secondary_stacks array in arm64 [...]"),
bootstacks was setup to be allocated dynamically.  While this is
generally how x86 does it, it inadvertently shrunk each boot stack from
KSTACK_PAGES pages to a single page.

Resize these back up to the expected size using the kstack_pages
tunable, as we'll need larger stacks with upcoming sanitizer work.

Reviewed by: andrew, imp, markj
Fixes: 8db2e8fd16c4 ("Remove the secondary_stacks array [...]")
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.

(cherry picked from commit bab32a8029c3f9339acbd786ffe8f27ad9cfd288)

20 months agotools: test: iconv: fix open_2 to not segfault
Kyle Evans [Tue, 11 Jan 2022 23:41:10 +0000 (17:41 -0600)]
tools: test: iconv: fix open_2 to not segfault

Record error condition when iconv_open() fails rather than leaving a
bogus iconv_t that iconv_close() can later choke on; this is one failure
mode.

If we opened MAX_LIMIT files with success, we need to rewind one so that
we don't iconv_close() one past the end of cd; this is the second
failure mode.

Sponsored by: Klara, Inc.

(cherry picked from commit 814bd1ed438f7dfc5bedcb1f3e772a46fe7026bb)

20 months agoiconv: only conditionally use ICONV_SET_DISCARD_ILSEQ
Kyle Evans [Tue, 22 Feb 2022 05:05:28 +0000 (23:05 -0600)]
iconv: only conditionally use ICONV_SET_DISCARD_ILSEQ

If the -c flag is used, then we can set it with ICONV_SET_DISCARD_ILSEQ;
otherwise, leave it alone.  The user may have specified //IGNORE in the
'to' codeset specification, there's no reason we can't allow that but
we'll currently turn it off.

Reviewed by: thj
Sponsored by: Klara, Inc.

(cherry picked from commit ea0f37dec65daf2b7e05712738cd1720aae129eb)

20 months agodate: attempt to more accurately describe year limitations with -v
Kyle Evans [Tue, 28 Jun 2022 03:54:13 +0000 (22:54 -0500)]
date: attempt to more accurately describe year limitations with -v

The previous description was both incorrect and incomplete in its
description -- the 2038 limit doesn't apply on !i386 platforms, and
it didn't note that values above 100 are accepted and interpreted
differently.  Further, it didn't note that absolute years are accepted.

Reviewed by: pauamma_gundo.com (manpages)
Sponsored by: Klara, Inc.

(cherry picked from commit 9fcac31db4602518e1337b1455581ffcae9348a5)

20 months agoalc: force maximum payload size to 128 bytes for AR816X/AR817x
Kyle Evans [Tue, 7 Jun 2022 01:52:55 +0000 (20:52 -0500)]
alc: force maximum payload size to 128 bytes for AR816X/AR817x

Otherwise, we'll trigger a DMA write error and render the device
unusable.

Obtained from: OpenBSD (via Haiku, waddlesplash)

(cherry picked from commit 8cdb6b2dd78793628d7c36198598c85741e44119)

20 months agozdiff: avoid non-conformant features
Kyle Evans [Fri, 20 May 2022 20:38:03 +0000 (15:38 -0500)]
zdiff: avoid non-conformant features

`setvar` is a non-conformant feature that looks slightly neater but is
not portable to other /bin/sh implementations.  Making the script
portable is straightforward, so let's do it.

Tests are added to make sure that I didn't break anything major in the
process.

Reviewed by: bapt (previous version), jilles
Sponsored by: Klara, Inc.

(cherry picked from commit 5b7adeb1845c7491a655d2b2e1ab55d7b7b96a34)

20 months agoarm64: disable the EL2 MMU before dropping to EL1
Kyle Evans [Fri, 13 May 2022 03:03:32 +0000 (22:03 -0500)]
arm64: disable the EL2 MMU before dropping to EL1

An earlier stage may have set HCR_EL2.E2H, the clearing of which may
break address translation.  We don't need the EL2 MMU at this point, so
we can avoid re-enabling it for now and just drop to EL1 as usual.

Suggested by: andrew
Reviewed by: andrew

(cherry picked from commit 51adf913e8815bdc928cb72dd378c596b8b15336)

20 months agoarm64: gic: disable the ITS if it's enabled prior to configuration
Kyle Evans [Sat, 19 Mar 2022 03:03:44 +0000 (22:03 -0500)]
arm64: gic: disable the ITS if it's enabled prior to configuration

The ITS is defined to be disabled on a warm reset, but we may be coming
in via another kernel/hypervisor type setup where the ITS has been
previously configured then relinquished to the next kernel in the chain.

If it's enabled, the later configuration of GITS_BASER will almost
certainly fail -- clear it to prevent that.

Reviewed by: andrew
Sponsored by: Ampere Computing
Submitted by: Klara, Inc.

(cherry picked from commit 1236b04bb7045e541b2343543e356273db20ee56)

20 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/

(cherry picked from commit d53555d63b18f141b752ef6e7a2762fc73a47956)