Commit Graph

19346 Commits

Author SHA1 Message Date
Chuck Tuffli
c2318cf80a nvme: fix spelling of Namespace
Fix spelling of a macro definition.

Reviewed by:	mav, imp
Differential Revision:	https://reviews.freebsd.org/D34330
2022-02-21 10:34:46 -08:00
Robert Wing
4379c1da56 bhyve/snapshot: use a string for cmd element in the nvlist
The nvlist for a checkpoint request will now look like:

    { cmd="checkpoint", suspend="true/false", filename="afilename" }

Reviewed by:	jhb
Suggested by:   jhb
Differential Revision:	https://reviews.freebsd.org/D34237
2022-02-15 08:12:15 -09:00
Kyle Evans
e01e8f911b freebsd-update: improve BE creation feature
This addresses one nit and one bug in the BE creation feature of
freebsd-update:

The nit addressed is that it currently only names the BEs after the
userland version, but the kernel version may be higher.  After this
change, we request both and pass them through sort(1) to choose the
highest.  This is especially helpful if a freebsd-update patch touched
one but not the other.

The bug fixed is that roots updated that are not located at '/', e.g.,
by using -b or -j, will no longer create boot environments
automatically.  There's a very low chance these will actually change the
BE in any meaningful way, anyways.  It could make sense in the future
to allow an argument-override to create the BE anyways if someone comes
up with a non-standard setup, e.g., where a jail is an important part of
their boot environment on an appliance or some such setup.

Half of this patch is submitted by delphij@, the other half kevans@.

PR:		261446
MFC after:	3 days
Reviewed by:	delphij, emaste, Dave Fullard <dave_fullard.ca>
Differential Revision:	https://reviews.freebsd.org/D34257
2022-02-12 15:36:24 -06:00
Alfredo Dal'Ava Junior
79f5d19890 kldxref: add R_PPC_ADDR32 handler
Implements R_PPC_ADDR32 handler for kldxref, addressing
"kldxref: unhandled relocation type 1" when running
"kldxref /boot/kernel" on powerpc 32 bits.

Reviewed by:	luporl
MFC after:	2 days
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D33745
2022-02-10 12:15:47 -03:00
Gordon Bergling
80212a36a3 tcpsso.8: Add a history section to the manpage
Mention that the tcpsso command first appeard in FreeBSD 14.
2022-02-10 09:27:42 +01:00
Alexander Motin
c04506fd4c pciconf: Fix PCIS_CRYPTO_ENTERTAIN copy/paste.
Submitted by:   Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week
2022-02-09 15:56:30 -05:00
Michael Tuexen
d24e064aaf tcpsso: fix typo in man page
Reported by:	maxim
Sponsored by:	Netflix, Inc.
2022-02-09 21:16:42 +01:00
Fangrui Song
ec81497cc7 crunchgen: remove -dc from linker invocation
In GNU ld and ld.lld, -dc is used with -r to allocate space to COMMON
symbols.  It is presumably to work around legacy code which cannot
handle COMMON symbols in relocatable output.  ld.lld may remove -dc or
make it a no-op for the 15.0.0 release.

As of 7420b323a0 crunch/crunchide does not require -dc, as the symbol
hiding technique no longer relied on making symbols local.

In addition -fno-common is now the default in Clang and GCC, so -dc
serves no purpose as the compiler does not generate COMMON symbols
anyway.

See https://maskray.me/blog/2022-02-06-all-about-common-symbols for more
detail on common symbols.

Reviewed by:	emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34215
2022-02-09 13:54:35 -05:00
Michael Tuexen
d73d40c17f usr.sbin: add tcpsso to Makefile 2022-02-09 19:22:18 +01:00
Michael Tuexen
881631a2a3 usr.sbin: add tcpsso
tcpsso is a command line tool to apply a socket option to an
existing TCP endpoint, which is identified by the inp_gencnt.
tcpsso can be used, for example, to switch the congestion control
module or the TCP stack.

