Commit Graph

277070 Commits

Author SHA1 Message Date
Gordon Bergling
b131efe3e5 sh.1: Fix a mandoc warning
- new sentence, new line

MFC after:	3 days
2022-07-31 16:23:27 +02:00
Gordon Bergling
2bf1b9984f uhsoctl.1: Fix the man page date
- STYLE: normalizing date format to: August 12, 2009

MFC after:	3 days
2022-07-31 12:27:10 +02:00
Gordon Bergling
98b610b506 uefi(8): Fix a typo in a source code comment
- s/intrrupt/interrupt/

MFC after:	3 days
2022-07-31 12:14:54 +02:00
Gordon Bergling
e24fd6d664 bluetooth(3): Fix a typo in a source code comment
- s/intrrupt/interrupt/

MFC after:	3 days
2022-07-31 12:13:13 +02:00
Gordon Bergling
37519e3ff3 qlnxe(4): Fix a typo in a source code comment
- s/pedning/pending/

MFC after:	3 days
2022-07-31 11:35:07 +02:00
Alexander V. Chernikov
27f107e1b4 routing: add debug printing helpers for rtentry and RTM* cmds.
MFC after:	2 weeks
2022-07-31 09:01:42 +00:00
Gordon Bergling
a4181a3ec3 mlx5en(4): Fix a typo in a source code comment
- s/functino/function/

MFC after:	3 days
2022-07-31 10:28:20 +02:00
Gordon Bergling
6c73ba1a28 cxgb(4): Fix a typo in a source code comment
- s/collissions/collisions/

Obtained from:	NetBSD
MFC after:	3 days
2022-07-31 09:59:03 +02:00
Kirk McKusick
b21582ee03 Add a flags parameter to the ffs_sbget() function that reads UFS superblocks.
Rather than trying to shoehorn flags into the requested superblock
address, create a separate flags parameter to the ffs_sbget()
function in sys/ufs/ffs/ffs_subr.c. The ffs_sbget() function is
used both in the kernel and in user-level utilities through export
to the sbget() function in the libufs(3) library (see sbget(3)
for details). The kernel uses ffs_sbget() when mounting UFS
filesystems, in the glabel(8) and gjournal(8) GEOM utilities,
and in the standalone library used when booting the system
from a UFS root filesystem.

The ffs_sbget() function reads the superblock located at the byte
offset specified by its sblockloc parameter. The value UFS_STDSB
may be specified for sblockloc to request that the standard
location for the superblock be read.

The two existing options are now flags:

UFS_NOHASHFAIL will note if the check hash is wrong but will still
   return the superblock. This is used by the bootstrap code to
   give the system a chance to come up so that fsck can be run to
   correct the problem.

UFS_NOMSG indicates that superblock inconsistency error messages
   should not be printed. It is used by programs like fsck that
   want to print their own error message and programs like glabel(8)
   that just want to know if a UFS filesystem exists on a partition.

One additional flag is added:

UFS_NOCSUM causes only the superblock itself to be returned, but does
   not read in any auxiliary data structures like the cylinder group
   summary information. It is used by clients like glabel(8) that
   just want to check for possible filesystem types. Using UFS_NOCSUM
   skips the superblock checks for csum data which allows superblocks
   that have corrupted csum data to be read and used.

The validate_sblock() function checks that the superblock has not
been corrupted in a way that can crash or hang the system. Unless
the UFS_NOMSG flag is specified, it will print out any errors that
it finds. Prior to this commit, validate_sblock() returned as soon
as it found an inconsistency so would print at most one message.
It now does all its checks so when UFS_NOMSG has not been specified
will print out everything that it finds inconsistent.

Sponsored by: The FreeBSD Foundation
2022-07-30 22:51:38 -07:00
Stefan Eßer
dc9e68ad01 calendar: clarify comment syntax in man page
The single line comment indicator '//' is only detected at the
beginning of a line or when following white space to allow URLs
in calendar entries.

MFC after:	3 days
2022-07-31 07:37:05 +02:00
Kirk McKusick
548045bf57 Updates to UFS/FFS superblock integrity checks when reading a superblock.
Reorder a few checks to ensure fields have been checked before
using them to check other fields.

