Commit graph

291260 commits

Author SHA1 Message Date
Warner Losh d21c19d412 cam/iosched: Document latency buckets correctly.
Document how latency buckets are actually computed: They are a doubling
from 20us to 10.485s by default, but based at
kern.cam.iosched.bucket_base_us and increase with a ratio of
kern.cam.iosched.bucket_ration / 100 from one to the next.

Sponsored by:		Netflix
2024-05-02 16:02:04 -06:00
Brooks Davis b25ceb97ed Revert "Make WITHOUT_UNDEFINED_VERSION the default"
This is causing failures on gcc13 CI builds so those need to be fixed
or worked around.

This reverts commit 4510f2ca91.
2024-05-02 22:55:08 +01:00
Warner Losh b12cae88cf nvmecontrol: Allow optional /dev/ for device names
nvmecontrol operates on devices. Allow a user to specify the /dev/ if
they want. Any device that starts with / will be treated as if it was a
full path for maximum flexbility.

Sponsored by:		Netflix
2024-05-02 15:52:20 -06:00
Mateusz Piotrowski c40e0bff72 date.1: Note that nanosecond support is to appear first in 14.1
Sponsored by:	Klara, Inc.
2024-05-02 22:48:08 +02:00
Mateusz Piotrowski 54d6fea979 RELNOTES: Mention date(1)'s nanosecond support
Sponsored by:	Klara, Inc.
2024-05-02 22:47:55 +02:00
Mark Johnston d5eae57088 sysctl: Make sysctl_ctx_free() a bit safer
Clear the list before returning so that sysctl_ctx_free() can be called
more than once on the same list without side effects.  This simplifies
error handling in drivers; previously, drivers would have to be careful
to call sysctl_ctx_free() at most once to avoid a use-after-free.

While here, use TAILQ_FOREACH_SAFE in the loop which unregisters OIDs.

Reviewed by:	thj, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45041
2024-05-02 15:42:28 -04:00
Brooks Davis 4510f2ca91 Make WITHOUT_UNDEFINED_VERSION the default
Link with --no-undefined-version by default.  Will detect and prevent
the accidental removal of symbols from versioned libraries.

Reviewed by:	arichardson, kib, dim, emaste
Differential Revision:	https://reviews.freebsd.org/D44216
2024-05-02 18:13:39 +01:00
Brooks Davis 723e60a278 libgcc_s: __extendxftf2 and __trunctfxf2 are amd64-only
__extendxftf2 and __trunctfxf2 build on amd64 not aarch64 and riscv.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D45052
2024-05-02 18:13:23 +01:00
John Baldwin afd0c206a6 ctladm: Use nitems() in a few more places
Sponsored by:	Chelsio Communications

Differential Revision:	https://reviews.freebsd.org/D45017
2024-05-02 09:55:15 -07:00
Mike Karels eb3dbf2dbe in6.h: expose s6_addr* definitions to user level
The only element of of in6_addr that is specified in RFC 3493 or
in POSIX.1-2017 is s6_addr, implemented via a #define to a union
member.  However, FreeBSD and other BSD systems have additional
definitions for the other union members, s6_addr{8,16,32} which
are defined for the kernel and loader.  Some Linux applications
also use them, and they seem to be allowed by the RFC and POSIX.
Remove the current ifdefs, exposing the additional fields to user
level, and replace with #if __BSD_VISIBLE.  Add an explanatory
comment expanding on the previous "nonstandard" comment.

MFC after:	1 week
Reviewed by:	bz
Differential Revision:	https://reviews.freebsd.org/D44979
2024-05-02 10:24:37 -05:00
Michael Tuexen eee88ef45f sctp: document sctp_recvmsg as implemented
PR:		275990
MFC after:	3 days
2024-05-02 15:17:43 +02:00
Richard Scheffenegger 30cf0fbf26 in_pcb: don't leak credential refcounts on error
In the error path during allocating an in_pcb, the credentials
associated with the new struct get their reference count
increased early on, but not decremented when the allocation
fails.