Reviewed by:		rrs, rscheff, debdrup, pau amma
Relnotes:		yes
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D34139
2022-02-09 19:14:25 +01:00
Robert Wing
edfb339d38 bhyve/snapshot: switch to nvlist for snapshot requests
Switch to using an nvlist with nvlist_send()/nvlist_recv() to
communicate from bhyvectl(8) to bhyve(8).

The idea is that a bhyve process receives a command with with a set of
arguments. The nvlist here is structured to reflect that premise.

For example, to snapshot the vm, the expected nvlist looks like:

    { cmd=START_CHECKPOINT, filename="filename" }

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D33977
2022-02-09 08:11:57 -09:00
Mateusz Piotrowski
ca77b6ff31 cron.8: Add periodic(8) to See Also 2022-02-09 11:50:01 +01:00
Mark Johnston
927aa5fefd bhyve: Fix getaddrinfo() error handling
- Use errx() since errno will not be set.
- Print the message returned by gai_strerror().

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-02-08 12:40:41 -05:00
Dimitry Andric
e17fede8ff Fix too small sscanf output buffers in kbdmap
This fixes the following warnings from clang 14:

usr.sbin/kbdmap/kbdmap.c:241:16: error: 'sscanf' may overflow; destination buffer in argument 5 has size 20, but the corresponding specifier may require size 21 [-Werror,-Wfortify-source]
                            &a, &b, buf);
                                    ^
usr.sbin/kbdmap/kbdmap.c:615:8: error: 'sscanf' may overflow; destination buffer in argument 3 has size 64, but the corresponding specifier may require size 65 [-Werror,-Wfortify-source]
                            keym, lng, desc);
                            ^
usr.sbin/kbdmap/kbdmap.c:615:14: error: 'sscanf' may overflow; destination buffer in argument 4 has size 64, but the corresponding specifier may require size 65 [-Werror,-Wfortify-source]
                            keym, lng, desc);
                                  ^
usr.sbin/kbdmap/kbdmap.c:615:19: error: 'sscanf' may overflow; destination buffer in argument 5 has size 256, but the corresponding specifier may require size 257 [-Werror,-Wfortify-source]
                            keym, lng, desc);
                                       ^

In each case, the buffer being sscanf'd into is one byte too small.

MFC after:	 3 days
2022-02-06 16:25:25 +01:00
Dimitry Andric
d310bf3867 Fix too small hostname buffer in bootparamd
This fixes the following warning from clang 14:

usr.sbin/bootparamd/bootparamd/bootparamd.c:204:32: error: 'fscanf' may
overflow; destination buffer in argument 3 has size 255, but the
corresponding specifier may require size 256 [-Werror,-Wfortify-source]

The MAX_MACHINE_NAME macro indicates the maximum number of bytes in a
machine name, but it does not include the NUL terminator required for
scanf.

MFC after:	 3 days
2022-02-06 15:25:49 +01:00
Gordon Bergling
64b3bcc6bd moused(8): Fix a common typo in source code comments
- s/comatible/compatible/

Obtained from:	NetBSD
MFC after:	3 days
2022-02-06 13:47:25 +01:00
Gordon Bergling
164fa411b9 makefs(8): Fix a few typos in source code comments
- s/concearned/concerned/
- s/quadradically/quadratically/

Obtained from:	NetBSD
MFC after:	3 days
2022-02-06 13:46:38 +01:00
Wolfram Schneider
a0e33bbdc5 update URL 2022-02-05 17:35:24 +00:00
Andrew Turner
c363da4ae8 Add the Arm SPE interrupt to acpidump
To support the Arm Statistical Profiling Extension (SPE) ACPI 6.3 added
a place to hold the SPE interrupt. Add to acpidump to show when printing
the Arm Generic Interrupt data.

Sponsored by:	The FreeBSD Foundation
2022-02-01 11:43:13 +00:00
John Baldwin
58862c0bea fstyp: Remove __packed from struct exfat_de_label.
This fixes a -Waddress-of-packed-member warning about a possibly
unaligned pointer from GCC 9 when calling convert_label().