Add eight new checks mostly checking for non-negative values.

No legitimate superblocks should fail as a result of these changes.
2022-07-30 22:35:11 -07:00
Bjoern A. Zeeb
13a7663c52 iwlwifi firmware: update to -73 / newer builds for 9xxx
Update iwlwifi 22000 firmware to -73 and rebuilds for 9000/9260.
Update the driver to accept the newer version.

Firmware was obtained from linux-firmware at
150864a4d73e8c448eb1e2c68e65f07635fe1a66.

Sponsored by:	The FreeBSD Foundation
MFC after:	23 days
2022-07-31 00:41:33 +00:00
Konstantin Belousov
4690e20eed tools/uma/smrstress: fix kthread exit
By convention, kernel threads must call kthread_exit() instead of
blindly returning from the thread function.  We have some safety measure
in fork_exit(), which checks for the P_KPROC p_flag and does
kthread_exit() for kernel thread that forgot to do it itself.

But this workaround only works for kernel threads belonging to the
kernel process.  If a kernel thread is attached to the normal process
with live userspace, and does not call kthread_exit(), then the
workaround is not activated, and for amd64 at least, the return from the
thread function/fork_exit() results in the return to userspace with the
copy of frame from the thread that did kthread_add().

Practically for smrstress, this destroys the user stack of the still
active frame in the other thread, which was the caller of kthread_add().

Fix it by adding kthread_exit() to the thread function.

Reported and tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D35999
2022-07-31 00:40:12 +03:00
Alan Cox
4670f90846 iommu_gas: Eliminate redundant parameters and push down lock acquisition
Since IOMMU map entries store a reference to the domain in which they
reside, there is no need to pass the domain to iommu_gas_free_entry(),
iommu_gas_free_space(), and iommu_gas_free_region().

Push down the acquisition and release of the IOMMU domain lock into
iommu_gas_free_space() and iommu_gas_free_region().

Both of these changes allow for simplifications in the callers of the
functions without really complicating the functions themselves.
Moreover, the latter change eliminates the direct use of the IOMMU
domain lock from the x86-specific DMAR code.

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35995
2022-07-30 14:28:48 -05:00
Alexander V. Chernikov
be1f485d7d sockets: add MSG_TRUNC flag handling for recvfrom()/recvmsg().
Implement Linux-variant of MSG_TRUNC input flag used in recv(), recvfrom() and recvmsg().
Posix defines MSG_TRUNC as an output flag, indicating packet/datagram truncation.
Linux extended it a while (~15+ years) ago to act as input flag,
resulting in returning the full packet size regarless of the input
buffer size.
It's a (relatively) popular pattern to do recvmsg( MSG_PEEK | MSG_TRUNC) to get the
packet size, allocate the buffer and issue another call to fetch the packet.
In particular, it's popular in userland netlink code, which is the primary driving factor of this change.

This commit implements the MSG_TRUNC support for SOCK_DGRAM sockets (udp, unix and all soreceive_generic() users).

PR:		kern/176322
Reviewed by:	pauamma(doc)
Differential Revision: https://reviews.freebsd.org/D35909
MFC after:	1 month
2022-07-30 18:21:51 +00:00
Bjoern A. Zeeb
d8dd6b329e LinuxKPI: 802.11: add missing linuxkpi_cfg80211_bss_flush()
Add the missing implementation of linuxkpi_cfg80211_bss_flush().
without this we get unresolved symbols and drivers won't load.

Reported by:	eduardo, Berislav Purgar (bpurgar gmail.com)
MFC after:	3 days
X-MFC-Squash:	b0f7376822
2022-07-30 14:23:14 +00:00
Warner Losh
206203f530 stand: Add a helper 'universe' target
Add a shortcut for invokging ${SRCTOP}/tools/boot/universe.sh by
creating a 'universe' target in src/stand. This will make it easier to
test out all the different combinations of boot loaders that we build.

