Commit Graph

278135 Commits

Author SHA1 Message Date
Bjoern A. Zeeb
8e93258f26 rtw89: import Realtek's rtw89 driver
Import rtw89 based on wireless-testing at (tag: wt-2022-09-02)
78667a29c116c6b186a37e28cd8dd7fa9923aee8 with adjustments for FreeBSD.

For the moment this will stay disconnected from the build until the
last bits are flushed out, but this will help people with a card to
do testing and possibly help improving.

Given the lack of full license texts on non-local files this is
imported under the draft policy for handling SPDX files (D29226). [1]

Approved by:	core.11 (imp) [1] [2022-03-27]
MFC after:	6 weeks
2022-09-09 16:32:17 +00:00
Bjoern A. Zeeb
d6d687daaa 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.

MFC after:	3 days
2022-09-09 16:30:00 +00:00
Gleb Smirnoff
c8bc874172 ip_reass: fixup the just added tunable
- Don't use hardcoded hash mask
- free the memory on VNET destroy

Fixes:	1494f4776a
2022-09-09 09:19:39 -07:00
Jiahao LI
6501fcdc0a if_dwc: fix reinitialization with changed MAC
It was observed that on RockPro64 hardware, the dwc interface is unable
to receive packets after being assigned a new MAC address. The fix is
simply to call mii_mediachg() before touching any device registers in
dwc_init_locked(). This is consistent with what the OpenBSD driver does.

PR:		263820
MFC after:	1 week
2022-09-09 12:31:26 -03:00
Matthew Grooms
87705c5c21 bcm2835_clkman: add RPI4 compat string
This enables attachment on the RPI4, thus enabling the bcm2835_pwm
driver too. Per the device tree documentation, these compat strings are
equivalent, and no further changes to the driver are required.

https://lists.freebsd.org/archives/freebsd-arm/2021-June/000143.html

MFC after:	3 days
2022-09-09 12:31:25 -03:00
Warner Losh
c73d20c831 gicv3_its: Fix typo
Sponsored by:		Netflix
2022-09-09 09:23:08 -06:00
Felix Palmen
78c30a6ad4 Bump __FreeBSD_version after linuxkpi changes.
Approved by:	tcberner (mentor)
2022-09-09 17:07:40 +02:00
Felix Palmen
600f161295 linuxkpi: Add non-atomic readq()/writeq()
The non-atomic versions are required by drm-510-kmod to build on 32-bit
architectures.

Approved by:		hselasky, manu, tcberner (mentor)
Differential Revision:	https://reviews.freebsd.org/D36507
2022-09-09 16:59:41 +02:00
Emmanuel Vadot
3fc174845c Revert "vmm: permit some IPIs to be handled by userspace"
This reverts commit a5a918b7a9.

This cause some problem with vm using bhyveload.

Reported by:	pho, kp
2022-09-09 15:55:01 +02:00
Emmanuel Vadot
83b65d0ae1 Revert "vmm: Remove unneeded variable maxcpus"
This reverts commit 653c36179d.
2022-09-09 15:54:56 +02:00
Randall Stewart
81560c5582 TCP: Rack ends up sending all that is outstanding every timeout.
In doing some testing for a different problem, I have found rack retransmitting
all outstanding data every time a timeout occurs. The outstanding is sent 1ms
apart between each packet, and then the timeout runs off again. This causes
extra retransmissions when we should be waiting for an ack after sending the
very first segment.

Reviewed by: tuexen
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D36494
2022-09-09 08:59:21 -04:00
Dag-Erling Smørgrav
d3791ac46a NOTES: add Veriexec options and modules.
Sponsored by:	Klara, Inc.
MFC after:	1 week
2022-09-09 14:11:19 +02:00
Dag-Erling Smørgrav
08e331f41b mac_veriexec_parser: fix build after 7e1d3eefd4.
Sponsored by:	Klara, Inc.
2022-09-09 14:09:08 +02:00
Dag-Erling Smørgrav
f419a28349 OptionalObsoleteFiles.inc: add bearssl, secureboot, veriexec.
Sponsored by:	Klara, Inc.
MFC after:	1 week
2022-09-09 14:06:11 +02:00
Bjoern A. Zeeb
7ea1cac248 systm.h: change pause from #define to inline function
There are drivers are using (*pause)(x, y) function pointers and depending
on how "pause" is used it gets replaced by pause_sbt causing compile time
failures.
Given "pause" is a generic enough name change it from a #define to an
inline function to avoid replacements where it should not.

MFC after:	2 weeks
Reviewed by:	kib
Differential Revision: https://reviews.freebsd.org/D36489
2022-09-09 11:54:59 +00:00
Mateusz Kozyra
6665c7a628 TMP461: Add support for ADT7461 sensor
The register map is fairly similar, with one difference in the local
sensor temperature register width.
Both devices support reading two sensors - "local" and "remote".
While here add support for the latter one.
The ADT7461 doesn't update the temperature correctly, unless a write
transaction is done before every read.
Do just that as a workaround for this issue.

