]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agoLinuxKPI: 802.11: remove special handling for (*ic_scan_curchan)
Bjoern A. Zeeb [Thu, 24 Mar 2022 17:32:07 +0000 (17:32 +0000)]
LinuxKPI: 802.11: remove special handling for (*ic_scan_curchan)

Remove the originally disabling of (*ic_scan_curchan), which for iwlwifi
was not needed.  The condition always only was approximate.

A set IEEE80211_FEXT_SCAN_OFFLOAD will still prevent net80211 from sending
probe_reqs if handled by driver/firmware.
ic_scan_curchan will re-arm the timer to switch channels for drivers which
need it (e.g., rtw88, but that again is a NOP for iwlwifi).

So enabling ic_scan_curchan should not have further side effects for iwlwifi
but allow other drivers to work better.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoLinuxKPI: 802.11: check IEEE80211_FEXT_SCAN_OFFLOAD on vap
Bjoern A. Zeeb [Thu, 24 Mar 2022 17:24:47 +0000 (17:24 +0000)]
LinuxKPI: 802.11: check IEEE80211_FEXT_SCAN_OFFLOAD on vap

When checking for IEEE80211_FEXT_SCAN_OFFLOAD, do so on the vap rather
than ic.  This brings us in line with what net80211 does.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoLinuxKPI: 802.11: make lkpi_ic_set_channel() unconditional
Bjoern A. Zeeb [Thu, 24 Mar 2022 16:51:02 +0000 (16:51 +0000)]
LinuxKPI: 802.11: make lkpi_ic_set_channel() unconditional

For (*config)() based drivers not using chanctx we need to use
ic_set_channel() to switch channels.  So far this was disabled
based on scanning flags (as swscan is one of the initial use cases
for this function).  Now make it only dependent on (*config)()
for the moment to save us the work if (*config)() is not supported.

For iwlwifi (*config)() is a NOP so no functional changes there
but for other drivers such as rtw88 this will allow us to scan and
set the channel (which helps to receive on channels other than 1).

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agokbd: replace vestigial spl calls with Giant assertions
Ed Maste [Tue, 22 Mar 2022 17:48:43 +0000 (13:48 -0400)]
kbd: replace vestigial spl calls with Giant assertions

The keyboard driver was initially protected via spl* interrupt priority
calls but (as part of a comprehensive effort) migrated to use the Giant
lock (mutex).

The spl calls left behind became NOPs but they can be confusing as they
have no bearing on the actual mutual exclusion that is now present.

Remove them from kbd and add assertions that Giant is held.  markj notes
that there is conflation between the "bus topo" lock (which is Giant
under the hood) and Giant.  The assertions could either be addressed as
a small item along with bus topology locking work or they'll be removed
if kbd is decoupled from Giant.

PR: 206680
Reviewed by: markj
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34645

2 years agoLinuxKPI: 802.11: use cfg80211_chandef_create()
Bjoern A. Zeeb [Thu, 24 Mar 2022 15:43:22 +0000 (15:43 +0000)]
LinuxKPI: 802.11: use cfg80211_chandef_create()

Rather than manually setting up a chandef and then effectively forcing
a memcpy, use cfg80211_chandef_create() to do the work for us entirely.
This works here as we do not store the resulting chandef separately
for other use.

While here remove a duplicate assignment in cfg80211_chandef_create().

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoLinuxKPI: 802.11: improve lkpi_80211_mo_sta_state() for non (*sta_state)
Bjoern A. Zeeb [Thu, 24 Mar 2022 15:34:57 +0000 (15:34 +0000)]
LinuxKPI: 802.11: improve lkpi_80211_mo_sta_state() for non (*sta_state)