Reported by:		cmiller_netapp.com
MFC after:		3 days
Reviewed by:		jhb, tuexen
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D45033
2024-05-01 08:41:26 +02:00
Ed Maste b07689d1f2 beinstall: retire mergemaster support
Mergemaster has been deprecated for some time, and will be retired.

Reviewed by:	kevans
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D41799
2024-05-01 19:02:00 -04:00
Brooks Davis 98c8caafff libgcc_s: 80-bit long double function are x86-only
Don't try to expose them on other architectures.

Reviewed by:	arichardson
Differential Revision:	https://reviews.freebsd.org/D45028
2024-05-01 21:49:47 +01:00
Stephen J. Kiernan ecaab0fb5d guestrpc module to handle VMware backdoor port GuestRPC functionality
Convert existing FreeBSD vmware_hvcall function to take a channel
and parameter arguments.

Added vmware_guestrpc_cmd() to send GuestRPC commands to the VMware
hypervisor. The sbuf argument is used for both the command to send
and to store the data to return to the caller.

The following KPIs can be used to get and set FreeBSD-specific guest
information in key/value pairs:
 * vmware_guestrpc_set_guestinfo
   - set a value into the guestinfo.fbsd.<keyword> key
 * vmware_guestrpc_get_guestinfo
   - get the value stored in the guestinfo.fbsd.<keyword> key

Add VMware devices to x86 NOTES

Reviewed by:	jhb
Obtained from:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D44528
2024-05-01 15:45:45 -04:00
Colin Percival f4b08097d8 release: Stage non-UFS images in vm-images-stage
When the VM image building code was updated to support building
non-UFS images, the vm-images-stage target was not updated to
install those newly built images to the FTP site.  As a result, we
have been sending weekly snapshot announcements since August claiming
that ZFS VM images are available when they are not in fact present
anywhere publicly accessible.

Fixes:	32ae9a6b39 "release: Build UFS and ZFS VM images"
Reported by:	Michael Dexter
MFC after:	5 days
2024-05-01 11:02:49 -07:00
George V. Neville-Neil 793556efde Fix up a mistake in the CFLAGS added. Pointed out by jrtc. 2024-05-01 13:21:59 -04:00
George V. Neville-Neil e60ca52b72 Out of tree modules should be built with DTrace by default. 2024-05-01 13:00:52 -04:00
Mark Johnston c100fe0ba3 examples: Install bhyve files on arm64
Sponsored by:	Innovate UK
2024-05-01 11:24:05 -04:00
SHENG-YI HONG e10b9d6602 bhyve: Move lock of uart frontend to uart backend
Currently, lock of uart in bhyve is placed in frontend. There are some
problems about it:

1. If every frontend should has a lock, why not move it inside backend
   as they all have same uart_softc.
2. If backend needs to modify the information of uart after initialize,
   it will be impossible as backend cannot use lock. For example, if we
   want implement a telnet support for uart in backend, It should wait
   for connection when initialize. After some remote process connect it,
   it needs to modify rfd and wfd in backend.

So I decide to move it to backend.

Reviewed by:	corvink, jhb, markj
Differential Revision:	https://reviews.freebsd.org/D44947
2024-05-01 11:09:31 -04:00
Mark Johnston aa34b1d20e vmrun.sh: Add arm64 support
For now, we enumerate disk devices before network devices.  This is to
work around a problem wherein u-boot remaps BARs during boot in a way
that bhyve does not handle.  Some discussion and experiments suggest
that this can be handled by having bhyve not map BARs during boot on
arm64; until a solution is implemented, however, this workaround is
sufficient for simple usage and doesn't have any real downsides.

The console and bootrom are specified slightly differently versus amd64,
and a few of vmrun.sh's command-line options are amd64-only.