Tested on LS1046ARDB.

Reviewed by:	manu
Obtained from:	Semihalf
Differential Revision: https://reviews.freebsd.org/D36464
2022-09-09 13:42:28 +02:00
Gleb Popov
c44ca4c227 msun/Makefile: Fix conditional and unbreak the build.
Approved by:	imp
Fixes:	20adba8bc1
2022-09-09 11:07:33 +03:00
Gleb Popov
dcdf4c1acd src.conf.5: Regenerate.
Approved by:	imp
Fixes:	20adba8bc1
2022-09-09 11:07:33 +03:00
Andrew Turner
643e14d094 Use the correct size when checking an EFI address
Use the correct page size macro when checking if an address is with
the EFI runtime map. This would previously work correctly when the
page size is 4k. With a larger page size it may incorrectly detect
memory as within the map when it's not.

Reported by:	imp
Sponsored by:	Innovate UK
2022-09-09 08:47:15 +01:00
Gleb Popov
20adba8bc1 src.conf: Introduce WITHOUT_MACHDEP knob.
Summary:
This knob can be used to make buildsystem prefer generic C implentations of
various functions, instead of machine-specific assembler ones.

Test Plan: `make buildworld` on amd64

Reviewed by: imp, emaste

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

MFC after:	3 days
2022-09-09 09:54:28 +03:00
Gleb Smirnoff
1494f4776a ip_reass: add loader tunable to tune the reassembly hash size 2022-09-08 13:49:58 -07:00
Gleb Smirnoff
a30cb31589 ip_reass: retire ipreass_slowtimo() in favor of per-slot callout
o Retire global always running ipreass_slowtimo().
o Instead use one callout entry per hash slot.  The per-slot callout
  would be scheduled only if a slot has entries, and would be driven
  by TTL of the very last entry.
o Make net.inet.ip.fragttl read/write and document it.
o Retire IPFRAGTTL, which used to be meaningful only with PR_SLOWTIMO.

Differential revision:	https://reviews.freebsd.org/D36275
2022-09-08 13:49:58 -07:00
Mark Johnston
e599810ded tail: Initialize the stat buffer used when input is stdin
PR:		266284
Reported by:	Jenkins via delphij
Fixes:		7e11889959 ("tail: Fix -f with stdin")
MFC after:	3 days
2022-09-08 16:21:39 -04:00
Mateusz Guzik
dda6376b04 net: employ newly added pfil_mbuf_{in,out} where approriate
Reviewed by:	glebius
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36454
2022-09-08 16:21:08 +00:00
Mateusz Guzik
0b70e3e78b net: add pfil_mbuf_{in,out}
This shaves a lot of branching due to MEMPTR flag.

Reviewed by:	glebius
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36454
2022-09-08 16:20:43 +00:00
Elliott Mitchell
cb6abe87cf hwpmc: purge EOL release compatibility 2022-09-08 16:17:24 +00:00
Gleb Smirnoff
e80062a2d4 tcp: avoid call to soisconnected() on transition to ESTABLISHED
This call existed since pre-FreeBSD times, and it is hard to understand
why it was there in the first place.  After 6f3caa6d81 it definitely
became necessary always and commit message from f1ee30ccd6 confirms that.
Now that 6f3caa6d81 is effectively backed out by 07285bb4c2, the call
appears to be useful only for sockets that landed on the incomplete queue,
e.g. sockets that have accept_filter(9) enabled on them.

Provide a new TCP flag to mark connections that are known to be on the
incomplete queue, and call soisconnected() only for those connections.

Reviewed by:		rrs, tuexen
Differential revision:	https://reviews.freebsd.org/D36488
2022-09-08 09:16:04 -07:00
Kyle Evans
72291cee07 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
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36490
2022-09-08 10:05:08 -05:00
Andrew Turner
7d90ce7cae 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
2022-09-08 14:30:11 +01:00
Andrew Turner
949bc17cf2 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
2022-09-08 14:30:09 +01:00
Andrew Turner
51a1bf7ba7 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
2022-09-08 14:29:37 +01:00
Andrew Turner
8c6e5d8cf1 Import an optimized str{n}cmp on arm64
These are from the Arm Optimized Routines and don't use the VFP so are
safe to use in the kernel.

Sponsored by:	The FreeBSD Foundation
2022-09-08 14:23:20 +01:00
Andrew Turner
01e478d955 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
2022-09-08 14:23:20 +01:00
Andrew Turner
376025cfb1 Move the non-exported PCB_FP_* flags to the upper bits
To make way for a flag for SVE move the PCB_FP_* flags we don't export
to userspace to the upper bits.

