Commit graph

20756 commits

Author SHA1 Message Date
Mark Johnston 9d975e47d5 exports.5: Clarify that exported dirs should be local mount points
If not, then in general the entire filesystem containing the exported
directory is accessiable.  This may be surprising, so try to make it
more clear.

Reviewed by:	rmacklem, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44614
2024-04-16 18:27:02 -04:00
Mark Johnston 88d09ddea0 exports.5: Update an example to use service(8)
MFC after:	1 week
2024-04-16 18:25:19 -04:00
Ed Maste 73cce7d888 mergemaster: postpone removal to FreeBSD 15
Mergemaster has been deprecated for quite some time, but was not
removed prior to FreeBSD 14.0.  Update the deprecation notice in the man
page to reflect this.

PR:		274967
Reported by:	naddy
Sponsored by:	The FreeBSD Foundation
2024-04-16 10:19:14 -04:00
Ed Maste 40b57cb616 tzsetup: be explicit about *timezone* abbreviation
During the install process tzsetup asks a question like

    Does the abbreviation `EDT' look reasonable?

The installer asks lots of questions, some that relate to the previous
screen or topic and some that do not.  A new user installed FreeBSD for
the first time and was confused by this question, not realizing that it
was asking whether the abbreviation is correct for the selected
timezone.

Reviewed by:	bapt, brooks, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44500
2024-04-16 09:55:46 -04:00
Fernando Apesteguía bc0c6c9cf3 freebsd-update: Add check for kernel modules
People get confused when some software (VirtualBox, etc) does not work as
expected (or at all) after a major upgrade.

We have a nice way to deal with this when using sources, namely including
PORTS_MODULES in /etc/make.conf, but we lack something similar for binary
updates.

This patch retrieves a list of kernel modules installed from packages and
advises the user to recompile from ports to avoid problems.

Approved by:		zlei@
Differential Revision:	https://reviews.freebsd.org/D39695
2024-04-14 19:46:23 +02:00
Mathieu bbc6e6c5ec daemon: fix -R to enable supervision mode
If we're doing restarts, then we must supervise -- the 'R' case simply
got missed.

PR:	278342
Fixes:	f907027b49 ("daemon: set supervise_enabled during [..]")
2024-04-13 22:12:36 -05:00
Collin Funk 52a19a90de kldxref: Prefer sys/cdefs.h __unreachable over the builtin
The __builtin_unreachable macro provided by Clang and GCC is a hint to
the compiler used for optimization. The programs work fine even if the
compiler doesn't support it. The sys/cdefs.h has had __unreachable for
9 years (commit 732b31de5d). It expands
to the builtin if it is available. In the rare case that it is
unsupported it expands to a null statement so compilation does not
fail.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Reviewed by: imp, freebsd@igalic.co
Pull Request: https://github.com/freebsd/freebsd-src/pull/1117
2024-04-12 16:39:25 -06:00
Collin Funk f7a10a7752 daemon: Prefer sys/cdefs.h __unreachable over the builtin
The __builtin_unreachable macro provided by Clang and GCC is a hint to
the compiler used for optimization. The programs work fine even if the
compiler doesn't support it. The sys/cdefs.h has had __unreachable for
9 years (commit 732b31de5d). It expands
to the builtin if it is available. In the rare case that it is
unsupported it expands to a null statement so compilation does not
fail.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Reviewed by: imp, freebsd@igalic.co
Pull Request: https://github.com/freebsd/freebsd-src/pull/1117
2024-04-12 16:39:18 -06:00
rilysh 16e5eb212f fdwrite.c: initialize pointers to NULL and a few other cleanups
1. Both trackbuf and vrfybuf are initialized to
zero (NULL). While it's okay to initialize pointers
to zero, to keep consistency, as they're explicitly
pointers, it's better to just use NULL ((void *)0)
instead of 0 (both are equivalent to the compilers).

2. Call free() for both trackbuf and vrfybuf after
their job has been done.

3. Remove the register keyword. Compilers generally
ignore this keyword (except for very very old compilers
and CPUs).

4. Remove the ctype.h header. It's not being used
anywhere in the file.

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1059
2024-04-11 12:24:36 -06:00
John Grafton 215c0a5158 adduser(8): support creation of ZFS dataset
On systems utilizing ZFS, default to creating a ZFS dataset for a new
user's home directory if the parent directory resides on a ZFS dataset.
Add a flag that disables this behavior if the administrator explicitly
does not want it.

If run during installation from within a chroot, set mountpoint to legacy
after dataset creation and mount directly into the chroot.  Then umount
and reset the mountpoint to inherit from parent.

Also support ZFS default encryption on user's home directory.

Feedback by: delphij
Reviewed by: imp, kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/881
2024-04-11 12:13:05 -06:00
Elyes Haouas ec8a394d9c usr.sbin: Remove repeated words
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/887
2024-04-11 11:53:37 -06:00
Elyes Haouas c384235c16 mergemaster: Fix typo
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/882
2024-04-11 11:40:47 -06:00
Elyes Haouas 6addf2595e inetd: Fix typos
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/882
2024-04-11 11:40:44 -06:00
Elyes Haouas dc8725726d pnfsdscopymr: Fix typos
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/882
2024-04-11 11:40:42 -06:00
Elyes Haouas e57d2e4aee crunch: Fix typo
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/882
2024-04-11 11:40:40 -06:00
Elyes Haouas 068e918057 manctl: Fix typo
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/882
2024-04-11 11:40:37 -06:00
Elyes Haouas 5ef49c7820 zonectl: Fix a typo
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/882
2024-04-11 11:40:35 -06:00
Jessica Clarke 014d7082a2 bhyve: Implement a PL031 RTC on arm64
Unlike amd64's, this RTC is implemented entirely in userspace. This is
the same RTC as is provided by QEMU's virt machine.

Reviewed by:	jhb
MFC after:	2 weeks
Obtained from:	CheriBSD
2024-04-10 11:17:56 -04:00
Jessica Clarke e3bd5730ca bhyve: Extract uart-clock from fdt_add_uart as an apb-pclk
This clock will also be used by the PL031 RTC (rather than defining
redundant per-device clocks).

Reviewed by:	jhb
MFC after:	2 weeks
Obtained from:	CheriBSD
2024-04-10 11:17:56 -04:00
Jessica Clarke 4dfa329f48 bhyve: Extend mevent to support updating timers
This will be used by a new PL031 implementation to provide an RTC for
arm64 guests.

Reviewed by:	jhb
MFC after:	2 weeks
Obtained from:	CheriBSD
2024-04-10 11:17:56 -04:00
Jessica Clarke 95b948c1d1 bhyve: Fix arm64 PCI I/O range to match FDT
This is supposed to combine with the memory range to make one contiguous
block, as is laid out in the FDT, so make this match what the OS is told
and thus actually configures.

Also drop the confusing leading zero from all three of these constants
that is making these 9 rather than 8 hex digits long (as one would
expect for a 32-bit address).

Reviewed by:	jhb
MFC after:	2 weeks
Obtained from:	CheriBSD
2024-04-10 11:17:56 -04:00
Jessica Clarke 0efad4aceb bhyve: Support legacy PCI interrupts on arm64
This allows us to remove various #ifdef hacks and enable building more
PCI devices.

Note that a hole is left in the interrupt mapping for the RTC rather
than having the two core devices straddle the PCIe interrupts. QEMU's
virt machine also takes this approach.

Reviewed by:	jhb
MFC after:	2 weeks
Obtained from:	CheriBSD
2024-04-10 11:17:56 -04:00
Mark Johnston 981f9f7495 bhyve: Push option parsing down into bhyverun_machdep.c
After a couple of attempts I think this is the cleanest approach despite
the expense of some code duplication.  Quite a few of the single-letter
bhyve options are x86-specific.

I think that going forward we should strongly discourage the addition of
new options and instead configure guests using the more general
configuration file syntax.

Reviewed by:	corvink, jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D41753
2024-04-10 11:17:56 -04:00
Mark Johnston 11c79f9e35 arm64: Connect bhyve and libvmmapi to the build
Reviewed by:	corvink, andrew, jhb, emaste
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D41742
2024-04-10 11:17:56 -04:00
Mark Johnston 4bb929cc6d bhyve: Partially disable INT#x support in virtio for arm64
A FreeBSD guest won't make use of this support and pci_lintr_* is not
implemented on arm64.  Simply make pci_lintr_*() calls amd64-specific
for now.

Reviewed by:	corvink, jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D41741
2024-04-10 11:17:56 -04:00
Mark Johnston dc6a00f2e4 bhyve: Use vm_raise_msi() instead of vm_lapic_msi()
No functional change intended.

Reviewed by:	corvink, jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D41740
2024-04-10 11:17:56 -04:00
Mark Johnston f286f746f4 bhyve: Add PCI mappings for arm64
- The extended config space and BAR ranges are listed in the FDT.
- Avoid referencing I/O ports in ACPI tables.  Currently the arm64 port
  does not support ACPI in any case.

Reviewed by:	corvink, jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D41739
2024-04-10 11:17:56 -04:00
Mark Johnston fc98569fc3 bhyve: Do not compile PCI passthrough support on arm64
Some required kernel functionality is not yet implemented.

For now this means that one cannot specify host PCI register values, but
that functionality is only used by amd64-specific device models for now.
Note that this limitation is rather artificial; it arises only because
pci_host_read_config() lives in pci_passthru.c.

Reviewed by:	corvink, andrew, jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D41738
2024-04-10 11:17:56 -04:00
Andrew Turner ff50e9d53f bhyve: Add bhyverun and vmexit handlers for arm64
Reviewed by:	corvink, jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D41006
2024-04-10 11:17:56 -04:00
Mark Johnston e497fe8657 bhyve: Use vm_get_highmem_base() instead of hard-coding the value
This reduces the coupling between libvmmapi (which creates the highmem
segment) and bhyve, in preparation for the arm64 port.

No functional change intended.

Reviewed by:	corvink, jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D40992
2024-04-10 11:17:55 -04:00
Mark Johnston eaff4c4f92 bhyve: Add FDT building code for arm64
fdt.c provides some basic routines which let platform initialization
code build the FDT that gets passed into the guest.  For now this is not
very generic; we declare info about CPUs, memory, a single UART
(specified by -o console), a PCIe controller (used for virtio devices),
an interrupt controller and the platform timer.

Co-authored-by:	andrew
Reviewed by:	corvink, jhb
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40996
2024-04-10 11:17:55 -04:00
Mark Johnston d878f72a73 bhyve: Provide optional libfdt linking
The arm64 port currently does not support ACPI, it instead builds up an
FDT which is exported to the guest.  This mechanism will not be used on
amd64 but isn't really arm64-specific either, so provide an opt-in
mechanism to link libfdt.

No functional change intended.

Reviewed by:	corvink, jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D40995
2024-04-10 11:17:55 -04:00
Andrew Turner f3003a0dfb bhyve: Add PL011 UART emulation
This will be use for arm64 guests, instead of the existing ns16550 UART
model.

Reviewed by:	corvink, jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D40997
2024-04-10 11:17:55 -04:00
Konstantin Belousov 1e6db7be69 pciconf(8): dump AMD IOMMU Base Capability
Reviewed by:	emaste
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44732
2024-04-10 08:28:24 +03:00
Lexi Winter 493908c4b4 periodic/daily/801.trim-zfs: Add a daily zfs trim script
As mentioned in zpoolprops(7), on some SSDs, it may not be desirable to
use ZFS autotrim because a large number of trim requests can degrade
disk performance; instead, the pool should be manually trimmed at
regular intervals.

Add a new daily periodic script for this purpose, 801.trim-zfs.  If
enabled (daily_trim_zfs_enable=YES; the default is NO), it will run a
'zpool trim' operation on all online pools, or on the pools listed in
'daily_trim_zfs_pools'.

The trim is not started if the pool is degraded (which matches the
behaviour of the existing 800.scrub-zfs script) or if a trim is already
running on that pool.  Having autotrim enabled does not inhibit the
periodic trim; it's sometimes desirable to run periodic trims even with
autotrim enabled, because autotrim can elide trims for very small
regions.

PR:		275965
MFC after:	1 week
Reviewed by:	imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/956
2024-04-09 15:55:11 -06:00
Rick Macklem cce11997a0 mountd.8: Document the new -A mountd option
Commit fefb7c399b added warning messages noting
that administrative controls that exported directories
that are not local server file system mount points actually
export the entire local server file system.
This commit also added a new command line option "-A' that
silences these warnings.

This patch documents the new "-A' mountd option.

This is a content change.

Reviewed by:	markj, pauamma_gundo.com (manpages)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44692
2024-04-08 18:58:40 -07:00
Rob Norris b9fa1500cb bhyvectl: generate usage from options table
The usage text had fallen out of sync with the actually available
options. Rather than keep them in sync by hand, just generate usage from
the available options.

Signed-off-by: Rob Norris <robn@despairlabs.com>

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44641
2024-04-08 09:08:54 -04:00
Rick Macklem 401c0f8aa1 exports.5: Add RFC number for NFS over TLS
This is a content change.

MFC after:	1 week
2024-04-07 16:35:55 -07:00
Konstantin Belousov f1519a8229 acpidump: add Foundation copyright
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-04-05 18:17:55 +03:00
Konstantin Belousov 6d789b6126 acpidump: dump AMD IVRS table describing IOMMU layout
Reviewed by:	markj
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44634
2024-04-05 18:17:55 +03:00
Konstantin Belousov 969a4b8be5 acpidump: add printfield() helper
Reviewed by:	markj
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44634
2024-04-05 18:17:55 +03:00
Konstantin Belousov 29a6b72775 acpidump: bump WARNS to 6
and disable warnings about unused function args coming from the vendor
acpi headers.

Reviewed by:	markj
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44634
2024-04-05 18:17:55 +03:00
Konstantin Belousov 4262ad56a0 acpidump: the acpi_get_fadt_revision() argument is unused
everywhere except i386.

Reviewed by:	markj
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44634
2024-04-05 18:17:55 +03:00
Konstantin Belousov de937ecb75 acpidump: silent the warning about unaligned uuid
The field comes from the ACPI NFIT table and must be already properly
aligned by BIOS (at least so is written in the spec).

Reviewed by:	markj
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44634
2024-04-05 18:17:55 +03:00
Yan-Hao Wang 1caa5d0861
efitable(8): Complete libxo transition
Reviewed by:	des
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D41411
2024-04-04 02:32:00 +08:00
SHENG-YI HONG 861f5b95b3
acpidump(8) Fix typo in error message
acpidump(8) uses iasl(8) to parse acpi information.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D44596
2024-04-03 01:28:23 +08:00
a-biardi 9181171162 freebsd-update: Fix typo in comment
s/patchname expansion/pathname expansion/

Signed-off-by: a.biardi@tiscali.it
Pull-request: https://github.com/freebsd/freebsd-src/pull/1152
2024-04-02 08:44:56 -04:00
Philipp Ost 2db2566f55 fwget: Add needed firmware for Radeon 780M GPU
PR:	278115
2024-04-02 07:38:00 +02:00
Rick Macklem fefb7c399b mountd.c: Add warning messages for administrative controls
When "administrative controls" (which are exports of subdirectories
within a NFS server's local file system) are used, they export the
entire local server file system. (The subdirectory only applies to
the Mount protocol used for NFSv3 mounts.)

To minimize the risk that this causes confusion w.r.t. what is exported
to NFS client(s), this patch generates warning messages for these.
Only one message is generated for each server local file system.
The messages can be silenced via a new "-A" command line option.

The mountd.8 man page will be patched via a separate commit.

Reviewed by:	emaste, markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D44502
2024-03-31 12:00:08 -07:00
Emmanuel Vadot 0cade55660 pkgbase: Remove FreeBSD-ipfilter package
Put the periodic script for ipfilter in the FreeBSD-ipf package with
all the utilities.

PR:	278042
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2024-03-30 09:39:52 +01:00
Mike Karels 970ea0b2cb bsdinstall: draw attention to new network config options
The network configuration options have changed in bsdinstall, with
an Auto option to proceed directly to DHCP and IPv6 autoconfig (which
is the default) as well as Manual (the old mode).  For users like me
that were used to hitting return automatically to select an interface,
but want manual configuration, attempt to call out the difference:
Change the menu caption to say "Please select a network interface
and configuration mode:" and not just an interface.

Reviewed by:	jrtc27
2024-03-27 15:20:26 -05:00
Mark Peek 3fed4f0db5 certctl: Revert to symlinks.
Unfortunately tar will not be able to extract base.txz to a system where
/etc and /usr are not on the same filesystem if the certificates are
hard links.

PR:		277828
Reviewed by:	mp
Differential Revision:	https://reviews.freebsd.org/D44496
2024-03-25 16:59:02 +01:00
Mark Peek 65904399db efibootmgr: allow -u as a valid option
PR:		277907
Reported by:	vsasjason@gmail.com
MFC after:	1 week
2024-03-24 12:37:12 -07:00
Mark Johnston d1c5d0cfcc bhyve: Move device model-independent UART code into a separate file
Currently bhyve implements a ns16550-compatible UART in uart_emul.c.
This file also contains generic code to manage RX FIFOs and to handle
reading from and writing to a TTY.  bhyve instantiates UARTs to
implement COM devices (via pci_lpc.c) and PCI UART devices.

The arm64 port will bring with it a PL011 device model which is used as
the default console (i.e., no COM ports).  To simplify its integration,
add a UART "backend" layer which lets UART device models allocate an RX
FIFO and interact with TTYs without duplicating code.  In particular,
code in uart_backend.* is to be shared among device models, and the
namespace for uart_emul.* is changed to uart_ns16550_*.

This is based on andrew@'s work in
https://github.com/zxombie/freebsd/tree/bhyvearm64 but I've made a
number of changes, particularly with respect to naming and source code
organization.

No functional change intended.

Reviewed by:	corvink, jhb
MFC after:	1 week
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D40993
2024-03-21 01:04:48 -04:00
Konstantin Belousov 8eaa6be80d daemon(8): handle case of waitpid() returning without exited child
Not checking for either WIFEXITED(status) or zero result results in
never finishing the loop.

PR:	277764
Reviewed by:	kevans (previous version)
Discussed with:	Daniel Tameling
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44401
2024-03-20 03:07:00 +02:00
John Baldwin 785600d0fb kldxref: Properly handle reading strings near the end of an ELF file
If a string is at or near the end of an input file and the amount of
remaining data in the file is smaller than the maximum string size,
the pread(2) system call would return a short read which is treated as
an error.  Instead, add a new helper function for reading a string
which permits short reads so long as the data read from the file
contains a terminated string.

Reported by:	jrtc27
Reviewed by:	jrtc27
Sponsored by:	University of Cambridge, Google, Inc.
Differential Revision:	https://reviews.freebsd.org/D44419
2024-03-18 17:01:23 -07:00
Rick Macklem 8f13abb4fd nfsd.8: Document ways to minimize Copy operation times
For NFSv4.2, a Copy operation can take a long time to complete.
If there is a concurrent ExchangeID or DelegReturn operation
which requires the exclusive lock on all NFSv4 state, this can
result in a stall of the nfsd server.

This patch documents ways to avoid this problem.

This is a content change.

Reviewed by:	karels, wollman, pauamma_gundo.com (manpages)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D44395
2024-03-18 15:40:41 -07:00
Michael Osipov 85c3ef77cc freebsd-update: mark "cron" as fetched as "fetch" itself
The change in 33bd05c318 was incomplete
because it did not mark "cron" as ISFETCHED=1 although it performs the
same operations as "install", but less output and does not perform a
hard exit. Mark result as such and make "install" know that updates have
been fetched.

PR:		277699
Approved by:	jrm (mentor), emaste, cperciva
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D44356
2024-03-18 11:01:59 +01:00
Michael Osipov 59b02bb420 freebsd-update: Don't provide copiable commands in output
Previously, freebsd-update provided ready-to-go commands for copying and
pasting into the terminal. This causes problems as soon as options are
used and not supplied again by the user, e.g., '-b' or '-d'.
Stop making them copiable and force the user to construct a valid command
line by himself to avoid failures.

PR:		276102
Approved by:	jrm (mentor), emaste
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D43700
2024-03-18 10:33:42 +01:00
Jamie Gritton d50685b303 jail: add the -C flag to clean up after a partially removed jail
Differential Revision:	https://reviews.freebsd.org/D42670
2024-03-16 22:11:14 -07:00
Jessica Clarke 75464941dc kldxref: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15
macOS, like Linux, does not include an outer const qualifier for its
fts_open callback arguments, so -Wincompatible-function-pointer-types
also picks this up and breaks the build now Clang 16 makes it an error
by default. Extend the existing Linux support to fix this.

MFC after:	1 week
2024-03-16 01:50:21 +00:00
Kyle Evans 6e2cfb24ee crunchgen: slap a dependency on the generated makefile for .lo
crunchgen generates a foo.lo for each binary it will end up crunching
into the final product.  While they have a dependency on the libs that
are used to link them, nothing will force relinking if the set of libs
needed to link them is changed.  Because of this, incremental builds may
not be possible if one builds a version of, e.g., rescue/ with a broken
set of libs specified for a project -- a subsequent fix won't be rolled
in cleanly, it will require purging the rescue/ objdir.

This is a bit crude, but the foo.mk we generate doesn't actually get
regenerated all that often in practice, so a spurious relink for the
vast majority of crunched objects won't actually happen all that often.

Reviewed by:	bapt, emaste, imp
Differential Revision:	https://reviews.freebsd.org/D43869
2024-03-08 20:01:25 -06:00
Mark Johnston 8a802df1de bhyve/gdb: Avoid rebuilding target.xml for install targets
Otherwise it's impossible to install from a read-only objdir.

Fixes:	f81cdf24ba ("bhyve: Add support for XML register definitions")
Reported by:	olivier
2024-03-07 00:39:07 -05:00
Eugene Grosbein e333110d1d diskinfo(8): introduce new option -l
In modes -p or -s, add an option -l to start each line
with a device name separated with a tab. Update the manual page.
Add an example to list names with corresponding serial numbers:

diskinfo -ls /dev/da?

MFC after:	2 weeks
2024-03-06 00:29:04 +07:00
Hartmut Brandt 83550d02fe Add a missing space in a warning. 2024-03-04 20:08:25 +01:00
Baptiste Daroussin 8fe86d923f usbconfig: allow to get usb vendors and products from the usb.ids database
Reviewed by:		emaste, manu
Differential Revision:	https://reviews.freebsd.org/D3392
2024-02-29 13:01:06 +01:00
Warner Losh bc4c7e78f8 ofwdump: Convert ints that are booleans to bool.
No functional changes...

Sponsored by:		Netflix
2024-02-26 16:15:55 -07:00
Jessica Clarke 09cb8031b4 efibootmgr: Simplify make_next_boot_var_name and fix cnt == 0 case
If cnt == 0 we access element 0 unconditionally, which is out of bounds,
and then if that doesn't crash and happens to be 0 we will access
element - 1, also out of bounds, and then if that doesn't crash will add
1 to whatever junk is there and use that for the variable. On CHERI,
though, this does crash. This code is also overly complicated, with
unnecessary special cases and tracking more state than needed.

Rewrite it in a more general manner that doesn't need those special
cases and naturally works for cnt == 0.

Found by:	CHERI
Reviewed by:	imp
Fixes:		1285bcc833 ("Import Netflix's efibootmgr to help manage UEFI boot variables")
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44029
2024-02-23 02:36:21 +00:00
Chuck Silvers 34467bd762 x86/ucode: add support for early loading of CPU ucode on AMD.
Sponsored by:	Netflix
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43318
2024-02-22 10:04:31 -08:00
Mark Johnston f81cdf24ba bhyve: Add support for XML register definitions
This is useful for exposing additional registers to debuggers.  For
instance, control registers are now available on amd64 when using gdb to
debug a guest.

The stub indicates support by including the string
"qXfer:features:read+" in its feature list.  The debugger queries for
target descriptions by sending the query "qXfer:features:read:" followed
by a file path.

The XML definitions are copied from QEMU and installed to
/usr/share/bhyve/gdb.

Note that we currently don't handle the SIMD registers at all, since
that's of somewhat limited utility (for me at least) and since that
requires new ioctls to fetch the register values.

Reviewed by:	jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D43666
2024-02-20 19:51:34 -05:00
Gleb Smirnoff 6a3e87e130 arp: fix arp -s/-S
When setting a permanent ARP entry, the route(4) would use
rtm->rtm_rmx.rmx_expire == 0 as a flag for installing a static entry, but
netlink(4) is looking for explicit NTF_STICKY flag in the request.  The
arp(8) utility was adopted to use netlink(4) by default, but it has lots
of route-era guts internally. Specifically there is global variable 'opts'
that shares configuration for both protocols, and it is still initialized
with route(4) specific RTF_xxx flags.  In set_nl() these flags are
translated to netlink(4) parameters. However, RTF_STATIC is a flag that is
never set by default, so attempt to use it as a proxy flag manifesting
-s/-S results in losing it.  Use zero opts.expire_time as a manifest of
-s/-S operation.  This is a minimal fix.  A better one would be to fully
get rid of route(4) legacy.

The change also corrects the logic to set NUD_PERMANENT flag for
consistency.  This flag is ignored by our kernel (now).

Reviewed by:		melifaro, tuexen, emaste
PR:			277063
Fixes:			6ad73dbf65
Differential Revision:	https://reviews.freebsd.org/D43983
2024-02-20 10:31:05 -08:00
Boris Lytochkin 03cc3489a0 ndp(8): increase buffer size in rtsock mode
On a router with many connected devices (~10k+) `ndp -an` can fail
with ENOMEM because of some additional NDP records were added
between sysctl() buffer size estimate and data fetch calls.

Allocate more space based on size estimate: 1/64 (~2%) of additional
space, but not less that 4 m_rtmsg structures.

Obtained from:	Yandex LLC
MFC after:	2 weeks
Sponsored by:	Yandex LLC
Differential Revision:	https://reviews.freebsd.org/D43956
2024-02-19 10:44:52 +03:00
Muhammad Moinur Rahman da9cd485d0
crontab/crontab.1: Fix crontab path in man
In FreeBSD the crontabs are stored in /var/cron/tabs directory and not
in /var directory.

Approved by:	kevans
Differential Revision:	https://reviews.freebsd.org/D43181
2024-02-19 00:56:16 +01:00
Mark Johnston 23d4d0fcc1 pmc: Fix some problems with the makefile
- For some reason we don't build it as a PIE, but I don't have any
  problems doing so with either clang or gcc.
- There is no apparent need to override WARNS, so don't.
- Some building with -O0, presumably that's left over from debugging.

MFC after:	1 week
Reviewed by:	imp, brooks
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D43923
2024-02-16 09:50:43 -05:00
Philip Paeps 2911c44baf bsdinstall: remove two dead mirrors 2024-02-15 21:49:33 +08:00
Philip Paeps 9c59988175 bsdinstall: prefer HTTP
In 2024, users are more likely to have working HTTP than working FTP.
Present http://ftp.FreeBSD.org as the first option in the installer.
Keep ftp://ftp.FreeBSD.org as the second option.

MFC after:	3 weeks
2024-02-15 21:49:33 +08:00
Shi-Xin Huang f4e0aec989
ypldap(8): Fix grammar in ypldap.c
Event:		Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/991
2024-02-13 14:11:07 +08:00
Christos Margiolis 5daa7cf42f mixer(8): Use new mixer if we change the default unit
If we use the -d option to change the default unit, close the current
mixer and open the one we set as the default to avoid printing and
applying changes (if any) to the old one.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D43809
2024-02-12 13:00:05 +02:00
Christos Margiolis cc7479d7dc mixer(8): Improve mute and recsrc controls
The input options of "dev.mute" (+, -, ^) and "dev.recsrc" (+, -, ^, =)
are quite cryptic. Allow the input to also be an actual description of
what these options do.

+ -> add (recsrc)
- -> remove (recsrc)
^ -> toggle (recsrc, mute)
= -> set (recsrc)
0 -> off (mute)
1 -> on (mute)

Also, deprecate the use of the symbol options in the EXAMPLES section of
the man page, by using the new descriptive options.

In the future, we might want to get rid of the symbol options
altogether, but preserve backwards compatibility for now.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	dev_submerge.ch, imp
Differential Revision:	https://reviews.freebsd.org/D43796
2024-02-12 13:00:05 +02:00
Christos Margiolis 7bd14d09a9 mixer.8: Fix wrong sentence
246e0457d9 ("mixer.8: Add terse example
for increasing volume") mentions that the example changes the volume of
the "first mixer found", while the example shows how the change the
volume of the current mixer's "vol" device. Re-phrease sentence to
reflect the actual behavior of the command.

Also, improve the example by using the % operator, instead of hardcoding
0.05.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D43795
2024-02-12 13:00:05 +02:00
Christos Margiolis 75be886e58 mixer(8): Allow full PCM device names as input for the -d option
The -d option is a wrapper around hw.snd.default_unit. Currently
mixer(8) expects the option argument to be just the unit's number (e.g
pcm0 -> 0). To avoid confusion, allow full device names of the form
"pcmN" as well.

While here, improve the -d option's description in the man page.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	dev_submerge.ch, imp
Differential Revision:	https://reviews.freebsd.org/D43794
2024-02-12 13:00:05 +02:00
Christos Margiolis 09ba07011a mixer(8): Improve error messsages and warnings
No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	dev_submerge.ch, imp
Differential Revision:	https://reviews.freebsd.org/D43793
2024-02-12 12:59:58 +02:00
Jessica Clarke c994f226bb bsdinstall: Add new Auto option to netconfig interface selection dialog
This changes the OK / Cancel buttons into Auto / Manual / Cancel, with
Auto being the default. Manual behaves like OK used to, i.e. presents a
series of dialogs asking exactly how to configure the interface, and
Cancel is unchanged, exiting with exit code 1. Auto will attempt to
configure IPv4+DHCP and IPv6+SLAAC with no interaction, failing only if
neither can be configured, thereby supporting all of IPv4-only,
IPv6-only and dual-stack environments. If at least one DNS server is
provided, it will also skip asking for DNS settings, otherwise it will
act like Manual mode for the purposes of DNS settings and prompt. For a
standard dual-stack environment this cuts down the number of netconfig
dialogs from 6 (interface, IPv4, DHCP, IPv6, SLAAC, DNS) to just the
first one.

Reviewed by:	brooks
Differential Revision:	https://reviews.freebsd.org/D43731
2024-02-09 18:13:47 +00:00
Mark Johnston 72c166696b traceroute6: Update .PATH and include path after traceroute moved
Fixes:	9b7a920a12 ("traceroute: move from contrib to usr.sbin")
2024-02-08 12:57:33 -05:00
Lexi Winter 3f0b108924 traceroute: remove rcsid tags
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1100
2024-02-08 09:52:42 -07:00
Lexi Winter 6a6c5572c3 traceroute: remove configuration #defines
traceroute used a series of #defines to specify what features are
available on the host platform.  As traceroute is now in source, these
are unnecessary and complicate the code, so remove them.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1100
2024-02-08 09:52:42 -07:00
Lexi Winter 9b7a920a12 traceroute: move from contrib to usr.sbin
traceroute hasn't had a vendor import since 2002, while since then it's
had several significant FreeBSD-specific commits.  Since it's unlikely
another vendor import will happen, and to make the merge of traceroute6
into traceroute easier, import traceroute into usr.sbin.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1100
2024-02-08 09:52:42 -07:00
Mark Johnston e6516294f4 bhyve: Add support for the 'p' query
This lets gdb query individual registers.  It's easy to implement and is
used by gdb when attaching to a CHERI target, so let's support it.

Sponsored by:	Innovate UK
Reviewed by:	corvink, jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D43664
2024-02-07 08:46:59 -05:00
Mariusz Zaborski cd724c2592 bsdinstall: complete whitelabeling the installer
The commit 147585b489 introduces
whitlabeling. This commit addresses couple more places where the
os name was missed.

Reviewed by:	imp, asiciliano, brd
Differential Revision:	https://reviews.freebsd.org/D43638
2024-02-04 13:01:08 +01:00
Jessica Clarke 1e75e61d5c bsdinstall: Fix broken netconfig persistence for installed system
The replacement of echo >> with sysrc -f used sysrc key value, which
means "read variables key and value" and thus did nothing useful (and in
fact emitted errors to the log about neither existing). Instead use the
correct sysrc key=value form so the installed system comes back up with
working networking.

Fixes:	60b37735f3 ("bsdinstall netconfig: avoid duplicate entries in rc.conf")
2024-02-03 22:50:47 +00:00
Jose Luis Duran 5eb1aebf8d traceroute: Lint manuals
Fix a number of warning mandoc -Tlint and igor turned up.  No changes
intended.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/901
2024-02-02 20:14:09 -07:00
Jose Luis Duran ba09352b73 traceroute: Standardize usage
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/901
2024-02-02 20:14:09 -07:00
Jose Luis Duran 00aa635337 traceroute: Update values in examples
Standardize the documentation and update it to reflect the current
values.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/901
2024-02-02 20:14:09 -07:00
Jessica Clarke 7414d14bd5 bsdinstall: Drop Error from title in netconfig no interfaces dialog
This isn't inherently an error. It is if you're attempting to download
dist tarballs or later install packages, but a FreeBSD system with no
NIC is a reasonable setup to have, especially in a throwaway VM setting,
so we shouldn't say it is one.

Leaving the exit code as 1 is still fine, since auto will ignore it, and
avoids breaking other uses.

MFC after:	1 week
2024-02-03 01:52:53 +00:00
Jessica Clarke b809c7d6a2 bsdinstall: Fix netconfig script when no interfaces are present
The script uses [ -z "$INTERFACES" ] to check if the list of interfaces
is empty and will exit early if so, but INTERFACES always contains at
least a space due to the way it appends the list of wireless devices.
Fix this by only adding the space when there are devices to append,
mirroring the behaviour for non-wireless devices above (both will result
in a redundant leading space when the list is non-empty, but that one is
harmless).

Fixes:		159ca5c844 ("Adapt to new wireless scheme where base wlan interfaces do not show up in ifconfig anymore.")
MFC after:	1 week
2024-02-03 01:52:37 +00:00
Ricardo Branco 752a340419 quot: Use getopt(3) and show usage() if no arguments
Also update the man page and usage to be a little more accurate with the
-a flag.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/983
2024-02-02 18:34:59 -07:00
Jessica Clarke 7143521f4c Revert "bsdinstall: separate out dist selection in prep for pkgbase support"
Firstly, my review comments were not addressed and instead totally
ignored. Secondly, and a more valid justification for the revert, this
completely breaks the installer, since selectdists isn't installed.
Given the blatant lack of testing, back out this commit until it has
actually been tested and review comments taken on board so that the
installer actually works.

This reverts commit 009d3f66cb.
2024-02-03 01:31:11 +00:00
Lexi Winter 0a49be722f traceroute6: remove -l flag
The -l flag was used to tell traceroute6(8) to show both hostname and
address for each hop.  However, traceroute(8) already does this by
default, and there's no reason for traceroute6 to behave differently.

Make this the default behaviour, and accept -l for backward
compatibility as a no-op flag.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1023
2024-02-02 14:49:13 -07:00
Graham Perrin 0b287d19e4 freebsd-update(8): Update date
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/826
2024-02-02 13:36:50 -07:00
Graham Perrin 4c1c516c1a freebsd-update(8): wrap to 80 columns
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/826
2024-02-02 13:36:37 -07:00
Graham Perrin a8c1ffca7a freebsd-update(8): Explain conflicts in /etc
Unlike etcupdate(8), freebsd-update only prints the files with
conflicts. It doesn't merge.

PR: 204549
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/826
2024-02-02 13:35:25 -07:00
Lexi Winter 4b1d3a3091 daily/223.backup-zfs: improve daily_backup_zfs_verbose behaviour
- 223.backup-zfs would previously honour the daily_backup_zfs_verbose
  flag for zfs/zpool list, but not for the properties list.  fix it to
  show a diff for both of these if requested.

- if daily_backup_zfs_verbose was disabled, 223.backup-zfs would still
  set rc=1 if the backup files changed, which caused periodic(8) to send
  a useless email even if daily_show_success=NO was set.

  change this so that it only sets rc=1 if diff output is enabled, i.e.
  the output is actually useful to the admin.

MFC after:	2 weeks
Reviewed by:	imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1091
2024-02-02 11:27:05 -07:00
Mina Galić f4613af424 kldxref: Fix maketempfile function's way of finding the root dir
Rather than assuming that the "root" is passed as directory and will be
marked by a trailing slash, we just assume that the directory, which has
been checked previously to be a directory, is a directory.

This fixes an inconsistency between `kldxref /boot/modules`, which tries
to create the temp file in `/boot/`, and `kldxref /boot/modules/`, which
tries to create it in `/boot/modules/` itself.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1093
2024-02-02 08:35:49 -07:00
Baptiste Daroussin 0f4e803733 kbdmap: fix typo preventing kbdmap to work under vt 2024-02-01 08:45:50 +01:00
Baptiste Daroussin f14ea00c8f kbdmap: remove debug 2024-02-01 08:45:50 +01:00
Gregory Neil Shapiro 19d4fb85bf Add new source file for sendmail 8.18.1 2024-02-01 00:04:53 +00:00
Brad Davis 009d3f66cb bsdinstall: separate out dist selection in prep for pkgbase support
No functional change intended.

Approved by:	asiciliano
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D43621
2024-01-31 15:05:27 -07:00
Enji Cooper d6251ebad5 periodic: fix a typo in a comment
No functional change.
2024-01-31 12:45:32 -08:00
John Baldwin c46860dbcb bhyve: Use NVMEF macro to construct fields
Reviewed by:	corvink, chuck (older version)
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43607
2024-01-29 11:02:07 -08:00
John Baldwin c85b3903d1 bhyve: Use the NVMEM macro instead of expanded versions
Reviewed by:	corvink, chuck
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43603
2024-01-29 11:00:09 -08:00
John Baldwin 1dade1f255 nvme: Rename NVMEB helper macro to NVMEM
The current macro always builds a full mask for a named field, so use
the M suffix for mask.

Reviewed by:	chuck, imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43601
2024-01-29 10:58:28 -08:00
John Baldwin c426923606 bhyve: Use NVMEV to read the ASQS field of AQA
This is not a functional change, but just being consistent instead of
omitting a shift by 0.

Reviewed by:	corvink, chuck, imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43600
2024-01-29 10:51:07 -08:00
John Baldwin c9d9315b74 camdd: Use the NVMEV macro instead of expanded versions
Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43599
2024-01-29 10:50:41 -08:00
John Baldwin 94962f5a72 bhyve: Use the NVMEV macro instead of expanded versions
Reviewed by:	corvink, chuck (older version)
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43598
2024-01-29 10:49:49 -08:00
Lexi Winter a84e01f02b service(8): direct user to rc(8) for a list of valid commands
New users may refer to service(8) to discover how to manage services,
but this manpage does not explain which commands are permitted besides
start/stop (for example, 'enable').  Add a paragraph that directs the
reader to rc(8) to discover this.

While here, add a few examples of common use-cases.

Reported by:	Mina Galić <freebsd@igalic.co>
Pull request:	https://github.com/freebsd/freebsd-src/pull/1057
2024-01-29 18:47:09 +01:00
Warner Losh 2b92b754f1 kldxref: Be more conservative about what we reject.
kldxref anything whose name doesn't end in .ko or that has no dots (eg
the kernel).

Sponsored by:		Netflix
Reviewed by:		jrtc27, jhb
Differential Revision:	https://reviews.freebsd.org/D43507
2024-01-28 21:45:23 -07:00
Andriy Gapon bf87d4a4bf efibootmgr: fix potential endless loop with -v
I observed the problem on a system with fairly old and, apparently,
buggy EFI implementation.  A list of boot devices had an invalid
trailing entry.  efidp_size() for that entry returned zero, which means
that the code got stuck looping on that entry.
2024-01-28 15:20:29 +02:00
Ed Maste 176b9e0d72 makefs: warn that ffs sectorsize other than 512 may not work
newfs always sets sectorsize to DEV_BSIZE (512) and derives some other
values based on the number of 512-byte sectors per real sector.  Similar
logic is required in makefs.  Until that happens, emit a warning that
the image may be incorrect.

PR:		276571
2024-01-26 17:27:57 -05:00
Mark Johnston d56ce5915c mpsutil: Clean up libutil deps
mpsutil doesn't use libutil, so doesn't need to include libutil.h.  See
commit 76103694a0.

No functional change intended.

MFC after:	1 week
2024-01-24 17:10:24 -05:00
Ed Maste 1f41c1c1a3 crunch: remove fdisk from examples
It has been deprecated for a long time; gpart should be used instead.
The man page was updated in 2015 to declare it obsolete (b8c19fd719).
2024-01-24 09:12:19 -05:00
Mark Johnston 5f086566e0 bhyve: Prepare to add arm64 support to the gdb stub
In particular:
- Stop assuming that the breakpoint size is one byte.
- Avoid referencing the "rip" field in machine-independent code, use a
  helper.

No functional change intended.

Reviewed by:	corvink, jhb
MFC after:	1 week
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D43483
2024-01-23 11:41:13 -05:00
Mark Johnston 5e728af444 bhyve: Simplify register definitions a bit
It's awkward to have separate tables for information which is logically
connected.  Merge the gdb_regset[] and gdb_regsize[] arrays and update
gdb_read_regs() to cope with the result.  This makes the addition of
arm64 support a bit cleaner.

No functional change intended.

Reviewed by:	corvink, jhb
MFC after:	1 week
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D43481
2024-01-23 11:40:52 -05:00
Mark Johnston cfa2c78aee bhyve: Avoid underflows when handling remote commands
Reviewed by:	corvink, jhb
MFC after:	1 week
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D43480
2024-01-23 11:40:40 -05:00
Christos Margiolis 9f550134a4 acpiconf: remove trailing space in "Mesurement Accuracy" output
No functional change intended.

MFC after: 1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43561
2024-01-23 17:39:40 +02:00
Jamie Gritton 768149ff15 jail: make sure jail.conf parse errors exit, and not crash.
Reported by:	Mason Loring Bliss
2024-01-20 21:20:59 -08:00
Mark Johnston e0deb85065 makefs: Make it possible to silence warnings about duplicate paths
When generating a VM image from an installworld mtree manifest, makefs
spits out several thousand warnings about duplicate paths in the
manifest.  These are harmless and have been around for a long time (see
the phabricator revision for some more details), so let's at least have
a way to make makefs quieter.

Reviewed by:	brooks, imp, emaste
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D43513
2024-01-19 19:50:56 -05:00
Robert Wing fdd1e1a564 bhyve: correct slirp_recv_disable()
Reviewed by:	corvink, markj
Differential Revision:	https://reviews.freebsd.org/D43472
2024-01-17 09:12:44 -09:00
Goran Mekić 6caa19a08b fwget: Use versioned packages for RDNA3 firmware
Fixes:	f596620302 ("fwget: Update for Radeon RX 7900 XT (RDNA3) PCI-ID")
Pointy hat to:	manu
2024-01-17 11:10:49 +01:00
Goran Mekić f596620302 fwget: Update for Radeon RX 7900 XT (RDNA3) PCI-ID
Latest DRM/firmware added support for RDNA3 based GPUs,
update fwget with the proper PCI ID.

Differential Revision:	https://reviews.freebsd.org/D43468
2024-01-17 10:38:07 +01:00
Alexander Leidinger e0dfe185cb jail(8): add support for ZFS datasets
Add zfs.dataset to jail(8) to add a list of ZFS datasets.
Bump FreeBSD version for jail managers to switch to native
dataset support.

Datasets are attached to the jail after the jail creation and
before the execution of any start command. Unlike current
implementations in jail managers which attach datasets after
the start command, this allows the zfs rc.d script to mount
the datasets on start.

Discussed with:	jamie
2024-01-17 08:40:40 +01:00
rilysh e2e956828c bhyve: return ENOMEM instead of EFAULT and call free() after being used
1. In basl_load() function, when allocation fails,
it returns an EFAULT instead of ENOMEM. An EFAULT
can mislead in some scenarios, whereas an ENOMEM
for an allocation function makes much more sense.

2. Call free() on addr, as it's not being used
anymore after the basl_table_append_bytes()
function.

Signed-off-by: rilysh <nightquick@proton.me>

MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1016
2024-01-16 09:39:25 -05:00
Pete Zaitcev 11500481c8 mptable: improve error reporting for invalid commands
mptable ignores arguments with matching first letters, report errors
when it gets garbate.

PR: 38727
Reviewed by: imp
2024-01-15 17:57:28 -07:00
Mark Johnston 2524b7dfb0 crashinfo: Print stack traces for all on-CPU threads
Add a python script which implements the bulk of this functionality.
Over time, this would ideally evolve into a library of python routines
which can be used to inspect kernel data structures and automate some
debugging tasks, similar to jhb's out-of-tree scripts, but written in a
somewhat nicer language and with better integration into the kgdb
command prompt.

Note that kgdb currently won't auto-load scripts in this directory.
This should perhaps change in the future.  It probably also makes more
sense to have a crashinfo.py which provides all the kgdb output that we
want to include in core.txt, rather than having crashinfo.sh pipe in
several commands.

Reviewed by:	avg, imp
Discussed with:	jhb
MFC after:	3 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33817
2024-01-15 16:36:40 -05:00
Michael Tuexen 256fe4a154 tcpsso: fix TIME_WAIT description in man-page
Reviewed by:		manpages(pauamma_gundo.com)
Fixes:			e179d9739b ("tcpsso: support TIME_WAIT state")
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D43424
2024-01-14 14:45:43 +01:00
Peter Grehan 0c243cd4a3 Fix issue with Linux guest XHCI tablet probing.
The USB3 spec mandates that the	device-descriptor max packet size
be 512 bytes, which requires a field size of 9 since it	is a
power-of-2.

Linux kernels recently started validating this field, resulting	in
the table not being probed and the cursor not working in bhyve VNC.

Reviewed by:	corvink
PR:		275760
MFC after:	1 week
2024-01-14 21:38:55 +10:00
Alexander Ziaee 246e0457d9 mixer.8: Add terse example for increasing volume
Reviewed by:	jhb
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1044
2024-01-12 14:55:36 -08:00
Kyle Evans 5df041c4bb bhyveload(8): document some SECURITY CONSIDERATIONS
The situation is improved now that we're running in a sandbox, but there
is still some host machine access that could be concerning depending on
the context.  These concerns may be somewhat mitigated by the fact that
the host machine usually provides the loader binary, even when the guest
image is providing the loader scripts -- they only bring the lua
scripts, and they have to be able to execute arbitrary syscalls rather
than the interfaces provided by libsa(3).

Reviewed by:	jhb, markj
Differential Revision:	https://reviews.freebsd.org/D43299
2024-01-12 13:58:16 -06:00
Yoshihiro Takahashi 1fa4ddcc6d periodic: Fix periodic reports when log files are not compressed.
The modern zcat(1) is capable of handling compressed and uncompressed
text files, so we can simply use zcat command.

PR:		253168
Reviewed by:	delphij
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D43357
2024-01-10 20:48:56 +09:00
John Baldwin 6631e2f9b4 kldxref: Workaround incorrect PT_DYNAMIC in existing powerpc kernels
Existing powerpc kernels include additional sections beyond .dynamic
in the PT_DYNAMIC segment.  Relax the requirement for an exact size
match of the section and segment for PowerPC files as a workaround.

Reported by:	jrtc27
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D43123
2024-01-09 10:57:48 -08:00
Michael Gmelin 731704f5ea bsdinstall: Fix installation script splitting
This allows writing setup scripts that contain lines starting with
"#!", e.g., a shebang when creating a shell script using cat:

    #!/bin/sh
    echo "Populate rc.local"
    cat >/etc/rc.local<<EOF
    #!/bin/sh
    echo booted | logger -s -t 'example'
    EOF

Prevent accidentally running a setup script left behind by a
previous invocation of bsdinstall.

Reviewed by:	imp, jrtc27
Differential Revision:	https://reviews.freebsd.org/D43350
2024-01-09 19:14:17 +01:00
Daniel Ebdrup Jensen 45486372ca nfsv4(4): Reflow lines to 80 character limit
In belatedly fixing a mistake made in fbbdfa2b8a, I noticed that igor
and mandoc -Tlint had a few more things to say.

As such, I'm reflowing a few lines and fixing a contraction.

MFC with:	fbbdfa2b8a
2024-01-09 12:14:57 +01:00
Daniel Ebdrup Jensen c925f0720f nfsv4(4): Belatedly bump .Dd
I forgot to do it when making the commit, so hat-tip to asomers@

Reported by:	asomers@
Fixes:		fbbdfa2b8a (nfsv4(4): mention the nfsv4_server_only..)
MFC with:	fbbdfa2b8a
2024-01-09 12:14:56 +01:00
Kyle Evans cef5e56f3f bhyveload: add CAP_SEEK to our dirfd rights
In the case of hostbase_fd, this is infact a bug fix; we have a seek
callback that the host: filesystem may use in loader, and we really
don't have a good excuse to break it.

bootfd-derived fds will only be used with fdlopen(3) and rtld doesn't
seem to need pread / lseek at all for it today, but there's no reason to
break if it finds a good reason to later.

Suggested by:	markj
2024-01-08 21:08:16 -06:00
John Baldwin 78258ee013 kldxref: Correct contract number in license ACK
Reviewed by:	brooks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D43371
2024-01-08 17:01:05 -08:00
Kyle Evans a4a838a31a bhyveload: make error printing consistent
Previously we used a mix of perror(3) + exit(3) and err(3); standardize
on the latter instead.  This does remove one free() in an error path,
because we're decidedly leaking a lot more than just the loader name
there (loader handle, vcpu, vmctx...) anyways.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43331
2024-01-08 11:49:40 -06:00
Michael Tuexen e179d9739b tcpsso: support TIME_WAIT state
TCP endpoints in TIME_WAIT are not handled in a special way anymore.
Therefore, they can be handled now by tcpsso.

Reviewed by:		rscheff
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D43351
2024-01-06 21:31:46 +01:00
Lexi Winter fbbdfa2b8a nfsv4(4): mention the nfsv4_server_only setting
Add note about configuring the NFSv4-only option.

It is already mentioned in rc.conf(5), but documenting it here makes it
more likely that people see it when they need it.

MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1008
2024-01-06 19:21:25 +01:00
Michael Tuexen f402e08737 tcpsso: fix typos in man page
Reviewed by:		manpages (bcr)
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D43342
2024-01-06 19:17:04 +01:00
Kyle Evans f9b17005bf bhyveload: fix comment style
Reported by:	jrtc27
Fixes: c067be72e8 ("bhyveload: limit rights on the dirfds we create")
2024-01-05 09:54:46 -06:00
Kyle Evans 24cd5c26fe bhyveload: support guest rebooting from the loader
userboot has a EXIT_REBOOT code that it uses when the 'reboot' loader
command is executed.  Use that and longjmp back to reinit the VM
entirely with a reboot request.  This fixes the 'reboot' option in the
loader menu to actually reboot rather than shutdown the VM.

The JMP_* constants are introduced to keep track of why we're doing a
longjmp, though they aren't currently used.  We'll notably still do a
complete reload of the interpreter to give the rebooted VM that new
loader smell.  It just seemed forward thinking to just keep track of the
different setjmp points.

While we're here, we don't actually need to keep the fd we passed to
fdlopen(3), so let's avoid leaking it.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43300
2024-01-05 00:21:15 -06:00