If a driver does not support (*sta_state)() we internally in
lkpi_80211_mo_sta_state() fall back to using (*sta_add/*sta_remove)().
In that case add tracking of both added_to_drv and state fields for the
lsta so that our state machine keeps working and assertions do not fire.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agobhyve: Do not remove guest physical addresses from IOMMU host domain
Bjoern A. Zeeb [Fri, 18 Mar 2022 20:39:06 +0000 (20:39 +0000)]
bhyve: Do not remove guest physical addresses from IOMMU host domain

This permits I/O devices on the host to directly access wired memory
dedicated to guests using passthru devices.  Note that wired memory
belonging to guests that do not use passthru devices has always been
accessible by I/O devices on the host.

bhyve maps guest physical addresses into the user address space of
the bhyve process by mmap'ing /dev/vmm/<vmname>.  Device models pass
pointers derived from this mapping directly to system calls such as
preadv() to minimize copies when emulating DMA.  If the backing store
for a device model is a raw host device (e.g. when exporting a raw disk
device such as /dev/ada<n> as a drive in the guest), the host device
driver (e.g. ahci for /dev/ada<n>) can itself use DMA on the host
directly to the guest's memory.  However, if the guest's memory is
not present in the host IOMMU domain, these DMA requests by the host
device will fail without raising an error visible to the host device
driver or to the guest resulting in non-working I/O in the guest.

It is unclear why guest addresses were removed from the IOMMU host domain
initially, especially only for VM's with a passthru device as the
host IOMMU domain does not affect the permissions of passthru devices,
only devices on the host.

A considered alternative was using bounce buffers instead (D34535
is a proof of concept), but that adds additional overhead for unclear
benefit.

This solves a long-standing problem when using passthru devices and
physical disks in the same VM.

Thanks to: grehan (patience and help)
Thanks to: jhb (for improving the commit message)
PR: 260178
Reviewed by: grehan, jhb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D34607

2 years agoLinuxKPI: allow bsddriver name to be set for PCI
Bjoern A. Zeeb [Thu, 24 Mar 2022 01:45:36 +0000 (01:45 +0000)]
LinuxKPI: allow bsddriver name to be set for PCI

Allow a driver to overwrite the bsddriver name (we use for pci and
for wlan parent devices).  This allows us to to set
.bsddriver.name in struct pci_driver passed to module_pci_driver()
and with that set the BSD driver name while retaining the Linux .name
one.

This is helpful for divers which have different parts depending on
chipset and with that would change driver names which is highly
confusing especially for configuration.   One example is an upcoming
rtw88 driver which would be rtw_8822be or rtw_8822ce depending on
chipset.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste, hselasky
Differential Revision: https://reviews.freebsd.org/D34653

2 years agovfs: hoist trailing slash handling out of the loop
Mateusz Guzik [Thu, 24 Mar 2022 13:17:31 +0000 (13:17 +0000)]
vfs: hoist trailing slash handling out of the loop

2 years agoriscv: fix riscv64sf build
Piotr Kubaj [Thu, 24 Mar 2022 14:24:21 +0000 (15:24 +0100)]
riscv: fix riscv64sf build

The library needs to have sf suffix cut off.

MFC after: 3 days
X-MFC with: 3781e77995e9b81afcbf7b3dc84b33b864c48794
Differential revision: https://reviews.freebsd.org/D34561
Reviewed by: dim

2 years agovfs: factor symlink traversal out of namei
Mateusz Guzik [Thu, 24 Mar 2022 12:57:30 +0000 (12:57 +0000)]
vfs: factor symlink traversal out of namei

The intent down the road is to eliminate the loop to begin with,
pushing traversal down to vfs_lookup, all while not allocating the
extra buffer.

2 years agovfs: factor FAILIFEXISTS handling out of vfs_lookup
Mateusz Guzik [Sun, 13 Mar 2022 17:36:51 +0000 (17:36 +0000)]
vfs: factor FAILIFEXISTS handling out of vfs_lookup

2 years agovfs: hoist degenerate path lookups out of the loop
Mateusz Guzik [Fri, 11 Mar 2022 15:51:39 +0000 (15:51 +0000)]
vfs: hoist degenerate path lookups out of the loop

2 years agovfs: retire the NDF_ONLY_PNBUF flag
Mateusz Guzik [Thu, 24 Mar 2022 10:15:54 +0000 (10:15 +0000)]
vfs: retire the NDF_ONLY_PNBUF flag

Consumers should use NDFREE_PNBUF instead.

2 years agovfs: NDFREE(&nd, NDF_ONLY_PNBUF) -> NDFREE_PNBUF(&nd)
Mateusz Guzik [Thu, 24 Mar 2022 10:10:03 +0000 (10:10 +0000)]
vfs: NDFREE(&nd, NDF_ONLY_PNBUF) -> NDFREE_PNBUF(&nd)

2 years agoMerge LLVM commit c03fdd340356 to fix lang/rust on powerpc
Piotr Kubaj [Thu, 24 Mar 2022 00:30:44 +0000 (01:30 +0100)]
Merge LLVM commit c03fdd340356 to fix lang/rust on powerpc

Summary:
Without it building rust fails with:
ld: error: CallSiteSplitting.cpp:(function llvm::SmallVectorImpl<std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<std::__1::pair<llvm::ICmpInst*, unsigned int>, 2u> > >::operator=(llvm::SmallVectorImpl<std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<std::__1::pair<llvm::ICmpInst*, unsigned int>, 2u> > >&&): .text._ZN4llvm15SmallVectorImplINSt3__14pairIPNS_10BasicBlockENS_11SmallVectorINS2_IPNS_8ICmpInstEjEELj2EEEEEEaSEOSB_+0xB0): relocation R_PPC_PLTREL24 out of range: -33582208 is not in [-3355443233554431]\19

This will need to be merged to releng/13.1.

Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D34652
MFC after: 3 days

2 years agohardware: added Dell H840 raid support
Wojciech Macek [Thu, 24 Mar 2022 06:13:45 +0000 (07:13 +0100)]
hardware: added Dell H840 raid support

Obtained from: Stormshield
Differential revision: https://reviews.freebsd.org/D34623

2 years agoDTrace test: skip flakey common.misc.t_dtrace_contrib.tst_dynopt_d in CI
Li-Wen Hsu [Thu, 24 Mar 2022 03:37:50 +0000 (11:37 +0800)]
DTrace test: skip flakey common.misc.t_dtrace_contrib.tst_dynopt_d in CI

PR: 237641
Sponsored by: The FreeBSD Foundation

2 years agoDTrace test: Add a new keyword SKIPCI to gentest.sh
Li-Wen Hsu [Thu, 24 Mar 2022 03:30:27 +0000 (11:30 +0800)]
DTrace test: Add a new keyword SKIPCI to gentest.sh

This is for marking a test case is flakey and should not be executed in
the CI environment.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34635

2 years agortsx: Display error if rtsx_read()/rtsx_write() fail.
Henri Hennebert [Thu, 24 Mar 2022 01:01:00 +0000 (21:01 -0400)]
rtsx: Display error if rtsx_read()/rtsx_write() fail.

MFC after: 1 week

2 years agortsx: Don't detach during shutdown
Henri Hennebert [Thu, 24 Mar 2022 00:58:38 +0000 (20:58 -0400)]
rtsx: Don't detach during shutdown

MFC after: 1 week

2 years agohda: whitespace fix for realtek pin patches
Ed Maste [Thu, 24 Mar 2022 00:54:51 +0000 (20:54 -0400)]
hda: whitespace fix for realtek pin patches

2 years agosound: test PCM_REGISTERED before PCM_DETACHING
Ed Maste [Mon, 21 Mar 2022 16:15:22 +0000 (12:15 -0400)]
sound: test PCM_REGISTERED before PCM_DETACHING

PCM_REGISTERED(d) tests that d is not NULL, so perform that check first
as we may have cases where devclass_get_softc has a null entry.

PR: 262671
Reviewed by: hselasky
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34648

2 years agobsdinstall(8): Usage example of tar doesn't work
Farhan Khan [Wed, 23 Mar 2022 20:54:30 +0000 (21:54 +0100)]
bsdinstall(8): Usage example of tar doesn't work

The order of arguments in the example does not work, because tar thinks
the directory is named -C, which does not exist and reports:
tar: Error opening archive: Failed to open '-C'

Approved by: rpokala@ (src) on IRC
Differential Revision: https://reviews.freebsd.org/D34649

2 years agoarm,arm64: Add a NT_ARM_TLS read-only register set.
John Baldwin [Wed, 23 Mar 2022 20:33:06 +0000 (13:33 -0700)]
arm,arm64: Add a NT_ARM_TLS read-only register set.

This register set exposes the per-thread TLS register.  It matches the
layout used by Linux on arm64.  Linux does not implement this note for
32-bit arm.

Reviewed by: andrew, markj
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D34595

2 years agoUse a regset for NT_ARM_VFP.
John Baldwin [Wed, 23 Mar 2022 20:33:06 +0000 (13:33 -0700)]
Use a regset for NT_ARM_VFP.

This includes adding support for NT_ARM_VFP for 32-bit binaries
running under aarch64 kernels both for ptrace(), and coredumps via the
kernel and gcore.

Reviewed by: andrew, markj
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D34448

2 years agoaarch64: Fix get_fpcontext32() to work on non-curthread.
John Baldwin [Wed, 23 Mar 2022 20:33:06 +0000 (13:33 -0700)]
aarch64: Fix get_fpcontext32() to work on non-curthread.

Similar to fill_fpregs(), only invoke vfp_save_state() for curthread.

While here, zero the buffer if FP hasn't been started to avoid leaking
kernel stack memory.

Reviewed by: andrew, markj
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D34525

2 years ago<sys/reg.h>: Add ELF32_REGSET.
John Baldwin [Wed, 23 Mar 2022 20:33:06 +0000 (13:33 -0700)]
<sys/reg.h>: Add ELF32_REGSET.

This permits adding a register set for FREEBSD32 ABIs.

While here, include <sys/linker_set.h> to make this header more
self-contained in the kernel.

Reviewed by: andrew, markj
Sponsored by: The University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D34536

2 years agocxgbe(4): Allow dump_cimla and dump_devlog to sleep.
Navdeep Parhar [Tue, 22 Mar 2022 20:13:56 +0000 (13:13 -0700)]
cxgbe(4): Allow dump_cimla and dump_devlog to sleep.

This has been safe since e9e7bc82505, which moved parts of error
handling from the ithread to a taskqueue.

MFC after: 1 week
Sponsored by: Chelsio Communications

2 years agoLinuxKPI: 802.11: fix lkpi_lsta_dump() debugging
Bjoern A. Zeeb [Wed, 23 Mar 2022 17:14:03 +0000 (17:14 +0000)]
LinuxKPI: 802.11: fix lkpi_lsta_dump() debugging

Fix two last-minute changes of d9f59799fc3e7940c47aa674c25994e640eae45e:
(1) for consitency name the debugging function lkpi_lsta_dump()
(2) pass in the original node (ni) rather than taking it from the lsta
    to avoid problems realted to bss_update as mentioned in the above
    commit.

No functional changes for users.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
X-MFC with: d9f59799fc3e7940c47aa674c25994e640eae45e

2 years agoLinuxKPI: skbuff: fix skb_queue_splice_init()
Bjoern A. Zeeb [Wed, 23 Mar 2022 17:05:43 +0000 (17:05 +0000)]
LinuxKPI: skbuff: fix skb_queue_splice_init()

In skb_queue_splice_init() we set a next value and then used that new
value to further update the remaining linking rather than the original
value.  Introduce another temporary variable 'n' to hold the original
value and use that.
While here rename q and h to from and to as otherwise it was too
confusing to read.

Also initialize skb->prev and skb->next to point to skb itself if
for nothing else at least to aid debugging.

Reported by: phk (panic in iwl_txq_reclaim)
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoelf: Avoid dumping uninitialized bytes in PRSTATUS core dump notes
Mark Johnston [Wed, 23 Mar 2022 16:52:44 +0000 (12:52 -0400)]
elf: Avoid dumping uninitialized bytes in PRSTATUS core dump notes

elf_prstatus_t contains pad space.

Reported by: KMSAN
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34606

2 years agocallout: Remove the CS_EXECUTING flag
Mark Johnston [Wed, 23 Mar 2022 16:37:02 +0000 (12:37 -0400)]
callout: Remove the CS_EXECUTING flag

It is now unused.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34626

2 years agosetitimer: Fix exit race
Mark Johnston [Wed, 23 Mar 2022 16:36:12 +0000 (12:36 -0400)]
setitimer: Fix exit race

We use the p_itcallout callout, interlocked by the proc lock, to
schedule timeouts for the setitimer(2) system call.  When a process
exits, the callout must be stopped before the process struct is
recycled.

Currently we attempt to stop the callout in exit1() with the call
_callout_stop_safe(&p->p_itcallout, CS_EXECUTING).  If this call returns
0, then we sleep in order to drain the callout.  However, this happens
only if the callout is not scheduled at all.  If the callout thread is
blocked on the proc lock, then exit1() will not block and the callout
may execute after the process has fully exited, typically resulting in a
panic.

I cannot see a reason to use the CS_EXECUTING flag here.  Instead, use
the regular callout_stop()/callout_drain() dance to halt the callout.

Reported by: ler
Tested by: ler, pho
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34625

2 years agobsdinstall time: Replace dialog with bsddialog
Alfonso S. Siciliano [Wed, 23 Mar 2022 15:52:39 +0000 (16:52 +0100)]
bsdinstall time: Replace dialog with bsddialog

Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility,
'dialog --calendar' is replaced by 'bsddialog --datebox' with same
features but different User Interface.

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D34583

2 years agoRemove L2_BLOCK_MASK from arm64
Andrew Turner [Wed, 23 Mar 2022 15:33:05 +0000 (15:33 +0000)]
Remove L2_BLOCK_MASK from arm64

It's unneeded as it was just used to align KERNBASE to a level 2
block start address. KERNBASE was already aligned correctly.

Sponsored by: The FreeBSD Foundation

2 years agoSupport EFIRT on arm64 with a non 4k page size
Andrew Turner [Wed, 23 Mar 2022 15:18:30 +0000 (15:18 +0000)]
Support EFIRT on arm64 with a non 4k page size

When the page size the kernel is built for is not the same as
EFI_PAGE_SIZE we need to increment the page index at a faster rate.

Add this adjustment to the arm64 EFIRT support in preperation for
experimental 16k PAGE_SIZE support.

Sponsored by: The FreeBSD Foundation

2 years agoAdd an implementation of .mcount on arm64
Andrew Turner [Tue, 22 Mar 2022 15:46:15 +0000 (15:46 +0000)]
Add an implementation of .mcount on arm64

To support cc -pg on arm64 we need to implement .mcount. As clang and
gcc think it is function like it just needs to load the arguments
to _mcount and call it.

On gcc the first argument is passed in x0, however this is missing on
clang so we need to load it from the stack. As it's the caller return
address this will be at a known location.

PR: 262709
Reviewed by: emaste (earlier version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34634

2 years agolinuxkpi: Add down_write_nest_lock
Emmanuel Vadot [Tue, 22 Mar 2022 09:28:02 +0000 (10:28 +0100)]
linuxkpi: Add down_write_nest_lock

Simply calls down_write like in Linux (when CONFIG_DEBUG_LOCK_ALLOC isn't
specified)
Needed by drm v5.10

MFC after: 1 month
Reviewed by: hselasky
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D34642

2 years agolinuxkpi: Add kstrtouint_from_user
Emmanuel Vadot [Tue, 22 Mar 2022 09:22:42 +0000 (10:22 +0100)]
linuxkpi: Add kstrtouint_from_user

Like kstrtoint_from_user but for uint.
Needed by drm v5.10

MFC after: 1 month
Reviewed by: hselasky
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D34642

2 years agolinuxkpi: Add cond_resched_lock
Emmanuel Vadot [Mon, 21 Mar 2022 10:14:05 +0000 (11:14 +0100)]
linuxkpi: Add cond_resched_lock

If we need to resched it takes the lock, resched, release the lock
and returns 1, otherwise simply returns 0.

Needed by drm v5.9

MFC after: 1 month
Reviewed by: hselasky
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D34620

2 years agoAdd devices and quirks for some Olympus cameras.
Greg Lehey [Wed, 23 Mar 2022 01:40:28 +0000 (12:40 +1100)]
Add devices and quirks for some Olympus cameras.

Reviewed by: hps@
Fixes:     Problems attaching Olympus cameras.
MFC after: 2 weeks

2 years agobsdinstall hardening: Replace dialog with bsddialog
Alfonso S. Siciliano [Tue, 22 Mar 2022 23:52:22 +0000 (00:52 +0100)]
bsdinstall hardening: Replace dialog with bsddialog

bsdinstall/scripts/hardening: Replace (LGPL) dialog utility with
(BSD-2-CLAUSE) dialog utility.

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D34102

2 years agotest-includes: improve portability
Brooks Davis [Tue, 22 Mar 2022 20:23:22 +0000 (20:23 +0000)]
test-includes: improve portability

FreeBSD's shell permits [^bar] to match characters not in [bar] like
common regular expressions. This is non-portable and '!' should be
used in place of '^' for portability.

Reported by: Nathaniel Wesley Filardo
Issue: https://github.com/CTSRD-CHERI/cheribsd/issues/1321
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D34597

2 years agoCorrect a handful of typos and grammos.
Jens Schweikhardt [Tue, 22 Mar 2022 20:12:42 +0000 (21:12 +0100)]
Correct a handful of typos and grammos.

2 years agoLinuxKPI: 802.11: rework sta state machine compatibility
Bjoern A. Zeeb [Tue, 22 Mar 2022 18:34:13 +0000 (18:34 +0000)]
LinuxKPI: 802.11: rework sta state machine compatibility

Rework the state machine parts for various reasons:
(1) to add sta tracing to be able to better follow ni and lsta state
(2) factor out/implement lkpi_lsta_remove() to unlink the lsta and
    free the ni reference.
(3) avoid calling lkpi_disassoc() when you would think you should as
    changing BSS_CHANGED_ASSOC setting vif->bss_conf.assoc to false
    triggers a sta removal from firmware in iwlwifi which then triggers
    follow-up errors.  I do not understand why they use flags and state
    and ?? in parallel (too many options and ways to do things?).
(4) when "roaming" (or being disassoc/deauth) from an AP both net80211
    and apparently so mac80211 re-start with a new node/sta.  This
    results in us losing one or the other state in the compat layer
    or not updating firmware appropriately.  To resolve this make use
    of (a) the newly introduced (*iv_update_bss)() and (b) always tear
    a station down to "State 1" (INIT/SCAN/pre-AUTH) and only if needed
    re-create the new one (if we go to AUTH).
    A slightly earlier version has survived a night of wpa_supplicant
    and hostapd fighting each other over disassoc and deauth and
    re-associating/authorizing.

While there update a few comments and typos and do a few minor auxiliary
changes which are hard or not worth to extract.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoLinuxKPI: 802.11: factor out dtim/tsf updates
Bjoern A. Zeeb [Tue, 22 Mar 2022 18:16:56 +0000 (18:16 +0000)]
LinuxKPI: 802.11: factor out dtim/tsf updates

Factor out dtim/tsf setting/updates into lkpi_update_dtim_tsf()
with tracing and add an extra update call.
This avoids some code duplication and puts maintainance into a
single place.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoLinuxKPI: 802.11: factor out lkpi_lsta_alloc() from lkpi_ic_node_alloc()
Bjoern A. Zeeb [Tue, 22 Mar 2022 15:14:31 +0000 (15:14 +0000)]
LinuxKPI: 802.11: factor out lkpi_lsta_alloc() from lkpi_ic_node_alloc()

Split lkpi_ic_node_alloc() into two functions to make the code simpler
and to allow lkpi_lsta_alloc() to be re-used from another part of the
code related to (*iv_update_bss)().

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoLinuxKPI: 802.11: implement ieee80211_beacon_loss()
Bjoern A. Zeeb [Tue, 22 Mar 2022 15:02:45 +0000 (15:02 +0000)]
LinuxKPI: 802.11: implement ieee80211_beacon_loss()

Implement ieee80211_beacon_loss() similar to
ieee80211_connection_loss() with different state handling.
While here leave a comment in connection_loss() about the state
change argument.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agonet80211: introduce (*iv_update_bss)()
Bjoern A. Zeeb [Tue, 22 Mar 2022 14:46:51 +0000 (14:46 +0000)]
net80211: introduce (*iv_update_bss)()

Introduce (*iv_update_bss)() with a default implementation to allow
drivers to overload/intercept the time when we swap iv_bss.

This helps firmware based drivers to synchronize state with firmware.
Otherwise, for some state changes, we begin with one ni (and in
LinuxKPI lsta) and try to finish with another ni (and a new lsta
in different state) and may no longer have access to the previous state.
This also saves us from constantly checking for ni changes complicating
code.

No functional changes intended.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
X-MFC: move (*iv_update_bss) to spare area

2 years agonet80211: improve one debug logging
Bjoern A. Zeeb [Tue, 22 Mar 2022 14:40:12 +0000 (14:40 +0000)]
net80211: improve one debug logging

When forcing DEUATH in ieee80211_sta_join1() log the current state
we are coming from as well.  Note this isn't always the state we
are expecting as iv_state was updated already, so contrary to the
comment we usually do not see RUN there.
Leave a comment earlier with regards to this as well.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoRemove the unused arm64 kernel profiling code
Andrew Turner [Tue, 22 Mar 2022 15:48:58 +0000 (15:48 +0000)]
Remove the unused arm64 kernel profiling code

It's unused. Remove it in preperation for userspace support.

Sponsored by: The FreeBSD Foundation

2 years agoneta: split fixed and in-band link status configuration
Sebastien Bini [Tue, 22 Mar 2022 15:44:09 +0000 (16:44 +0100)]
neta: split fixed and in-band link status configuration

Fixed-link mode requires different handling than the in-band
managed connection. Update interrupt, link-up/down and
autonegotiation settings for the former.

Reviewed by: mw
MFC after: 1 week
Obtained from: Stormshield
Differential Revision: https://reviews.freebsd.org/D34394

2 years agoIPv4 multicast: fix netstat -g
Mike Karels [Mon, 21 Mar 2022 19:59:13 +0000 (14:59 -0500)]
IPv4 multicast: fix netstat -g

The vif structure includes fields at the end which are #ifdef KERNEL,
causing a mismatch between the structure sizes between kernel and
user level.  netstat -g failed with an ENOMEM on the sysctl to fetch
the vif table.  Change the vif sysctl code in ip_mroute to copy out
only the user-level-visible portion of each table entry.

Reviewed by: bz, wma
Differential Revision: https://reviews.freebsd.org/D34627

2 years agoEnter epoch when addding IPv4 multicast forwarding cache entry
Mike Karels [Mon, 21 Mar 2022 14:50:08 +0000 (09:50 -0500)]
Enter epoch when addding IPv4 multicast forwarding cache entry

The code path from the IPv4 multicast setsockopt could call ip_output()
without entering an epoch.  Specifically, the MRT_ADD_MFC setbsocopt
would call add_mfc(), which in turn called ip_mdq() to send queued
packets.  This resulted in an epoch assert failure in ip_output().
Enter an epoch in add_mfc(), and add some epoch asserts to check
for similar failures.

Reviewed by: kp, bz, wma, cy
Differential Revision: https://reviews.freebsd.org/D34624

2 years agoFix umtxq_sleep() regression caused by 56070dd2e4d.
Alexander Motin [Mon, 21 Mar 2022 23:43:39 +0000 (19:43 -0400)]
Fix umtxq_sleep() regression caused by 56070dd2e4d.

umtxq_requeue() moves the queue to a different hash chain and different
lock, so we can't rely on msleep_sbt() reacquiring the same old lock.
We have to use PDROP and update the queue chain and so lock pointer.

PR: 262587
MFC after: 2 weeks

2 years agopowerpcspe: fix PCI enumeration on ppce500
Alfredo Dal'Ava Junior [Mon, 21 Mar 2022 10:57:07 +0000 (07:57 -0300)]
powerpcspe: fix PCI enumeration on ppce500

This fixes PCI devices not being found on QEMU ppce500. This
generic board used to have its first PCI slot at 0x11, like the
mpc8544dsi and some real HW. After commit [1], it was changed to
0x1 and our driver wasn't prepared for that.

[1] https://gitlab.com/qemu-project/qemu/-/commit/3bb7e02a9725a24e5bf915b35f914f82f5b07a1f

Reviewed by: jhibbits, bdragon
MFC after: 2 days
Sponsored by: Institudo de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D34621

2 years agoRemove unused snd_ds1 file ds1-fw.h
Ed Maste [Mon, 21 Mar 2022 18:19:49 +0000 (14:19 -0400)]
Remove unused snd_ds1 file ds1-fw.h

Fixes: 92e6b4712b53 ("Retire broken snd_ds1 and ...")
Reported by: joel

2 years agoLinuxKPI: pci: implement pci_upstream_bridge()
Bjoern A. Zeeb [Wed, 16 Feb 2022 18:04:08 +0000 (18:04 +0000)]
LinuxKPI: pci: implement pci_upstream_bridge()

Allow drivers to query the "upstream PCI bridge".
Currently we point back to ourselves on pdev->bus->self rather than
to the parent PCI bridge.
We keep this as status-quo with an extra comment and only on-demand
allocate a pci_dev for the parent bridge if we are asked for in
pci_upstream_bridge().
When releasing the pci_dev we check if pdev->bus->self has changed
and call pci_dev_put() to release the reference count on the parent
bridge as well.

This code moves pci_is_root_bus() higher up in pci.h but no functional
change there.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: hselasky, (jhb some earlier)
Thanks to: wulf for handling drm-kmod
Differential Revision: https://reviews.freebsd.org/D34305

2 years agokern_tc.c/cputick2usec() (which is used to calculate cputime from
firk [Mon, 21 Mar 2022 13:33:11 +0000 (09:33 -0400)]
kern_tc.c/cputick2usec() (which is used to calculate cputime from
cpu ticks) has some imprecision and, worse, huge timestep (about
20 minutes on 4GHz CPU) near 53.4 days of elapsed time.

kern_time.c/cputick2timespec() (it is used for clock_gettime() for
querying process or thread consumed cpu time) Uses cputick2usec()
and then needlessly converting usec to nsec, obviously losing
precision even with fixed cputick2usec().

kern_time.c/kern_clock_getres() uses some weird (anyway wrong)
formula for getting cputick resolution.

PR: 262215
Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D34558

2 years agoMake SHMMAXPGS an unsigned long
Andrew Turner [Tue, 15 Mar 2022 17:42:30 +0000 (17:42 +0000)]
Make SHMMAXPGS an unsigned long

This is used to calculate sizes that are then stored in unsigned long
fields. Make this unsigned long so the calculations use this type and
not an int that can lead to an integer overflow with a large PAGE_SIZE.

This allows building this on arm64 with PAGE_SIZE of 16k. Further work
will be needed if a 32-bit architecture tries to use a similar sized
page.

Sponsored by: The FreeBSD Foundation

2 years agoMerge libcxxrt commit f2e55091e2e878386c9f7974d4922bbdc4faed84
Dimitry Andric [Sun, 20 Mar 2022 21:21:28 +0000 (22:21 +0100)]
Merge libcxxrt commit f2e55091e2e878386c9f7974d4922bbdc4faed84

  Fix unlock in two-word version and add missing comment.

  Fixes #15
  Fixes #16

This should fix the hangs in __cxa_guard_acquire() reported on i386 (and
possibly other 32-bit platforms).

Obtained from: https://github.com/libcxxrt/libcxxrt/commit/f2e5509
Fixes: 56aaed388b0a
MFC after: 2 weeks

2 years agoReapply libcxxrt atomics cleanup commit, preparing for upstream fix
Dimitry Andric [Sun, 20 Mar 2022 21:19:27 +0000 (22:19 +0100)]
Reapply libcxxrt atomics cleanup commit, preparing for upstream fix

This reapplies upstream commit fd484be, as there is a follow-up fix for
the possible hangs in __cxa_guard_acquire() on i386:

  Atomics cleanup (#11)

  We need to test exception specifiers but they're gone in C++17 so
  compile the tests with an older version of the standard.

  Rewrite the guard logic to be more idiomatic C++ and more
  comprehensible and make sure that atomics are used where necessary.

Obtained from: https://github.com/libcxxrt/libcxxrt/commit/fd484be
Fixes: 56aaed388b0a
MFC after: 2 weeks

2 years agomixer.8: Document shorthand syntax for volume setting.
Hans Petter Selasky [Sun, 20 Mar 2022 19:15:30 +0000 (20:15 +0100)]
mixer.8: Document shorthand syntax for volume setting.

Submitted by: christos@
Differential Revision: https://reviews.freebsd.org/D34614
Sponsored by: NVIDIA Networking

2 years agomixer.4 and mixer.8: Fix mandoc -Tlint errors.
Hans Petter Selasky [Sun, 20 Mar 2022 19:13:00 +0000 (20:13 +0100)]
mixer.4 and mixer.8: Fix mandoc -Tlint errors.

Submitted by: christos@
Differential Revision: https://reviews.freebsd.org/D34603
Sponsored by: NVIDIA Networking

2 years agomixer(8): Improve shorthand volume parsing.
Hans Petter Selasky [Sun, 20 Mar 2022 19:08:13 +0000 (20:08 +0100)]
mixer(8): Improve shorthand volume parsing.

The initial patch had a bug where the full volume syntax, floating point values,
:, + and -, wasn't accepted.

While at it move some defines to enum's.

Fixes: da3d4469ef841be44ac4b346a6b51668d608ed49
Submitted by: christos@
Differential Revision: https://reviews.freebsd.org/D34617
Sponsored by: NVIDIA Networking

2 years agotslog: Add CTLFLAG_SKIP to sysctls
Colin Percival [Sun, 20 Mar 2022 17:41:58 +0000 (10:41 -0700)]
tslog: Add CTLFLAG_SKIP to sysctls

The timestamp logs are quite large (often much larger than all the
other sysctls combined) so it's unlikely anyone will want to have
them displayed by `sysctl -a`.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D34616

2 years agosysctl(8): Mention CTLFLAG_SKIP
Colin Percival [Sun, 20 Mar 2022 17:41:03 +0000 (10:41 -0700)]
sysctl(8): Mention CTLFLAG_SKIP

`sysctl -a` does not print values with this flag.

Reviewed by: debdrup
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D34615

2 years agomixer(8): Add shorthand syntax for setting the volume.
Hans Petter Selasky [Sun, 20 Mar 2022 16:28:08 +0000 (17:28 +0100)]
mixer(8): Add shorthand syntax for setting the volume.

dev.volume=X[.X] can now also be written as dev=X[.X] .

Requested by: hselasky@ and bsduck (FreeBSD forums)
Submitted by: christos@
Differential Revision: https://reviews.freebsd.org/D34612
Sponsored by: NVIDIA Networking

2 years agomixer(8): Remove [.volume] string from default printout.
Hans Petter Selasky [Sun, 20 Mar 2022 16:23:37 +0000 (17:23 +0100)]
mixer(8): Remove [.volume] string from default printout.

Submitted by: christos@
Differential Revision: https://reviews.freebsd.org/D34591
Sponsored by: NVIDIA Networking

2 years agocap_fileargs: silence warnings of unused variable
Mariusz Zaborski [Sun, 20 Mar 2022 10:17:31 +0000 (11:17 +0100)]
cap_fileargs: silence warnings of unused variable

We still want to fetch the variable just to verify that the interface
is right.

Reported by: pstef

2 years agoFix llvm build after 1b3bef43e3cb, due to API change
Dimitry Andric [Sat, 19 Mar 2022 23:12:58 +0000 (00:12 +0100)]
Fix llvm build after 1b3bef43e3cb, due to API change

After merging llvm commit b9ca73e1a8fd for PR 262608, it would fail to
compile with:

/usr/src/contrib/llvm-project/llvm/lib/IR/Operator.cpp:197:22: error: no member named 'isZero' in 'llvm::APInt'
   if (!IndexedSize.isZero()) {
        ~~~~~~~~~~~ ^

Upstream refactored their APInt class, and isZero() was one of the newer
methods which did not yet exist in llvm 13.0.0. Fix this by using the
older but equivalent isNullValue() method instead.

Fixes: 1b3bef43e3cb
MFC after: 3 days

2 years agoApply llvm fix for assertion compiling certain versions of Wine
Dimitry Andric [Sat, 19 Mar 2022 19:59:04 +0000 (20:59 +0100)]
Apply llvm fix for assertion compiling certain versions of Wine

Merge commit b9ca73e1a8fd from llvm git (by Stephen Tozer):

  [DebugInfo] Correctly handle arrays with 0-width elements in GEP salvaging

  Fixes an issue where GEP salvaging did not properly account for GEP
  instructions which stepped over array elements of width 0 (effectively a
  no-op). This unnecessarily produced long expressions by appending
  `... + (x * 0)` and potentially extended the number of SSA values used
  in the dbg.value. This also erroneously triggered an assert in the
  salvage function that the element width would be strictly positive.
  These issues are resolved by simply ignoring these useless operands.

  Reviewed By: aprantl

  Differential Revision: https://reviews.llvm.org/D111809

PR: 262608
Reported by: Damjan Jovanovic <damjan.jov@gmail.com>
MFC after: 3 days

2 years agoRevert upstream libcxxrt commit which can cause hangs on i386
Dimitry Andric [Sat, 19 Mar 2022 19:46:28 +0000 (20:46 +0100)]
Revert upstream libcxxrt commit which can cause hangs on i386

This reverts upstream commit fd484be:

  Atomics cleanup (#11)

  We need to test exception specifiers but they're gone in C++17 so
  compile the tests with an older version of the standard.

  Rewrite the guard logic to be more idiomatic C++ and more
  comprehensible and make sure that atomics are used where necessary.

It looks like there are some corner cases in the i386 and/or 32-bit
atomics handling, which can make __cxa_guard_acquire() hang in certain
situations.

Reported by: antoine
Obtained from: https://github.com/libcxxrt/libcxxrt/commit/fd484be
Fixes: 56aaed388b0a
MFC after: 2 weeks

2 years agoAdd deprecation notices to ISA sound cards
Ed Maste [Fri, 18 Mar 2022 15:50:23 +0000 (11:50 -0400)]
Add deprecation notices to ISA sound cards

ISA sound cards (and ISA itself) are long obsolete.  NYCBUG dmesgd has
no entries for any of these devices after 2005.

Add deprecation notices to device attach routines and man pages for:

snd_ad1816  Analog Devices AD1816 SoundPort
snd_ess     Ensoniq ESS
snd_gusc    Gravis UltraSound
snd_mss     Microsoft Sound System
snd_sbc     Creative Sound Blaster

Reviewed by: cy, mav
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34604

2 years agortsx: Call rtsx_init() on resume.
hlh-restart [Sat, 19 Mar 2022 16:37:24 +0000 (12:37 -0400)]
rtsx: Call rtsx_init() on resume.

MFC after: 3 days

2 years agocache: add a comment about a realpath bug
Mateusz Guzik [Sat, 19 Mar 2022 15:11:25 +0000 (15:11 +0000)]
cache: add a comment about a realpath bug

2 years agovfs: replace VFS_NOTIFY_UPPER_* macros with an enum
Mateusz Guzik [Sat, 19 Mar 2022 13:15:55 +0000 (13:15 +0000)]
vfs: replace VFS_NOTIFY_UPPER_* macros with an enum

2 years agovfs: add missing flags to db show mount
Mateusz Guzik [Sat, 19 Mar 2022 12:04:44 +0000 (12:04 +0000)]
vfs: add missing flags to db show mount

2 years agovfs: retire the no longer used MNTK_LOOKUP_EXCL_DOTDOT flag
Mateusz Guzik [Sat, 18 Sep 2021 10:46:03 +0000 (12:46 +0200)]
vfs: retire the no longer used MNTK_LOOKUP_EXCL_DOTDOT flag

Reviewed by: markj
Tested by: pho (previous version)
Differential Revision: https://reviews.freebsd.org/D34466

2 years agonullfs: hash insertion without vnode lock upgrade
Mateusz Guzik [Mon, 7 Mar 2022 11:43:43 +0000 (11:43 +0000)]
nullfs: hash insertion without vnode lock upgrade

Use the hash lock to serialize instead.

This enables shared-locked ".." lookups.

Reviewed by: markj
Tested by: pho (previous version)
Differential Revision: https://reviews.freebsd.org/D34466

2 years agovfs: add MNTK_UNLOCKED_INSMNTQUE
Mateusz Guzik [Mon, 7 Mar 2022 11:40:04 +0000 (11:40 +0000)]
vfs: add MNTK_UNLOCKED_INSMNTQUE

Can be used when the fs at hand can synchronize insmntque with other
means than the vnode lock.

Reviewed by: markj
Tested by: pho (previous version)
Differential Revision: https://reviews.freebsd.org/D34466

2 years agopsci: finish psci_present implementation
Kyle Evans [Sat, 19 Mar 2022 03:03:44 +0000 (22:03 -0500)]
psci: finish psci_present implementation

This was already declared in psci.h, but it was never defined/set.  Do
this now, so we can use it to decide if enable-method in /cpus FDT nodes
should be inspected later on.  While we're here, convert it to a
boolean.

Reviewed by: andrew (slightly earlier version)
Differential Revision: https://reviews.freebsd.org/D34553

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

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

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

Reviewed by: andrew
Sponsored by: Ampere Computing
Submitted by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D34546

2 years agoCorrect date in ObsoleteFiles.inc entry
Ed Maste [Sat, 19 Mar 2022 01:33:10 +0000 (21:33 -0400)]
Correct date in ObsoleteFiles.inc entry

Fixes: 92e6b4712b53 ("Retire broken snd_ds1 and ...")

2 years agoRetire broken snd_ds1 and snd_maestro drivers
Ed Maste [Fri, 18 Mar 2022 20:34:05 +0000 (16:34 -0400)]
Retire broken snd_ds1 and snd_maestro drivers

In 2012 joel@ reported[1] that these were not functional, and they do
not appear to have been fixed since.

[1] https://lists.freebsd.org/pipermail/freebsd-multimedia/2012-January/012751.html

Reported by: joel
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

2 years agoUpdate deprecation notice in snd_maestro, snd_ds1
Ed Maste [Fri, 18 Mar 2022 21:01:12 +0000 (17:01 -0400)]
Update deprecation notice in snd_maestro, snd_ds1

These drivers are broken and have been scheduled for removal since 2012.
They will finally be removed before FreeBSD 14.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

2 years agoRemove snd_aureal driver source
Ed Maste [Fri, 18 Mar 2022 20:11:32 +0000 (16:11 -0400)]
Remove snd_aureal driver source

This driver was not finished when it was committed in 1999 and was never
connected to the build.

A version of the driver used to be available in ports as
audio/aureal-kmod, but it has been removed.  It did not build on FreeBSD
10.x or later and the binary objects it required were not available
after Google Code disappeared.

PR: 124343
Reported by: joel
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agouefi(8): Note i386 is unsupported
Warner Losh [Fri, 18 Mar 2022 20:12:39 +0000 (14:12 -0600)]
uefi(8): Note i386 is unsupported

We have no support for i386 booting at this time. Add that in the bugs section.

Sponsored by: Netflix

2 years agorc.subr.8: Format notes consistently
Mateusz Piotrowski [Fri, 18 Mar 2022 14:06:48 +0000 (15:06 +0100)]
rc.subr.8: Format notes consistently

MFC after: 3 days

2 years agonamei: Treat non-tied KLDs as if they had INVARIANTS enabled
Andrew Gallatin [Fri, 18 Mar 2022 14:14:14 +0000 (10:14 -0400)]
namei: Treat non-tied KLDs as if they had INVARIANTS enabled

When working with a vendor to debug their kernel module,
I found that a non-tied kld which uses NDINIT will panic
due to "namei: bad debugflags " on a kernel compiled with
INVARIANTS because non-tied KLDs do not pick up the
initialization that is done in NDINIT_DBG/NDREINIT_DBG().

Fix this by making this initialization happen for non-KLD_TIED
as well as INVARIANTS

Reviewed by: mjg
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D34588

2 years agozfskeys: Support autoloading of keys stored on ZFS
Mateusz Piotrowski [Fri, 18 Mar 2022 12:35:16 +0000 (13:35 +0100)]
zfskeys: Support autoloading of keys stored on ZFS

The zfskeys service script starts before the zfs service script, so that
dataset decryption keys are available when `zfs mount -a` is run. One of
the potential edge cases of this design is that if a key is stored on
ZFS it won't be loaded until `zfs mount -a` is issued.

In order to address that let's try to load the additional keys and mount
related ZFS datasets after the zfs script finishes its standard mounting
procedure.

PR: 262468
Reported by: Graham Perrin <grahamperrin@gmail.com>
Reviewed by: allanjude
Approved by: allanjude (src)
Fixes: 33ff39796ffe Add zfskeys rc.d script for auto-loading encryption keys
MFC after: 3 days
Sponsored by: Modirum
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D34601

2 years agomixer.3: Fix spelling
Hans Petter Selasky [Fri, 18 Mar 2022 11:08:55 +0000 (12:08 +0100)]
mixer.3: Fix spelling

Submitted by: christos@
Differential Revision: https://reviews.freebsd.org/D34378
MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agouefi.8: Fix style
Mateusz Piotrowski [Fri, 18 Mar 2022 10:53:10 +0000 (11:53 +0100)]
uefi.8: Fix style

MFC after: 3 days

2 years agouefi.8: Document i386 and riscv EFI bootloader names
Mateusz Piotrowski [Fri, 18 Mar 2022 10:52:02 +0000 (11:52 +0100)]
uefi.8: Document i386 and riscv EFI bootloader names

Based on tools/boot/install-boot.sh.

MFC after: 2 weeks

2 years agogptboot.8: Fix a typo and fix lint warnings
Mateusz Piotrowski [Fri, 18 Mar 2022 09:07:18 +0000 (10:07 +0100)]
gptboot.8: Fix a typo and fix lint warnings

MFC after: 3 days

2 years agox86/tsc: fetch frequency from CPUID when running on Xen
Roger Pau Monné [Wed, 16 Mar 2022 08:56:40 +0000 (09:56 +0100)]
x86/tsc: fetch frequency from CPUID when running on Xen

Introduce a helper to fetch the TSC frequency from CPUID when running
under Xen.

Since the TSC can also be initialized early when running as a Xen
guest pull out the call to tsc_init() from the
early_clock_source_init() handlers and place it in clock_init(), as
otherwise all handlers would call tsc_init() anyway.

Reviewed by: markj
Sponsored by: Citrix Systems R&D
Differential revision: https://reviews.freebsd.org/D34581

2 years agoprocstat: remove set but not used variable
Piotr Pawel Stefaniak [Thu, 17 Mar 2022 21:53:00 +0000 (22:53 +0100)]
procstat: remove set but not used variable

In an earlier version of D26310, strcmp was strncmp.

2 years agobacklight: Remove set but not used variable
Piotr Pawel Stefaniak [Thu, 17 Mar 2022 21:37:15 +0000 (22:37 +0100)]
backlight: Remove set but not used variable

2 years agoloader.efi: Improve the manual page
Mateusz Piotrowski [Fri, 18 Mar 2022 08:54:23 +0000 (09:54 +0100)]
loader.efi: Improve the manual page

- Add SPDX tag
- Add a files section describing different locations related to the
  loader
- Add an example explaining how to install a new loader.efi to ESP
- Reference uefi(8)

Reviewed by: tsoome
Reviewed by: Pau Amma <pauamma@gundo.com>
Reviewed by: Jose Luis Duran <jlduran@gmail.com>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D34592