__packed has to be removed from struct exfat_dirent as well to fix an
alignment warning when casting from a struct exfat_dirent pointer to a
struct exfat_de_label pointer.

Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D32144
2022-01-31 17:33:31 -08:00
Robert Wing
b4cc5d63b6 bhyve/virtio: use correct device id for virtio-scsi
Section 4.1.2.1 of the virtio spec states that the transitional PCI
device id for a scsi device is 0x1004.

Fix suggested by reporter.

PR:             259961
Reported by:    me@nanaya.pro
Reviewed by:	imp, jhb
Fixes:  f9c005a17f ("Add bhyve virtio-scsi storage backend support.")
Differential Revision:	https://reviews.freebsd.org/D34103
2022-01-31 09:44:47 -09:00
Chuck Tuffli
ac678b4aaf bhyve nvme: Fix Identify Namespace, NSID=ffffffff
If the NVMe Controller doesn't support Namespace Management, it should
return "Invalid Namespace or Format" when the Host request Identify
Namespace with the global NSID value.

Fixes UNH IOL 16.0 Test 9.1, Case 6

Reviewed by:	imp, allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33578
2022-01-29 23:11:14 -08:00
Chuck Tuffli
fa263c532b bhyve nvme: Fix Set Features, AEN
NVMe Controllers which do not support Endurance Groups must return an
error when the Endurance Group Event Aggregate Log Change Notices bit is
set in Set Features, Asynchronous Event Configuration.

Fixes UNH IOL Test 3.12, Case 8

Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33577
2022-01-29 23:10:59 -08:00
Chuck Tuffli
ff5ed0fac4 bhyve nvme: Fix reported VWC value
v1.4 and later NVMe Controllers report "Flush all Namespaces" support
differently.

Fixes UNH IOL 16.0 Test 2.6, Case 3

Reviewed by:	imp, allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33576
2022-01-29 23:10:42 -08:00
Chuck Tuffli
9d8cd04694 bhyve nvme: Fix LBA out-of-range calculation
The function which checks for a valid LBA range mistakenly named an
input value as NLB ("Number of Logical Blocks") instead of "number of
blocks". The NVMe specification defines NLB as a zero-based value (i.e.
NLB=0x0 represents 1 block, 0x1 is 2 blocks, etc.), but the passed
parameter is a 1's-based value.

Fix is to rename the variable to avoid future confusion.

While in the neighborhood, also check that the starting LBA is less than
the size of the backing storage to avoid an integer overflow.

Reviewed by:	imp, allanjude, jhb
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33575
2022-01-29 23:09:57 -08:00
Chuck Tuffli
073f2076fe bhyve nvme: Add Select support to Get Features
Implement basic support for the SEL field of Get Features. This returns
information about Namespace Specific features.

Fixes UNH ILO 16.0 Test 1.2, Case 13

Reviewed by:	imp, allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33574
2022-01-29 23:09:35 -08:00
Chuck Tuffli
29241c96f7 bhyve nvme: Update v1.4 Identify Controller data
Compliant v1.4 Controllers must report a Controller Type (CNTRLTYPE).
Also, do not advertise secure erase functionality in the Format NVM
Attributes field of the Identify Controller data structure as the
Controller does not implement secure erase.

Fixes UNH ILO Test 1.1, Case 2

Reviewed by:	imp, allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33573
2022-01-29 23:09:10 -08:00
Chuck Tuffli
ea9ee35583 bhyve nvme: Add Temperature Threshold support
This adds the ability for a guest OS to send Set / Get Feature,
Temperature Threshold commands. The implementation assumes a constant
temperature and will generate an Asynchronous Event Notification if the
specified threshold is above/below this value. Although the
specification allows 9 temperature values, this implementation only
implements the Composite Temperature.

While in the neighborhood, move the clear of the CSTS register in the
reset function after all other cleanup. This avoids a race with the
guest thinking the reset is complete (i.e. CSTS.RDY = 0) before the NVMe
emulation is actually complete with the reset.

Fixes UNH IOL 16.0 Test 1.7, cases 1, 2, and 4.

Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33572
2022-01-29 23:08:47 -08:00
Chuck Tuffli
1381a11829 bhyve nvme: Fix Set Features
Be more conservative and only support the Features mandatory for an I/O
Controller.