Sponsored by:		Netflix
2022-07-30 05:01:47 -06:00
Warner Losh
2101541ff1 stand: Move quit command to common commands
Since both EFI and the future kboot will benefit from a 'quit' command,
move it from efi/loader/main.c to common/commands.c. In EFI this command
exits back to the boot loader (which will cause the next BootXXXX in the
BootOrder list to be attempted). In kboot, this will exit back to
whatever called loader.kboot. In uboot this will cause a reset (which
will restart uboot, not quite a simple exit, but will look similar)
and in OFW it will execute OF_exit which should return to the
openfirmware prompt.

Sponsored by:		Netflix
2022-07-30 04:48:35 -06:00
Justin Hibbits
43eebd0364 mpc85xx/pci: Conditionally reset PCI bridges
Sometimes we need to reset a PCIe bus, but sometimes it breaks the
downstream device(s).  Since, from my testing, this is only needed for
Radeon cards installed in the AmigaOne machines because the card was
already initialized by firmware, make the reset dependent on a device
hint (hint.pcib.X.reset=1).  With this, AmigaOne X5000 machines can have
other devices in the secondary PCIe slots.
2022-07-29 21:54:20 -04:00
Zhenlei Huang
150486f6a9 Introduce and use the NET_EPOCH_DRAIN_CALLBACKS() macro
Reviewed by:	melifao, kp
Differential Revision:	https://reviews.freebsd.org/D35968
2022-07-29 21:21:10 +02:00
Neel Chauhan
b07a48d4f3 vmd: Add 8086:A77F PCI ID for all Intel Raptor Lake SKUs
Summary:
This is based on the Linux kernel commit
922bfd001d1ac02111ebbe0524aaab6ca7925521.

Reviewed by:		mav (src)
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D35996
2022-07-29 11:17:20 -07:00
Kirk McKusick
58cb362676 Fix for 90e2971 that caused some geli commands to return the wrong exit status.
The reported problem is that some geli commands exit with a
success status when they should exit with a failed status.

The gctl_error() function is defined differently in the kernel
(in sys/geom/geom_ctl.c) versus in the geom user facilities (in
sbin/geom/misc/subr.c). In the kernel, calling gctl_error() causes
an error return to be set while in the user version it does not.
It was only by a quirk that had been added to the user geom return
processing that I "cleaned up" that the lack of the user implementaion
to set the error return showed up.

This patch adds the missing setting of the error code when calling
the user facility gctl_error().

Reported by:  Jenkins
Debugging by: Alan Somers
Debugging by: Cy Schubert
Debugging by: Li-Wen Hsu
2022-07-29 11:11:46 -07:00
Bjoern A. Zeeb
b0f7376822 LinuxKPI: 802.11 header updates
While working on new and updates to drivers more structs, fields,
functions, .. were found, had to be shuffled around, ..
Some of these are (so far still dummy) functions or not properly
typed fields.  The IEEE80211_HE_ constants are all still dummy.
This was msotly as a start to make new (out-of-tree) things compile.

Sponsored by:	The FreeBSD Foundation (minor VHT/chan width bits)
MFC after:	1 week
2022-07-29 15:23:49 +00:00
Bjoern A. Zeeb
89c32dafa5 LinuxKPI: skbuff: sort list header and add new (dummy) functions
While working on new and updates to drivers more skbuff changes
came up.  Sort out the list/prev/next header problem and add more
(so far dummy) functions needed.

MFC after:	1 week
2022-07-29 15:21:48 +00:00
Bjoern A. Zeeb
195733401f net80211: change order in ieee80211_vhtchanflags()
While 80P80 is less likely to be used, VHT160 (a single contiguous
width) is harder to acquire but also preferable so return that first.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:    adrian
Differential Revision: https://reviews.freebsd.org/D35977
2022-07-29 15:10:52 +00:00
Bjoern A. Zeeb
dc32c71339 net80211: VHT correct check/option in ieee80211_vht_adjust_channel()
In ieee80211_vht_adjust_channel() we have to check for all possible
IEEE80211_FVHT_VHT* options using the mask rather than just checking
for IEEE80211_FVHT_VHT;  ieee80211_vhtchanflags() (contrary to its
HT counterpart) only returns the "highest" flag nor or-ing them together
with the base flag.  For the moment this seems to make sense as with
more width options we'd add a pyramid.

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

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D35977
2022-07-29 15:10:45 +00:00
Bjoern A. Zeeb
656d0e8fa9 net80211: add VHT5G and VHT2G checks/return to media_status
Add the fields for VHT (2Ghz and 5Ghz) to report back by media_status
so we actually have a chance to get the right information.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D35977
2022-07-29 15:10:38 +00:00
Bjoern A. Zeeb
5c9f992919 net80211: improve DDB output.
Start adding more fields to DDB output related to VHT (11ac) and
mark COM, VAP, and STA more explicitly to make show all vaps /..
more readable.

