Commit Graph

18487 Commits

Author SHA1 Message Date
Mateusz Piotrowski
77d208a3ae Improve formatting of synopsis section
This patch is about sorting the arguments and using proper mdoc(7) macros
to stylize arguments and command modifiers for much better readability.

Further style fixes in other sections within the bhyve manual page are
going to be worked on in upcoming patches.

Reviewed by:	rgrimes
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D24526
2020-04-22 06:32:51 +00:00
Hans Petter Selasky
872d83be7b Update string tables in hccontrol(8).
Submitted by:	Marc Veldman <marc@bumblingdork.com>
PR:		245796
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-21 17:51:54 +00:00
Hans Petter Selasky
21eefd310a Substitute le_read_supported_status with le_read_supported_states.
Refer to bluetooth core v5.2 specifications Vol4. Part E. 7.8.27.

PR:		245763
Submitted by:	Marc Veldman <marc@bumblingdork.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-20 13:44:14 +00:00
Hans Petter Selasky
6cf6c1510d Fix cut and paste off-by-one error in hccontrol(8).
Make sure strncpy() doesn't write beyond its given buffer.

PR:		245739
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-19 14:25:56 +00:00
Hans Petter Selasky
ea01149104 Improve printing of le features in hccontrol(8).
Submitted by:	Marc Veldman <marc@bumblingdork.com>
PR:		245739
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-19 14:22:21 +00:00
Hans Petter Selasky
3bc36313e4 Bring HCI error messages up-to-date.
See Bluetooth v5.6 core specification Vol.1 Part F: Controller error codes.

Submitted by:	Marc Veldman <marc@bumblingdork.com>
PR:		245737
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-19 10:24:15 +00:00
Rick Macklem
3c49a19fc9 Change the type of "len" to avoid warnings.
The "len" variable is used as the last argument to getsockname(2) and
accept(2). It was declared an "int" and this patch changes it to "socklen_t".
2020-04-18 23:46:58 +00:00
Hans Petter Selasky
6f80a2c88e Add missing feature descriptions to hci_features2str().
The list of possible features in hccontrol/features2str() is incomplete.
Refer to "Bluetooth Core Specification 5.2 Vol. 2 Part C. 3.3 Feature Mask Definition".

Submitted by:	Marc Veldman <marc@bumblingdork.com>
PR:		245354
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-18 08:29:16 +00:00
Eugene Grosbein
4e49fbcd37 jail(8): improve manual and usage information with more clear
description for "jail -e" mode to show that it does not take
additional jail name argument.

Reported by:		David Marec <david.marec@davenulle.org>
MFC after:		3 days
2020-04-17 10:12:11 +00:00
Scott Long
3859e5c3c6 Add support for some IOCFacts fields that are available with mpr (12Gb)
controllers.  It's ugly due to the single codebase for mpr and mps and
not being able to share their respective headers.
2020-04-16 04:17:06 +00:00
Scott Long
39e2d6bc38 Don't keep a private copy of mpr_ioctl.h and mps_ioctl.h, since they
easily get out of sync with the real files from the driver.
2020-04-16 03:33:46 +00:00
Xin LI
02371ceb33 Sync with NetBSD/OpenBSD. 2020-04-16 03:23:19 +00:00
Mateusz Piotrowski
1565e1889a Fix a typo
Reported by:	rgrimes
MFC with:	359967
2020-04-15 17:11:44 +00:00
Mateusz Piotrowski
6f2b877647 Document the exit status and the stdout message of nologin(8)
Reviewed by:	debdrup (earlier version)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24196
2020-04-15 13:13:46 +00:00
Conrad Meyer
38e6153f75 bhyve(8): Correct copyright boilerplate for r359950
Use the text from the canonical sys/copyright.h 2-clause FreeBSD License.

