Commit Graph

144952 Commits

Author SHA1 Message Date
Doug Moore
86d00db451 Use 0 and 1, not false and true, in tree.h changes.
Reported by:	jenkins
2022-09-20 23:36:40 -05:00
Doug Moore
b16f993ec2 rb_tree: augmentation shortcut
RB-tree augmentation maintains data in each node of the tree that
represents the product of some associative operator applied to all the
nodes of the subtree rooted at that node. If a node in the tree
changes, augmentation data for the node is updated for that node and
all nodes on the path from that node to the tree root. However,
sometimes, augmenting a node changes no data in that node,
particularly if the associated operation is something involving 'max'
or 'min'. If augmentation changes nothing in a node, then the work of
walking to the tree root from that point is pointless, because
augmentation will change nothing in those nodes either. This change
makes it possible to avoid that wasted work.

Define RB_AUGMENT_CHECK as a macro much like RB_AUGMENT, but which
returns a value 'true' when augmentation changes the augmentation data
of a node, and false otherwise. Change code that unconditionally walks
and augments to the top of tree to code that stops once an
augmentation has no effect. In the case of rebalancing the tree after
insertion or deletion, where previously a node rotated into the path
was inevitably augmented on the march to the tree root, now check to
see if it needs augmentation because the march to the tree root
stopped before reaching it.

Change the augmentation function in iommu_gas.c so that it returns
true/false to indicate whether the augmentation had any effect.

Reviewed by:	alc, kib
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D36509
2022-09-20 23:21:14 -05:00
Mateusz Guzik
d0b235c715 cxgbe: fix the build after e398922eaf 2022-09-20 21:31:49 +00:00
Hans Petter Selasky
cbda8bed15 linuxkpi: Resolve duplicate global symbol name to fix LINT kernel build.
seq_printf() is defined in both spl_procfs_list.c and linux_seq_file.c .
Fix this by renaming the LinuxKPI ones and use macros to invoke the
correct function.

Reported by:	jfree@
Differential Revision:  https://reviews.freebsd.org/D35883
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-09-20 22:37:15 +02:00
Randall Stewart
e398922eaf Enable M_TSTMP in Chelsio cxgbe driver by creating a mechanism that can sync the time.
Chelsio has always been recording a timestamp in the mbuf (rcv_tstmp) but
not setting the M_TSTMP bit in the mbuf flags. This is because the timestamp
was just the free running 60bit clock. This change fixes that so that
we keep a synchronization by periodically (every 30 seconds after startup)
getting the timestamp and the current nanosecond time. We always keep
several sets around and the current one we always keep the current pair
and the previous pair of timestamps. This allows us to setup a ratio
between the two so we can correctly translate the time. Note that
we use special care to split the timestamp into seconds (per the clock tick)
and nanoseconds otherwise 64bit math would overflow.

Reviewed by: np
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D36315
2022-09-20 15:13:16 -04:00
Jake Freeland
f697b9432d linuxkpi: drm-kmod debugfs support
This diff extends LinuxKPI to support simple attribute files in debugfs.
These simple attributes are an essential component for compiling drm-kmod
with CONFIG_DEBUG_FS enabled.
This will allow for easier graphics driver debugging using
Intel's igt-gpu-tools.

Reviewed by:	hselasky
Differential Revision:	https://reviews.freebsd.org/D35883
Sponsored by:	Google, Inc. (GSoC 2022)
2022-09-20 19:41:10 +02:00
Jake Freeland
a11195df34 linuxkpi: Add strndup_user
Reviewed by:	hselasky, markj
Differential Revision:	https://reviews.freebsd.org/D36350
Sponsored by:	Google, Inc. (GSoC 2022)
2022-09-20 19:40:05 +02:00
Jake Freeland
a06eeeaa1d linuxkpi: Add EPOLL aliases
Reviewed by:	hselasky
Differential Revision:	https://reviews.freebsd.org/D36527
Sponsored by:	Google, Inc. (GSoC 2022)
2022-09-20 19:39:52 +02:00
Jake Freeland
f0b0f28f35 linuxkpi: Add down_read_killable()
Reviewed by:	hselasky
Differential Revision:	https://reviews.freebsd.org/D36528
Sponsored by:	Google, Inc. (GSoC 2022)
2022-09-20 19:39:32 +02:00
Randall Stewart
7cc3ea9c6f mlx5 M_TSTMP accuracy looses quite a bit of precision so lets fix it.
The way that the clock is synchronized between the system and the current mlx5 for the purposes of the M_TSTMP
being carried we loose a lot of precision. Instead lets change the math that calculates this to separate out
the seconds/nanoseconds and operate on the two values so we don't get overflow instead of just
shifting the value down and loosing precision.

Reviewed by: kib, hselasky
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D36327
2022-09-20 13:12:16 -04:00
Mateusz Guzik
2c2ef670a7 pseudofs: use the vget_prep/vget_finish idiom 2022-09-19 20:08:40 +00:00
Mateusz Guzik
4e1262ac99 zfs: stop passing LK_INTERLOCK to VOP_LOCK
There is an ongoing effort to eliminate this feature.
2022-09-19 20:03:01 +00:00
Gleb Smirnoff
0c7f3ae8c6 tcpcb: fix tabulation count in i4012ef7754c and abbreviate "packets"
This lines up comments to the rest of the file.  Abbreviation
helps to fit in to 80 char terminal.  Not a functional change.
2022-09-19 10:29:53 -07:00
Sébastien BINI
64cce803c4 Correct IPv6 MLD group state string table
MLD_REPORTING_MEMBER was missing

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36311
2022-09-19 09:01:36 -04:00
Michael Tuexen
6d9e911fba 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
2022-09-19 12:49:31 +02:00
Hubert Mazur
55760984d5 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
2022-09-19 09:18:19 +02:00
Jakub Kołodziej
b8a083ea32 gpio: Merge TCA6416 & TCA6408 drivers into TCA64XX
This merges TCA6416, TCA6408 drivers and adds PCA9555 support.
They handle 8 pin and 16 pin ICs with basic INPUT/OUTPUT functionality.
The register map is fairly similar so there is no point in having two
separate drivers.

