Commit Graph

292527 Commits

Author SHA1 Message Date
Jessica Clarke
703768a235 mx25l.4: Document the correct disk device path
This was true at time of commit, but the path was changed 2 weeks later
to just be the /dev/flash/spiN name, without updating the manpage.

Reported by:	David Gilbert <dgilbert@daveg.ca>
Fixes:		68dd779577 ("Give the mx25l device sole ownership of the name /dev/flash/spi* ...")
MFC after:	1 week
2024-06-11 17:43:18 +01:00
Doug Moore
dd0e5c02ab swap_pager: small improvement to find_least
Drop an unneeded test, a branch and a needless computation to save a
few instructions.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D45558
2024-06-11 11:36:23 -05:00
Ed Maste
0277c0c6f7 ktrace(1): add more xrefs
Following commit a87651e2ff add xrefs to intro(2) and sigaction(2),
and use a consistent form.

Suggested by:	kib, arrowd
Reviewed by:	kib (earlier)
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45555
2024-06-11 11:02:00 -04:00
Peter Holm
ff4a72c159 stress2: Replace random() with arc4random() 2024-06-11 15:52:34 +02:00
Peter Holm
cb53f83d8a Revert "stress2: Replace rename() with arc4random()"
This reverts commit f65d0b18d9.

Misleading commit message
2024-06-11 15:51:21 +02:00
Andrew Turner
9a4813e1dc bhyve: Fix the build with gcc
gcc doesn't like const and static to not be at the start of a variable
declaration. Update the gdb_regset arrays to make it more obvious they
are arrays of struct gdb_reg and to fix the gcc build.

Reviewed by:	corvink, markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45550
2024-06-11 13:12:43 +00:00
Andrew Turner
abf239cf09 arm64/vmm: Add braces to fix the gcc build
Reviewed by:	markj, emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45548
2024-06-11 13:12:43 +00:00
Wei Hu
e02d20ddff Hyper_V: add a boot parameter to tlb flush hypercall
Add boot parameter hw.vmbus.tlb_hcall for tlb flush hypercall.
By default it is set to 1 to allow hyercall tlb flush. It can be
set to 0 in loader.conf to turn off hypercall and use system
provided tlb flush routine.

The change also changes flag in the per cpu contiguous memory
allocation to no wait to avoid panic happened some cases which there
are no enough contiguous memery available at boot time.

Reported by:	gbe
Tested by:	whu
MFC after:	1 week
Fixes:		2b887687ed
Sponsored by:	Microsoft
2024-06-11 10:05:21 +00:00
Peter Holm
f65d0b18d9 stress2: Replace rename() with arc4random() 2024-06-11 09:38:13 +02:00
Ryan Libby
e754909cb0 virstor: remove relation between chunk size and MAXPHYS
There's no reason why the virstor chunk size needs to relate to MAXPHYS.
Remove it.  Instead, just make sure that the chunk size is a multiple of
the sector size.

Reviewed by:	imp
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D45518
2024-06-10 17:38:17 -07:00
Ryan Libby
a2fda816eb virstor: write large maps in chunks during label
During the initial label of a virstor device, write out the allocation
map in chunks if it is large (> 1 MB) in order to avoid large mallocs.

Even though the kernel virstor geom may still do a large malloc to
represent the allocation map, this may still be useful to avoid a
ulimit.