Reported by:	grehan (thanks!)
2020-04-15 05:55:14 +00:00
Conrad Meyer
52c39ee643 bhyve(8): Minor cosmetic niceties in instemul failure
Print the failed instruction stream as a contiguous stream of hex.  This
is closer to something you could throw at a disassembler than 0xHH 0xHH
0xHH.

Also, use the debug.h 'raw' stdio-aware printf helper to avoid the
cascading
         line
             effect.
2020-04-15 02:34:44 +00:00
Conrad Meyer
9cb339cc7b bhyve(8): Add VM Generation Counter ACPI device
Add an implementatation of the 'Virtual Machine Generation ID' spec to
Bhyve.  The spec provides a randomly generated GUID (at bhyve start) in
device memory, along with an ACPI device with _CID VM_Gen_Counter and ADDR
evaluating to a Package pointing at that GUID.

A GPE is defined which Notifies the ACPI Device when the generation changes
(such as when a snapshot is rolled back).  At this time, Bhyve does not
support snapshotting, so the GPE is never actually raised.

Suggested by:	rpokala
Discussed with:	grehan
Differential Revision:	https://reviews.freebsd.org/D23165
2020-04-15 02:00:17 +00:00
Conrad Meyer
bb30b08e76 bhyve(8): Add bootrom allocation abstraction
To allow more general use of the bootrom region, separate initialization from
allocation, and allocation from loading a file.

The bootrom segment is the high 16MB of the low 4GB region.

Each allocation in the segment creates a new mapping with specified protection.
By default, allocation begins at the low end of the range.  However, the
BOOTROM_ALLOC_TOP flag is provided to locate a provided bootrom in the high
region it is expected to be in.

The existing ROM-file loading code is refactored to use the new interface.

Reviewed by:	grehan (earlier version)
Differential Revision:	https://reviews.freebsd.org/D24422
2020-04-15 01:58:51 +00:00
Chris Rees
1d3500e065 Add mention of wireless option in bsdconfig
Submitted by:		debdrup
Approved by:		dteske (maintainer)
Differential Revision:	https://reviews.freebsd.org/D24378
2020-04-12 20:54:35 +00:00
Jason A. Harmening
31de6cad17 config(8): use sbuf to manage line buffers
PR:	245476
Reported by:	kevans
Reviewed by:	imp, kevans
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D24373
2020-04-12 02:42:42 +00:00
Emmanuel Vadot
19602a3869 gpioctl: Print interrupts capabilities
GPIO drivers who supports interrupts report them in the caps
(obtain via the getcaps method) but gpioctl doesn't know
how to interpret this and print "UNKNOWN" for each one of them.
Even if we don't have userland gpio interrupts support for now
let gpioctl print the supported caps.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24133
2020-04-11 15:25:40 +00:00
John Baldwin
ba10a6d08c Remove the -o option from gssd(8).
This uses DES and the kernel no longer supports DES for in-kernel GSS.

Reviewed by:	kp
Relnotes:	yes
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D24345
2020-04-10 23:10:28 +00:00
Rodney W. Grimes
9d3fd86663 In the past changes have been made to smbios->minor without updating the
smbios->bcdrev value.
Correct that by calculating bcdrev from the major/minor values.

Reported by:	bcran
Reviewed by:	bcran, jhb
Approved by:	jhb (maintainer)
2020-04-07 23:17:44 +00:00
Aleksandr Fedorov
1ff57e3a25 Add VIRTIO_NET_F_MTU flag support for the bhyve virtio-net device.
The flag can be enabled using the new 'mtu' option:
bhyve -s X:Y:Z,virtio-net,[tapN|valeX:N],mtu=9000

Reported by:	vmaffione, jhb
Approved by:	vmaffione (mentor)
Differential Revision:	https://reviews.freebsd.org/D23971
2020-04-07 17:06:33 +00:00
Kyle Evans
610acef538 config(8): "fix" a couple of buffer overflows
Recently added/changed lines in various kernel configs have caused some
buffer overflows that went undetected. These were detected with a config
built using -fno-common as these line buffers smashed one of our arrays,
then further triaged with ASAN.

