Commit Graph

19917 Commits

Author SHA1 Message Date
Corvin Köhne
2957847031
bhyve: add basl support for checksums
The qemu ACPI table loader patches the ACPI tables. After patching them,
checksums aren't correct any more. It has to calculate a new checksum
for the ACPI table. For that reason, basl has to keep track of checksums
and has to cause the qemu loader to create new checksums for the tables.

The qemu ACPI table loader isn't supported yet. However, the address of
all tables is unknown as long as bhyve hasn't finished ACPI table
creation. So, the checksum of tables which include pointer to other
tables are unknown too. This requires tracking of checksums too.

Reviewed by:		jhb
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D36990
2022-11-15 08:27:10 +01:00
Corvin Köhne
3a766cd0f1
bhyve: add basl support for length fields
ACPI tables have different layouts. So, there's no common position for
the length field. When tables are build by basl, the length is unknown
at the beginning. It has to be set after building the table.

Reviewed by:		jhb
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D36989
2022-11-15 08:27:09 +01:00
Corvin Köhne
995374a655
bhyve: add basl support for generic addresses
In upcoming commits, bhyve will build some ACPI tables by it's own.
Therefore, it should be capable of appending GENERIC_ADDRESS structs to
ACPI tables.

Reviewed by:		jhb, markj
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D36988
2022-11-15 08:27:08 +01:00
Corvin Köhne
e22f5ce2bf
bhyve: add basl support for int values
In upcoming commits, bhyve will build some ACPI tables by it's own.
Therefore, it should be capable of appending int values to ACPI tables.

Reviewed by:		jhb, markj (older version)
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D36987
2022-11-15 08:27:07 +01:00
Corvin Köhne
22a2e94f38
bhyve: use basl to load ACPI tables
Load the blobs compiled by iasl into a basl_table. The basl_table is a
temporary buffer which copies the ACPI tables into guest memory for us.
This allows us in the future to pass the blobs over the qemu fwcfg
interface to the guest.

Reviewed by:		jhb, markj
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D36986
2022-11-15 08:27:06 +01:00
Corvin Köhne
ac3c2b3e38
bhyve: add table dump functions for basl
Developing an ACPI table compiler isn't quite easy. It's helpful if you
can take a look at the ACPI tables created by the compiler.

The dump functions can either dump a ACPI table which was copied into
guest memory or a ACPI table provided for qemu's ACPI table loader.

Reviewed by:		jhb, markj
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D36985
2022-11-15 08:27:04 +01:00
Corvin Köhne
21bbc28426
bhyve: add basic basl implementation
Basl is the bhyve ASL compiler. At the moment, it's just a small wrapper
to call iasl, the Intel ASL compiler. As bhyve will gain support for
qemu's ACPI table loader in the future, it has to create ACPI tables on
it's own. Therefore, it makes sense to create a new file which keeps the
code for basl.

This first implementation of basl supports creating an ACPI table by
appending raw bytes to it. It's also capable of loading all tables into
guest memory.

Reviewed by:		jhb, markj (older version)
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D36984
2022-11-15 08:27:01 +01:00
Corvin Köhne
eff8d03477
bhyve/kdblayout: add some missing keys to german layout
The '/' and '§' keys are missing in the german keyboard layout.

Reviewed by:		markj
Approved by:		manu (mentor)
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D37386
2022-11-15 07:48:27 +01:00
Wanpeng Qian
10846c53c4
bhyve: nvme controller obey async event setting when reporting critical temperature
Async event report is controlled by async event configuration feature
setting. When reporting a critical temperature warning, check the async
event configuration.

Approved by:		manu (mentor)
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D37355
2022-11-15 07:48:26 +01:00
Wanpeng Qian
05a21658eb
bhyve: return FEATURE_NOT_CHANGEABLE for unimplemented feature of NVMe controller
Set Feature is a feature specified function. Currently only some
features have the set procedure. For features that are not handled by
the controller, we should return a FEATURE_NOT_CHANGEABLE error message.

Approved by:		manu (mentor)
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D32802
2022-11-15 07:48:25 +01:00
Wanpeng Qian
8ab99dbea1
bhyve: abort and return FEATURE_NOT_SAVEABLE while set feature with a save flag for NVMe controller.
Currently bhyve's NVMe controller cannot save feature values cross
reboot. It should return a FEATURE_NOT_SAVEABLE error when the command
specifies a save flag.

Quote from NVMe specification, page 205:

https://nvmexpress.org/wp-content/uploads/NVM-Express-1_4-2019.06.10-Ratified.pdf

If the Feature Identifier specified in the Set Features command is not
saveable by the controller and the controller receives a Set Features
command with the Save bit set to one, then the command shall be aborted
with a status of Feature Identifier Not Saveable.

Reviewed by:		chuck (older version)
Approved by:		manu (mentor)
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D32767
2022-11-15 07:48:24 +01:00
Mark Johnston
c4c368fb3e bhyve: Simplify control flow in the xhci device model
We only need to call pci_xhci_xfer_complete() when handling a transfer
to the control endpoint, so move that code into the epid == 1 block and
eliminate a goto.  Also remove an unneeded reinitialization of
setup_trb.

No functional change intended.

MFC after:	1 week
Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D37287
2022-11-14 15:08:45 -05:00
Mark Johnston
84b0b7ea4c bhyve: Fix a typo in a comment
Reported by:	Mikaël Urankar <mikael.urankar@mailo.fr>
Fixes:	719e307f80 ("bhyve: Cast away const when fetching a config nvlist")
2022-11-14 09:01:00 -05:00
Gordon Bergling
30a6c8a3a8 vipw.8: Add a FILES section
Mention passwd related files in the FILES section
of vipw(8).

Obtained from:	OpenBSD
MFC after:	3 days
2022-11-12 12:56:29 +01:00
Mark Johnston
719e307f80 bhyve: Cast away const when fetching a config nvlist
Silence a warning from the compiler about "const" being discarded.  The
warning is correct: nvlist values are supposed to be immutable.
However, fixing this properly will require some contortions on behalf of
consumers who look up a subtree of the config and modify it.  Per a
discussion on freebsd-virtualization@, the solution will probably be to
outright replace the use of nvlists for VM configuration, but until that
happens let's document the problem and silence the warning.

No functional change intended.

MFC after:	2 weeks
Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D37293
2022-11-11 10:02:42 -05:00
Mark Johnston
8b1adff8bc bhyve: Drop volatile qualifiers from snapshot code
They accomplish nothing since the qualifier is casted away in calls to
memcpy() and copyin()/copyout().  No functional change intended.

MFC after:	2 weeks
Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D37292
2022-11-11 10:02:26 -05:00
Mark Johnston
593200c23b bhyve: Drop volatile qualifiers from virtio rings
The qualifiers are there presumably because these rings are mapped into
the guest, but they do not appear to be required for correctness, and
bhyve generally doesn't qualify accesses to guest memory this way.
Moreover, the qualifiers are discarded by snapshot code, causing clang
to emit warnings.  Just stop using volatile here.

MFC after:	2 weeks
Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D37291
2022-11-11 10:02:10 -05:00
Mark Johnston
691e23e6c5 bhyve: Drop volatile qualifiers from xhci hw struct fields
This fixes a warning raised by the removal of the volatile qualifier
from &trb->qwTrb0 in the following snippet:

	xfer_block = usb_data_xfer_append(xfer,
	     (void *)(trbflags & XHCI_TRB_3_IDT_BIT ?
		 &trb->qwTrb0 : XHCI_GADDR(sc, trb->qwTrb0)),
	     trb->dwTrb2 & 0x1FFFF, (void *)addr, ccs);

The use of volatile appears to be inherited from the kernel driver's
definitions of the same structures.  It makes some sense, since USB TRBs
and related structures live in guest memory, but bhyve device models
generally don't volatile-qualify accesses to guest memory and I can't
see how they are required for correctness here.  Moreover, XHCI_GADDR
does not return volatile pointers so we're already being inconsistent.
Just drop the qualifiers to address the warning.

MFC after:	2 weeks
Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D37290
2022-11-11 10:01:52 -05:00
Mark Johnston
0ced97acb0 bhyve: Define an accessor for net backend private data
Use it to silence warnings about potential unaligned accesses.  No
functional change intended.

MFC after:	1 week
Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D37289
2022-11-11 10:01:40 -05:00
Mark Johnston
f64f343809 bhyve: Address warnings about potential unaligned accesses in fwctl.c
This silences some warning about potential unaligned accesses.  No
functional change intended.

MFC after:	1 week
Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D37288
2022-11-11 10:01:27 -05:00
Gordon Bergling
40b245af0f pnfs.4: Fix a typo
- s/attrbute/attribute/

MFC after:3 days
2022-11-08 14:57:06 +01:00
Navdeep Parhar
118cfb829f pciconf(8): Decode ACS extended capability.
MFC after:	1 week
Sponsored by:	Chelsio Communications
Reviewed by:	kib@
Differential Revision:	https://reviews.freebsd.org/D37271
2022-11-07 13:20:22 -08:00
Baptiste Daroussin
a67b925ff3 mail: make The Dragonfly Mail Agent (dma) the default mta.
dma accepts mail from a local Mail User Agent (MUA) and delivers it
locally or to a smarthost for delivery. dma does not accept inbound
mail (i.e., it does not listen on port 25) and is not intended to
provide the same functionality as a full MTA like postfix or sendmail.
It is intended for use cases such as delivering cron(8) mail. which
is the default configuration and usage of sendmail in the default
setup of the base system.

In order to switch the default from sendmail to dma, we teach
mailwrapper to fallback on dma directly if the mailer.conf file cannot
be opened.
We install by default a mailer.conf file which points at dma
We install a mailer.conf file for sendmail in the examples.

Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D37035
2022-11-07 12:49:56 +01:00
Wanpeng Qian
b631954ff0
bhyve: initial PowerCycles value
Currently PowerCycles field of Log Page is 0 and it is an invalid value.
This patch will initial the PowerCycles data to 1.

MFC after:		1 week
Approved by:		manu (mentor)
Reviewed By:		grehan (older version), chuck, corvink
Differential Revision:	https://reviews.freebsd.org/D32558
2022-11-04 10:13:01 +01:00
Mark Johnston
752ba1004a makefs: Fix handling of inherited mountpoints
Commit d7eec79b70 overlooked the fact that
nvlist_find(DATA_TYPE_STRING) does not provide a nul-terminated string.
Fix the leak a different way.