Reviewed by:	kd
Obtained from:	Semihalf
Differential Revision: https://reviews.freebsd.org/D36559
2022-09-19 09:18:08 +02:00
Mateusz Guzik
a3ab1102e3 vfs: silence a bogus LOR in freevnode
Reported by:	imp
2022-09-19 02:14:50 +00:00
Mateusz Guzik
fa3eb3c970 vfs: indent V_VALID_FLAGS with a tab
Requested by:	kib
2022-09-18 21:32:25 +00:00
Doug Moore
14696d81f1 rb_tree: silence unused function warnings
With DIAGNOSTIC set a kernel build generates warnings about the
defined-but-unused RB_RANK method. Don't set _RB_DIAGNOSTIC
automatically, to silence these warnings.

Reported by:	mjguzik@gmail.com
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D36617
2022-09-18 03:34:47 -05:00
Mateusz Guzik
c3707bd3d6 linuxkpi: use SI_SUB_EVENTHANDLER + 1, like other consumers
Otherwise it may try to initialize before eventhandler subsystem.
2022-09-17 23:52:23 +00:00
Mateusz Guzik
a75d1ddd74 vfs: introduce V_PCATCH to stop abusing PCATCH 2022-09-17 15:41:37 +00:00
Mateusz Guzik
9e4f35ac25 vfs: deperl msleep flag calculation in vn_start_*write 2022-09-17 17:17:20 +02:00
Mateusz Guzik
1c7084fe56 vfs: clean up parse_mount_dev_present 2022-09-17 12:42:46 +00:00
Mateusz Guzik
298c7c5165 zfs: don't access nameidata unless namei succeeded 2022-09-17 12:25:59 +00:00
Mateusz Guzik
b77bdfdb67 vfs: fix non-INVARIANTS build after 5b5b7e2ca2
Reported by:	gj
2022-09-17 10:45:12 +00:00
Mateusz Guzik
aede6a9670 vfs: fixup parse_mount_dev_present after 5b5b7e2ca2
Reported by:	kib
2022-09-17 10:35:00 +00:00
Mateusz Guzik
5b5b7e2ca2 vfs: always retain path buffer after lookup
This removes some of the complexity needed to maintain HASBUF and
allows for removing injecting SAVENAME by filesystems.

Reviewed by:	kib (previous version)
Differential Revision:	https://reviews.freebsd.org/D36542
2022-09-17 09:10:38 +00:00
Mateusz Guzik
3df3d88cc5 vfs: move cn_nameptr assignment out of namei_getpath 2022-09-17 09:08:34 +00:00
Mateusz Guzik
41a0a99f85 vfs: slightly reorganize error handling in chroot
This avoids duplicated NDFREE_NOTHING which will be of importance
later.
2022-09-17 09:08:34 +00:00
Konstantin Belousov
55c5216582 vm/vm.h: cleanup
Move declarations for in-kernel function and variables to _KERNEL
section.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36612
2022-09-17 11:58:52 +03:00
Brooks Davis
bb23932803 ktrace: make ktr_tid a long not intptr_t (NFC)
Long ago, ktr_tid was ktr_buffer which pointed to the buffer following
the header and was used internally in the kernel.  Use was removed in
efbbbf570d and it was repurposed as ktr_kid in c6854c347f.  For
ABI reasons, it stayed an intptr_t rather than becoming an lwpid_t at
the time.  Since it doesn't hold a pointer any more (unless you have
a ktrace.out from 2005), change the type to long which is alwasy the
same size on all supported architectures.  Add a suggestion to change
the type to lwpid_t (__int32_t) on a future ABI break.

Remove most remaining references to ktr_buffer, retaing a comment in
kdump.c explaining why negative values are treated as 0.  While here,
accept that pid_t and lwpid_t are of type int and simplify casts in
printf.

This changed was motivated by CheriBSD where intptr_t is 16-bytes
in the pure-capability ABI.

Reviewed by:	kib, markj
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D36599
2022-09-17 09:21:59 +01:00
Warner Losh
7cd4984e67 SPDX: Not BSD-4-Clause
This is not BSD-4-Clause. It's closer to a modified BSD-2-Clause with 2
added clauses (and the first one has added clauses). Remove
SPDX-License-Idnetifier since this license doesn't match anything in
SPDX.
2022-09-16 21:49:16 -06:00
Doug Moore
87cd087a4a iommu_gas: don't remove and insert boundary entry
Avoid removing an item in iommu_gas_free_region only to reinsert it,
by avoiding removing an entry that is either first_place or
last_place.

Reviewed by:	kib
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D36597
2022-09-16 15:32:11 -05:00
Konstantin Belousov
ff41239f58 Add AT_USRSTACK{BASE, LIM} AT vectors, and ELF_BSDF_VMNOOVERCOMMIT flag
Reviewed by:	brooks, imp (previous version)
Discussed with:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36540
2022-09-16 23:23:26 +03:00
Konstantin Belousov
26eed2aa06 swap_pager: style, wrap long lines
Reviewed by:	brooks, imp (previous version)
Discussed with:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36540
2022-09-16 23:23:13 +03:00
Konstantin Belousov
ccdaa1ab1c vm_overcommit: put into __read_mostly section
Suggested by:	mjg
Reviewed by:	brooks, imp (previous version)
Discussed with:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36540
2022-09-16 23:23:04 +03:00
Konstantin Belousov
a6cc4c6e98 vm: make vm.overcommit available externally
Reviewed by:	brooks, imp (previous version)
Discussed with:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36540
2022-09-16 23:22:49 +03:00
Mateusz Guzik
50176b0296 locks: whack a failed experiment in form of restrict_starvation
This was never enabled and only pollutes the code. The issue will
be addressed later in a different manner.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-09-16 17:29:37 +00:00
Warner Losh
4134f677eb i386: Make boot loader smaller by reducing size of bootinfo
We don't need the 56 bytes at the end of bootinfo, and never had.  Don't
copy them from old boot loaders, and don't provide them with new boot
loaders.

Add comments about what versions of FreeBSD 'old' means in various
contexts. Add note that old disk loader (from 1.x/2.x) is doomed to
failure because it doesn't provide metadata that we now require to boot,
and has been since approximately FreeBSD 7.x. Retain all this
information to explain why we have 4 arguments that are always 0, even
though it's ancient history.

This saves 56 bytes in the boot loader.