Reviewed by:	corvink, jhb
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D44933
2024-05-01 08:36:30 -04:00
Mark Johnston c1b37d909e bhyvectl: Add arm64 bits and hook it up to the build
For now this implementation doesn't provide any machine dependent
functionality on arm64, but it's enough to be able to reset and destroy
VMs.

Reviewed by:	jhb
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D44932
2024-05-01 08:33:23 -04:00
Mark Johnston 1c4ee7dfb8 bhyvectl: Prepare to add arm64 support
Move MD code into a separate directory and add a simple interface which
lets the MD bits register options and handle them.

No functional change intended.

Reviewed by:	jhb
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D44932
2024-05-01 08:31:00 -04:00
Mark Johnston 4afce4473d sdt: Add macros which expand to probe and provider structure names
No functional change intended.

MFC after:	1 week
2024-05-01 07:49:35 -04:00
Josef 'Jeff' Sipek 0fe60dc655 fattime: fix fattime to timespec conversion of dates beyond 2106-02-06
It turns out that the only conversion issue was in fattime2timespec, where
multiplying the number of seconds in a day by the number of days overflowed
32-bit unsigned int for dates beyond 2106-02-07 06:28:15.

Casting one of the multiplicands as time_t forces a 64-bit multiplication on
systems where time_t is 64-bits and produces no binary changes on the one
remaining system with 32-bit time_t (namely i386).

Since the code is now tested & fixed, this change removes the fixme comments.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44755
2024-05-01 07:56:41 +03:00
Josef 'Jeff' Sipek 9d1396c346 fattime: make the test code check beyond 32-bit time_t limits
On systems that have a 64-bit time_t, the test code now exercises the whole
range of fattime.  To do this, this commit...

1. replaces the call to random() with two calls to arc4random() to
   generate a 33-bit number of seconds in order to cover the entire range of
   fattime [1970,2107].  (32-bits stops just short - in January 2106.)
   On systems with 32-bit time_t, the extra bits are discarded and only the
   time_t expressible range is tested.
2. casts time_t values passed to printf as longs and changes the format
   string to match.

Now, the test code builds, runs, and exercises what it can (i.e., the whole
fattime range or the 32-bit time_t subset of it) on both 32-bit and 64-bit
time_t systems.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44754
2024-05-01 07:56:41 +03:00
Josef 'Jeff' Sipek 7b8b613d08 fattime: make the test code build again
This change...

1. replaces calls to timet2fattime/fattime2timet with calls to
   timespec2fattime/fattime2timespec.  The functions got renamed shortly
   after they landed in the kernel but the test code wasn't updated (see
   7ea93e912b).
2. adds a utc_offset stub.

With this, the test code builds and runs as a 32-bit binary (cc -Wall -O2
-m32 subr_fattime.c).

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44753
2024-05-01 07:56:41 +03:00
Navdeep Parhar c6c6d4aff9 cxgbe/tom: Fix the rx channel selection in options2.
This affects TOE operation when multiple rx c-channels are in use for
offload, which is an unusual configuration.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-04-30 17:07:15 -07:00
Navdeep Parhar 7f10048f98 cxgbe(4): Query TPCHMAP once and not once per port.
MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-04-30 16:32:55 -07:00
Navdeep Parhar 480ff89c67 cxgbe(4): Rename rx_c_chan to rx_chan.
It is the equivalent of tx_chan but for receive so rx_chan is a better
name.  Initialize both using helper functions and make sure both are
displayed in the sysctl MIB.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-04-30 16:07:24 -07:00
Mark Johnston 2c18289b72 clang-format: Minor tweaks
Invert KeepEmptyLinesAtTheStartOfBlocks.  We used to require an empty
line at the beginning of functions with no local variables, which I
believe is the reason for this setting.  Now it is discouraged in new
code.