Reviewed by:	markj
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D45517
2024-06-10 17:36:20 -07:00
Ryan Libby
0f409d2673 BSD.tests.dist: add entry for virstor test
Reviewed by:	markj
Fixes:		7affbeeab1 virstor: basic functional test
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D45551
2024-06-10 11:56:18 -07:00
Ryan Libby
7affbeeab1 virstor: basic functional test
Reviewed by:	asomers, markj
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D45535
2024-06-10 10:32:22 -07:00
Alan Somers
81ef0a89fc Fix mtree entry for ctladm tests
MFC after:	2 weeks
MFC with:	9747d11d91
Sponsored by:	Axcient
2024-06-10 11:29:48 -06:00
Alan Somers
edbd489d09 ctladm: don't require the use of "-p" with "port -r"
When removing a port, the ioctl frontend requires the "-p" argument.
But other frontends, like cfiscsi, do not.  So don't require that
argument in the ctladm command.  The frontend driver will report an
error if any required argument is missing.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:    mav
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1279
2024-06-10 10:01:25 -06:00
Alan Somers
afecc74cd7 ctladm: better documentation for adding and removing cfiscsi ports
MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:    mav
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1279
2024-06-10 10:01:25 -06:00
Alan Somers
591de7534f ctladm: print port number with a succesful "port -c" command
Make "ctladm port -c" print the port number of the newly successful
port.  This way it won't have to be guessed by a subsequent "ctladm
portlist" command.  That means it's safe to use it concurrently with
other ctladm processes.  In particular, this allows the tests to be run
in parallel.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:    mav
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1279
2024-06-10 10:01:25 -06:00
Alan Somers
9747d11d91 Add some ATF tests for ctladm
So far only "ctladm port -c" and "ctladm port -r" are covered.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	mav
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1279
2024-06-10 10:01:25 -06:00
Ed Maste
0e34d09930 Add WITHOUT_LLVM_BINUTILS src.conf description
Before FreeBSD 15 I plan to switch to LLVM_BINUTILS by default.  Add the
src.conf description now, for the benefit of downstream branches and
testing/CI.

PR:		258872 [exp-run]
Sponsored by:	The FreeBSD Foundation
2024-06-10 11:50:32 -04:00
Andrew Turner
6abad5b606 Remove the arm FIQ support
It isn't used, and only masks/unmasks FIQs on the local CPU so will be
broken on SMP.

Reviewed by:	mmel
Differential Revision:	https://reviews.freebsd.org/D33804
2024-06-10 15:16:10 +00:00
Andrew Turner
86bafddd61 arm64: Fix indentation to be consistent
Adjust the mair_el1 macro indentation to be consistent with the
surrounding macros.

Reviewed by:	emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45524
2024-06-10 15:16:10 +00:00
Andrew Turner
63f7a38343 vmm: Only link the arm64 hyp code in vmm.ko once
This code runs at EL2 while the kernel runs at EL1. We build these
files for EL2 through a dependency in vmm_hyp_blob.elf.full so there
is no need to include them in SRCS.

Reviewed by:	imp, kib, markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45467
2024-06-10 15:16:10 +00:00
Ed Maste
87e5b17c14 prepare-commit-msg: add 50 column marker
A common convention suggests a 50 column commit subject line (the first
line of the commit message).  Add a 50 column marker to the commit
message template