Sponsored by:		Netflix
Reviewed by:		phk, rgrimes, kib
Differential Revision:	https://reviews.freebsd.org/D36550
2022-09-16 09:18:57 -06:00
Warner Losh
59b1d07428 i386: Mark the obsolete fields in bootinfo with _was_
Mark the obsolete fields in bootinfo with _was_. Note that the fields
from bi_memdesc_version to the end of the structure never were used in a
release. They were added in April 2010 for i386 EFI booting. The boot
loader set these fields though 2019, but no kernel ever looked at them
and we never supported i386 EFI booting, and likely never will in this
form. They can likely be deleted entirely in the future, but locore.S
needs to change to do that (it also needs to change to drop support for
really old booting scenarios as well, which will eliminate bi_endcommon
too).

All the other fields haven't been used since the 4.x -> 5.x cutover of
the wdc driver to ata.

The bi_bios_dev field is used in the handoff between bootXX and the
loader. The loader uses it to determine what disk it was loaded off of
to detmerine the default root filesystem. It's not used by the i386
kernel anymore to determine anything.

Sponsored by:		Netflix
Reviewed by:		tsoome
Differential Revision:	https://reviews.freebsd.org/D36544
2022-09-16 09:18:57 -06:00
Nuno Teixeira
b44869cba1 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
2022-09-16 14:29:30 +01:00
Jessica Clarke
7b673a2c73 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 1b1428dcc8,
with no safer equivalent put in its place.

Reviewed by:	brooks, kib, markj
Obtained from:	CheriBSD
Fixes:		1b1428dcc8 ("Fix a TOCTOU vulnerability in freebsd32_copyin_control().")
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36554
2022-09-15 17:16:22 +01:00
Ed Maste
9054e29681 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
2022-09-15 10:07:23 -04:00
Gordon Bergling
a5c1b9e332 qlnxe(4): Fix a typo in a source code comment
- s/paramters/parameters/

MFC after:	3 days
2022-09-15 10:31:05 +02:00
Gordon Bergling
c86b1d9965 safexcel: Fix a typo in a source code comment
- s/paramters/parameters/

MFC after:	3 days
2022-09-15 10:26:48 +02:00
Gordon Bergling
4771011b8f kern_jail: Fix a typo in a source code comment
- s/paramter/parameter/

MFC after:	3 days
2022-09-15 10:25:19 +02:00
Gordon Bergling
d53555d63b netpfil: Fix some typos in source code comments
- s/paramter/parameter/
- s/paramters/parameters/

MFC after:	3 days
2022-09-15 10:24:00 +02:00
Warner Losh
9baa0817ec 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
2022-09-14 21:29:31 -06:00
Gleb Smirnoff
da6715bbb1 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
2022-09-14 19:22:40 -07:00
Mateusz Guzik
d04c7f10d4 vfs: make delmntque return with the interlock held
saves on relocking dance -- the lock is taken immediately
afterwards anyway.
2022-09-14 23:30:19 +00:00
Mateusz Guzik
43fbd0e7a7 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.
2022-09-14 23:04:22 +00:00
Mateusz Guzik
ad5e1f9c2d devfs: stop taking the interlock in devfs_delete
It buys nothing now that vhold does not require it.
2022-09-14 22:51:42 +00:00
Mateusz Guzik
a1c555f48b devfs: retire the unused DEVFS_DEL_VNLOCKED flag 2022-09-14 22:47:53 +00:00
Mateusz Guzik
a755fb921e vfs: retire the V_MNTREF flag
Reviewed by:	kib, mckusick
Differential Revision:	https://reviews.freebsd.org/D36521
2022-09-14 18:16:36 +00:00
Mateusz Guzik
61a1d5dde2 vfs: stop using the V_MNTREF flag
Reviewed by:	kib, mckusick
Differential Revision:	https://reviews.freebsd.org/D36521
2022-09-14 18:16:23 +00:00
Mateusz Guzik
db5f85a4b2 ufs: stop using the V_MNTREF flag
Reviewed by:	kib, mckusick
Differential Revision:	https://reviews.freebsd.org/D36521
2022-09-14 18:16:07 +00:00
Mateusz Guzik
04f095a491 ufs: try to elide the interlock in ufs_itimes
Reviewed by:	kib, mckusick
Differential Revision:	https://reviews.freebsd.org/D36522
2022-09-14 18:12:03 +00:00
Mateusz Guzik
be931de6c9 ufs: always call ufs_itimes on close
While here dedup code with fifo.