Tell clang-format to align consecutive macros, since we tend to do that.
clang-format's output isn't quite what we want here.  Typically we have
a tab after a #define for some reason, and clang-format doesn't appear
to have an option for that.  clang-format will also use a mix of tabs
and spaces to minimize indentation, which is also against our
convention.  However, the result looks better with this setting than
without.

Reviewed by:	emaste
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D29870
2024-04-30 17:33:43 -04:00
Mark Johnston 4a5e2ddbd8 arm: Remove duplicate definitions in armreg.h
No functional change intended.

MFC after:	1 week
2024-04-30 17:33:43 -04:00
Stephen J. Kiernan 46b606c8fd userboot: support environment and symlinks in test application
Pass the environment on to the loader.
Also define USERBOOT=1 in the environment varables.

Add support for symlinks in the test application open callback.

stat the root directory when opening file
Without this, running "ls" command on the root directory encounters
issues getting the directory listing.

Reviewed by:	jhb
Obtained from:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D44625
2024-04-30 16:40:18 -04:00
Justin Hibbits 2cb4909011 cons: Add boot option to mute boot messages after banner
This is useful for embedded systems, where it provides feedback that the
kernel has booted, but avoids printing the probe messages.  If both
mutemsgs and verbose are set, verbose cancels the mute.

Additionally, this unmutes the console on panic, so a user can see what
happened leading up to the panic.

Obtained from:  Juniper Networks, Inc.
2024-04-30 16:23:47 -04:00
Navdeep Parhar 21aba39655 cxgbe(4): Minor tweaks to comments.
No functional change intended.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-04-30 13:02:45 -07:00
Navdeep Parhar 9de0036b55 cxgbe(4): Initialize mps_bg_map to an invalid value if it's not known.
MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-04-30 13:02:44 -07:00
Navdeep Parhar 4d1362cdc7 cxgbe(4): Do not read hardware registers to determine the number of ports.
PORTVEC obtained from the firmware is the authoritative source of this
information, and nports (calculated from PORTVEC) is available by the
time t4_port_init runs.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-04-30 13:02:44 -07:00
Andrew Gallatin 13a5a46c49 Fix new users of MAXPHYS and hide it from the kernel namespace
In cd85379104, kib made maxphys a load-time tunable.  This made
the #define MAXPHYS in sys/param.h  almost entirely obsolete, as
it could now be overridden by kern.maxphys at boot time, or by
opt_maxphys.h.

However, decades of tradition have led to several new, incorrect, uses
of MAXPHYS in other parts of the kernel, mostly by seasoned
developers.  I've corrected those uses here in a mechanical fashion,
and verified that it fixes a bug in the md driver that I was
experiencing.

Since using MAXPHYS is such an easy mistake to make, it is best to
hide it from the kernel namespace.  So I've moved its definition to
_maxphys.h, which is now included in param.h only for userspace.

That brings up the fact that lots of userspace programs use MAXPHYS
for different reasons, most of them probably wrong.  Userspace consumers
that really need to know the value of maxphys should probably be
changed to use the kern.maxphys sysctl.  But that's outside the scope
of this change.

Reviewed by: imp, jkim, kib, markj
Fixes: 30038a8b4e ("md: Get rid of the pbuf zone")
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D44986
2024-04-30 15:29:06 -04:00
Navdeep Parhar 857d74b634 cxgbe(4): Allocate a taskqueue per port instead of per channel.
All the channels are not used on all boards and there's no point
allocating taskqueues that will never be used.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-04-30 11:11:23 -07:00
Brooks Davis 397d8f3c36 libsys: don't try to expose freebsd7___semctl
This has always been in libc and never exported directly.  I accidently
included it along side some freebsd11_* symbols based on a tree where I
moved semctl(2).

Fixes:		df1a09ba52 libsys: expose a few more symbols for libc's use
2024-04-30 19:06:10 +01:00
Dag-Erling Smørgrav 21b5829d28 tftpd: Untangle a conditional.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D45026
2024-04-30 16:56:17 +02:00
Mark Johnston 661a83f9bf vm: Fix error handling in vm_thread_stack_back()
vm_object_page_remove() wants to busy the page, but that won't work
here.  (Kernel stack pages are always busy.)