Sponsored by:	The FreeBSD Foundaton
MFC after:	1 week
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D35977
2022-07-29 15:10:31 +00:00
Bjoern A. Zeeb
463d6125e7 net80211: correct IEEE80211_FEXT_BITS
Correct IEEE80211_FEXT_BITS adding the missed one and move the later
one further.  This will actually make VHT to show.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D35977
2022-07-29 15:10:24 +00:00
Bjoern A. Zeeb
a78be09e4d net80211: add more 802.11ac Element IDs
Add more Element IDs for VHT (11ac) to complete the current list
and we can use them if/as needed.

Sposnored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D35977
2022-07-29 15:10:15 +00:00
Bjoern A. Zeeb
c7a8db6a85 net80211: radiotap: add one more define for HE
Add one more define for HE radiotap used by a driver.

MFC after:	1 week
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D35977
2022-07-29 15:09:55 +00:00
Alan Somers
a043594c21 ip6(4): document IP_ORIGDSTADDR
The option was originally added in r313524, but with incomplete
documentation.

MFC after:	1 week
Reviewed by:	karels, gbe (manpages)
Differential Revision: https://reviews.freebsd.org/D35890
2022-07-29 09:06:19 -06:00
Doug Rabson
0c19c4db74 Move sort to runtime
Allows pkg bootstrap without having to install FreeBSD-utilities
2022-07-29 11:27:25 +01:00
Alfredo Dal'Ava Junior
0df5a06864 loader: fix powerpc64le ofw loader
This is similar to 5d48fb3b16.
With LLVM14 the .data.rel.ro ELF section appears after .data,
making loader behave erractly and kernel is not loaded.
This patch makes ensures the correct order.

Based on discussion at:
            https://github.com/llvm/llvm-project/issues/56306

MFC after:	1 day
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
2022-07-29 05:13:19 -03:00
Alan Cox
42736dc44d x86/iommu: Reduce DMAR lock contention
Replace the DMAR unit's tlb_flush TAILQ by a custom list implementation
that enables dmar_qi_task() to dequeue entries without holding the DMAR
lock.

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35951
2022-07-29 00:11:33 -05:00
Xin LI
19225e2aae ObsoleteFiles: Fix paths for removed manual pages. 2022-07-28 22:03:02 -07:00
Bjoern A. Zeeb
467d3e2e8a LinuxKPI 802.11/iwlwifi/rtw88: update KPI
Upgrade the argument of (*bss_info_changed) mac80211 ops function call
from 32 to 64 bit.
Add an extra argument to ieee80211_beacon_get_template().

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

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

Sponsored by:	The FreBSD Foundation
MFC after:	1 week
2022-07-28 23:39:03 +00:00
John Baldwin
ea8f128c7c pmap_mapdev: Consistently use vm_paddr_t for the first argument.
The devmap variants used vm_offset_t for some reason, and a few places
explicitly cast bus addresses to vm_offset_t.  (Probably those casts
along with similar casts for vm_size_t should just be removed and
instead permit the compiler to DTRT.)

Reviewed by:	markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35961
2022-07-28 15:55:10 -07:00
Warner Losh
9579540144 kboot: Make console raw when we start
Put the console into raw mode on startup. This allows the menus to work
as expected. Boot is now interruptable.

Note: Likely should restore the terminal settings on most exists.  It's
not clear the best way to do this, and most shells have an auto stty
sane anyway, so note it for future improvement.