Reviewed by:	kib, mckusick
Differential Revision:	https://reviews.freebsd.org/D36522
2022-09-14 18:11:40 +00:00
Konstantin Belousov
2eddd8ebf9 i386: explain the handshake between copyout_fast.s and page fault handler
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2022-09-14 18:47:57 +03:00
Konstantin Belousov
cbbf522795 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
2022-09-14 18:46:32 +03:00
Konstantin Belousov
49587b8fb4 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
2022-09-14 18:46:32 +03:00
Konstantin Belousov
fd25c62278 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
2022-09-14 18:46:32 +03:00
Konstantin Belousov
5313350374 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
2022-09-14 18:46:31 +03:00
Konstantin Belousov
7078e0e2c2 i386 double fault: %ebx printout was missed
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2022-09-14 18:46:31 +03:00
Gleb Smirnoff
15b73a2a14 ip_reass: use correct comparison in ipreass_callout()
Reported-by:	syzbot+55415dc73f9b89b87fce@syzkaller.appspotmail.com
2022-09-14 08:32:07 -07:00
Tetsuya Uemura
e2386f18ec 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
2022-09-14 07:34:15 -06:00
Mateusz Guzik
f7dc4a71da vfs: plug spurious error checks in namei
error is guaranteed 0 at that point
2022-09-13 23:18:30 +00:00
Jessica Clarke
100f79569d 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
2022-09-13 17:46:28 +01:00
Jessica Clarke
129028c79c 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
2022-09-13 17:46:21 +01:00
Jessica Clarke
80466455ad 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
2022-09-13 17:46:09 +01:00
Pavel Timofeev
d88dc1b0b9 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
2022-09-13 12:16:26 -04:00
Aleksandr Fedorov
0e6e2c4ef3 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
2022-09-13 17:20:41 +03:00
Richard Scheffenegger
bb1d472d79 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
2022-09-13 12:09:21 +02:00
Richard Scheffenegger
ea6d0de299 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
2022-09-13 12:07:06 +02:00
Doug Moore
4893472c9a 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
2022-09-13 01:11:47 -05:00
Adrian Chadd
633d178c63 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
2022-09-12 20:10:25 -07:00
Adrian Chadd
82302a49fd 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
2022-09-12 20:10:25 -07:00
Adrian Chadd
3d9bd82522 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
2022-09-12 20:10:25 -07:00
Adrian Chadd
f060362ade 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
2022-09-12 20:10:24 -07:00
Adrian Chadd
f05b3c9f47 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
2022-09-12 20:10:24 -07:00
Mateusz Guzik
b4137c9ed1 vfs: make NDVALIDATE private to vfs_lookup.c
it is not used elsewhere.
2022-09-12 22:50:48 +00:00
Navdeep Parhar
998eb37aca 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
2022-09-12 11:40:35 -07:00
Navdeep Parhar
df275ae509 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
2022-09-12 11:40:29 -07:00
Navdeep Parhar
c387ff0045 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
2022-09-12 11:40:25 -07:00
Dag-Erling Smørgrav
c198adf394 siftr: spell PFIL_PASS correctly.
Sponsored by:	NetApp
Sponsored by:	Klara Inc.
Differential Revision: https://reviews.freebsd.org/D36539
2022-09-12 19:20:10 +02:00
Adrian Chadd
7d0e83c60b 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
2022-09-11 19:36:42 -07:00
Vladimir Kondratyev
975407b1d8 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
2022-09-11 13:21:16 +03:00
Alan Cox
8d7ee2047c 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
2022-09-11 01:19:22 -05:00
Allan Jude
b20ec58669 vfs.typenumhash: fix sysctl description
a string continuation was missing a space, resulting in two works
being smushed together.

Sponsored by:	Klara, Inc.
2022-09-10 22:47:51 +00:00
Mateusz Guzik
1760a6950a Fixup build after recent getsock changes 2022-09-10 20:40:43 +00:00
Mateusz Guzik
3be2225fc8 Remove fflag argument from getsock_cap
Interested callers can obtain in other own easily enough
and there is no reason to branch on it.
2022-09-10 19:47:47 +00:00
Mateusz Guzik
3212ad15ab Add getsock
All but one consumers of getsock_cap only pass 4 arguments.
Take advantage of it.
2022-09-10 19:47:47 +00:00
Mateusz Guzik
a2ad70923f Add branch prediction hints to getsock_cap 2022-09-10 19:41:52 +00:00
Gordon Bergling
13604a80f7 iscsi(4): Remove a double word in a source code comment
- s/to to/to/

MFC after:	3 days
2022-09-10 13:04:42 +02:00
Gordon Bergling
a5beac3992 isp: Remove a double word in the driver manual
- s/to to/to/

MFC after:	3 days
2022-09-10 13:03:38 +02:00
Gordon Bergling
bcb2341c7d netinet6: Remove a double word in a source code comment
- s/to to/to/

MFC after:	3 days
2022-09-10 13:01:44 +02:00
Gordon Bergling
eb2f7d9a5a ocs_fc(4): Remove double words in source code comments
- s/to to/to/

MFC after:	3 days
2022-09-10 13:00:23 +02:00
Peter Jeremy
c02d4224c8
arm64: allwinner: aw_r_intc: Add A64 and H6 compatible.
This fixes booting the Pine H64 with a 5.13 DTS.

Suggested by:	manu@
2022-09-10 20:36:22 +10:00
Gleb Smirnoff
29b4b63c59 ip_reass: optimize ipreass_drain_vnet()
- Call ipreass_reschedule() only once per slot [1]
- Aggregate stats and update them once

Suggested by:	jtl [1]
2022-09-10 02:17:15 -07:00
Gleb Smirnoff
13018bfae8 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.
2022-09-10 02:11:39 -07:00
Bjoern A. Zeeb
800aa9cd3d 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 c994352a88.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2022-09-09 18:40:23 +00:00
Mateusz Guzik
e5d08f4729 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")
2022-09-09 17:16:58 +00:00
Mateusz Guzik
6b94546a7e pf: partially depessimize pf_match_translation
Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-09-09 17:03:55 +00:00
Bjoern A. Zeeb
866e021654 rtw89: import firmware for Realtek's rtw89 supported chipsets.
Import the most recent versions of the firmware images for the
rtw89 driver.

This is based on linux-firmware at 2f2f0181581d3e35bfdb9fc65f609ee9d3fbaeb7.

The license of the firmware matches the previously added rtw88(4) firmware
and you can find a copy in sys/contrib/dev/rtw89fw/LICENCE.rtlwifi_firmware.txt.

Add build infrastructure to create the .ko files but do not yet hook
it up to the build until all parts are in the tree.

Approved by:	core.11 (imp) [2022-03-27]
MFC after:	6 weeks
2022-09-09 16:32:17 +00:00
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
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
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 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
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
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
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
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
Mateusz Guzik
3e0b486886 vfs: flip a condition around in kern_statat
error tends to be 0.
2022-09-07 20:06:24 +00:00
Neel Chauhan
c4e591c9ab snd_hda: Remove duplicate erroneous HDA_INTEL_ALLKPS line
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D36483
2022-09-07 11:17:26 -07:00
Neel Chauhan
22ecfc580b snd_hda: Add the full Intel AlderLake HD Audio PCI IDs
This is based off the Linux file sound/hda/intel-dsp-config.c.

Reviewed by:		imp (src)
Tested on:		HP Spectre x360 16-f0023dx
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D36476
2022-09-07 09:03:56 -07:00
Wei Hu
0af5a0cd27 Hyper-V: storvsc: relax a kassert check
On ARM64 this kassert check could cause unnecessary panic.

Sponsored by:	Microsoft
2022-09-07 15:06:54 +00:00
Gordon Bergling
dfd3777085 net80211(4): Bring back an accidently reverted grammar correction
- s/that that/that/

Reported by:	se, danfe
MFC after:	3 days
2022-09-07 13:35:45 +02:00
Gordon Bergling
d78a907665 net80211(4): Correct a grammar mistake in a source code comment
- s/the/be the/
- s/Mhz/MHz/
- s/it'll/it will/