Make the error handling path look more like vm_thread_stack_dispose().

Reported by:	pho
Reviewed by:	kib, bnovkov
Fixes:	7a79d06697 ("vm: improve kstack_object pindex calculation to avoid pindex holes")
Differential Revision:	https://reviews.freebsd.org/D45019
2024-04-30 09:45:48 -04:00
Olivier Certner 9b30b96c1f
Remove remnants of portsnap(8)
This was prompted by noticing that '/var/db/portsnap' still exists on
newly-installed machines.

With this change, all mentions of portsnap(8) in the tree are gone,
except for the historical note in the AUTHORS section of manpage
phttpget(8).

locate(1) will thus start indexing again '/var/db/portsnap' on machines
where this directory still exists, which may be a good way to push
administrators to delete it.

Reviewed by:            cperciva
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D45023
2024-04-30 22:44:34 +09:00
Martin Matuska c0b58e65de libarchive: merge bugfixes from vendor branch
#2147 archive_string: clean up strncat_from_utf8_to_utf8 (36047967a)
 #2153 archive_match: check archive_read_support_format_raw()
       return value (0ce1b4c38)
 #2154 archive_match: turn counter into flag (287e05d53)
 #2155 lha: Do not allow negative file sizes (93b11caed)
 #2156 tests: setenv LANG to en_US.UTF-8 in bsdunzip test_I.c (83e8b0ea8)

MFC after:	3 days
2024-04-30 11:55:01 +02:00
Martin Matuska ed3e988642 Update vendor/libarchive to libarchive master 83e8b0ea8
#2147 archive_string: clean up strncat_from_utf8_to_utf8 (36047967a)
 #2153 archive_match: check archive_read_support_format_raw()
       return value (0ce1b4c38)
 #2154 archive_match: turn counter into flag (287e05d53)
 #2155 lha: Do not allow negative file sizes (93b11caed)
 #2156 tests: setenv LANG to en_US.UTF-8 in bsdunzip test_I.c (83e8b0ea8)

Obtained from:		libarchive
Libarchive commit:	83e8b0ea8c3b07e07ac3dee90a8724565f8e53fd
2024-04-30 11:49:58 +02:00
Andrew Turner b91f2954bd arm64: Check for virtio for scmi_virtio.c
scmi_virtio.c depends on virtio. Check for this before including it in
the kernel.

Reported by:	Isaac Cilia Attard (via cperciva)
Sponsored by:	Arm Ltd
2024-04-30 08:50:38 +00:00
Konstantin Belousov 5b3e5c6ce3 kcmp_pget(): do not accept TIDs
Otherwise pget() might still look up and hold the current process.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-04-30 10:07:03 +03:00
Konstantin Belousov 1e01650a78 kcmp_pget(): add an assert that we did not hold the current process
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-04-30 10:06:52 +03:00
Emmanuel Vadot 11d79c4756 linuxkpi: Add linuxkpi_video module
This contain the hdmi code and the aperture code like in linux.

Differential Revision:	https://reviews.freebsd.org/D44925
Reviewed by:		bz
Obtained from:		drm-kmod
Sponsored by:		Beckhoff Automation GmbH & Co. KG
2024-04-30 07:42:31 +02:00
Emmanuel Vadot 7f84bb34a1 linuxkpi: hdmi: Split the module declaration to a new file
In order to have a proper linuxkpi_video kmod, move the module declaration
to a new file as linuxkpi_video will also include linux_hdmi.c

Differential Revision:	https://reviews.freebsd.org/D44926
Reviewed by:		bz, emaste, wulf
Sponsored by:		Beckhoff Automation GmbH & Co. KG
2024-04-30 07:41:48 +02:00