out* arguments are different on Linux and the i915 driver uses them.
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35942
Make most AST handlers dynamically registered. This allows to have
subsystem-specific handler source located in the subsystem files,
instead of making subr_trap.c aware of it. For instance, signal
delivery code on return to userspace is now moved to kern_sig.c.
Also, it allows to have some handlers designated as the cleanup (kclear)
type, which are called both at AST and on thread/process exit. For
instance, ast(), exit1(), and NFS server no longer need to be aware
about UFS softdep processing.
The dynamic registration also allows third-party modules to register AST
handlers if needed. There is one caveat with loadable modules: the
code does not make any effort to ensure that the module is not unloaded
before all threads processed through AST handler in it. In fact, this
is already present behavior for hwpmc.ko and ufs.ko. I do not think it
is worth the efforts and the runtime overhead to try to fix it.
Reviewed by: markj
Tested by: emaste (arm64), pho
Discussed with: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D35888
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
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
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
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
With clang 15, the following -Werror warning is produced:
sys/compat/linux/linux_util.c:243:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
linux_get_char_devices()
^
void
This is because linux_get_char_devices() is declared with a (void)
argument list, but defined with an empty argument list. Make the
definition match the declaration.
MFC after: 3 days
It used to be mapped at the top of the UVA.
If the randomization is enabled any address above .data section will be
randomly chosen and a guard page will be inserted in the shared page
default location.
The shared page is now mapped in exec_map_stack, instead of
exec_new_vmspace. The latter function is called before image activator
has a chance to parse ASLR related flags.
The KERN_PROC_VM_LAYOUT sysctl was extended to provide shared page
address.
The feature is enabled by default for 64 bit applications on all
architectures.
It can be toggled kern.elf64.aslr.shared_page sysctl.
Approved by: mw(mentor)
Sponsored by: Stormshield
Obtained from: Semihalf
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D35349
Store the shared page address in struct vmspace.
Also instead of storing absolute addresses of various shared page
segments save their offsets with respect to the shared page address.
This will be more useful when the shared page address is randomized.
Approved by: mw(mentor)
Sponsored by: Stormshield
Obtained from: Semihalf
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D35393
This is in preparation for removal of OBJT_DEFAULT. In particular, it
is now cheap to check whether an OBJT_SWAP object has any swap blocks
allocated, so the benefit of having a separate OBJT_DEFAULT type is
quite marginal, and the OBJT_DEFAULT->SWAP transition is a source of
bugs.
Reviewed by: alc, hselasky, kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35779
typecheck macro check if the type of a variable matches a type.
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35569
iwlwifi allocates queues on first wakeup. This takes a lot longer on
FreeBSD's work implementation that it seems to on Linux based on some
discussion. That meant that we couldn't get non-data frames out quickly
enough initially and failed to associate.
d0d2911035 should have solved most of this
for us with iwlwifi. None of the other drivers ported to LinuxKPI/802.11
up to today will call a dequeue so we get notified when the queus are
allocated or even need to do so.
Remove the bandaid initilly put in for iwlwifi now and speed up the
overall process of getting us associated.
MFC after: 3 days
This changes cleans up lsta from the VIF station list as well as
deals with freeing the lsta itself so it is not leaked.
lkpi_iv_update_bss() makes this more complicated than it should be
as we ties more sta state (incl. drv/fw) to the node that net80211
does not know about. There is more work to be done detangling this
now that is better understood.
MFC after: 3 days
In lkpi_iv_update_bss() introduced in d9f59799fc we swap lsta and
along with that sta and drv state if ni gets reused and swapped under
us by net80211. What we did not do was to sync sta->addr which later
(usually in lkpi_sta_assoc_to_run) during a bss_info update cause
problems in drivers (or firmware) as the BSSID and the station address
were not aligned.
If this proves to hold up to fix iwlwifi issues seem on firmware
for older chipsets, multi-assoc runs, and rtw89 (which this fixes)
we should add asserts that lkpi_iv_update_bss() can only happen in
pre-auth stages and/or make sure we factor out synching more state
fields.
Found debugging: rtw89
MFC after: 3 days
To calculate the base (lowest addressable) address of the stack of the
initial thread glibc parses /proc/self/maps.
In fact, the base address is calculated as 'to' value of stack entry of the
/proc/self/maps - stack size limit (if the stack grows down).
The base address should fit in between preceding entry and stack entry of
the /proc/self/maps.
In FreeBSD, since 19bd0d9 (Implement address space guards), we actually
have two mappings for the stack region. The first one is the no-access
mapping for the region the stack can grow into (guard page), and the
second - initial stack region with size sgrowsiz.
The first mapping confuses Glibc, in the end which is improperly
calculate stack size and the base address.
PR: 253337
Reviewed by: kib
Differential revision: https://reviews.freebsd.org/D35537
MFC after: 2 week
This is equivalent to asm/fpu/api.h, but is included by drm on aarch64.
Reviewed by: bz, imp, hselasky
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D35512
For as long as we do not implement the compat code for tx aggregation
return -EINVAL in ieee80211_start_tx_ba_session() as both rtw88 and
rtw89 check for this value and only then disable further attempts.
MFC after: 3 days
We need Giant as we run in a taskqueue_thread via linux_work.
This fix detaching amdgpu and i915kms.
Reviewed by: bz, hselasky, imp
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35478
Fix a build with DEBUG after d0d2911035
which lost the __func__, __LINE__ argument in an updated tracing line.
Reported by: Tomoaki AOKI (junchoon dec.sakura.ne.jp)
MFC after: 2 days
X-MFC with: d0d2911035
A problem which showed up on 13.1 between BETA3 and RC1 was that on older
chipsets the fw would crash. While some 0x18 ADD_STA problems were seen
before, d9f59799fc was the actual trigger for this problem
(in 0x28 MAC_CONTEXT command) in a squashed merge to the releng branch.
Strangely there were no changes to assoc_to_run in that revision so other
circumstances may be the actual cause but swapping the bss_info update and
the sta_state in that function seem to make my 8265 happy while AX200 and
AX210 stay good.
Thanks to everyone who helped debug this.
Sponsored by: The FreeBSD Foundation (partially)
MFC after: 3 days
Rework the way we are dealing with the last queue. If the driver
opts in to STA_MMPDU_TXQ then preferably send all non-data frames
via the last (IEEE80211_NUM_TIDS) queue which otherwise is not used
in station mode.
If we do not have that queue we do individual tx() calls for non-data
frames now.
Everything else goes via the selected queue if possible for as long as
we have a ni (sta) and otherwise resorts to direct tx.
Tested on: Intel AX200 and AX210
Sponsored by: The FreeBSD Foundation
MFC after: 3 days