Reported by:	bz, danfe
MFC after:	3 days
2022-09-07 13:13:54 +02:00
Mateusz Guzik
14c9a2dbfb net: retire PFIL_FWD
It is now unused and not having it allows further clean ups.

Reviewed by:	cy, glebius, kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36452
2022-09-07 10:04:31 +00:00
Mateusz Guzik
223a73a1c4 net: remove stale altq_input reference
Code setting it was removed in:
commit 325fab802e
Author: Eric van Gyzen <vangyzen@FreeBSD.org>
Date:   Tue Dec 4 23:46:43 2018 +0000

    altq: remove ALTQ3_COMPAT code

Reviewed by:	glebius, kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36471
2022-09-07 10:03:12 +00:00
Emmanuel Vadot
653c36179d vmm: Remove unneeded variable maxcpus
Reported by:	FreeBSD User <freebsd@walstatt-de.de>
Fixes:	a5a918b7a9 ("vmm: permit some IPIs to be handled by userspace")
2022-09-07 11:41:16 +02:00
Albert Jakieła
06c30b2c76 mvneta: Use clkgen API on armv7
With addition of clkgen devices to the Armada38x we no longer
need to rely on get_tclk() to get the device frequency.
Leave it as a fallback, just in case.

Reviewed by:	manu
Obtained from:	Semihalf
Differential Revision: https://reviews.freebsd.org/D36465
2022-09-07 09:44:59 +02:00
Albert Jakieła
59c2babcab mv_twsi: Use the clock API on armv7
With the addition of clkgen devices to the Armada38x, there is
no longer any need to use the get_tclk() hack.

Reviewed by:	manu
Obtained from:	Semihalf
Differential Revision: https://reviews.freebsd.org/D36456
2022-09-07 09:44:59 +02:00
Albert Jakieła
4a4c6dc9a3 Add ARMADA38X gateclk control
This patch introduces basic gate control driver for Armada38x SoC.
Each gate controls coreclk output to a given peripheral.

Reviewed by:	manu
Obtained from:	Semihalf
Differential Revision: https://reviews.freebsd.org/D36455
2022-09-07 09:44:58 +02:00
Albert Jakieła
07c5be33f1 Add ARMADA38X clkgen driver
This patch introduces clkgen driver for Armada38x SoCs.
Clock topology consists of single coreclk which supplies
clock signal to CPU cores and peripherials.

Reviewed by:	manu
Obtained from:	Semihalf
Differential Revision: https://reviews.freebsd.org/D36453
2022-09-07 09:44:58 +02:00
Mateusz Kozyra
299b6c9cb1 uart_bus_acpi: Read clock frequency from bus
It is stored in the clock-frequency property.
In case of failure, fallback to the harcoded value stored in the
compat data.
Also, while here improve style.
Tested on LS1046ARDB and x86 PC.

Reviewed by:	mw
Obtained from:	Semihalf
Differential Revision: https://reviews.freebsd.org/D36326
2022-09-07 09:44:58 +02:00
Corvin Köhne
a5a918b7a9 vmm: permit some IPIs to be handled by userspace
Add VM_EXITCODE_IPI to permit returning unhandled IPIs to userland.
INIT and Startup IPIs are now returned to userland. Due to backward
compatibility reasons, a new capability is added for enabling
VM_EXITCODE_IPI.

MFC after:              2 weeks
Differential Revision:  https://reviews.freebsd.org/D35623
Sponsored by:           Beckhoff Automation GmbH & Co. KG
2022-09-07 09:07:03 +02:00
Gleb Smirnoff
aa74cc6d6f divert(4): do not depend on ipfw(4)
Although originally socket was intended to use with ipfw(4) only, now
it also can be used with pf(4).  On a kernel without packet filters,
it still can be used to inject traffic.
2022-09-06 20:54:57 -07:00
Gleb Smirnoff
999c9fd733 divert(4): don't check for CSUM_SCTP without INET
This compiles, but actually is a dead code.

Noticed by:	bz
Fixes:		e72c522858
2022-09-06 20:54:57 -07:00
Cy Schubert
1f7a710ab3 ipfilter: Remove unused ioctl
The SIOCSTAT1 ioctl is only used in ip_auth and is unused in ip_state.
The ip_state version was likely added to support a new statistic yet
to be developed in ipfstat(8) or for some sample userspace application
(similar in fashion to the sample provided for authentication rules).
There is no need to report individual state hash table bucket lengths
to any future userspace application.

If needed for any future debugging purposes a DTrace probe would be a
better vehicle.

This unused ioctl in ip_stat results in a panic.

PR:		266124
Reported by:	Robert Morris <rtm@lcs.mit.edu>
MFC after:	3 days
2022-09-06 19:57:05 -07:00
Cy Schubert
3e81ef62f9 ipfilter: Remove IPL_SELECT
IPL_SELECT was used for HP-UX >= 11.11 only. Remove this de trop code.

MFC after:	3 days
2022-09-06 19:56:35 -07:00
Alexander Motin
0586be48a9 CTL: Validate IOCTL parameters.
It was possible to cause kernel panic by passing too large args_len
or non-NULL result_nvl.

Though since the /dev/cam/ctl device is accessible only by root and
used only by limited number of tools it was not a big problem.

PR:	266115
PR:	266136
Reported by:	Robert Morris <rtm@lcs.mit.edu>
MFC after:	1 week
2022-09-06 21:58:27 -04:00
Warner Losh
0fddee6d1f arm64: machdep.c fix two typos
Sponsored by:		Netflix
2022-09-06 18:09:43 -06:00
Andrew Turner
a8fac0ce78 Decode the arm64 ID_AA64ISAR1_EL1 register
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35627
2022-09-06 16:49:36 +01:00
Mateusz Guzik
69ce6ae21a pf: make pfsync_state_import appease an assert in pf_free_state
The newly created state failed to be inserted anywhere. This follows
other places.

Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-09-06 15:00:46 +00:00
Andrew Turner
7c4cfece6b 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
2022-09-06 13:11:04 +01:00
Hans Petter Selasky
0e391a3197 ktls: Add missing NULL pointer check for TLS RX hardware offload.
The send tag pointer may be NULL when the ktls_reset_receive_tag()
function is invoked. Add check for this.

