Fix two last-minute changes of d9f59799fc:
(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: d9f59799fc
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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] 3bb7e02a97
Reviewed by: jhibbits, bdragon
MFC after: 2 days
Sponsored by: Institudo de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D34621
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
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
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
Fix unlock in two-word version and add missing comment.
Fixes#15Fixes#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: 56aaed388b
MFC after: 2 weeks
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: 56aaed388b
MFC after: 2 weeks
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: da3d4469ef
Submitted by: christos@
Differential Revision: https://reviews.freebsd.org/D34617
Sponsored by: NVIDIA Networking
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
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
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: 1b3bef43e3
MFC after: 3 days
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
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: 56aaed388b
MFC after: 2 weeks
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