Avoids a "hang" in UNH test 1.2.10 associated with Predictable Latency
Mode Configuration and Host Behavior Support features.

Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33571
2022-01-29 23:07:44 -08:00
Chuck Tuffli
45ab4076f3 bhyve nvme: Remove redundant AER Limit checks
The NVMe emulation checked if the Asynchronous Event Request Limit
(a.k.a AERL) would be exceeded in pci_nvme_aer_add(), but this function
is only called from nvme_opc_async_event_req() which also checks for
exceeding the AERL.

Reviewed by:	imp, allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33570
2022-01-29 23:07:29 -08:00
Chuck Tuffli
785b5da318 bhyve nvme: Add missing Admin opcodes
Don't treat unsupported Admin commands as Invalid Opcode. Instead return
the proper Invalid Field in Command.

Fixes UNH IOL test 1.17.2

Reviewed by:	imp, allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33569
2022-01-29 23:07:04 -08:00
Chuck Tuffli
b1b2a4d9e8 bhyve nvme: Implement Log Page Offset
Modify the Get Log Page command to parse the Log Page Offset fields to
support more recent versions of the NVMe specification.

Fixes various tests for UNH Test 1.3.*

Reviewed by:	imp, allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33568
2022-01-29 23:06:46 -08:00
Chuck Tuffli
62d47feceb bhyve nvme: Fix Namespace Specific Set Features
Return an error if the feature specified in Set Features is Namespace
specific but the Namespace ID uses the Global Namespace tag.

Fixes UNH Test 1.2.7

Reviewed by:	imp, allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33566
2022-01-29 23:06:23 -08:00
Chuck Tuffli
cf76cdd4bf bhyve nvme: Fix NVM Format completion status
The NVM Format command is unique among the Admin commands in that it
needs to finish asynchronously. For this reason, the emulation code
invented a synthetic completion status (NVME_NO_STATUS) to indicate that
the command was still in progress and the command processing loop should
not generate a completion message. The implementation used the value
0xffff for the synthetic value as this set both the Status Code and
Status Code Type fields to reserved values.

Format initialized the completion status to this value and expected
error cases to override it with a status code/type appropriate to the
situation. The macros used to set the NVMe status are careful not to
modify bit 0 (i.e. the phase bit), which with the synthetic completion
status, causes the phase bit to get out of sync. When running tests in a
guest with illegal NVM Format commands, Admin commands would eventually
hang because it appeared there were no completions due to the incorrect
phase bit value.

Fix is to only set NVME_NO_STATUS if the blockif delete command
succeeds. While in the neighborhood, add a missing break statement when
NVM Format is not supported.

Reviewed by:	imp, allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33565
2022-01-29 23:05:58 -08:00
Chuck Tuffli
595a12f18b bhyve nvme: Advertise v1.4 support
Bump advertised NVMe support from v1.3 to v1.4

Reviewed by:	allanjude
Tested by:      jason@tubnor.net
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33564
2022-01-29 23:04:25 -08:00
Mateusz Piotrowski
75a86e93e6 usbconfig.8: Sort flags according to style(9)
MFC after:	2 weeks
2022-01-29 22:10:21 +01:00
Mateusz Piotrowski
5eafaf9e68 usbconfig.8: Improve style and fix examples
- Use Ar macros for arguments
- Stylize the argument synopsis to the -d flag
- Change the width of the list to one of the actual tags in the list
- Stylize "ugen" and "/dev/ugen" with Cm as those are constant strings,
  which are usually treated as command modifiers.
- Break long lines to reduce the number of warnings from linters
- Fix examples; the -d flag is now required when specifying the unit and
  the address with the "dot notation".

MFC after:	2 weeks
2022-01-29 22:05:22 +01:00
Baptiste Daroussin
f954986015 disextract: eliminate last use of __DECONST 2022-01-28 10:09:08 +01:00
Baptiste Daroussin
dd8ca6b27f distextract: simply code by using strsep(3) 2022-01-28 10:06:55 +01:00
Alfonso Siciliano
263660c061 bsddialog: import version 0.1
Import bsddialog 0.1 Utility and Library, fully refatorized, API stable,
manuals completed, easier to maintain and improve.