Reviewed by:	gallatin @
Sponsored by:	NVIDIA Networking
2022-09-06 13:49:23 +02:00
Ed Maste
dda082e009 qat: make function definition match prototype
LacSymCb_CallbacksRegister declared with a (void) argument list but was
defined with ().  With Clang 15 this produced a warning.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2022-09-05 21:24:58 -04:00
Bjoern A. Zeeb
e3a0b1202b 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 e674ddec0b
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
MFC after:	3 days
2022-09-05 21:03:03 +00:00
Bjoern A. Zeeb
ec190d9150 LinuxKPI: 80211: improve linuxkpi_ieee80211_get_tid()
Continue what was started in 26a3694833
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
MFC after:	3 days
2022-09-05 20:57:17 +00:00
Gleb Smirnoff
ddc0ed5836 loop(4): make interface methods static 2022-09-05 10:29:10 -07:00
Gleb Smirnoff
0773b44e82 tcp: tcp6_connect() requires net epoch
PR:			262663
Reported & tested by:	dch
MFC after:		2 weeks
2022-09-05 10:19:11 -07:00
Gordon Bergling
94466c432e Revert "usb: Remove a double words in a source code comments"
This reverts commit 8ca67bf127.

The original comment was correct; changing it loses a key part.

Reported by:	jrtc27
2022-09-05 15:45:35 +02:00
Mateusz Guzik
9503043f6e pf: stop using PFIL_FWD
It is only there to check if the packet was reassembled,
relevant if we are forwarding. But if the packet originated
locally it could not have been reassembled, thus the flag is
redundant.

Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-09-05 13:06:12 +00:00
Alexander V. Chernikov
db98b42050 netinet6: call lle_event eventhandler after updating state
Fix nd6_na_input() eventhandler call: run eventhandler after lle
 state transition.

Old behaviour (as seen by event handler):
 * fe80::5054:ff:fe8c:63e9 dev vtnet0 lladdr 52:54:00:8c:63:e9 INCOMPLETE
New behaviour:
* fe80::5054:ff:fe8c:63e9 dev vtnet0 lladdr 52:54:00:8c:63:e9 REACHABLE

MFC after: 2 weeks
2022-09-05 13:01:27 +00:00
Mateusz Guzik
69413598d2 signal: use proc_iterate to save on work
Most notably poudriere performs kill -9 -1 in jails for each port
being built. This reduces the scan from hundrends of processes to
literally 1.

Reviewed by:	jamie, markj
Differential Revision:	https://reviews.freebsd.org/D34522
2022-09-05 11:54:47 +00:00
Mateusz Guzik
5ecb5444aa jail: add process linkage
It allows iteration over processes belonging to given jail instead of
having to walk the entire allproc list.

Note the iteration can miss processes which remains bug-compatible
with previous code.

Reviewed by:	jamie (previous version), markj (previous version)
Differential Revision:	https://reviews.freebsd.org/D34522
2022-09-05 11:54:47 +00:00
Alexander V. Chernikov
4bccbf03d8 routing: allow logging framework to be used outside of the subsystem
MFC after:	2 weeks
2022-09-05 10:44:27 +00:00
Rick Macklem
33721eb991 nfscl: Allow "nolockd" to work for NFSv4 mounts
Commit 40ada74ee1 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.

MFC after:	2 weeks
2022-09-04 13:09:33 -07:00
Gordon Bergling
6e9e7b0583 bxe(4): Grammar fix for a source code comment
- s/that that/that the/

MFC after:	3 days
2022-09-04 17:43:15 +02:00
Gordon Bergling
8ca67bf127 usb: Remove a double words in a source code comments
- s/that that/that/

MFC after:	3 days
2022-09-04 17:40:25 +02:00
Gordon Bergling
0721306c2b msdosfs(5): Remove a double word in a source code comment
- s/that that/that/

MFC after:	3 days
2022-09-04 17:34:52 +02:00
Gordon Bergling
d744e271eb kern: Remove a double word in a source code comment
- s/that that/that/

MFC after:	3 days
2022-09-04 17:32:10 +02:00
Gordon Bergling
8a153724cd bpf(3): Grammar fix for a source code comment
- s/that that/that the/

MFC after:	3 days
2022-09-04 17:30:05 +02:00
Gordon Bergling
630c517745 hyperv: Fix a typo in a source code comment
- s/Unsupport/Unsupported/

MFC after:	3 days
2022-09-04 17:19:40 +02:00
Gordon Bergling
79d939126a qcom_qup: Remove a double word in a source code comment
- s/the the/the/

MFC after:	3 days
2022-09-04 13:54:40 +02:00
Gordon Bergling
8f538e2766 net80211(4): Remove a double word in a source code comment
- s/the the/the/

MFC after:	3 days
2022-09-04 13:53:17 +02:00
Gordon Bergling
d81e1b4429 tmpfs(5): Remove a double word in a source code comment
- s/the the/the/

MFC after:	3 days
2022-09-04 13:51:50 +02:00
Gordon Bergling
26d6e38604 hyperv: Remove a double word in a source code comment
- s/the the/the/

MFC after:	3 days
2022-09-04 13:49:47 +02:00
Gordon Bergling
d6f9a3c0a8 mps(4): Remove a double word in a source code comment
- s/the the/the/

MFC after:	3 days
2022-09-04 13:48:21 +02:00
Gordon Bergling
2f9de90b22 mpr(4): Remove a double word in a source code comment
- s/the the/the/

MFC after:	3 days
2022-09-04 13:46:44 +02:00
Gordon Bergling
f76a02886c hid: Remove a double word in a source code comment
- s/the the/the/

MFC after:	3 days
2022-09-04 13:45:50 +02:00
Gordon Bergling
591a9b5ea3 netmap(4): Remove a double word in a source code comment
- s/the the/the/

MFC after:	3 days
2022-09-04 13:42:48 +02:00
Gordon Bergling
8cf905e5fa etherswitch(4): Remove a double word in a source code comment
- s/the the/the/

MFC after:	3 days
2022-09-04 13:41:44 +02:00
Gordon Bergling
160d76986e arm64: Remove a double word in a source code comment
- s/the the/the/