Sponsored by:		Netflix
2022-07-28 15:35:42 -06:00
Warner Losh
963037786f kboot: implement stripped down termios
Implement a stripped down termios, obtained from various files in musl
and HOST_ or host_ prepended to most things and a few unavoidable style
tweaks. Only implements the bits of termios we need for the boot loader:
put the terminal into raw mode, restore terminal settings and speed
stuff.

Sponsored by:		Netflix
2022-07-28 15:35:42 -06:00
Warner Losh
54e6e0deb4 kboot: Implement host_ioctl
Sponsored by:		Netflix
2022-07-28 15:35:42 -06:00
Warner Losh
f56d7a73be kboot: Add host_exit and use it to implement exit()
Clients of libsa are expected to implement exit(). The current exit just
loops forever. It is better to really exit: when running as init that
will reboot the system. When not running as init, other programs can
recover (not that we support running as init, but when we do in the
future, this is still the rigtht thing).

Sponsored by: Netflix
2022-07-28 15:35:42 -06:00
Warner Losh
75cbdbc983 kboot: aarch64 support
Add support for aarch64. exec.c and ldscript are copied from the EFI
version with #ifdefs for the differences. Once complete, I'll refactor
them. host_syscall.S implements a generic system call. tramp.S is a
first attempt to create a tramoline that we can use to jump to the
aarch64 kernel. Add aarch64-specific startup and stat files as well.
exec.c tweaked slightly to avoid bringing in bi_load(), which will come
in later. Includes tweaks to stat due to name differences between names
on different Linux architectures.

Sponsored by:		Netflix
2022-07-28 15:35:42 -06:00
Warner Losh
a0c075229f kboot: Move conf.c up to top level
conf.c is the same now between powerpc64 and amd64, so move it up to
kboot. Move powerpc file formats defines to ppc64_elf_freebsd.c

Sponsored by:		Netflix
2022-07-28 15:35:42 -06:00
James Skon
13890d30f8 altq: improve pfctl config time for large numbers of queues
In the current implementation of altq_hfsc.c, whne new queues are being
added (by pfctl), each queue is added to the tail of the siblings linked
list under the parent queue.

On a system with many queues (50,000+) this leads to very long load
times at the insertion process must scan the entire list for every new
queue,

Since this list is unordered, this changes merely adds the new queue to
the head of the list rather than the tail.

Reviewed by:	kp
MFC after:	3 weeks
Sponsored by:	RG Nets
Differential Revision:	https://reviews.freebsd.org/D35964
2022-07-28 22:00:07 +02:00
Hans Petter Selasky
c019a1690b hidbus(4): Align refcount checks for hidbus_intr_start() and hidbus_intr_stop().
No functional change intended.

Discussed with:	wulf @
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-07-28 21:28:36 +02:00
Mark Johnston
828ea49deb riscv: Avoid passing invalid addresses to pmap_fault()
After the addition of SV48 support, VIRT_IS_VALID() did not exclude
addresses that are in the SV39 address space hole but not in the SV48
address space hole.  This can result in mishandling of accesses to that
range when in SV39 mode.

Fix the problem by modifying VIRT_IS_VALID() to use the runtime address
space bounds.  Then, if the address is invalid, and pcb_onfault is set,
give vm_fault_trap() a chance to veto the access instead of panicking.

PR:		265439
Reviewed by:	jhb
Reported and tested by:	Robert Morris <rtm@lcs.mit.edu>
Fixes:		31218f3209 ("riscv: Add support for enabling SV48 mode")
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35952
2022-07-28 14:33:39 -04:00
Brooks Davis
0c8ff61ee1 src.libnames.mk: NEED/WANT_COMPAT+static support
Look in _LIB_OBJTOP for all static libraries not just INTERNALLIBs. In
normal operation this is a no-op, but improves the consistency of this
file.

Reviewed by:	imp, jhb
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D35822
2022-07-28 18:55:01 +01:00
Warner Losh
6feb6b4ffc ncal: LT is the country code for Lithuania
PR: 265479
MFC After: 3 days
2022-07-28 11:35:50 -06:00
John Hood
60b92ba932 /usr/sbin/pkg: don't sleep on fetch failure
PR:	263458
2022-07-28 17:55:13 +02:00