Commit graph

292246 commits

Author SHA1 Message Date
Doug Moore c0d0bc2bed subr_pctrie: add leaf callbacks to pctrie_reclaim
PCTRIE_RECLAIM frees all the interior nodes in a pctrie, but is little
used because most trie-destroyers want to free leaves of the tree
too. Add PCTRIE_RECLAIM_CALLBACK, with two extra arguments, a callback
function and an auxiliary argument, that is invoked on every non-NULL
leaf in the tree as the tree is destroyed.

Reviewed by:	rlibby, kib (previous version)
Differential Revision:	https://reviews.freebsd.org/D45565
2024-06-13 11:48:09 -05:00
Ed Maste a16cb8709d tzsetup: Correct UTC description
UTC is Coordinated Universal Time, not Greenwich Mean Time.

Reviewed by:	imp, allanjude
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45573
2024-06-12 20:24:49 -04:00
Rick Macklem bb53f071e8 nfscl: Add support for read delegations and atomic upgrade
For NFSv4.1/4.2, an atomic upgrade of a delegation from a
read delegation to a write delegation is allowed and can
result in significantly improved performance.
This patch adds this upgrade to the NFSv4.1/4.2 client and
enables use of read delegations.

For a test case of building a FreeBSD kernel (sources and
output objects) over a NFSv4.2 mount, these changes reduced
the elapsed time by 30% and included a reduction of 80% for
RPC counts when delegations were enabled.  As such, with this
patch there are at least certain cases where enabling
delegations seems to be worth the increased complexity they
bring.

This patch should only affect the NFSv4.1/4.2 behaviour
when delegations are enabled, which is not the default.

MFC after:	1 month
2024-06-12 16:41:12 -07:00
Rick Macklem 4308d6e0fc nfscl: Add a check for VREG for delegations
Since delegations are only issued for regular files, check
v_type to see if the query is for a regular file.  This is
a simple optimization for the non-VREG case.
While here, fix a couple of global variable declarations.

This patch should only affect the NFSv4.1/4.2 behaviour
when delegations are enabled, which is not the default.

MFC after:	1 month
2024-06-12 16:17:23 -07:00
Rick Macklem ec1f285f2e nfscl: Add support for the NFSv4.1/4.2 WANT_xxx flags
NFSv4.1/4.2 defined new OPEN_WANT_xxx flags that a client
can use to hint to the server that delegations are or are
not wanted.  This patch adds use of those delegations to
the client.

This patch should only affect the NFSv4.1/4.2 behaviour
when delegations are enabled, which is not the default.

MFC after:	1 month
2024-06-12 16:11:10 -07:00
Kristof Provost 07ed239698 pf: make TCP sequence number tracking less strict by one octet for FIN packets
The data of a TCP packet must fit into the announced window, but this is not
required for the sequence number of the FIN.  A packet with the FIN bit set and
containing data that fits exactly into the announced window was blocked. Our
stack generates such packets when the receive buffer size is set to 1024. Now
pf uses only the data lenght for window comparison.
OK henning@

Obtained From:	OpenBSD
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-06-12 23:33:11 +02:00
Kristof Provost 20a2fe68fa pf: correctly reset max_win if the SYN-ACK lacks a wscale option.
pf was setting max_win to 0 and discarded retransmitted SYN-ACK segments without
wscale if the original SYN contained a wscale option. with gerhard@, ok
henning@

Obtained From:	OpenBSD
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-06-12 23:33:11 +02:00
Michael Gmelin 8a9f0fa42b ifconfig: Fix default netmask calculation
Reported by:	phk
Reviewed by:	emaste, kp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D45570
2024-06-12 20:10:13 +02:00
Andrew Turner a30149b2a9 arm64: Create a version of vfp_save_state for cpu_switch
This will be used when we add SVE support to reduce the registers
needed to be saved on context switch.

Reviewed by:	imp
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D43305
2024-06-12 14:09:14 +01:00
Andrew Turner 4eec584d79 arm64: Clear td_frame when returning to userspace
When returning from an exception to userspace clear the saved td_frame.
On the next exception this should point to the frame, however this is
not guaranteed.

To ensure the trap frame pointer is either valid or NULL clear it
before returning to userspace in the EL0 synchronous exception handler.

Reviewed by:	kib, markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D44807
2024-06-12 14:08:13 +01:00
Andrew Turner 19782e5bef ibcore: Mark write-only variables
Some LinuxKPI lock macros pass need a flags field passed in. This is
written to but never read from so gcc complains.

Fix this by marking the flags variables as unused to quieten the
compiler.

Reviewed by:	brooks (earlier version), kib
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45303
2024-06-12 14:04:45 +01:00
Andrew Turner a7ae78caaa cdefs: Add __writeonly to mark write only vars
When a variable in write only and can't be removed, e.g. for API
reasons, it is useful to document this fact similar to __diagused
and __witness_used.

Add __writeonly to tell the compiler and anyone looking at the code
that this variable is expected to only be written to, and to not
raise and error.

Reviewed by:	imp, kib
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45561
2024-06-12 14:04:13 +01:00
Ruslan Bukin 62cb671705 riscv: include ahci device to GENERIC.
This is needed for bhyve guest VM.

Reviewed by:	mhorne
Sponsored by:	UKRI
Differential Revision:	https://reviews.freebsd.org/D45497
2024-06-12 13:40:50 +01:00
Andrew Turner bbdf32d94c nanobsd: Remove pre-armv6 support
Remove support for pre-armv6 from nanobsd. It was removed from FreeBSD
in 2020.

Reviewed by:	imp, emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45560
2024-06-12 11:49:13 +00:00
Andrew Turner b8a496dfb6 lib: Remove __ARM_ARCH checks that are always true
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D45559
2024-06-12 11:49:05 +00:00
Doug Moore f0a0420dfd powerof2: replace loops with fls or ilog2
In several places, a loop tests for powers of two, or iterates through
powers of two.  In those places, replace the loop with an invocation
of fls or ilog2 without changing the meaning of the code.

Reviewed by:	alc, markj, kib, np, erj, avg (previous version)
Differential Revision:	https://reviews.freebsd.org/D45494
2024-06-12 05:00:48 -05:00
Doug Moore a880104a21 swap_pager: add new page range struct
Define a page_range struct to pair up the two values passed to
freerange functions. Have swp_pager_freeswapspace also take a
page_range argument rather than a pair of arguments.

In swp_pager_meta_free_all, drop a needless test and use a new
helper function to do the cleanup for each swap block.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D45562
2024-06-11 22:54:39 -05:00
Ed Maste e77ad954bb Revert "libm: fma: correct zero sign with small inputs"
This change introduced a test failure, so revert until that can be
addressed.

This reverts commit 888796ade2.

PR:		277783
Reported by:	rlibby
Sponsored by:	The FreeBSD Foundation
2024-06-11 21:36:12 -04:00
Ed Maste 92927b8bcf msun: update Clang bug reference in fma test
LLVM bugzilla bug 8100 became issue #8472 with the migration to GitHub.

https://github.com/llvm/llvm-project/issues/8472
2024-06-11 20:29:27 -04:00
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