MFC after:	3 days
2022-09-04 13:40:15 +02:00
Gordon Bergling
9755e244c9 x86: Correct a typo in source code comment
- s/occured/occurred/

MFC after:	3 days
2022-09-04 13:36:53 +02:00
Gordon Bergling
d653487430 i386: Correct a typo in source code comment
- s/occured/occurred/

MFC after:	3 days
2022-09-04 13:35:34 +02:00
Gordon Bergling
2fae7b811f iwm(4): Correct some typos in source code comments
- s/occured/occurred/

MFC after:	3 days
2022-09-04 13:33:59 +02:00
Gordon Bergling
01e7018587 powerpc: Correct some typos in source code comments
- s/occured/occurred/

MFC after:	3 days
2022-09-04 13:32:13 +02:00
Gordon Bergling
f2e13c27bb vmci(4): Correct some typos in source code comments
- s/occured/occurred/

MFC after:	3 days
2022-09-04 13:28:47 +02:00
Gordon Bergling
49a033d8cf kern: Correct some typos in source code comments
- s/occured/occurred/
- s/the the/the/

MFC after:	3 days
2022-09-04 13:00:01 +02:00
Gordon Bergling
347b1991b0 netdump(4): Correct a typo in source code comment
- s/occured/occurred/

MFC after:	3 days
2022-09-04 12:59:29 +02:00
Gordon Bergling
c3679af313 tcp_rack: Correct some typos in source code comments
- s/occured/occurred/

MFC after:	3 days
2022-09-04 12:58:13 +02:00
Gordon Bergling
893f36b7f1 netinet: Correct a typo in source code comment
- s/occured/occurred/

MFC after:	3 days
2022-09-04 12:57:12 +02:00
Gordon Bergling
b197d4b893 qat(4): Correct some typos in source code comments
- s/occured/occurred/
- s/the the/the/

MFC after:	3 days
2022-09-04 12:51:22 +02:00
Gordon Bergling
88cdf609e4 bhnd(4): Correct some typos in source code comments
- s/occured/occurred/

While here, fix some whitespace issues.

MFC after:	3 days
2022-09-04 12:49:42 +02:00
Gordon Bergling
d07a501876 tcp_hpts: Correct some typos in source code comments
- s/occured/occurred/
- s/the the/the/

MFC after:	3 days
2022-09-04 12:47:49 +02:00
Gordon Bergling
4d89e2018c netpfil: Correct some typos in source code comments
- s/occured/occurred/
- s/the the/the/

MFC after:	3 days
2022-09-04 12:46:05 +02:00
Gordon Bergling
dc79640e92 iwn(4): Correct a typo in a kernel error message
- s/settting/setting/

MFC after:	5 days
2022-09-04 12:23:27 +02:00
Gordon Bergling
4e50737fa8 sound(4): Fix a typo in a source code comment
- s/availavle/available/

MFC after:	3 days
2022-09-04 11:23:34 +02:00
Bjoern A. Zeeb
a486fbbd78 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)
MFC after:	4 days
2022-09-03 23:40:51 +00:00
Bjoern A. Zeeb
527687a9e3 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
MFC after:	4 days
2022-09-03 23:11:05 +00:00
Bjoern A. Zeeb
b35f6cd066 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
MFC after:	4 days
2022-09-03 22:51:16 +00:00
Bjoern A. Zeeb
570773d68c mgb: quiten -Wunused-function with LINT builds
As the function itself seems to be helpful don't remove the code but
change the #ifdef DEBUG to #if 0 to avoid:
  warning: unused function 'mgb_dump_some_stats' [-Wunused-function]
with LINT builds.
2022-09-03 22:47:19 +00:00
Bjoern A. Zeeb
fb47649ebc 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
MFC after:	5 days
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D36410
2022-09-03 21:18:40 +00:00
Kirk McKusick
82ee4e1c42 Updates to UFS/FFS superblock integrity checks when reading a superblock.
Yet more updates based on ways Peter Holm found to corrupt UFS
superblocks in ways that could cause kernel hangs or crashes.

No legitimate superblocks should fail as a result of these changes.

Reported by:  Peter Holm
Tested by:    Peter Holm
Sponsored by: The FreeBSD Foundation
2022-09-03 14:11:38 -07:00
Bjoern A. Zeeb
c9b7e9df18 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
MFC after:	5 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D36409
2022-09-03 21:04:13 +00:00
Bjoern A. Zeeb
8def06d5af 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)
MFC after:	5 days
Differential Revision: https://reviews.freebsd.org/D36411
2022-09-03 20:59:30 +00:00
Gordon Bergling
e1a40dd294 mlx5en(4): Correct a typo in a kernel error message
- s/ouput/output

MFC after:	5 days
2022-09-03 19:29:33 +02:00
Gordon Bergling
fd2235ffdc netpfil: Fix a typo in a source code comment
- s/intergers/integers/

While here, fix some whitespace issues.

MFC after:	3 days
2022-09-03 19:18:54 +02:00
Gordon Bergling
b0e86eed27 ltc430x(4): Fix a typo in a source code comment
- s/overriden/overridden/

MFC after:	3 days
2022-09-03 15:43:05 +02:00
Gordon Bergling
ddf38e0204 bce(4): Fix a typo in a source code comment
- s/overriden/overridden/

MFC after:	3 days
2022-09-03 15:39:51 +02:00
Gordon Bergling
de47bf0d52 bge(4): Fix a typo in a source code comment
- s/overriden/overridden/

MFC after:	3 days
2022-09-03 15:38:26 +02:00
Gordon Bergling
f93ef3ff06 bxe(4): Fix two typos in source code comments
- s/overriden/overridden/

MFC after:	3 days
2022-09-03 15:36:00 +02:00
Gordon Bergling
b55a0762fc malo(4): Fix a typo in asource code comment
- s/overriden/overridden/

MFC after:	3 days
2022-09-03 15:34:27 +02:00
Gordon Bergling
cc280cac34 sdhci(4): Fix a typo in asource code comment
- s/overriden/overridden/

MFC after:	3 days
2022-09-03 15:31:59 +02:00
Gordon Bergling
ac34f366cc sound(4): Fix a typo in asource code comment
- s/overriden/overridden/