Sponsored by:	The FreeBSD Foundation
2022-09-08 14:23:20 +01:00
Maxim Sobolev
6ad780caa2 Generate termcap.small automatically. This eliminates the
need to do synchronization by hand when termcap is updated.

Reviewed by:	uqs, bapt, imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36333
2022-09-08 04:22:37 -07:00
Alexander V. Chernikov
e762417077 routing: constantify nh/nhg argument in <nhop|nhgrp>_get_origin().
MFC after:	1 month
2022-09-08 10:21:25 +00:00
Alexander V. Chernikov
000250be0d routing: add abitity to set the protocol that installed route/nexthop.
Routing daemons such as bird need to know if they install certain route
 so they can clean it up on startup, as a form of achieving consistent
 state during the crash recovery.
Currently they use combination of routing flags (RTF_PROTO1) to detect
 these routes when interacting via route(4) rtsock protocol.
Netlink protocol has a special "rtm_protocol" field that is filled and
 checked by the route originator. To prepare for the upcoming netlink
 introduction, add ability to record origing to both nexthops and
 nexthop groups via <nhop|nhgrp>_<get|set>_origin() KPI. The actual
 calls will be used in the followup commits.

MFC after:	1 month
2022-09-08 09:18:32 +00:00
Kyle Evans
bab32a8029 arm64, riscv: size boot stacks appropriately
In 8db2e8fd16 ("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:	8db2e8fd16 ("Remove the secondary_stacks array [...]")
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D36475
2022-09-08 00:03:05 -05:00
Doug Moore
d0354fa7b6 rb_tree: reduce duplication in balancing code
Change RB_INSERT_COLOR and RB_REMOVE_COLOR so that the blocks of code
that are identical except for left and right being exchanged are made
only one block with a variable to indicate left- or right-handedness.

Rename RB macros so that those not intended for external use begin
with an underscore.

Add comments to the balancing code so that another might understand it.

Reviewed by:	alc, kib
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D36393
2022-09-07 23:46:19 -05:00
Wei Hu
6f7b1310b6 Hyper-V: storvsc: relax a couple more kasserts
Seems these kasserts don't work well on ARM64

Fixes:	0af5a0cd27
Sponsored by:	Microsoft
2022-09-08 04:22:26 +00:00
Doug Moore
2c545cf3b0 rb_tree: test rank balance
With _RB_DIAGNOSTIC defined, provide an RB_RANK method to compute the
rank of a node in an rb-tree, if the subtree rooted at that node is
rank-balanced, and -1 otherwise.

In rb_test, rewrite a bit to avoid malloc/free and nondeterministic
running times because of randomness. Allocate all the nodes on the
stack, and shuffle a set of keys to get randomness for the testing.

Add a rank-balance check for the completed tree.

Reviewed by:	markj
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D36484
2022-09-07 21:40:05 -05:00
Michael Gmelin
0eb736c0f6 stand: Unbreak FAT32 in loader
This corrects an issue introduced in b4cb3fe0e3, where a freshly
allocated `DOS_FS` structure would not be initialized properly before
use in `dos_open`.

In case of FAT32 file systems, this would leave `fs->dirents`
uninitialized and - depending on its content and due to checks in
`parsebs` - prevent mounting the file system successfully.

This particularily impacted the EFI loader, as it was sometimes not
able to read files from a FAT32-formatted EFI partition, including
LoaderEnv (`/efi/freebsd/loader.env`).

Accepted by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36482
2022-09-08 02:16:34 +02:00
Bjoern A. Zeeb
b3b6a959c8 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.

MFC after:	2 weeks
While here sort some other Realtek entries by DeviceID.
2022-09-07 23:48:59 +00:00
Bjoern A. Zeeb
549198b1ab 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.

MFC after:	1 week
2022-09-07 23:38:54 +00:00
Bjoern A. Zeeb
ac07a3b8b6 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.

MFC after:	1 week
2022-09-07 23:35:41 +00:00
Bjoern A. Zeeb
fb3c549738 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).

MFC after:	1 week
2022-09-07 23:33:45 +00:00
Bjoern A. Zeeb
c994352a88 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
MFC after:	1 week
2022-09-07 23:28:13 +00:00
Rick Macklem
e7d9290fc2 RELNOTES: Add an entry for use of "intr,nolockd" NFSv4.1/4.2 mounts
Add an entry for the commits that make the mount options "intr" and
"nolockd" usable for NFSv4.1/4.2 mounts.
2022-09-07 15:55:15 -07:00
Rick Macklem
85c11f808e RELNOTES: Add an entry for new NFSv4.1/4.2 console messages
Add and entry for the commits that generate new console messages
indicating that all clients need to have unique /etc/hostid strings.
2022-09-07 15:35:55 -07:00
Rick Macklem
9b436906fa mount_nfs.8: Update for NFSv4 use of "nolockd"
Commit 33721eb991 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.

Reviewed by:	gbe (manpages), karels
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36462
2022-09-07 14:07:20 -07:00