Update deps for new API:
add mixedgauge consts, delete __DECONST and add bsddialog_geterror()
info to avoid silent errors

* tzsetup
* kbdmap
* distextract

Differential Revision:	https://reviews.freebsd.org/D34066
2022-01-28 09:56:21 +01:00
Trond Endrestol
140db0be99 efitable(8): Add missing -u in the manpage
PR:	261524
MFC after:	3 days
2022-01-28 03:04:38 +02:00
Tom Jones
f0ec0fda01 bsdinstall: Add quotes around error message argument
When error is called with a message with spaces (and probably multiple
lines) these are passed into dialog unquoted and an error message was
presented, wrap with quotes.

Reviewed by:	bapt, allanjude
Sponsored by:   Ampere Computing LLC
Sponsored by:   Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D33918
2022-01-27 17:14:30 +00:00
Emmanuel Vadot
9acd521dbd pkgbase: bhyve: Tag the kbdlayout file to be in the bhyve package 2022-01-26 19:32:19 +01:00
Gordon Bergling
575c1773bf mergemaster(8): Fix a typo in an error message
- s/differnt/different/

MFC after:	3 days
2022-01-26 17:59:49 +01:00
Gordon Bergling
ee6d379be7 cpucontrol(8): Fix a typo in an error message
- s/incorret/incorrect/

MFC after:	1 week
2022-01-26 10:36:42 +01:00
Robert Wing
08cb63a12f bhyve/block_if: allow DIOCGMEDIASIZE ioctl
This is needed to get mediasize of the device after a resize event.

I missed this earlier as I was building WITH_BHYVE_SNAPSHOT, which
disables capsicum.

Reviewed by:	khng, markj
Fixes: ae9ea22e14 ("bhyve: get mediasize for character devices when ...")
Differential Revision:	https://reviews.freebsd.org/D34013
2022-01-25 07:44:13 -09:00
Gordon Bergling
340e08beee pmcstudy: Fix a typo in a usage message
-s /measurments/measurements/

MFC after:	3 days
2022-01-24 19:41:39 +01:00
Martin Matuska
e92ffd9b62 zfs: merge openzfs/zfs@17b2ae0b2 (master) into main
Notable upstream pull request merges:
  #12766 Fix error propagation from lzc_send_redacted
  #12805 Updated the lz4 decompressor
  #12851 FreeBSD: Provide correct file generation number
  #12857 Verify dRAID empty sectors
  #12874 FreeBSD: Update argument types for VOP_READDIR
  #12896 Reduce number of arc_prune threads
  #12934 FreeBSD: Fix zvol_*_open() locking
  #12947 lz4: Cherrypick fix for CVE-2021-3520
  #12961 FreeBSD: Fix leaked strings in libspl mnttab
  #12964 Fix handling of errors from dmu_write_uio_dbuf() on FreeBSD
  #12981 Introduce a flag to skip comparing the local mac when raw sending
  #12985 Avoid memory allocations in the ARC eviction thread

Obtained from:	OpenZFS
OpenZFS commit:	17b2ae0b24
2022-01-22 23:05:15 +01:00
Ryan Moeller
b252fb2430 bhyve: ahci: Fix regression with no ports
An AHCI controller may be specified with no connected ports.  Avoid
dumping core in this case for compatibility with existing VM configs.

Reviewed by:	khng, jhb
Fixes:		621b509048 Refactor configuration management in bhyve.
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D33969
2022-01-21 12:59:25 +00:00
Michael Reifenberger
19eaa01bea Append Keyboard Layout specified option for using VNC.
Part two: Append bhyve -K option for specified keyboard layout
with layout setting files every languages.
Since the cmd option '-k' was used in the meantime
it was changed to '-K'

PR:		246121
Submitted by:	koinec@yahoo.co.jp
Reviewed by:	grehan@
Differential Revision:	https://reviews.freebsd.org/D29473

MFC after:	4 weeks
2022-01-20 23:49:27 +01:00