MFC after:	3 days
2022-09-03 15:30:39 +02:00
Gordon Bergling
6b49770088 pci(4): Fix a typo in asource code comment
- s/overriden/overridden/

MFC after:	3 days
2022-09-03 15:28:05 +02:00
Gordon Bergling
2b7d656f17 kern: Fix a typo in asource code comment
- s/overriden/overridden/

MFC after:	3 days
2022-09-03 15:26:55 +02:00
Gordon Bergling
f9a9fe46dc ath(4): Fix two typos in source code comments
- s/overriden/overridden/

MFC after:	3 days
2022-09-03 15:24:48 +02:00
Gordon Bergling
d0ddb5aaca usb: Fix two typos in source code comments
- s/overriden/overridden/

MFC after:	3 days
2022-09-03 15:22:42 +02:00
Gordon Bergling
fa52f9dc9a tcp_rack: Fix two typos in source code comments
- s/overriden/overridden/

MFC after:	3 days
2022-09-03 15:05:42 +02:00
Gordon Bergling
028ecc7aa1 netisr(9): Fix a typo in a source code comment
- s/overriden/overridden/

MFC after:	3 days
2022-09-03 15:04:15 +02:00
Gordon Bergling
310d144a83 isp(4): Fix two typos in source code comments
- s/overriden/overridden/

MFC after:	3 days
2022-09-03 14:54:14 +02:00
Gordon Bergling
05e1ac3cbf impi(4): Fix two typos in source code comments
- s/overriden/overridden/

MFC after:	3 days
2022-09-03 14:52:44 +02:00
John Baldwin
e120d3b2d4 qat: Move CWARNFLAGS down so it works.
CWARNFLAGS must be added to after including kern.mk, otherwise all the
warnings set in kern.mk are ignored.  This is why the
-Wmissing-prototypes warnings were not seen previously.

While here, drop -Wno-pointer-sign as it is doesn't seem to be needed,
but add -Wno-cast-qual to silence warnings for various casts of const
pointers to non-const pointers.

Reviewed by:	MichalX.Gulbicki_intel.com, markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D36332
2022-09-02 14:52:55 -07:00
John Baldwin
1c4c92f91b qat: Add #includes for missing prototypes.
This fixes numerous -Wmissing-prototypes warnings when that warning
is enabled.

Reviewed by:	MichalX.Gulbicki_intel.com, markj
Sponsored by:	DARPA
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D36331
2022-09-02 14:51:54 -07:00
John Baldwin
50f1a377da qat: Add a prototype for icp_adf_is_dev_in_error.
Reviewed by:	MichalX.Gulbicki_intel.com, markj
Sponsored by:	DARPA
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D36330
2022-09-02 14:51:39 -07:00
John Baldwin
e3b17b5042 qat: Drop extraneous parentheses from some macro values.
This header duplicates a few #defines in "adf_cfg_strings.h".  The
latter header does not use the unneeded parentheses, but if a C file
includes both of these headers, clang raises an error because the macro
is redefined with a different value.

Reviewed by:	markj
Sponsored by:	DARPA
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D36329
2022-09-02 14:49:40 -07:00
Gleb Smirnoff
74ed2e8ab2 raw ip: fix regression with multicast and RSVP
With 61f7427f02 raw sockets protosw has wildcard pr_protocol.  Protocol
of a specific pcb is stored in inp_ip_p.

Reviewed by:		karels
Reported by:		karels
Differential revision:	https://reviews.freebsd.org/D36429
Fixes:			61f7427f02
2022-09-02 12:17:09 -07:00
Tijl Coosemans
cfdc649e45 i386 doreti: Fix calculation of stack frame size
Reviewed by:	kib
Fixes:		e8b2980e4a - i386 doreti: stop saving/restoring %ecx
2022-09-02 16:41:52 +02:00
Kornel Dulęba
e23ad9c4ba tpm: Fix entropy harvesting logic
Use a taskqueue instead of a callout.
Callout functions mustn't sleep, where as the TPM driver
uses a sx lock in order to serialize accesses to the device.
Since the entropy harvesting feature is not enabled by default,
this commit should not bring any functional changes to the GENERIC
kernel.

Approved by:	mw(mentor)
Sponsored by:	Stormshield
Obtained from:	Semihalf
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36412
2022-09-02 13:09:41 +02:00
Mathew McBride
2486b446db 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.

MFC after:	6 days
Sponsored by:	Traverse Technologies
Differential Revision: https://reviews.freebsd.org/D35837
2022-09-02 00:51:42 +00:00
Warner Losh
281a6ff273 acpi: Fix error message
Fix a formatting error from 195f794318

Fixes:		195f794318
Sponsored by:	Netflix
2022-09-01 11:35:45 -06:00
Alexander Motin
4e679d8aea hwpmc: Avoid touching MSR_DEBUGCTLMSR inside VMs.
At least KVM in Proxmox seems not happy about it.  Just to be safe
block it for all VMs, since it should just improve profile accuracy.

MFC after:	1 week
2022-09-01 13:23:11 -04:00
Warner Losh
991aef9795 acpi: Move some errors with RSDP and XSLT out from under bootverbose
Failure to map RSDP, XSLT and checksum failures are events that can't
happen unless something has gone wrong. As such, they should be reported
always, and not in bootverbose. This has been this way since it was
originally brought in to parse APIC tables.

Sponsored by:		Netflix
Reviewed by:		andrew
Differential Revision:	https://reviews.freebsd.org/D36406
2022-09-01 10:40:15 -06:00
Warner Losh
a14b26a6bd acpi: Unmap RSDP in more error cases
Add missing pmap_unmapbios() calls for when we return 0. Otherwise we
can leave the table mapped when it is of no use.

Sponsored by:		Netflix
Reviewed by:		andrew
Differential Revision:	https://reviews.freebsd.org/D36405
2022-09-01 10:39:20 -06:00
Warner Losh
195f794318 acpi: arm64 doesn't support ACPI 1.0 RSDP, report when we see one
arm64 requires ACPI RSDP Revision 2.0 since it requires 64-bit physical
addresses. It is an error worth reporting if we have a RSDP pointer, but
it points to the wrong version.

Sponsored by:		Netflix
Reviewed by:		andrew
Differential Revision:	https://reviews.freebsd.org/D36404
2022-09-01 10:38:53 -06:00