Double the sizes; this is really not a great fix, but addresses the
immediate need until someone rewrites config. While here, add some bounds
checking so that we don't need to detect this by random bus errors or other
weird failures.

MFC after:	3 days
2020-04-07 14:14:59 +00:00
Maxim Sobolev
a8b8edb25e Normalize deployment tools usage and definitions by putting into one place
instead of sprinkling them out over many disjoint files. This is a follow-up
to achieve the same goal in an incomplete rev.348521.

Approved by:	imp
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D20520
2020-04-07 02:46:22 +00:00
Kyle Evans
3a166b3323 yp*: fix -fno-common build
This is mostly two problems spread out far and wide:
- ypldap_process should be declared properly
- debug is defined differently in many programs

For the latter, just extern it and define it everywhere that actually needs
it. This mostly works out nicely for ^/libexec/ypxfr, which can remove the
assignment at the beginning of main in favor of defining it properly.

-fno-common will become the default in GCC10/LLVM11.

MFC after:	3 days
2020-04-06 23:16:05 +00:00
Kyle Evans
f5339b097a adduser: allow standard IFS characters in passwords
Notably, the default IFS contains space/tab, thus any leading/trailing
whitespace characters tend to be removed.

Set IFS= for just the read lines to mitigate this, allowing the user to be
less surprised when their leading/trailing spaces weren't actually captured
in the password as they are with other means of setting a user's password.

PR:		245342
Submitted by:	dereks_lifeofadishwasher.com
Reviewed by:	jilles
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D24292
2020-04-05 19:25:46 +00:00
Brooks Davis
415a606e17 pmc: diable position-independent builds, they fail to link on amd64
PR:		245189
Reported by:	Gordon Bergling
Sponsored by:	DARPA
2020-04-03 16:10:42 +00:00
Edward Tomasz Napierala
28930b94b2 Stop hardcoding WARNS in uefisign(8).
MFC after:	2 weeks
Sponsored by:	DARPA
2020-04-01 15:10:26 +00:00
Edward Tomasz Napierala
1e89ef5dc1 Stop hardcoding WARNS in iscsid(8).
MFC after:	2 weeks
Sponsored by:	DARPA
2020-04-01 15:09:52 +00:00
Edward Tomasz Napierala
981e04778f Stop hardcoding WARNS in automount(8) et al.
MFC after:	2 weeks
Sponsored by:	DARPA
2020-04-01 15:08:13 +00:00
Andrew Turner
3a142cd10c Use memmove to copy within a buffer
jail(8) would try to use strcpy to remove the interface from the start of
an IP address. This is undefined, and on arm64 will result in unexpected
IPv6 addresses.

Fix this by using memmove top move the string.

PR:		245102
Reported by:	sbruno
MFC after:	2 weeks
Sponsored by:	Innovate UK
2020-04-01 09:51:29 +00:00
Vincenzo Maffione
2bec4e57e1 valectl: fix typo in man page
Submitted by:	Jose Luis Duran
MFC after:	3 days
2020-03-31 16:47:15 +00:00
Edward Tomasz Napierala
7fcbecd004 Add 'ctld -t', to test configuration file validity.
Reviewed by:	mav, allanjude, bcr (man pages)
MFC after:	2 weeks
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D23792
2020-03-31 13:43:09 +00:00
Rebecca Cran
e23fe873b2 Bhyve: fix SMBIOS Type 17 table generation
According to the SMBIOS specification (revision 2.7 or newer), the
extended module size field should only be used for sizes that can't
fit in the older size field.