Reviewed by:	lwhsu
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45538
2024-06-10 10:48:32 -04:00
Ed Maste
a87651e2ff ktrace(1): add xref to namei(9)
namei was mistaken for a typo (see GitHub pull request #1284).  Add an
xref to make it clear.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45546
2024-06-10 10:41:45 -04:00
Wei Hu
fd911ae609 Hyper-V: remove unused alloc_pcpu_ptr()
Fixes:		2b887687ed
Sponsored by:	Microsoft
2024-06-10 12:33:46 +00:00
Kristof Provost
3ff0dc1af8 vmxnet3: make descriptor count checks more robust
When we update credits there is a potential for a race causing an
overflow of vxcr_next (i.e. incrementing it past vxcr_ndesc). Change the
check to >= rather than == to be more robust against this.

Reviewed by:	emaste
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D43712
2024-06-10 11:04:47 +02:00
Benedict Reuschling
e5a54f19be accf_tls(9): Fix grammar in description (singular/plural) 2024-06-10 08:29:26 +00:00
Benedict Reuschling
e335a74b56 accf_http.9: Fix grammar in description (singular/plural) 2024-06-10 08:13:58 +00:00
Getz Mikalsen
6c5ee6e55a simd(7): add missing aarch64 SIMD functions
Some of the string functions in contrib/arm-optimized routines are SIMD
enhanced which is not reflect on the simd(7) manpage. This commit
addresses that and introduces a new label A for functions enhanced with
the Arm ASIMD (Neon) extension.

Approved by:	emaste
Reviewed by:	fuz (GSoC mentor)
MFC to:		stable/14
Sponsored by:   Google LLC (GSoC 2024)
Differential Revision:	https://reviews.freebsd.org/D45523
2024-06-09 18:09:44 +02:00
Christos Margiolis
bbca3a75bb sound: Include sound(4) channel information in sndstat nvlist
Extend SNDST_DSPS_PROVIDER_INFO for sound(4) to include information
about each channel in a given device, similar to how cat'ing
/dev/sndstat with hw.snd.verbose=2 works.

While here, document all provider_info fields.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D45501
2024-06-09 17:30:22 +02:00
Mark Johnston
da925fcebf libc/tests: Further refine the condition for installing h_raw
See 8164d511d6 ("libc/tests: Fix installation without MK_TOOLCHAIN")
for some background.  Here we should really be testing MK_CLANG instead,
since that's what gates compilation of libclang_rt.

Fixes:	8164d511d6 ("libc/tests: Fix installation without MK_TOOLCHAIN")
2024-06-09 10:08:31 -04:00
Mark Johnston
3ce9b2ee94 ti/am335x: Fix the device_set_descf() call in dmtpps_probe()
Fixes:	459dc61c8b ("arm: Convert drivers to use device_set_desc(f)()")
2024-06-09 10:08:31 -04:00
Zhenlei Huang
2671bde992 pfsync: Correctly check if bpf peers are present
On creating the pfsync(4) interface, pfsync_clone_create() does an
unconditional bpfattach(). Use bpf_peers_present() which was introduced
in commit 16d878cc99 [1] to check the presence of bpf peers.

This will save a little CPU cycles and memory usage when the
synchronisation interface is not configured and there is no bpf peers
present. There should be no functional change.

1. 16d878cc99 Fix the following bpf(4) race condition which can result in a panic

Reviewed by:	kp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45533
2024-06-09 09:05:22 +08:00
Zhenlei Huang
ebc2bab048 pflog: Correctly check if bpf peers are present
On creating the pflog(4) interface, pflog_clone_create() does an
unconditional bpfattach(). Use bpf_peers_present() which was introduced
in commit 16d878cc99 [1] to check the presence of bpf peers.

This will save a little CPU cycles when no bpf peers present. There
should be no functional change.

1. 16d878cc99 Fix the following bpf(4) race condition which can result in a panic

Reviewed by:	kp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45532
2024-06-09 09:05:22 +08:00
Rick Macklem
13a51233e4 nfsd: Delete an unused VNET global variable
During code inspection, I noticed that
NFSD_VNET_DEFINE(nfsrv_dontlisthead)
is unused, so delete it.

MFC after:	2 weeks
2024-06-08 16:40:52 -07:00
Ed Maste
888796ade2 libm: fma: correct zero sign with small inputs
PR:		277783
Reported by:	Victor Stinner
Submitted by:	kargl
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D44433
2024-06-08 11:55:36 -04:00
Alan Cox
5ee5c40402 arm64 pmap: Defer bti lookup
Defer the bti lookup until after page table page allocation is complete.
We sometimes release the pmap lock and sleep during page table page
allocation.  Consequently, the result of a bti lookup from before
page table page allocation could be stale when we finally create the
mapping based on it.

Modify pmap_bti_same() to update the prototype PTE at the same time as
checking the address range.  This eliminates the need for calling
pmap_pte_bti() in addition to pmap_bti_same().  pmap_bti_same() was
already doing most of the work of pmap_pte_bti().

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D45502
2024-06-08 02:26:55 -05:00
Zhenlei Huang
23f4131ad6 sys/sysctl.h: Fix wrong assertion with multiple access flags
With multiple flags passed in, e.g., CTLFLAG_RD | CTLFLAG_CAPRD, due to
the precedence rules, this will result in false positive assertion. Fix
that by surrounding the replacement lists with parentheses.

Reviewed by:	imp, erj
Fixes:		10a1e981d4 iflib: mark isc_driver_version as constant
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D45531
2024-06-08 11:21:11 +08:00
Kristof Provost
ba2a920786 pf: convert DIOCBEGINADDRS to netlink 2024-06-08 04:46:43 +02:00
Bjoern A. Zeeb
63a327b954 LinuxKPI: 802.11: use net80211 IEEE80211_HTCAP_* definitions
Rather than using the values and leaving net80211 names in a comment
define the LinuxKPI IEEE80211_HT_CAP_* to the net80211 IEEE80211_HTCAP_*
names.  That way errors like the one fixed in 3e0915b7b6 are less
likely to happen.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-06-07 23:57:04 +00:00
Bjoern A. Zeeb
3753988c5d LinuxKPI: pm: add SET_SYSTEM_SLEEP_PM_OPS() and device_can_wakeup()
Add the SET_SYSTEM_SLEEP_PM_OPS() by factoring some other macro code
out in order to set the suspend/resume functions when the struct is
already given.  Such is the case in iwlwifi d3.

Also add an initial implementation of device_can_wakeup().  Though
this is likely all we need we have no way of setting the flag for it
yet so leave a pr_debug() and a comment there as well.  Until we want
to support WoWLAN this is likely not needed for wireless.
Doing it the proper way checking a bool in 'struct dev_pm_info' would
change 'struct device' and with that 'struct pci_dev' and break the
KBI.  In favour of mergeability this version does not implement the
full functionality yet.

Both help to make an updated iwlwifi d3 compile.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D45358
2024-06-07 22:57:04 +00:00
Bjoern A. Zeeb
8866534929 LinuxKPI: 802.11: make sure we can send DISASSOC or DEAUTH frames
The "Invalid TXQ" error from iwlwifi seems to be triggered by a
frame being sent for a sta which is no longer known to the driver/fw.

While we make sure to trigger the sending of the frame in net80211
early enough (by calling (*iv_newstate)() early on rather than at
the end), TX in LinuxKPI is run in a deferred task.  When we drop the
net80211 ic lock again and re-acquire the LHW lock the packet may not
yet have made it to the driver.
Work around this between the (ic and lhw) locks by making sure
(a) no new packets get queued after we return from (*iv_newstate)(),
and (b) the TX task has run or gets cancelled and we manually push
any remaining packets out (or let lsta_free() clean them up).
The disabled packet queuing now also needs to be re-enabled in
scan_to_auth() in case an lsta is staying in service or gets re-used.

Also make sure that any following lkpi_wake_tx_queues() calls no
longer ignore queues which have not seen a prior dequeue.
This former workaround "feature" (ltxq->seen_dequeue) should be
fully garbage collected in a later change on its own.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
PR:		274382
Tested by:	emaste, lwhsu, thj, rkoberman at gmail.com
Accepted by:	adrian
Differential Revision: https://reviews.freebsd.org/D45508
2024-06-07 21:47:42 +00:00
Bjoern A. Zeeb
105b9df26e LinuxKPI: 802.11: close race lkpi_sta_scan_to_auth()/(*iv_update_bss)()
We have to unlock the net80211 ic lock in order to be able to call
sleepable downcalls to the driver/firmware; a 2nd thread may go through
net80211::join1() and (*iv_update_bss)() after we checked and unlocked.
Re-check status at the end of the function under the ic lock so that we
do not accidentally set lvif_bss_synched to true again despite it no
longer being true.

This should fix a race where we lost the (*iv_update_bss)() state
during startup where one SCAN->AUTH is followed by a (then) AUTH->AUTH
and lkpi_sta_a_to_a() did the wrong thing.

Once we re-consider net80211 state and allowing a second join
on a different node or iv_bss update without previously tearing down
the older node we can likely undo a lot of these extra checks and
workarounds.

Sponsored by:	The FreeBSD Foundation (updated version)
Tested by:	emaste (on and off)
MFC after:	3 days
Reviewd by:	cc
Differential Revision: https://reviews.freebsd.org/D43967
2024-06-07 21:40:32 +00:00
Bjoern A. Zeeb
3e0915b7b6 LinuxKPI: 802.11: Fix definition of IEEE80211_HT_CAP_RX_STBC
IEEE80211_HT_CAP_RX_STBC was set to 0x100 instead of 0x300.
Correct to get the expected behavior.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Fixes:		b0f7376822 LinuxKPI: 802.11 header updates
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D45506
2024-06-07 21:16:49 +00:00
Bjoern A. Zeeb
5bbf4b6291 net80211: fix IEEE80211_FHT_BITS
AMPDU_RX was added as a second AMPDU_TX, LDPC_TX and LDPC_RX missing;
correct and add missing.
Makes ddb output (and other debugging) look more correct.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D45505
2024-06-07 21:15:04 +00:00
Bjoern A. Zeeb
582469016a LinuxKPI: 802.11: initalize lsta to NULL in linuxkpi_ieee80211_rx()
The logic following this new assignment in some cases may not set lsta
but the later tracing is checking for it to be != NULL.
With lsta not initialized that check may not hold up and later we would
dereference lsta->state and possibly panic.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D45507
2024-06-07 21:06:31 +00:00
Kristof Provost
d9ab899931 pf: migrate DIOCGETLIMIT/DIOCSETLIMIT to netlink
Event:		Kitchener-Waterloo Hackathon 202406
2024-06-07 20:59:02 +02:00
Kristof Provost
ea6d6addc9 pf.conf.5: remove 'set limit tables'
We've never supported this (or at least not since 2012) limit. Remove it from
the man page.

Event:		Kitchener-Waterloo Hackathon 202406
2024-06-07 20:59:02 +02:00
Dimitry Andric
ead8e4c081 Merge commit 382f70a877f0 from llvm-project (by Louis Dionne):
[libc++][NFC] Rewrite function call on two lines for clarity (#79141)

  Previously, there was a ternary conditional with a less-than comparison
  appearing inside a template argument, which was really confusing because
  of the <...> of the function template. This patch rewrites the same
  statement on two lines for clarity.

Merge commit d129ea8d2fa3 from llvm-project (by Vitaly Buka):

  [libcxx] Align `__recommend() + 1`  by __endian_factor (#90292)

  This is detected by asan after #83774

  Allocation size will be divided by `__endian_factor` before storing. If
  it's not aligned,
  we will not be able to recover allocation size to pass into
  `__alloc_traits::deallocate`.

  we have code like this
  ```
   auto __allocation = std::__allocate_at_least(__alloc(), __recommend(__sz) + 1);
      __p               = __allocation.ptr;
      __set_long_cap(__allocation.count);

  void __set_long_cap(size_type __s) _NOEXCEPT {
      __r_.first().__l.__cap_     = __s / __endian_factor;
      __r_.first().__l.__is_long_ = true;
    }

  size_type __get_long_cap() const _NOEXCEPT {
      return __r_.first().__l.__cap_ * __endian_factor;
    }

  inline ~basic_string() {
      __annotate_delete();
      if (__is_long())
        __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
    }
  ```
  1. __recommend() -> even size
  2. `std::__allocate_at_least(__alloc(), __recommend(__sz) + 1)` - > not
  even size
  3. ` __set_long_cap() `- > lose one bit of size for __endian_factor == 2
  (see `/ __endian_factor`)
  4. `__alloc_traits::deallocate(__alloc(), __get_long_pointer(),
  __get_long_cap())` -> uses even size (see `__get_long_cap`)

This should fix incorrect deallocation sizes for some instances of
std::string. Memory profiling or debugging tools like AddressSanitizer,
LeakSanitizer or TCMalloc could then complain about the the size passed
to a deallocation not matching the size originally passed to the
allocation.

Reported by:	Aliaksei Kandratsenka <alkondratenko@gmail.com>
PR:		279560
MFC after:	3 days
2024-06-07 20:43:46 +02:00
Dmitry Luhtionov
4cc4b5e2b5 Add some AMD device IDs. 2024-06-07 13:02:03 -04:00