Fixes:	d7eec79b70 ("makefs: Plug a memory leak")
2022-10-28 17:00:22 -04:00
Jung-uk Kim
19ee8335c5 acpica: Merge ACPICA 20221020 2022-10-27 22:04:32 -04:00
Warner Losh
1d21f64149 bhyve: Implement MSR_MISC_FEATURES_ENABLES
Linux reads MISC_FEATURES_ENABLES to manage the CPUID faulting feature
(undocumented in the Intel SDM, but documented in 323850-004 (Intel
Virtualization Technology FlexMigration Application Note). Since bhyve
doesn't emulate this feature, we always return 0. Neither does bhyve
support the MONITOR/MWAIT fault bit also in this MSR (which is
documented in the sdm), so always return 0.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D36602
2022-10-27 11:34:41 -06:00
Mark Johnston
ae71263c66 bhyve: Remove an unused parameter from pci_nvme_append_iov_req()
No functional change intended.

MFC after:	1 week
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D37116
2022-10-27 10:48:55 -04:00
Mark Johnston
a309ad7bd1 bhyve: Fix an apparent pointer arithmetic bug in the xhci emulation
Also remove the out-parameter of pci_xhci_find_stream(), since it's
unused by all callers.

MFC after:	1 week
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D37118
2022-10-27 10:48:55 -04:00
Mark Johnston
04336c0562 bhyve: Make sure that the VNC version is initialized
clang warned that "client_ver" can be left uninitialized.  This change
causes the new connection to be dropped if a version string is not
presented.

MFC after:	1 week
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D37117
2022-10-27 10:48:55 -04:00
Emmanuel Vadot
e7a5a60ed5 pkgbase: Put devmatch in its own package
devmatch is useful on standalone machine but not on jails.
Put devinfo(8) and libdevinfo there too.

Differential Revision:	https://reviews.freebsd.org/D36229
2022-10-26 19:46:38 +02:00
Emmanuel Vadot
a7ffc94849 pkgbase: Put ufs related tools and lib in their own package
It's not really useful in a jail or in a mdroot or even if a users
wants to do a full zfs machine.

Reviewed by:	mckusick
Differential Revision:	https://reviews.freebsd.org/D36227
2022-10-26 19:46:34 +02:00
Maxim Konovalov
b620928d54 hccontrol.8: missed underscore fixed.
PR:	267343
2022-10-25 16:29:44 +00:00
Mark Johnston
ed72168431 bhyve: Address some signed/unsigned comparison warnings
MFC after:	1 week
2022-10-25 11:16:57 -04:00
Mark Johnston
cea34d0705 bhyve: Address signed/unsigned comparison warnings in the e1000 model
No functional change intended.

MFC after:	1 week
2022-10-25 11:16:57 -04:00
Mark Johnston
f0553616cf bhyve: Address signed/unsigned comparison warnings in the AHCI model
No functional change intended.

MFC after:	1 week
2022-10-25 11:16:57 -04:00
Mark Johnston
46f5c82896 bhyve: Address warnings in blockif_proc()
- Use unsigned types for all arithmetic.  Use a new signed variable for
  holding the return value of pread() and pwrite().
- Handle short I/O from pwrite().

MFC after:	1 week
2022-10-25 11:16:56 -04:00
Mark Johnston
e008f5be72 bhyve: Fix a typo in a function name
MFC after:	1 week
2022-10-25 11:16:56 -04:00
Mark Johnston
03f7ccab32 bhyve: Avoid arithmetic on void pointers
No functional change intended.

MFC after:	1 week
2022-10-25 11:16:56 -04:00
Mark Johnston
3b6cb9b436 bhyve: Avoid shadowing global variables in bhyverun.c
- Rename the global cores/sockets/threads to cpu_cores/sockets/threads.
  This way, num_vcpus_allowed() doesn't shadow them.
- The global maxcpus is unused, remove it for the same reason.

MFC after:	1 week
2022-10-25 11:16:56 -04:00
Gordon Bergling
7bef61eef3 dconschat(8): Fix a typo in an error message
- s/faild/failed/

MFC after:	1 week
2022-10-25 12:58:55 +02:00
Mark Johnston
eefd863cba bhyve: Drop a bogus const qualifier
No functional change intended.

MFC after:	1 week
2022-10-24 17:35:16 -04:00
Mark Johnston
fb7ce0a95e bhyve: Use the new vm_limit_rights() interface
This addresses a compiler warning arising from the fact that bhyve
needs to cast away a const qualifier in order to call free().

No functional change intended.

Reviewed by:	jhb
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D37099
2022-10-24 17:33:13 -04:00
Vitaliy Gusev
3b5e5ce87b bhyve: Handle snapshots of unconfigured virtio-net devices
In case of device reset or not configured - features_negotiated is not
set, calling calling pci_vtnet_neg_features is wrong and resume gets
"Segmentation fault".

Reviewed by:	markj
Sponsored by:	vStack
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36244
2022-10-23 14:50:43 -04:00
Mark Johnston
eb805f4e0f bhyve: Annotate an unused function as such
No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Mark Johnston
489392feb7 bhyve: Make hda_ops function tables const
No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Mark Johnston
84633b9d52 bhyve: Put the prototype for vga_render() in a header
No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Mark Johnston
f703dc0ef0 bhyve: Put the prototype for vmexit_task_switch() in a header
No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Mark Johnston
c9faf69874 bhyve: Fix some warnings in the snapshot code
- Qualify unexported symbols with "static".
- Drop some unnecessary and incorrect casts.
- Avoid arithmetic on void pointers.
- Avoid signed/unsigned comparisons in loops which use nitems() as a
  bound.

No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Mark Johnston
63898728b5 bhyve: Avoid arithmetic on void pointers
No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Mark Johnston
cd49c066a3 bhyve: USB device model structures can be qualified with "static"
No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Mark Johnston
7039bdd535 bhyve: Use the proper type for string literals
No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Mark Johnston
33dfef5cf3 bhyve: Fix some warnings in the ps2 emulation code
- Include headers containing prototypes for exported functions.
- Initialize all fields of the extended translation table.
- Qualify an unexported translation table as static.
- Fix error handling for a read(2).
- Fix some style bugs.

No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Mark Johnston
4a1c23a708 bhyve: Address some warnings in bhyverun.c
- Annotate unused parameters as such.
- Avoid shadowing the global "vmexit".

No functional change intended.

MFC after:	1 week
2022-10-23 11:11:33 -04:00
Alan Somers
15b3e3bb7e ctld: if adding a target fails, retry it on the next reload
If the admin creates more CTL ports than kern.cam.ctl.max_ports, then
adding some will fail.  If he then removes some ports and does
"service ctld reload", he would expect that the new ports would get
added in the newly-freed port space. But they don't, because ctld
assigned them port numbers during their first creation attempts.

Fix this bug by removing newly created ports from ctld's internal list
if the kernel rejects them for any reason.  That way, a subsequent
config reload will attempt to add them again, possibly with new port
numbers.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	jhb, mav
Differential Revision: https://reviews.freebsd.org/D36974
2022-10-21 18:28:45 -06:00
Mitchell Horne
fc4c39c54f kldxref: handle R_RISCV_64 relocation
These are emitted in at least two kmods, and kldxref prints a warning.
While here, remove the unneeded local variable 'val'.

Reviewed by:	jrtc27, imp, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37038
2022-10-20 12:01:29 -03:00
Pawel Biernacki
a20a02abcd pmc: remove write-only variable 2022-10-19 20:59:23 +00:00
Ed Maste
b668975218 ntp: retire now-unused MIPS cases 2022-10-19 15:36:23 -04:00
Baptiste Daroussin
3467e28f3d mailwrapper: create mailwrapper symlinks for dma(8)
The Dragonfy Mail Agent (dma) can be used with mailwrapper as a
replacement for sendmail(8)

Even if mailwrapper and sendmail are disabled from the build but
dma is not create all the expect symlinks on mailwrapper and make
mailwrapper a symlink to dma, the same way it was done before when
mailwrapper is disabled by sendmail was not.

Discussed with:	emaste
2022-10-18 16:42:27 +02:00
Mitchell Horne
1e6577831d config(5): drop mention of mips
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D37019
2022-10-17 15:12:12 -03:00
Cy Schubert
865f46b255 unbound: Reapply Vendor import 1.17.0
Reapply 643f9a0581. 64d318ea98 was a
mismerge during fake rebase. Let's reapply it.

Changes include: Added ACL per interface, proxy protocol and bug fixes.

Announcement:   https://nlnetlabs.nl/news/2022/Oct/13/unbound-1.17.0-released/

Merge commit '643f9a0581e8aac7eb790ced1164748939829826' into main
2022-10-16 14:08:33 -07:00
Cy Schubert
8cee2ebac5 Revert "unbound: Vendor import 1.17.0"
This reverts commit 64d318ea98, reversing
changes made to 8063dc0320.

Revert a mismerge which reversed 8063dc0320.
2022-10-16 13:42:15 -07:00
Cy Schubert
64d318ea98 unbound: Vendor import 1.17.0
Added ACL per interface, proxy protocol and bug fixes.

Announcement:   https://nlnetlabs.nl/news/2022/Oct/13/unbound-1.17.0-released/

Merge commit '643f9a0581e8aac7eb790ced1164748939829826' into new_merge
2022-10-16 13:32:55 -07:00
Corvin Köhne
0bda8d3e9f vmm: permit some IPIs to be handled by userspace
Add VM_EXITCODE_IPI to permit returning unhandled IPIs to userland.
INIT and STARTUP IPIs are now returned to userland. Due to backward
compatibility reasons, a new capability is added for enabling
VM_EXITCODE_IPI.

Reviewed by:		jhb
Differential Revision:  https://reviews.freebsd.org/D35623
Sponsored by:           Beckhoff Automation GmbH & Co. KG
2022-10-14 12:03:05 +02:00
Kyle Evans
12b92f3ed8 bsdinstall: use the correct DISTDIR for fetching local distfiles
fetchmissingdists naturally sets BSDINSTALL_DISTDIR to a directory in
the new filesystem that it can write fetched distfiles to.  As a result,
BSDINSTALL_DISTSITE was incorrectly set to the scratch space on /mnt for
the call to distfetch when grabbing local distfiles, and it would
subsequently fail.

Switch to using the copy of BSDINSTALL_DISTDIR that we stashed off
coming into fetchmissingdists; this one is in-fact set to the path where
the local distfiles are stored.

Patch suggested by jrtc27.

Reported and tested by: Daniel O'Connor <darius dons net au>
MFC after:	1 week
2022-10-14 00:22:09 -05:00
Baptiste Daroussin
88e6c9a674 pw: remove the inaccurate anymore information from the README 2022-10-12 12:11:32 +02:00
Baptiste Daroussin
c0358afd5b pw: exit with an error in case of using an illegal option
PR:		263188
Reported by:	Dennis Clarke <dclarke@blastwave.org>
MFC After:	1 week
2022-10-12 12:06:32 +02:00
Rick Macklem
1e588a9ceb rpc.tlsservd: Add an option to run multiple daemons
During discussions with someone that was doing NFS-over-TLS
development for Solaris, we had a concern that the server might
become overloaded after rebooting, due to a large number of
TLS handshake requests from clients.

To alleviate this potential problem, this patch modifies rpc.tlsservd
so that it supports the "-N/--numdaemons" command line option,
which specifies that up to RPCTLS_SRV_MAXNPROCS (currently defined
as 16 in the patch) may be started.

When there are multiple daemons, one is selected by the patched kernel
in a round-robin fashion, to serve a TLS handshake request.

The man page update will be done in a future commit.

Reviewed by:	emaste, karels
Differential Revision:	https://reviews.freebsd.org/D35886
2022-10-08 16:06:16 -07:00
Mark Johnston
5b966d7871 bhyve: Initialize the return value in blockif_register_resize_callback()
MFC after:	1 week
2022-10-08 11:33:43 -04:00
Mark Johnston
3dddf73ee1 bhyve: Make bc_magic unsigned
This addresses a number of compiler warnings about signed/unsigned
comparisons in assertions.

MFC after:	1 week
2022-10-08 11:33:43 -04:00
Mark Johnston
07d82562d8 bhyve: Make pci_bars local to pci_emul.c
MFC after:	1 week
2022-10-08 11:33:42 -04:00
Mark Johnston
98d920d9cf bhyve: Annotate unused function parameters
MFC after:	1 week
2022-10-08 11:33:21 -04:00
Jessica Clarke
a45048565a bsdinstall: Fix race condition when shutting down after installation
Whilst reboot(8) will block whilst it runs, shutdown(8) does not,
daemonizing instead. This means that we must wait after running it,
otherwise we will exit and cause the system to attempt to go multi-user
in parallel with the shutdown daemon killing init. With the new
multi-console support in the installer, runconsoles will immediately
kill this daemon, racing with the daemon being able to signal init as
desired, and I have seen this race be lost in QEMU with a single CPU. In
the past this wasn't such an issue, since shutdown's daemon puts itself
in a new session group immediately after fork (and the parent doesn't
wait until that has happened, so whilst there's technically a race
condition in there where it could receive a SIGHUP from the death of the
parent's session leader, in practice this is very unlikely to be hit.
This means that the only consequence of this oversight before was that
you might get the beginnings of more console output on the way to
multi-user and thus the console would look a little confusing.

Reviewed by:	gjb
Fixes:		e4505364c0 ("release/rc.local: Provide option to shutdown after installation complete")
Fixes:		a09af1b7fd ("bsdinstall release: Start installer on multiple consoles")
Differential Revision:	https://reviews.freebsd.org/D36879
2022-10-06 20:04:04 +01:00
Michael Tuexen
8ff4fc03e6 traceroute6: fix capabilities for the rcv socket
On the receive socket, recvmsg() and poll()/select() is called.
Therefore, CAP_EVENT is needed in addition to CAP_RECV..

While there, check the socket for readbility before calling recvmsg().

Reviewed by:		markj@
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D36878
2022-10-04 23:40:29 +02:00
Mark Johnston
cba2fa7c5b makefs: Add a cast to placate static analyzers
"prefixlen" will always be smaller than 32 but adding a cast is
harmless.

Reported by:	Coverity
2022-10-04 13:05:54 -04:00
Mark Johnston
d7eec79b70 makefs: Plug a memory leak
nvlist_find_string() would return a copy of the found value, but callers
assumed they would have to make their own copy.  It's simpler to change
nvlist_find_string() than it is to change callers, so do that.

Reported by:	Coverity
2022-10-04 13:05:54 -04:00
John Baldwin
2fb81691b0 bhyve: Don't free an invalid pointer.
The netmap-specific data stored at be->opaque is freed by the caller
on error as part of freeing be.

Reviewed by:	markj
Reported by:	GCC -Wfree-nonheap-object
Differential Revision:	https://reviews.freebsd.org/D36828
2022-10-03 16:10:44 -07:00
John Baldwin
3b887005b4 rpc.lockd: Explicitly cast enum nlm_stats values to enum nlm4_stats.
NLM 4 status values are a superset of the older NLM protocol so these
casts are safe while pacifying -Wenum-conversion warnings from GCC.

Reviewed by:	rmacklem
Differential Revision:	https://reviews.freebsd.org/D36816
2022-10-03 16:10:42 -07:00
John Baldwin
c41b161812 ypldap: Fix mismatch in array bounds for ldapclient().
Reviewed by:	emaste
Reported by:	GCC -Warray-parameter
Differential Revision:	https://reviews.freebsd.org/D36807
2022-10-03 16:10:41 -07:00
Jessica Clarke
e571b0f8f8 etcupdate: Fix -N support for build command
Whilst febca0e643 added -N for both build and extract, it only fully
worked for extract; build would perform the actual tree build with
-DNO_ROOT and construct the intended METALOG, but the subsequent tarball
creation did not take this into account and just tarred up the the
directory as-is rather than using the METALOG. This resulted in the
permissions and ownership not being correct, as well as there being a
stray METALOG file in the tarball's root.

Reported by:	avg
Reviewed by:	avg, jhb, imp
Tested by:	avg
Fixes:		febca0e643 ("etcupdate: Add a -N flag to perform a NO_ROOT build")
Differential Revision:	https://reviews.freebsd.org/D36845
2022-10-03 17:16:19 +01:00
Jessica Clarke
a09af1b7fd bsdinstall release: Start installer on multiple consoles
Currently the installer is only started on the primary ("high level")
console. For systems where this is the video console and serial consoles
aren't of interest, and headless systems with just a serial console,
this works just fine, but for systems where both video and serial
consoles are present and meaningful this requires the user to select the
right primary console in loader, with the poor user experience of the
system appearing to hang if they leave the wrong one selected. This
notably differs from our multi-user behaviour of spawning getty on every
console, where the only issue with selecting the wrong primary console
is a quieter boot process until the login prompt appears (or the system
crashes).

Instead, use the newly-added runconsoles helper to run the installer on
every console (except for ttyv*, where only ttyv0 will be used). For
interactive installations, any of the consoles can be used, though only
one should be used at a time as no effort is made to avoid multiple
installations running at the same time clobbering each other. If the
Live CD option is selected, the other installers (which should, if the
user is well-behaved, be sitting at the welcome screen) will be killed.
If an automated install is in use, the primary console will be used to
display its output, and the others will direct the user to the primary
console.

Reviewed by:	brooks, gjb
Differential Revision:	https://reviews.freebsd.org/D36805
2022-10-03 17:09:17 +01:00
Jessica Clarke
d577d6178b bsdinstall release: Move code to a new startbsdinstall wrapper
This separates out the install media-specific environment (creating
bsdinstall_etc) from actually running the installer on a given console.
This will be used by a future change to start the installer on multiple
consoles.

Reviewed by:	brooks, gjb
Differential Revision:	https://reviews.freebsd.org/D36803
2022-10-03 17:09:16 +01:00
Jessica Clarke
a2464ee127 bsdinstall: Add a new runconsoles helper binary
This helper binary will run a given command on every on console, as
defined by /etc/ttys (except for ttyv*, where only ttyv0 will be used).
If one of the command processes exits, the rest will be killed. This
will be used by a future change to start the installer on multiple
consoles.

Reviewed by:	brooks, imp, gjb
Differential Revision:	https://reviews.freebsd.org/D36804
2022-10-03 17:09:16 +01:00
Brad Davis
03d66186f6 bsdinstall: add hooks to allow for easier customizing the install
Approved by:	allanjude
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36459
2022-10-03 09:50:42 -06:00
Dag-Erling Smørgrav
0aa2700123 Put OPIE to rest.
Differential Revision: https://reviews.freebsd.org/D36592
2022-10-02 03:37:29 +02:00
Cy Schubert
35d60ac2e5 unbound: Adjust version string
Sync version string with contrib.

Reported by:	"Herbert J. Skuhra" <herbert@gojira.at>
Fixes:		4f5c8956cf
MFC after:	3 days
2022-10-01 06:51:30 -07:00
Michael Tuexen
a779bb4d94 tcp_sso: add support for TCP_MAXUNACKTIME
Reported by:		rscheff@
Reviewed by:		rscheff@
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D36802
2022-09-29 02:02:11 +02:00
Brooks Davis
b4cfdbfed2 manpages: Remove telnetd references
Mostly remove from the SEE ALSO section, adding a mention of the port
where not removed. Elsewhere, remove as appropriate and change from .Xr
to .Nm where a mention of telnetd continues to make sense (or removing
it would require significant reworking of the surrounding text).

Reviewed by:	imp, delphij, emaste
Differential Revision:	https://reviews.freebsd.org/D36785
2022-09-29 17:56:41 +01:00
Brooks Davis
edb5226248 inetd.conf: update telnetd paths
Follow the example of rsh and point to /usr/local.

Reviewed by:	imp, delphij, emaste
Differential Revision:	https://reviews.freebsd.org/D36783
2022-09-29 17:56:41 +01:00
Mark Johnston
65b8109b4e bhyve: Address some warnings in bhyverun.c
- Add const and __unused qualifiers where appropriate.
- Localize some global variables.
- Consistently spell vmexit state as "vme" in vmexit handlers, to avoid
  shadowing the global vm_exit state array.
- Similarly, avoid shadowing "optarg".

MFC after:	2 weeks
2022-09-29 12:36:44 -04:00
Mark Johnston
6cb261620d bhyve: Use designated initializers for virtio_consts tables
This is easier to read and addresses some compiler warnings.

One might expect these tables to be read-only but it seems that the
snapshot/restore code may modify them.

MFC after:	2 weeks
2022-09-29 12:36:44 -04:00
Mark Johnston
ee83710bc4 bhyve: Address compiler warnings in audio.c
- Avoid arithmetic on void pointers.
- Avoid a signed/unsigned comparison in loops which write or fill audio
  data buffers.

Convert while loops to for loops while here.

MFC after:	2 weeks
2022-09-29 12:36:44 -04:00
Mark Johnston
57d96d8df9 bhyve: Address -Wno-unused warnings in atkbd.c
MFC after:	2 weeks
2022-09-29 12:36:44 -04:00
Mark Johnston
889cec66d3 bhyve: Make smbios tables local to smbiostbl.c
Also flag them as const.

MFC after:	2 weeks
2022-09-29 12:36:44 -04:00
Vinícius Zavam
c153a35bfd
bsdinstall: replace ntpdate by ntpd_sync_on_start
* change current NTP services offered by the FreeBSD Installer;
  * no longer offer ntpdate to be enabled and started on boot;
  * start offering the option to make ntpd set the date and time on boot itself.

The motivation for this change comes from the ntpdate(8) manpage:

  Note: The functionality of this program is now available in the ntpd(8)
  program. See the -q command line option in the ntpd(8) page. After a
  suitable period of mourning, the ntpdate utility is to be retired from
  this distribution.

Approved by:		cy (src), dteske (src)
Differential Revision:	https://reviews.freebsd.org/D36206
2022-09-27 09:04:20 +00:00
Rick Macklem
7652321b79 rpc.tlsclntd.8: Fix the RFC number now that it exists
The RFC for this finally got published and, therefore,
now has a number.  This patch puts this RFC number
in the man page.

This is a content change.

MFC after:	1 week
2022-09-23 16:59:29 -07:00
Rick Macklem
423387bee2 rpc.tlsservd.8: Fix the RFC number now that it exists
The RFC for this finally got published and, therefore,
now has a number.  This patch puts this RFC number
in the man page.

This is a content change.

MFC after:	1 week
2022-09-23 16:53:36 -07:00
Ed Maste
06a400d76b makefs: whitespace cleanup (remove space before tab)
MFC after:	1 week
2022-09-20 10:26:24 -04:00
Jens Schweikhardt
e9e615c88a Fix dead references (wrong section) to sysctl(8). 2022-09-16 20:00:49 +02:00
Gordon Bergling
8f98a937ed uname.1: Clarify the -r option
It is some times hard to understand the difference between
kernel version and userland version. So clarify the -r option
of uname(1) in terms of a printed kernel version.

While here, add some cross references:

- cross reference freebsd-version(1) in uname(1)
- cross reference freebsd-version(1) and uname(1) in freebsd-update(8)

PR:		265594
Reported by:	rwatson
Reviewed by:	gbe, imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36516
2022-09-16 13:27:54 +02:00
Gordon Bergling
59f7c7ff51 cxgbetool(8): Fix a typo in a source code comment
- s/paramter/parameter/

MFC after:	3 days
2022-09-15 10:29:54 +02:00
Brad Davis
2913e785f0 bsdinstall: fix a couple stragglers in whitelabeling the scripts
PR:		265797
Reviewed by:	allanjude, asiciliano
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36235
2022-09-14 11:06:11 -06:00
Jens Schweikhardt
b94e192660 Capitalize title like in all other titles. 2022-09-14 13:42:43 +02:00
Filipe da Silva Santos
10c6af3441 bhyve: Fix build when BHYVE_SNAPSHOT is set
Fixes:		9cc9abf409 ("bhyve: create all vcpus on startup")
Sponsored by:	Beckhoff Automation GmbH & Co. KG
X-MFC-With:	9cc9abf409
2022-09-13 08:32:09 +02:00
Emmanuel Vadot
3fc174845c Revert "vmm: permit some IPIs to be handled by userspace"
This reverts commit a5a918b7a9.

This cause some problem with vm using bhyveload.

Reported by:	pho, kp
2022-09-09 15:55:01 +02:00
Corvin Köhne
a5a918b7a9 vmm: permit some IPIs to be handled by userspace
Add VM_EXITCODE_IPI to permit returning unhandled IPIs to userland.
INIT and Startup IPIs are now returned to userland. Due to backward
compatibility reasons, a new capability is added for enabling
VM_EXITCODE_IPI.

MFC after:              2 weeks
Differential Revision:  https://reviews.freebsd.org/D35623
Sponsored by:           Beckhoff Automation GmbH & Co. KG
2022-09-07 09:07:03 +02:00
Corvin Köhne
9cc9abf409 bhyve: create all vcpus on startup
vcpus could be restarted by the guest by sending an INIT SIPI SIPI
sequence to a vcpu. That's not supported by bhyve yet but it will be
supported in a future commit. So, create the vcpu threads only once on
startup to make restarting a vcpu easier.

MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D35621
Sponsored by:		Beckhoff Automation GmbH & Co. KG
2022-09-07 09:05:36 +02:00
Gordon Bergling
5f285d5537 cd9660(5): Correct a typo in a source code comment
- s/byes/bytes/

MFC after:	3 days
2022-09-04 18:20:09 +02:00
Gordon Bergling
990878b07f pkg(8): Remove a double word in a source code comment
- s/that that/that/

MFC after:	3 days
2022-09-04 17:28:16 +02:00
Gordon Bergling
886ce99dea bhyve(4): Remove a double word in a source code comment
- s/the the/the/

MFC after:	3 days
2022-09-04 13:57:00 +02:00
Alfonso S. Siciliano
5f3ec44e7e
bsdinstall(8) hostname: Update for bsddialog 0.3
* Delete --hline info. bsddialog(1) 0.3 closes an --inputbox pressing
   only Enter (restoring the previous LGPL-dialog behavior).
 * Add dynamic width auto-sizing.
2022-09-03 22:15:12 +02:00
Gordon Bergling
b82cbe4651 cron(8): Fix a typo in a source code comment
- s/overriden/overridden/

MFC after:	3 days
2022-09-03 15:00:29 +02:00
Gleb Smirnoff
f70a2e2948 ipfwpcap: use PF_DIVERT/SOCK_RAW instead of PF_INET/SOCK_RAW/IPPROTO_DIVERT 2022-08-30 16:24:37 -07:00
John Baldwin
bb31aee26b bhyve virtio-scsi: Avoid out of bounds accesses to guest requests.
- Ignore I/O requests with insufficiently sized input or output
  buffers (those not containing compete request headers).

- Ignore control requests with improperly sized buffers.

- While here, explicitly zero the output header of an I/O request to
  avoid leaking malloc garbage from the host if the header is not
  fully populated.

PR:		264521
Reported by:	Robert Morris <rtm@lcs.mit.edu>
Reviewed by:	mav, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36271
2022-08-29 15:37:27 -07:00
John Baldwin
62806a7f31 bhyve virtio-scsi: Tidy warning and debug prints.
Use a consistent prefix ("virtio-scsi: ") similar to the e1000 device
model.

Reviewed by:	mav, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36270
2022-08-29 15:37:15 -07:00
John Baldwin
7afe342dcb bhyve e1000: Sanitize transmit ring indices.
When preparing to transmit pending packets, ensure that the head (TDH)
and tail (TDT) indices are in bounds.  Note that validating values
when they are written is not sufficient along as the transmit length
(TDLEN) could be changed turning a value that was valid when written
into an out of bounds value.

While here, add further restrictions to the head register (TDH).  The
manual states that writing to this value while transmit is enabled can
cause unexpected behavior and that it should only be written after a
reset.  As such, ignore attempts to write while transmit is active,
and also ignore writes of non-zero values.  Later e1000 chipsets have
this register as read-only.

Also ignore any attempts to transmit packets if the transmit ring's
size is zero.

PR:		264567
Reported by:	Robert Morris <rtm@lcs.mit.edu>
Reviewed by:	emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36269
2022-08-29 15:36:57 -07:00
Mark Johnston
09a2fce092 makefs tests: Do not run ZFS tests in parallel
makefs-created pools always have the same GUID and thus cannot be
imported simultaneously.

Reported by:	olivier
2022-08-29 12:54:25 -04:00
Mark Johnston
a3b6b3ac4d makefs tests: Do not install ZFS tests if WITHOUT_ZFS is defined 2022-08-29 12:50:51 -04:00
Mark Johnston
575ca2c265 makefs: Remove some redundant initializations
No functional change intended.
2022-08-29 12:50:51 -04:00
Baptiste Daroussin
5876499023 tzsetup: remove left overs from libbsddialog conversion
PR:	265954
2022-08-26 11:54:17 +02:00
Dag-Erling Smørgrav
0a9b374ecc chown: see also chmod.
Sponsored by:	Klara, Inc.
MFC after:	1 week
2022-08-24 20:21:39 +02:00
Brooks Davis
e9ad2964f5 pkg: Add limited --debug/-d support
Add an internal debug level global:
 - Level 1 (-d) currently does nothing.

 - Level 2 (-d -d) enables libfetch debugging (quite verbose) so it's
   possible to see what pkg is attempting to download without having
   to sniff traffic.

Reviewed by:	debdrup, bapt
Differential Revision:	https://reviews.freebsd.org/D35756
2022-08-24 18:32:09 +01:00
Navdeep Parhar
f6cc21e8e1 cxgbetool: remove unnecessary vertical whitespace.
No functional change.

MFC after:	3 days
2022-08-19 15:38:13 -07:00
John Baldwin
baf753cc19 bhyve: Support other schemes for naming pass-through devices.
Permit naming pass through devices using the syntax accepted by
pciconf (pci[<domain>:]<bus>:<slot>:<func>) as well as by device name
(e.g. "ppt0").

While here, fix an error in the manpage that had the bus and slot
arguments for the original /-delimited scheme swapped.

Reviewed by:	imp, markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36147
2022-08-19 14:58:55 -07:00
Alexander Motin
3b7935f33b Decode couple arrays in NFIT table.
MFC after:	1 week
2022-08-18 21:30:38 -04:00
Jessica Clarke
c6890399fc makefs: Fix issues building as a cross-tool on non-FreeBSD
This adds missing includes, uses the standard dirent.h rather than the
BSD-specific sys/dirent.h subset (which works on macOS but not Linux)
and works around Linux's lack of st_birthtim.

This allows usr.sbin/makefs to be added to LOCAL_XTOOL_DIRS again on
macOS and Linux so that disk images can be cross-built.

Reviewed by:	markj
Fixes:		240afd8c1f ("makefs: Add ZFS support")
Differential Revision:	https://reviews.freebsd.org/D36135
2022-08-18 02:46:28 +01:00
Jessica Clarke
b0ce7dfc5e makefs: Fix 32-bit issues in ZFS time attributes setting
Currently the code copies a struct timespec's raw bits as a pair of
uint64_t. On 64-bit systems this has the same representation, but on
32-bit issues there are two issues:

1. tv_sec is a time_t which is 32-bit on i386 specifically
2. tv_nsec is a long not a 64-bit integer

On i386, this means the assertion should fire as the size doesn't match.
On other 32-bit systems there are 4 bytes of padding after tv_nsec,
which in practice are probably 0, as this data is ultimately coming from
the kernel, so it's deterministic (though the padding bytes are not
required to be preserved by the compiler, so are strictly unspecified).
However, on 32-bit big-endian systems, the padding bytes are in the
wrong half to be harmless, resulting in the nanoseconds being multiplied
by 2^32.

Fix this all by marshalling via a real uint64_t pair like is done by the
real ZFS_TIME_ENCODE.

Reviewed by:	markj
Fixes:		240afd8c1f ("makefs: Add ZFS support")
Differential Revision:	https://reviews.freebsd.org/D36131
2022-08-18 02:46:27 +01:00
Mark Johnston
8502144d7a makefs tests: Add test cases for handling of multiple staging dirs
Sponsored by:	The FreeBSD Foundation
2022-08-17 17:28:01 -04:00
Mark Johnston
582ce32ff8 makefs tests: Whitespace fixes
Sponsored by:	The FreeBSD Foundation
2022-08-17 17:28:00 -04:00
Mark Johnston
8eca320798 makefs: Handle multiple staging directories when creating ZFS pools
The fsnode tree traversal routines used in ZFS mode assume that all
children of a (directory) fsnode can be accessed using a directory fd
for the parent and the child name.  This is true when populating the
image using an mtree manifest or from a single staging directory, but
doesn't work when multiple staging directories are specified.

Change the traversal routines to use absolute path lookups when an mtree
manifest is not in use.  This isn't ideal, but it's the simplest way to
fix the problem.

Reported by:	imp
Sponsored by:	The FreeBSD Foundation
2022-08-17 17:28:00 -04:00
Jens Schweikhardt
3c405c7e83 Indicate which port gdb.1 and kgdb.1 come from. 2022-08-17 19:13:22 +02:00
John Baldwin
fa46f3704b bhyve e1000: Skip packets with a small header.
Certain operations such as checksum insertion and VLAN insertion
require the device model to rewrite the packet header.  The first step
in rewriting the packet header is to copy the existing packet header
from the source packet.  This copy is done by copying data from an
iovec array that corresponds to the S/G entries described by transmit
descriptors.  However, if the total packet length is smaller than the
headers that need to be copied as the initial template, this copy can
overflow the iovec array and use garbage values as the source pointer
to memcpy.  The PR used a single descriptor with a length of 0 in its
PoC.

To fix, track the total packet length and drop requests to transmit
packets whose payload is smaller than the required header length.

While here, fix another issue where the final descriptor could have an
invalid length (too short) that could underflow 'len' when stripping
the checksum.  Skip those requests instead, too.

PR:		264372
Reported by:	Robert Morris <rtm@lcs.mit.edu>
Reviewed by:	grehan, markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36182
2022-08-17 10:01:16 -07:00
John Baldwin
e7439f6aeb bhyve xhci: Cache the value of MaxPStreams when initializing an endpoint.
This avoids type confusion where a malicious guest could rewrite the
MaxPStreams field in an endpoint context after the endpoint was
initialized causing the device model to interpret a guest provided
address (stored in ep_ringaddr of the "software" endpoint state) as a
bhyve host process address (ep_sctx_trbs).  It also prevents a malicious
guest from triggering overflows of ep_sctx_trbs[] by increasing the
number of streams after the endpoint has been initialized.

Rather than re-reading the MaxPStreams value out of the endpoint context
in guest memory on subsequent operations, cache the value in the software
endpoint state.  Possibly the device model should raise errors if the
value of MaxPStreams changes while an endpoint is running.  This approach
simply ignores any such changes by the guest.

PR:		264294, 264347
Reported by:	Robert Morris <rtm@lcs.mit.edu>
Reviewed by:	markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36181
2022-08-17 10:00:36 -07:00
John Baldwin
bcab868a65 bhyve: Style fix for read/write_config. 2022-08-17 10:00:09 -07:00
Chuck Tuffli
6391be3089 bhyve nvme: Switch to POSIX standard functions
Switch bzero to memset and bcopy to memcpy

Reviewed by:	imp, jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36215
2022-08-16 17:23:27 -07:00
Brad Davis
17f4ded551 bsdinstall: add variables to allow skipping over some phases of the install
Reviewed by:	allanjude, dteske
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D35357
2022-08-16 15:11:44 -06:00
Emmanuel Vadot
0c6b2a9179 pkgbase: Put accounting utilities in the acct package 2022-08-16 21:15:19 +02:00
Jens Schweikhardt
1f5e2d569d Oops, wlan(4) is not the removed an(4). Restore that paragraph. 2022-08-16 21:08:17 +02:00
Jens Schweikhardt
1b9ad57f7f The wi(4) and an(4) drivers have been removed. Delete dead xrefs. 2022-08-16 21:05:01 +02:00
Jens Schweikhardt
e1ae2a285a Indicate the port where the referenced man pages come from. 2022-08-16 20:57:30 +02:00
Mark Johnston
d06bf11c06 bhyve: Sprinkle const qualifiers where appropriate
No functional change intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-08-16 14:21:44 -04:00
Mark Johnston
37045dfa89 bhyve: Mark variables and functions as static where appropriate
Mark them const as well when it makes sense to do so.  No functional
change intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-08-16 14:21:44 -04:00
Mark Johnston
75ce327a2c bhyve: Use "void" instead of empty parameter lists
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-08-16 14:21:44 -04:00
Mark Johnston
c4d26f027b makefs: Style
Reported by:	rpokala
Fixes:		187084dddd ("makefs: Align the block buffer used in ZFS mode")
Sponsored by:	The FreeBSD Foundation
2022-08-16 14:21:44 -04:00
Chuck Tuffli
715f82e4f5 bhyve nvme: Support minimal Controller list
Controllers must support the Identify Controller list if they support
Namespace Management. But the UNH NVMe tests use this command regardless
of whether the device under test supports Namespace Management.

This implementation returns an empty Controller list (i.e., Number of
Identifiers is zero).

Fixes UNH Test 1.1.2

Reviewed by:	jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36193
2022-08-16 09:15:53 -07:00
Chuck Tuffli
ec0efe34dd bhyve nvme: Fix reported SANICAP value
The NVMe specification only allows Controllers compliant with the
revision 1.3 and earlier specification to report a value of 0x0 in the
No-Deallocate Modifies Media After Sanitize (NODMMAS) field.

For our revision 1.4 Controller, report that media is not modified after
Sanitize as the implementation does not implement Sanitize.

Fixes UNH Test 1.1.2

Reviewed by:	jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36192
2022-08-16 09:14:43 -07:00
Mark Johnston
0726cde8ea makefs tests: Re-enable the ZFS snapshot test
This reverts commit 35b587464a.

PR:		265849
Sponsored by:	The FreeBSD Foundation
2022-08-16 11:02:52 -04:00
Mark Johnston
4f816f5b11 makefs: Fix space accounting for the root DSL directory
Space used by the MOS is summed after all on-disk data structures are
finalized, so the MOS DSL directory represents a special case when
counting bytes used for each directory.  The DSL layer failed to update
the MOS DSL directory's parent, the root directory, accordingly, so the
root directory reported less space used than was used in reality.  Be
careful to update the root directory after the MOS is finalized.

PR:		265849
Sponsored by:	The FreeBSD Foundation
2022-08-16 11:02:51 -04:00
Mark Johnston
187084dddd makefs: Align the block buffer used in ZFS mode
For some dnode types, particularly ZAPs, we want the buffer to have
uint64_t alignment.

Sponsored by:	The FreeBSD Foundation
2022-08-16 11:02:51 -04:00
Mateusz Piotrowski
f9572577cf exports.5: Clean up EXAMPLES and STANDARDS
There was a missing sentence in the description of the second mount
entry in the example. Fix that and some other bits in the EXAMPLES
section.

Also, make the STANDARDS section a bit more readable.

MFC after:	1 week
Sponsored by:	Klara Inc.
2022-08-16 15:04:44 +02:00
Jens Schweikhardt
20f68c5f2d Indicate that xrefs to *roff,tbl,eqn et al are found in ports/textproc/groff. 2022-08-15 22:15:18 +02:00
Mark Johnston
35b587464a makefs tests: Skip a ZFS regression test in CI
It triggers panics after the latest OpenZFS import.

PR:		265849
2022-08-14 21:37:41 -04:00
Wanpeng Qian
9f678cfcb4 bhyve nvme: Fix firmware read only initialization
Summary:
Code was using the mask value without the shift.

Test Plan: Within FreeBSD/Linux guest, Identify NVMe controller to check the result.

Reviewed by:	chuck, imp
MFC after:	2 weeks
Signed-off-by:	Wanpeng Qian <wanpengqian@gmail.com>
Differential Revision: https://reviews.freebsd.org/D32659
2022-08-14 09:59:36 -07:00
WanpengQian
3cae10048d bhyve nvme: Fix Active Firmware Info
Summary:
Currently Active Firmware Info is not initialized.

Fix is to initialize the Active Firmware Info to Slot 1.

Test Plan: Within FreeBSD/Linux guests, show the Firmware Logpage to confirm.

Reviewed By:	chuck
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D32658
2022-08-14 09:59:36 -07:00
WanpengQian
eae0210cdd bhyve: Fix Number of Power States Supported value
Summary:
Set Number of Power States Supported to indicate 1 power state. Keep the
Power State Descriptor data structures as zero to indicate "Not
reported".

Test Plan:
Within FreeBSD/Linux guests, list the number of power states and check
the Max Power value.

Reviewed By:	markj, chuck
MFC after:	2 weeks
Signed-off-by:	Wanpeng Qian <wanpengqian@gmail.com>
Differential Revision: https://reviews.freebsd.org/D32657
2022-08-14 09:59:36 -07:00
Jens Schweikhardt
016aeb7ca0 The fdformat man page is in section 8 (not 1). 2022-08-14 18:14:52 +02:00
Mark Johnston
b6ecef28bf bhyve: Address uses of uninitialized variables in pci_nvme.c
The debug print in nvme_opc_get_log_page() would print an uninitialized
local variable.

In nvme_opc_write_read(), a failed LBA bounds check would cause
pci_nvme_stats_write_read_update() to be called with an uninitialized
variable as a parameter.  Although the parameter is unused when the
check fails (and so status != 0), LLVM 14 emits some bogus machine code
in this path, which happens to result in a segfault when it gets
executed.

PR:		265749
Reviewed by:	chuck, emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36119
2022-08-14 11:59:01 -04:00
Mark Johnston
af86d12c80 bhyve: Address -Wunused* warnings in pci_nvme.c
Currently these are not reported because bhyve is compiled with WARNS=2.
Let's start taking small steps towards enabling more warnings.

No functional change intended.

Reviewed by:	chuck, imp, emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36118
2022-08-14 11:56:33 -04:00
Chuck Tuffli
7376c08cc6 bhyve nvme: Fix uninitialized pointer
The Dataset Management code could free an uninitialized pointer if the
device doesn't support the Dataset Management command.

PR:		264548
Reported by:	Robert Morris <rtm@lcs.mit.edu>
2022-08-14 07:53:22 -07:00
Chuck Tuffli
d7d1becad4 bhyve nvme: Fix Controller init error cases
Fuzzing of bhyve uncovered an assertion failure in the NVMe emulation.
Investigation uncovered several corner cases the code did not handle.
This change handles several Controller initialization errors, including
 - bad AQ sizes
 - bad AQ vm_map_gpa
 - doorbell writes prior to RDY
 - doorbell writes to uninitialized queue
 - CSTS.RDY if CFS set

PR:		256317,256319,256320,256322
Reported by:	Cheolwoo Myung <cwmyung@snu.ac.kr>
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D35453
2022-08-14 07:47:34 -07:00
Chuck Tuffli
3d3678627c bhyve nvme: Check return value of mapped memory
Fuzzing of bhyve using hyfuzz discovered a way to cause a segmentation
fault in the NVMe emulation. If a guest specifies a physical address in
either the PRP1 or PRP2 field of a command that cannot be mapped from
guest to host, the function paddr_guest2host() returns a NULL pointer.
The NVMe emulation did not check for this error case, which allowed for
the segmentation fault to occur.

Fix is to check for a return value of NULL and indicate an error back to
the guest (Data Transfer error). While in the area, slightly refactor
the write/read blockif function to use a common error exit path.

PR:		256321
Reported by:	Cheolwoo Myung <cwmyung@snu.ac.kr>
Reviewed by:	imp, jhb
Differential Revision:	https://reviews.freebsd.org/D35452
2022-08-14 07:45:21 -07:00
Jens Schweikhardt
4ee44ffcca Indicate that kgdb.1 is from ports/devel/gdb. 2022-08-14 15:17:29 +02:00
Jens Schweikhardt
9356efa8c8 Indicate that X(7) cross refs are satisfied by ports/x11/xorg-docs. 2022-08-14 12:01:30 +02:00
Jens Schweikhardt
7c20397b72 In man page cross refs to sudo, indicate it comes from ports/security/sudo. 2022-08-14 11:44:43 +02:00
Chuck Tuffli
88951aaaee bhyve nvme: Fix out-of-bound IOV array access
Summary:
NVMe operations indicate the memory region(s) associated with a command
via physical region pages (PRPs). Since each PRP has a fixed size,
contiguous memory regions larger than the PRP size require multiple PRP
entries.

Instead of issuing a blockif call for each PRP, the NVMe emulation
concatenates multiple contiguous PRP entries into a single blockif
request. The test for contiguous regions has a bug such that it
mistakenly treats an initial PRP address of zero as a contiguous range
and concatenates it with the previous. But because there is no previous
IOV, the concatenation code corrupts the IO request structure and leads
to a segmentation fault when the blockif request completes.

Fix is to test for the existence of a previous range before trying to
concatenate the current range with the previous one.

While in the area, rename pci_nvme_append_iov_req()'s lba parameter to
offset to match its usage.

PR:             264177
Reported by:    Robert Morris <rtm@lcs.mit.edu>
Reviewed by:	jhb
MFC after:      2 weeks
Differential Revision:	https://reviews.freebsd.org/D35328
2022-08-13 12:16:02 -07:00
Maxim Sobolev
6b3ad1d737 When -u option is used also set USER, HOME and SHELL variables.
This is consistent with what other uid-morphing utilities
do, i.e. jexec(1), su(1) etc.

MFC after:      2 weeks
Reviewed by:    gbe
Differential Revision:  https://reviews.freebsd.org/D36148
2022-08-12 10:07:56 -07:00
Alexander Motin
5244006fea ctladm: Fix typo in command line help.
MFC after:	1 week
2022-08-11 16:53:50 -04:00
Mark Johnston
78d7704b7c makefs: Fix a memory leak in fs_layout_one()
Check the canmount property before building the mountpoint string.

Reported by:	Coverity
Fixes:		240afd8c1f ("makefs: Add ZFS support")
Sponsored by:	The FreeBSD Foundation
2022-08-11 10:18:13 -04:00
Mark Johnston
e225983737 makefs: Fix memory leaks in dsl_dir_finalize_props()
nvstring_get() returns a copy of the string, not a pointer into the
nvlist's internal buffer.

Reported by:	Coverity
Fixes:		240afd8c1f ("makefs: Add ZFS support")
Sponsored by:	The FreeBSD Foundation
2022-08-11 10:18:06 -04:00
Jessica Clarke
febca0e643 etcupdate: Add a -N flag to perform a NO_ROOT build
This is in preparation for including an etcupdate tree when performing a
-DNO_ROOT release image build. Although -DNO_ROOT can be passed via -M,
to be useful we need to mangle the resulting METALOG to mirror the
various cleanups to the tree that are done after the build (removing
generated files, empty files and empty directories), so etcupdate needs
its own flag.

Reviewed by:	jhb, pauamma
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D35857
2022-08-09 22:57:47 +01:00
Jessica Clarke
c5e30fbdb7 etcupdate: Prefer POSIX -depth to BSD -d
This is in preparation for building an etcupdate tree on non-FreeBSD
when building release images. The -d option is documented as a
BSD-specific equivalent to the POSIX -depth primary. Whilst GNU find
sort of accepts it in an attempt to be compatible, it still doesn't
permit it coming before the paths, unlike BSD find, and prints a
deprecation warning either way. Thus, use the equivalent POSIX -depth to
ensure it works correctly and without warning everywhere.

Reviewed by:	jhb
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D35856
2022-08-09 22:57:22 +01:00
Jessica Clarke
5513d7dee5 etcupdate: Add a -m flag to change the make binary that's run
This will allow release/Makefile to forward on ${MAKE} to allow building
on non-FreeBSD systems where ${MAKE} is something other than make, as
make is typically GNU make in such situations.

Reviewed by:	jhb, pauamma
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D35854
2022-08-09 22:56:19 +01:00
Gordon Bergling
75f8dcc831 mfiutil.8: Fix some mandoc warnings
- new sentence, new line
- no blank before trailing delimiter

MFC after:	3 days
2022-08-07 17:24:48 +02:00
Cy Schubert
e34667e449 unbound: Update version to 1.16.2
Chase 790c6b2451 to update the version to 1.16.2.

Reported by:	"Herbert J. Skuhra" <herbert@gojira.at>
MFC after:	3 days
X-MFC with:	790c6b2451
2022-08-06 01:59:22 -07:00
Mark Johnston
240afd8c1f makefs: Add ZFS support
This allows one to take a staged directory tree and create a file
consisting of a ZFS pool with one or more datasets that contain the
contents of the directory tree.  This is useful for creating virtual
machine images without using the kernel to create a pool; "zpool create"
requires root privileges and currently is not permitted in jails.
makefs -t zfs also provides reproducible images by using a fixed seed
for pseudo-random number generation, used for generating GUIDs and hash
salts.  makefs -t zfs requires relatively little by way of machine
resources.

The "zpool_reguid" rc.conf setting can be used to ask a FreeBSD guest to
generate a unique pool GUID upon first boot.

A small number of pool and dataset properties are supported.  The pool
is backed by a single disk vdev.  Data is always checksummed using
Fletcher-4, no redundant copies are made, and no compression is used.
The manual page documents supported pool and filesystem properties.

The implementation uses a few pieces of ZFS support from with the boot
loader, especially definitions for various on-disk structures, but is
otherwise standalone and in particular doesn't depend on OpenZFS.

This feature should be treated as experimental for now, i.e., important
data shouldn't be trusted to a makefs-created pool, and the command-line
interface is subject to change.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35248
2022-08-05 13:42:29 -04:00
Brad Davis
3e1101f29b bsdinstall: allow setting the root password via env variables
Reviewed by:	0mp, allanjude, asiciliano, dteske, pauamma, rpokala, sef
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35588
2022-08-05 09:10:21 -06:00
Gordon Bergling
2bf1b9984f uhsoctl.1: Fix the man page date
- STYLE: normalizing date format to: August 12, 2009

MFC after:	3 days
2022-07-31 12:27:10 +02:00
Gordon Bergling
e24fd6d664 bluetooth(3): Fix a typo in a source code comment
- s/intrrupt/interrupt/

MFC after:	3 days
2022-07-31 12:13:13 +02:00
Kirk McKusick
b21582ee03 Add a flags parameter to the ffs_sbget() function that reads UFS superblocks.
Rather than trying to shoehorn flags into the requested superblock
address, create a separate flags parameter to the ffs_sbget()
function in sys/ufs/ffs/ffs_subr.c. The ffs_sbget() function is
used both in the kernel and in user-level utilities through export
to the sbget() function in the libufs(3) library (see sbget(3)
for details). The kernel uses ffs_sbget() when mounting UFS
filesystems, in the glabel(8) and gjournal(8) GEOM utilities,
and in the standalone library used when booting the system
from a UFS root filesystem.

The ffs_sbget() function reads the superblock located at the byte
offset specified by its sblockloc parameter. The value UFS_STDSB
may be specified for sblockloc to request that the standard
location for the superblock be read.

The two existing options are now flags:

UFS_NOHASHFAIL will note if the check hash is wrong but will still
   return the superblock. This is used by the bootstrap code to
   give the system a chance to come up so that fsck can be run to
   correct the problem.

UFS_NOMSG indicates that superblock inconsistency error messages
   should not be printed. It is used by programs like fsck that
   want to print their own error message and programs like glabel(8)
   that just want to know if a UFS filesystem exists on a partition.

One additional flag is added:

UFS_NOCSUM causes only the superblock itself to be returned, but does
   not read in any auxiliary data structures like the cylinder group
   summary information. It is used by clients like glabel(8) that
   just want to check for possible filesystem types. Using UFS_NOCSUM
   skips the superblock checks for csum data which allows superblocks
   that have corrupted csum data to be read and used.

The validate_sblock() function checks that the superblock has not
been corrupted in a way that can crash or hang the system. Unless
the UFS_NOMSG flag is specified, it will print out any errors that
it finds. Prior to this commit, validate_sblock() returned as soon
as it found an inconsistency so would print at most one message.
It now does all its checks so when UFS_NOMSG has not been specified
will print out everything that it finds inconsistent.

Sponsored by: The FreeBSD Foundation
2022-07-30 22:51:38 -07:00
John Hood
60b92ba932 /usr/sbin/pkg: don't sleep on fetch failure
PR:	263458
2022-07-28 17:55:13 +02:00
Corvin Köhne
50526f522b bhyve: fix spelling mistake in passthru emulation
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D35707
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-07-27 18:20:47 +02:00
Alan Somers
982f980b86 prometheus_sysctl_exporter: ignore ENOENT for mibs specified on the CLI
They might belong to kernel modules not currently loaded, or to other
kernel versions.  Ignoring them allows the configuration to be shared
between multiple hosts.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	rew
Differential Revision: https://reviews.freebsd.org/D35540
2022-07-24 09:19:46 -06:00
Mateusz Piotrowski
adf9cd56fa pw.8: Refernece to openssl-passwd(1) and crypt(3)
It may be unclear how to generate an encrypted password hash for -H,
so point users to openssl-passwd(1) and crypt(3).

MFC after:	2 weeks
2022-07-21 20:08:05 +02:00
Mateusz Piotrowski
203be0938d jail.8: Fix formatting of synopsis and some code examples
MFC after:	3 days
2022-07-18 13:41:35 +02:00
Mateusz Piotrowski
aa35037ba5 beinstall.8: Update example distsites for BSDINSTALL_DISTSITE
MFC after:	1 week
2022-07-18 13:41:35 +02:00
Cy Schubert
752b6daecc unbound: Update version strings to 1.16.1
The last number of unbound upgrades failed to manually update the
version strings in usr.sbin/unbound/config.h. This commit fixes that.

Reported by:	"Herbert J. Skuhra" <herbert@gojira.at>
Fixes:		0a92a9fca7
		a39a5a6905
		9cf5bc93f6
		273016e836
		24e3652200
		5469a99530
MFC after:	3 days
2022-07-17 07:25:06 -07:00
Dimitry Andric
9917049b60 WPA_DISTDIR does not need to end in a slash
Since all uses of the macro also append a slash, this leads to double
slashes.

MFC after:	3 days
2022-07-16 17:45:26 +02:00
Gordon Bergling
d34de8d378 crunchide(1): Fix a typo in a comment
- s/maek/make/

Obtained from:	NetBSD
MFC after:	3 days
2022-07-16 13:32:47 +02:00
Jessica Clarke
232cf6be4b certctl: Introduce a new -d <distbase> option
This will be used by Makefile.inc1 to fix -DNO_ROOT distributeworld,
which needs to split out DESTDIR from DISTBASE so the METALOG file
includes the base/ prefix.

Reviewed by:	kevans
Obtained from:	CheriBSD
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35808
2022-07-14 01:23:42 +01:00
Felix Johnson
39ad6e289f swapinfo.8: Mention BLOCKSIZE in the ENVIRONMENT section
Copy the ENVIRONMENT section from df(1) to swapinfo(8), except
that the --si option is removed for swapinfo.

PR:		235225
Reported by:	0mp
MFC after:	3 days
2022-07-08 21:35:33 +02:00
Alexander V. Chernikov
e1c7783e22 ndp(8): add structured output formatting via libxo
Differential Revision:	https://reviews.freebsd.org/D35677
MFC after:	2 weeks
2022-07-08 11:39:34 +00:00
Mateusz Piotrowski
ccee95df52 jail.conf.5: List configuration and example files
MFC after:	3 days
2022-07-08 10:50:31 +02:00
Warner Losh
5c19fabbe3 devinfo: xref devctl
devctl has ways to get the different locator's paths to devices, while
devinfo does not. xref devctl in devinfo(8) as a hint.

Sponsored by:		Netflix
2022-07-05 15:15:08 -06:00
Mateusz Piotrowski
4e3dc91e4c sesutil.8: Polish
- Use right mdoc macros
- Fix synopsis. Some of the optional command modifiers were not optional
  after all.
- Sort options

MFC after:	1 week
2022-07-05 16:39:01 +02:00
KUROSAWA Takahiro
d80d734937 arp(8): use getifaddrs(3) instead of ioctl(SIOCGIFCONF)
The original code had used a fixed-size buffer for ioctl(SIOCGIFCONF),
that might cause the target ifreq spilled from the buffer.  Use the handy
getifaddrs(3) to fix the problem.

Reviewed by:		glebius
Differential revision:	https://reviews.freebsd.org/D35536
2022-07-04 20:56:29 -07:00
Andrew Gallatin
0aa1507751 pmcstat: fix log analysis
pmcstat has been broken for analyzing logs since D35342 / b6e28991bf.

This is because the pmc for the first CPU is not added when reading logs
because unlike its clones, its event id is not invalid. That causes us
to fail the assertion at lib/libpmcstat/libpmcstat_logging.c:293
when encountering samples from cpu0.

Fix this by removing the check that the PMC is invalid

Reviewed by: tsoome
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D35709
2022-07-04 12:42:39 -04:00
Cy Schubert
7999a7f2a8 wpa: Enable WEP by default
As of hostap 2.10, WEP is disabled by default. This of course is not a
bad thing but requires some planning and an announcment to remove WEP
support by default. A possible src.conf knob or letting users know they
should use the port instead might different options.

MFC after:	3 days
2022-07-03 14:19:38 -07:00
Gordon Bergling
c7b9006af5 snmp_hostres(3): Fix a typo in a debug message
- s/atempt/attempt/

MFC after:	3 days
2022-07-03 14:57:12 +02:00
John Baldwin
e5ed417bb4 bhyve: Document the "type" config variable for network device models. 2022-06-30 15:14:36 -07:00
Yan Ka Chiu
b9c3e544c4 bhyve virtio-net: Allow backend type to be explicitly specified.
Surrently virtio-net uses the prefix of the backing interface to
choose the backend.  This patch adds an additional option "type" to
choose the backend type explicitly.  This allows greater flexibility
for end users to manage bhyve specific resources (such as by naming
the tap interfaces to more descriptive names).  The option "type" is
optional.  When it is not presented, the backend is derived from the
name of the backend interface.

For example, the line `-s 3,virtio-net,bsdvm0,type=tap` will create a
virtio-net device for the guest using the tap interface "bsdvm0".

Adding a new "type" option preserves the current legacy format in which
the first value after virtio-net names an instance of a backend.

Note that tap interfaces not following the pattern "tap*" will not be
created on demand via devfs cloning but must be created explicitly.

Reviewed by:	vmaffione, jhb
Differential Revision:	https://reviews.freebsd.org/D35143
2022-06-30 10:29:45 -07:00
Michael Tuexen
61a73acd88 tcpsso: improve man page
Describe explicitly the handling of TCP endpoints in the TIME-WAIT and
SYN-RCVD state.

Reported by:		glebius@
Reviewed by:		glebius@
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D35651
2022-06-30 18:37:09 +02:00
Mateusz Piotrowski
3beedc3840 pkg.7: Clean up mdoc
MFC after:	1 week
2022-06-30 16:22:02 +02:00
Fernando Apesteguía
4a3c598f35 Bump .Dd for recently modified manual pages
During the removal of named(8) references, some pages were modified but their
.Dd where not updated accordingly.

Reported by:	lwhsu@
Fixes:	942e234d86
2022-06-27 18:20:03 +02:00
Fernando Apesteguía
942e234d86 Remove references to named(8)
named(8) hasn't been in base for some time. Remove all references to it in
manual pages.

Approved by:	manpages (Pau Amma)
Differential Revision:	https://reviews.freebsd.org/D35586
2022-06-26 18:53:08 +02:00
Aleksandr Rybalko
b6e28991bf System wide and NUMA domain wide counters support. PMC classes for ARM DMC-620 and CMN-600.
Add support for system wide and NUMA domain wide counters support.
Add 3 new PMC classes for ARM DMC-620 and CMN-600 controllers PMU.

Reviewed by:	mhorne
Sponsored By:	ARM
Sponsored By:	Ampere Computing
Differential Revision: https://reviews.freebsd.org/D35342
2022-06-26 08:31:03 +03:00
Vitaliy Gusev
a85bbbea91 bhyve: Enable suspend/resume support for virtio-blk.
Reviewed by:	jhb
Sponsored by:	vStack
Differential Revision: https://reviews.freebsd.org/D26267
2022-06-23 11:46:06 -07:00
Vitaliy Gusev
cd9618bdb2 bhyve: Snapshot impovements for 'blockif' backend
When pausing a block I/O device model as part of suspending a VM, wait
for all active block I/O requests to finish before saving snapshot
data.  This avoids having to save information about in-flight requests
both in the block_if layer and in storage device models.

For the AHCI device model, the queues are now guaranteed to be idle
when taking a snapshot, so remove the code to save queue state and
rely on the initial state in a resumed VM having all queues already
idle.

This will also simplify adding NVMe snapshot support in the future.

Reviewed by:	jhb
Sponsored by:	vStack
Differential Revision: https://reviews.freebsd.org/D26267
2022-06-23 11:46:06 -07:00
Brad Davis
a320e9dd51 bsdinstall: improve zfsboots ability to handle datasets under a BE
Currently we only set canmount=noauto on the root of the BE, this
change makes it so we set it on all datasets under the BE as well.

Reviewed by:	allanjude
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35422
2022-06-23 09:21:08 -06:00
Cy Schubert
3e8eb5c7f4 wpa: Disable P2P in WPS
Disable P2P in WPS as it is not supported by FreeBSD. Also, it is not
enabled in wpa_supplicant so the WPS P2P code is redundant.

PR:		264238
Reported by:	adrian
MFC after:	3 days
2022-06-22 20:57:27 -07:00
Kyle Evans
4014365e42 mixer: remove volume backwards compat, add % interpretation
The current situation is fairly confusing, where an integer is interpreted
as a percent until you slap a decimal on it and magically it becomes an
absolute value.

Let's have a flag day in 14.0 and remove this shim entirely.  Setting with
percent can still be useful, so allow a trailing '%' to indicate as such.
As a side effect, we tighten down the format allowed in the volume a little
bit by ensuring there's no trailing garbage after the value once it's
separated into left and right components.

Reviewed by:	christos, hselasky, pauamma_gundo.com (manpages)
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D35101
2022-06-17 22:50:58 -05:00
James Mintram
e16b709e2d bhyve: Report an error for invalid UUIDs.
Reviewed by:	rgrimes, grehan, jhb
Differential Revision:	https://reviews.freebsd.org/D30050
2022-06-16 13:18:01 -07:00
John Baldwin
73702c3980 pmcannotate: Don't increment end address passed to objdump -d.
libpmc already returns an end address that is after the end of the
last instruction of a function (on both amd64 and arm64) as the end
address written to the annotate map file is computed as the start
address of the symbol plus the size.

Adding one could result in a curious failure where an entire
function's contents in assembly was reduced instead to only the first
instruction.  The reason is that when the end instruction is bumped by
one, objdump -d can append the first instruction of the next function
in its output.  However, since pmcannotate concatenates all of the
objdump -d output from various functions into a single file which it
then searches to find the assembly for a given file, if this
additional trailer was earlier in the file than the full function, the
trailer was chosen to represent the entire function resulting in the
truncated listing of the function.

Sponsored by:	University of Cambridge, Google, Inc.
Differential Revision:	https://reviews.freebsd.org/D35399
2022-06-14 10:52:54 -07:00
Mitchell Horne
ec1a13df03 Remove mips-specific Makefiles for /sbin and /usr/sbin
They are no longer needed, but were likely missed simply because they
don't show up in a grep for 'mips'.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D35475
2022-06-14 10:15:03 -03:00
Alan Somers
6a02539959 bsdinstall: allow an install script to access packages on the DVD
If installing from the DVD, mount its packages in the chroot at
/dist/packages.  That way they'll be accessible to an install script.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	gjb
Differential Revision: https://reviews.freebsd.org/D35330
2022-06-13 13:27:51 -06:00
Ed Maste
f92e0d6acd pkg-bootstrap: use latest package set on arm64 stable branches
As with i386 and amd64, "latest" packages are available on stable
branches for arm64/aarch64.

Reviewed by:	manu
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35445
2022-06-13 14:57:10 -04:00
Dmitry Ovsyannikov
9f48eea366 rpcbind: get contact addr from xprt members
Addition to D31491 in order to actually resolve the top root cause.

Currently rpcbind gets contact address from connectionless xprt->xp_p2
member of a transport and will fail to get it when working over
connection oriented transport, leading to a guess game in terms of
contact address on rpcinfo requests like RPCBPROC_GETVERSADDR or
RPCBPROC_GETADDRLIST and poor returns which may influence a user
of a call and specifically reported on OSX clients, which tend to
not provide address hint from rpcinfo request to a server.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D35220
2022-06-13 08:54:08 -05:00
Baptiste Daroussin
0a9541d9f3 pw: reinitialize struct tm before every call to strptime
This prevents corrupted result due to leftover of previous failed
call to strptime
2022-06-07 22:32:35 +02:00
Marc Fonvieille
45ef6b4b5d bsdinstall/scripts/docsinstall: Add Indonesian Documentation
Add Indonesian Documentation to docinstall menu.

Approved by:	doceng (implicit) re (gjb, implicit)
MFC after:	1 week
2022-06-06 13:44:43 +02:00
Brad Davis
3bcd261265 bsdinstall: allow overriding DISTRIBUTIONS in the normal auto mode
Reviewed by:	dteske
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35355
2022-06-05 19:04:04 -06:00
Gordon Bergling
0b4302aa93 acpi(4): Fix a typo in a debug statement
- s/Efficency/tEfficiency/

Obtained from:	NetBSD
MFC after:	3 days
2022-06-04 15:17:09 +02:00
Gordon Bergling
10924c4fc3 ac(8): Fix a typo in a source code comment
- s/chosing/choosing/

MFC after:	3 days
2022-06-04 12:41:20 +02:00
Gordon Bergling
df4da2d6b7 fstype(8): Fix two typos in source code comments
- s/auxillary/auxiliary/

MFC after:	3 days
2022-06-04 10:38:48 +02:00
Doug Rabson
5e9c888a7a pkgbase: Move pw to the runtime package
This allows building a container image with enough functionality for
downloading and installing packages without having to include the
utilities package.

Reviewed by: manu
MFC after:   2 weeks
2022-05-30 15:23:00 +01:00
Corvin Köhne
8284799a23 bhyve: use bhyve_config for SMBIOS strings
Some software uses SMBIOS entries to identify the system on which it's
running. In order to make it possible to use such software inside a VM,
SMBIOS entries should be configurable. Therefore, bhyve_config can be
used. While only a few SMBIOS entries might be of interest, it makes
sense that all SMBIOS entries are configurable. This way all SMBIOS
tables are build the same way and there's no special handling for some
tables.

Reviewed by:	jhb
Sponsored by:	Beckhoff Automation GmbH & Co. KG
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34465
2022-05-30 10:03:43 +02:00
Alan Somers
77d678b7a4 Fix a memory leak from caf73e5857
Don't shadow an already-local variable with another local declaration.

Reported by:	dteske
MFC after:	13 days
MFC with:	caf73e5857
Sponsored by:	Axcient
Differential Revision:	https://reviews.freebsd.org/D35331
2022-05-28 13:17:37 -06:00
Alan Somers
caf73e5857 bsdinstall: fix prepopulating the ZFS disk menu with ZFSBOOT_DISKS
If the ZFSBOOT_DISKS variable is set to one or more disk names, then
those disks should be preselected in the disk menu.  However, the code
wasn't correctly setting the variable, leaving all disks unselected.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	dteske
Differential Revision: https://reviews.freebsd.org/D35331
2022-05-27 09:09:33 -06:00
John Baldwin
f8287caae4 etcupdate: Preserve permissions when installing a resolved file.
Similar to the change in 1a04446f08, use
cat to overwrite the contents of the existing file rather than cp so
that metadata of the existing file such as permissions and ownership
is preserved.

PR:		255514
Reported by:	uqs
MFC after:	1 week
2022-05-25 14:20:40 -07:00
John Baldwin
431944fb5f etcupdate: Don't rotate trees for a dry run.
When performing a dry run, remove the temporary tree created rather
than rotating the trees.  Rotating the trees meant that etcupdate
thought the latest changes were already merged and would not merge
them on the next real run.

PR:		260281
Reported by:	Tomoaki AOKI <junchoon@dec.sakura.ne.jp>
Fixes:		0611aec3cf etcupdate: Always extract to a temporary tree.
MFC after:	1 week
2022-05-25 14:02:51 -07:00
Alan Somers
7919c76dbd bsdinstall: use gpt/efiboot0 label in /etc/fstab
Otherwise, boot will hang if the numbering of disks has changed since
initial install.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	brd
Differential Revision: https://reviews.freebsd.org/D35309
2022-05-24 13:17:10 -06:00
Brad Davis
cc42ef5328 bsdinstall: allow whitelabeling the scripts
Approved by:		allanjude, asiciliano
Differential Revision:	https://reviews.freebsd.org/D35197
Sponsored by:		Rubicon Communications, LLC ("Netgate")
2022-05-24 09:49:06 -06:00
Brad Davis
33005c89c6 bsdinstall: break list of scripts out to one per line to make adding/removing entries easier
Approved by:		allanjude, asiciliano
Differential Revision:	https://reviews.freebsd.org/D35249
Sponsored by:		Rubicon Communications, LLC ("Netgate")
2022-05-24 09:30:31 -06:00
Alfonso S. Siciliano
6368dcb292
bsdinstall hostname: Replace dialog with bsddialog
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.
Add --hline info because bsddialog requires TAB to switch the focus on
buttons for an inputbox, dialog differs.
Delete f_dialog_inputbox_size() using libbsddialog autosizing.

Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35285
2022-05-24 14:20:22 +02:00
Rick Macklem
b387a075d9 rpc.tlsclntd: Add the -2 option to the usage line
Commit 72bf76d6b8 added the -2 option to use
TLS 1.2 NFS-over-TLS mounts.  It did not add -2
to the usage message.

This patch adds -2 to the usage message.

MFC after:	2 weeks
2022-05-22 14:41:20 -07:00
Rick Macklem
b4fa7fde15 rpc.tlsservd: Add the -2 option to the usage line
Commit 0637b12b13 added the -2 option to allow
TLS 1.2 NFS-over-TLS mounts.  It did not add -2
to the usage message.

This patch adds -2 to the usage message.

MFC after:	2 weeks
2022-05-22 14:36:20 -07:00
Rick Macklem
915fc1afe5 rpc.tlsclntd: Add the -2 option to the man page
Since the KTLS now supports TLS1.3, the daemons default
to version 1.3, since the draft (to be an RFC someday)
requires TLS1.3.

However, since FreeBSD 13,0, 13,1 uses TLS1.2 for
NFS-over-TLS, the "-2" option is added to both daemons
for compatibility with FreeBSD 13.0, 13.1.

This patch updates the man pages for this.

This is a content change.

Reviewed by:	pauamma_gundo.com
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35290
2022-05-22 14:20:14 -07:00
Rick Macklem
e2c72fecfc rpc.tlsservd: Add the -2 option to the man page
Since the KTLS now supports TLS1.3, the daemons default
to version 1.3, since the draft (to be an RFC someday)
requires TLS1.3.

However, since FreeBSD 13,0, 13,1 uses TLS1.2 for
NFS-over-TLS, the "-2" option is added to both daemons
for compatibility with FreeBSD 13.0, 13.1.

This patch updates the man pages for this.

This is a content change.

Reviewed by:	pauamma_gundo.com
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35290
2022-05-22 14:17:06 -07:00
Rick Macklem
0bf3f379e1 rpc.tlsclntd: Update the man page for the -C option
Commit f5b40aa0de modifies the -C command line option
for rpc.tlsclntd to use the TLS 1.3 SSL_CTX_set_ciphersuites().

This patch updates the man page for this modified command
line option.

This is a content change.

Reviewed by:	jhb, pauamma_gundo.com (same change for rpc.tlsservd.8)
MFC after:	2 weeks
2022-05-22 13:58:59 -07:00
Rick Macklem
f5b40aa0de rpc.tlsclntd: Modify the -C option to use SSL_CTX_set_ciphersuites
Commit 0b4f2ab0e9 fixes the krpc so that it can use TLS
version 1.3 for NFS-over-TLS, as required by
the draft (someday to be an RFC).
This patch replaces SSL_CTX_set_cipher_list() with
SSL_CTX_set_ciphersuites(), since that is the function
that is used for TLS1.3.

The man page will be updated in a separate commit.

MFC after: 	2 weeks
2022-05-22 13:49:08 -07:00
Rick Macklem
8d098deda3 rpc.tlsservd: Modify the -C option to use SSL_CTX_set_ciphersuites
Commit 0b4f2ab0e9 fixes the krpc so that it can use TLS
version 1.3 for NFS-over-TLS, as required by
the draft (someday to be an RFC).
This patch replaces SSL_CTX_set_cipher_list() with
SSL_CTX_set_ciphersuites(), since that is the function
that is used for TLS1.3.

The man page has already been updated.

MFC after: 	2 weeks
2022-05-22 13:44:31 -07:00
Rick Macklem
d94358e29d rpc.tlsservd: Update the man page for the -C option
Commit 712aac1389 adds a new -C command line option
to rpc.tlsservd.

This patch updates the man page for this new command
line option.

This is a content change.

Reviewed by:	jhb, pauamma_gundo.com
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35136
2022-05-21 15:44:29 -07:00
Alfonso S. Siciliano
58c63d5e37
bsdinstall netconfig_ipv6: Replace dialog with bsddialog
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35270
2022-05-21 18:04:28 +02:00
Alfonso S. Siciliano
90943fbfeb
bsdinstall netconfig_ipv4: Replace dialog with bsddialog
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35267
2022-05-21 17:40:34 +02:00
Alfonso S. Siciliano
4effc38819
bsdinstall jail: Replace dialog with bsddialog
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35274
2022-05-21 17:14:03 +02:00
Alfonso S. Siciliano
8cfbeb56aa
bsdinstall services: Improve mouse configuration
bsdinstall(8) has an option to enable moused support.
However, if it is not selected, moused is still started
through the configuration of nondefault devices.
So, automatically add the moused_nondefault_enable="NO"
setting to rc.conf unless moused support is selected.

PR:			227999
Reported by:		bcran
Reviewed by:		bapt
Differential Revision:	https://reviews.freebsd.org/D35193
2022-05-21 16:42:23 +02:00
Rick Macklem
72bf76d6b8 rpc.tlsclntd: Add an option to force use of TLS version 1.2
Commit 0b4f2ab0e9 fixes the krpc so that it can use TLS
version 1.3 for NFS-over-TLS, as required by
the draft (someday to be an RFC).
Since FreeBSD 13.0, 13.1 use TLS version 1.2 for
NFS-over-TLS mounts, this command line option
may be used so that NFS-over-TLS mounts to 13.0, 13.1
servers will still work.

Without the command line option, NFS-over-TLS mounts
will use TLS version 1.3.

The man page update will be a separate commit.

MFC after: 	2 weeks
2022-05-20 14:57:42 -07:00
Rick Macklem
0637b12b13 rpc.tlsservd: Add an option to allow TLS version 1.2
Commit 0b4f2ab0e9 fixes the krpc so that it can use TLS
version 1.3 for NFS-over-TLS, as required by
the draft (someday to be an RFC).
Since FreeBSD 13.0, 13.1 use TLS version 1.2 for
NFS-over-TLS mounts, this command line option
may be used so that mounts from 13.0, 13.1 will still work.

Without the command line option, only TLS version 1.3
mounts are permitted.

The man page update will be a separate commit.

MFC after: 	2 weeks
2022-05-20 14:47:36 -07:00
Mark Johnston
21add93b58 makefs: Remove execute permission from in-tree test scripts
Let the build system set it as needed.  No functional change intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-05-19 11:46:02 -04:00
Gleb Popov
7eb6a92e3f jexec man: Explain how PATH is adjusted.
Add a sentence that explains that PATH is set to `/bin:/usr/bin`.
I had to dive into `jexec.c` to find this out.

Reviewed by:	markj
Differential Revision: https://reviews.freebsd.org/D35251
2022-05-19 16:58:32 +03:00
Andrew Turner
190abf86bb Fix the name of Makefile.aarch64
Makefile.arm64 relies on being included via Makefile.${MACHINE}. This
only works when arm64 is the only aarch64 architecture. Switch to
Makefile.aarch64 so downstream CheriBSD can use the file when building
for Morello which uses a differen ${MACHINE} value.

Sponsored by:	Innovate UK
2022-05-19 11:30:21 +01:00
Ed Maste
ec3c01ae72 makefs: sort cd9660 sysid entries in man page
"efi" was added at the end of the sysid list rather than in alpha
order.  Move it as a diff reduction against NetBSD.
2022-05-18 15:42:12 -04:00