Reviewed by:	rgrimes, grehan, jhb
Differential Revision:	https://reviews.freebsd.org/D24107
2020-03-31 02:36:39 +00:00
Ed Maste
b4b880cb6d correct 'disble' typo in hccontrol
PR:		245125
Submitted by:	Marc Veldman
MFC after:	1 week
2020-03-30 17:38:13 +00:00
Kyle Evans
89c7bb5613 cron: respect PATH from login.conf
As a followup to the use of login.conf environment vars (other than PATH) in
cron, this patch adds PATH (and HOME) to the list of login.conf settings
respected.

The new logic is as follows:

1. SHELL is always _PATH_BSHELL unless explicitly overridden in the crontab
file itself; no other settings are respected. This is unchanged.

2. PATH is taken from the first of: crontab file, login.conf, _PATH_DEFPATH

3. HOME is taken from the first of: crontab file, login.conf, passwd entry,
unset

4. The current directory for invoking the command is taken from the crontab
file's value of HOME (existing behavior), or the passwd entry, but not
anywhere else (so it might not equal HOME if that was set in login.conf).

Submitted by:	Andrew Gierth <andrew_tao173.riddles.org.uk>
Reviewed by:	sigsys_gmail.com
Differential Revision:	https://reviews.freebsd.org/D23597
2020-03-30 03:26:52 +00:00
Kyle Evans
a33e986417 config(8): fixes for -fno-common
Move this handful of definitions into main.c, properly declare these as
extern in config.h. This fixes the config(8) build with -fno-common.

Unexplained in my previous commit to gas, -fno-common will become the
default in GCC10 and LLVM11, so it's worth addressing these in advance.

MFC after:	3 days
2020-03-28 04:02:00 +00:00
Chuck Tuffli
1264a2b909 bhyve: fix NVMe emulation update of SQHD
The SQHD field of a Completion Queue entry indicates the current
Submission Queue head pointer value. The head pointer represents the
next entry to be consumed and is updated after consuming the current
entry.

In the Admin queue processing, the current code updates the head pointer
after reporting the value to the host via the SQHD. This gives the
impression that the Controller is perpetually one command behind in its
processing of the Admin SQ. And while this doesn't appear to bother some
initiators, it is wrong.

Fix is to update the SQ head pointer prior to writing the SQHD value in
the completion.

While here, fix missed update of dword 0 (cdw0) in the completion
message.

Reported by:	khng300
Reviewed by:	jhb, imp
Approved by:	jhb (maintainer)
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24083
2020-03-27 15:28:27 +00:00
Chuck Tuffli
961be12f6a bhyve: fix NVMe emulation missed interrupts
The bhyve NVMe emulation has a race in the logic which generates command
completion interrupts. On FreeBSD guests, this manifests as kernel log
messages similar to:
    nvme0: Missing interrupt

The NVMe emulation code sets a per-submission queue "busy" flag while
processing the submission queue, and only generates an interrupt when
the submission queue is not busy.

Aside from being counter to the NVMe design (i.e. interrupt properties
are tied to the completion queue) and adding complexity (e.g. exceptions
to not generating an interrupt when "busy"), it causes a race condition
under the following conditions:
 - guest OS has no outstanding interrupts
 - guest OS submits a single NVMe IO command
 - bhyve emulation processes the SQ and sets the "busy" flag
 - bhyve emulation submits the asynchronous IO to the backing storage
 - IO request to the backing storage completes before the SQ processing
   loop exits and doesn't generate an interrupt because the SQ is "busy"
 - bhyve emulation finishes processing the SQ and clears the "busy" flag

Fix is to remove the "busy" flag and generate an interrupt when the CQ
head and tail pointers do not match.

Reported by:	khng300
Reviewed by:	jhb, imp
Approved by:	jhb (maintainer)
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24082
2020-03-27 15:28:22 +00:00
Chuck Tuffli
f3e46ff932 bhyve: use STAILQ in NVMe emulation
Use the standard queue(3) macros instead of hand-crafted linked list
code.

Reviewed by:	imp, jhb
Approved by:	jhb (maintainer)
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24081
2020-03-27 15:28:16 +00:00
Chuck Tuffli
cd65e08916 bhyve: implement NVMe deallocate command
This adds support for the Dataset Management (DSM) command to the NVMe
emulation in general, and more specifically, for the deallocate
attribute (a.k.a. trim in the ATA protocol). If the backing storage for
the namespace supports delete (i.e. deallocate), setting the deallocate
attribute in a DSM will trim/delete the requested LBA ranges in the
underlying storage.

Reviewed by:	jhb, araujo, imp
Approved by:	jhb (maintainer)
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D21839
2020-03-27 15:28:11 +00:00
Chuck Tuffli
d31d525ef5 bhyve: refactor NVMe namespace initialization
Pass the struct pci_nvme_blockstore pointer for this namespace to the
namespace initialization function instead of only the desired eui64
value.

Minor functional change in that the code updates the eui64 value in the
blockstore.

Reviewed by:	jhb, araujo
Approved by:	jhb (maintainer)
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D21838
2020-03-27 15:28:05 +00:00
Chuck Tuffli
da8de3e9a8 bhyve: refactor NVMe PRP memcpy
Add a "copy direction" parameter to nvme_prp_memcpy such that data can
be copied to the memory specified by the PRP entries (current behavior)
or copied from the PRP entries (new behavior). The upcoming deallocate
functionality will use the copy from capability.

Reviewed by:	jhb, araujo
Approved by:	jhb (maintainer)
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D21837
2020-03-27 15:28:00 +00:00
Andrey V. Elsukov
ccf8b02c94 Fix typo.
MFC after:	2 weeks
2020-03-26 12:00:26 +00:00
Andrey V. Elsukov
7d367c51c8 Add property-based filters for syslogd.
Property-based filters allow substring and regular expressions
(see re_format(7)) matching against various message attributes.
Filter specification starts with '#:' or ':' followed by three
comma-separated fields property, operator, "value". Value must be
double-quoted. A double quote and backslash must be escaped by a
blackslash.

Following properties are supported as test value:
o msg - body of the message received;
o programname - program name sent the message;
o hostname - hostname of message's originator;
o source - an alias for hostname.

Supported operators:
o contains - true if filter value is found as a substring of property;
o isequal - true if filter value is equal to property;
o startswith - true if property starts with filter value;
o regex - true if property matches basic regular expression defined
    in filter value;
o ereregex - true if property matches extended regular expression
    defined in filter value;

Operator may be prefixed by '!' to invert compare logic or by
'icase_' to make comparison function case insensitive.

Submitted by:	Boris N. Lytochkin <lytboris at gmail com>
MFC after:	2 weeks
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D23468
2020-03-26 11:54:25 +00:00
Simon J. Gerraty
53f151f906 Fix pkgfs stat so it satisfies libsecureboot
We need a valid st_dev, st_ino and st_mtime
to correctly track which files have been verified
and to update our notion of time.

ve_utc_set(): ignore utc if it would jump our current time
by more than VE_UTC_MAX_JUMP (20 years).

Allow testing of install command via userboot.
Need to fix its stat implementation too.

bhyveload also needs stat fixed - due to change to userboot.h

Call ve_error_get() from vectx_close() when hash is wrong.

Track the names of files we have hashed into pcr

For the purposes of measured boot, it is important
to be able to reproduce the hash reflected in
loader.ve.pcr
so loader.ve.hashed provides a list of names in the order they
were added.

Reviewed by:	imp
MFC after:	1 week
Sponsored by:	Juniper Networks
Differential Revision:	https://reviews.freebsd.org//D24027
2020-03-25 19:12:19 +00:00
Emmanuel Vadot
ee55186dfd pmc: Add include path for libpmcstat as it is an internallib
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D24173
2020-03-25 01:32:16 +00:00
Emmanuel Vadot
e055e3367e wlandebug: Add include path for libifconfig as it is a internallib
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D24172
2020-03-25 01:31:26 +00:00