Commit Graph

18764 Commits

Author SHA1 Message Date
Peter Grehan
2f40fc6ff3 Add legacy debug/test interfaces for kvm unit tests.
Implement the legacy debug/test interfaces expected by KVM-unit-tests'
realmode, emulator, and ioapic tests.

Submitted by:	adam_fenn.io
Reviewed by:	markj, grehan
Approved by:	grehan (bhyve)
MFC after:	3 weeks
Relnotes:	Yes
Differential Revision:	https://reviews.freebsd.org/D27130
2020-11-17 13:14:04 +00:00
Brooks Davis
73734d6eb1 Add missing includes of src.opts.mk
Without this "SUBDIR.${MK_TESTS}=tests" would always expand to
"SUBDIR.=tests" resulting in the tests not being built.

Sponsored by:	DARPA
2020-11-16 17:20:35 +00:00
Scott Long
8e1031086d Revert the whole getlocalbase() set of changes while a different design is
hashed out.
2020-11-15 20:24:59 +00:00
Peter Grehan
cd5b6d16ca Fix regression in AHCI controller settings.
When the AHCI code was reworked to use FreeBSD struct
definitions, the valid element was mis-transcribed resulting
in the UMDA capability being hidden. This prevented Illumos
from using AHCI disk/cdrom drives.

Fix by using definitions that match the code pre-rework.

PR:	250924
Submitted by:	Rolf Stalder
Reported by:	Rolf Stalder
MFC after:	3 days
2020-11-15 12:59:24 +00:00
Scott Long
1b249101df Fix the previous revision, it suffered from an incomplete change to the
getlocalbase API.  Also don't erroneously subtract the lenth from the
buffer a second time.
2020-11-15 07:50:29 +00:00
Scott Long
7ca0d5403e Replace hardcoded references to _PATH_LOCALBASE with calls to getlocalbase.3
Reviewed by:	imp, se
2020-11-14 18:01:14 +00:00
Mateusz Piotrowski
32f4592764 Document the PAGER environment variable
Sometimes users want to use freebsd-update(8) in a non-interactive way and
what they often miss is that they have to set PAGER to cat(1) in order to
avoid interactive prompts from less(1).

MFC after:	4 weeks
2020-11-14 13:07:41 +00:00
Rebecca Cran
a2fe464c81 bhyve: update smbiostbl.c to bump the version and release date
Since lots of work has been done on bhyve since 2014, increase the version
to 13.0 to match 13-CURRENT, and update the release date.

Reviewed by:	grehan
Differential Revision:	https://reviews.freebsd.org/D27147
2020-11-13 19:47:16 +00:00
Brandon Bergren
26869ad14c [PowerPC] Allow traversal of oversize OF properties.
In standards such as LoPAPR, property names in excess of the usual 31
characters exist.

This breaks property traversal.

While in IEEE 1275-1994, nextprop is defined explicitly to work with a
32-byte region of memory, using a larger buffer should be fine. There is
actually no way to pass a buffer length to the nextprop call in the OF
client interface, so SLOF actually just blindly overflows the buffer.

So we have to defensively make the buffer larger, to avoid memory
corruption when reading out long properties on live OF systems.

Note also that on real-mode OF, things are pretty tight because we are
allocating against a static bounce buffer in low memory, so we can't just
use a huge buffer to work around this without it being wasteful of our
limited amount of 32-bit physical memory.

This allows a patched ofwdump to operate properly on SLOF (i.e. pseries)
systems, as well as any other PowerPC systems with overlength properties.

Reviewed by:	jhibbits
MFC after:	2 weeks
Sponsored by:	Tag1 Consulting, Inc.
Differential Revision:	https://reviews.freebsd.org/D26669
2020-11-13 16:49:41 +00:00
Konstantin Belousov
038f5c7bfe bhyve: remove a hack to map all 8G BARs 1:1
Suggested and reviewed by:	grehan
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D27186
2020-11-12 02:52:01 +00:00
Konstantin Belousov
670b364b76 bhyve: increase allowed size for 64bit BAR allocation below 4G from 32 to 128 MB.
Reviewed by:	grehan
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D27095
2020-11-12 00:51:53 +00:00
Konstantin Belousov
9922872ba2 bhyve: avoid allocating BARs above the end of supported physical addresses.
Read CPUID leaf 0x8000008 to determine max supported phys address and
create BAR region right below it, reserving 1/4 of the supported guest
physical address space to the 64bit BARs mappings.

PR:    250802 (although the issue from PR is not fixed by the change)
Noted and reviewed by:	grehan
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D27095
2020-11-12 00:46:53 +00:00
Olivier Cochard
c4fd0cc9ee Return the same value for smbios.chassis.maker as smbios.system.maker (and prevents returning a space character).
Reviewed by:	grehan
Approved by:	grehan
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D27123
2020-11-08 07:49:39 +00:00
Cy Schubert
ce558a3f33 Fix build post-r367455.
MFC after:	2 weeks
X-MFC with:	r367455
2020-11-07 19:17:37 +00:00
Bryan Drewery
9470af395f syslogd: Stop trying to send remote messages through special sockets
Specifically this was causing the /dev/klog fd and the signal pipe
handling fd to get a sendmsg(2) called on them and always returned
[ENOTSOCK].

r310350 combined these sockets into the main socket list and properly
skipped AF_UNSPEC at the sendmsg(2) call but later in r344739 it was
broken such that these special sockets were no longer excluded since
the AF_UNSPEC check specifically excluded these special sockets. Only
these special sockets have sl_sa = NULL. The sl_family checks should
be redundant now but are left in case of future changes so the intent
is clearer.

MFC after:	2 weeks
2020-11-07 17:18:44 +00:00
Robert Wing
3701068b5d Add a periodic script to backup output generated from gmirror list.
Disabled by default.

PR:             86388
Submitted by:   Miroslav Lachman <000.fbsd@quip.cz>
Reviewed by:    allanjude, gbe
Approved by:    allanjude (mentor)
MFC after:      4 weeks
Event:          July 2020 Bugathon
Differential Revision:  https://reviews.freebsd.org/D25631
2020-11-07 04:15:24 +00:00
Kyle Evans
2c5e865059 binmiscctl(8): miscellaneous cleanup
- Bad whitespace in Makefile.
- Reordered headers, sys/ first.
- Annotated fatal/usage __dead2 to help `make analyze` out a little bit.
- Spell a couple of sizeof constructs as "nitems" and "howmany" instead.

MFC after:	1 week
2020-11-07 03:43:45 +00:00
Robert Wing
eefe831eaf Add a periodic script to backup output generated from zfs list, zfs get,
`zpool list`, and `zpool get` commands.

Disabled by default.

PR:             86388
Submitted by:   Miroslav Lachman <000.fbsd@quip.cz>
Reviewed by:    allanjude, 0mp
Approved by:    allanjude (mentor)
MFC after:      4 weeks
Event:          July 2020 Bugathon
Differential Revision:  https://reviews.freebsd.org/D25638
2020-11-06 22:58:31 +00:00
John-Mark Gurney
e771d59074 fix up docs, if signature checking is enabled, the file MUST exist... 2020-11-06 22:11:05 +00:00
Allan Jude
cc3568c1d0 VirtIO: Make sure the guest knows the TRIM alignment requirements
If bhyve is used to emulate 512e access in guest OS, then discard addresses should be properly aligned.
Otherwise ioctl DIOCGDELETE fails for 512b requires on devices with 4K sector size.
see g_dev_ioctl() in sys/geom/geom_dev.c

Submitted by:	Vitaliy Gusev <gusev.vitaliy@gmail.com>
MFC after:	1 week
Sponsored by:	vStack.com
Differential Revision:	https://reviews.freebsd.org/D27075
2020-11-05 17:10:14 +00:00
Mateusz Piotrowski
d3231fbdd2 pmcstat: Fix a typo in the usage message
Reviewed by:	emaste
Approved by:	emaste
Differential Revision:	https://reviews.freebsd.org/D26082
2020-11-04 15:44:59 +00:00
Alex Richardson
d24f17df96 Fix bad libbxo format strings in jls
The existing format string for the empty case was trying to read varargs
values that weren't passed to xo_emit. This appears to work on x86 (since
the next argument is probably a pointer an empty string), but for CHERI
we can bound variadic arguments and detect a read past the end.

While touching these lines also use the libxo 'a' modifier to avoid having to
construct the libxo format string using asprintf.

Found by:	CHERI
Reviewed By:	allanjude
Differential Revision: https://reviews.freebsd.org/D26885
2020-11-04 14:31:52 +00:00
Adrian Chadd
e72a100b79 [ctld] Fix compilation under gcc-6.4
* remove dup yylex symbol; already defined in a header file
* uint64_t is always >= 0

Reviewed by:	cem, imp
Differential Revision:	https://reviews.freebsd.org/D27046
2020-11-01 21:18:21 +00:00
Olivier Cochard
ac8f506b85 bhyve currently reports each of "smbios.system.maker" and
"smbios.system.family" as " ".
This presents challenges for both humans and tools when trying to parse output
that uses those results.
The new values reported are now:
smbios.system.family="Virtual Machine"
smbios.system.maker="FreeBSD"

PR:		250728
Approved by:	grehan@FreeBSD.org
Sponsored by:	Netflix
2020-10-30 00:03:59 +00:00
Edward Tomasz Napierala
bce7ee9d41 Drop "All rights reserved" from all my stuff. This includes
Foundation copyrights, approved by emaste@.  It does not include
files which carry other people's copyrights; if you're one
of those people, feel free to make similar change.

Reviewed by:	emaste, imp, gbe (manpages)
Differential Revision:	https://reviews.freebsd.org/D26980
2020-10-28 13:46:11 +00:00
Cy Schubert
c0caa2e24e MFV r367082:
Update unbound 1.11.0 --> 1.12.0.

MFC after:	1 month.
2020-10-27 23:03:15 +00:00
Stefan Eßer
1f474190fc Replace literal uses of /usr/local in C sources with _PATH_LOCALBASE
Literal references to /usr/local exist in a large number of files in
the FreeBSD base system. Many are in contributed software, in configuration
files, or in the documentation, but 19 uses have been identified in C
source files or headers outside the contrib and sys/contrib directories.

This commit makes it possible to set _PATH_LOCALBASE in paths.h to use
a different prefix for locally installed software.

In order to avoid changes to openssh source files, LOCALBASE is passed to
the build via Makefiles under src/secure. While _PATH_LOCALBASE could have
been used here, there is precedent in the construction of the path used to
a xauth program which depends on the LOCALBASE value passed on the compiler
command line to select a non-default directory.

This could be changed in a later commit to make the openssh build
consistently use _PATH_LOCALBASE. It is considered out-of-scope for this
commit.

Reviewed by:	imp
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D26942
2020-10-27 11:29:11 +00:00
Ed Maste
f98cf03166 mergemaster: Clarify installed and updated versions
Describe "diff installed new" as "Displaying differences between
installed and new."  Previously mergemaster described them in the
opposite order.

PR:		249214
Reported by:	Yuri Victorovich
MFC after:	2 weeks
2020-10-25 18:06:45 +00:00
Rick Macklem
f93c028ac9 Update man page for -R option added by r376026.
This is a content change.

Reviewed by:	bcr
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D26746
2020-10-24 22:52:29 +00:00
Rick Macklem
bde6f938bf Add "-R" option to tell mountd to not register with rpcbind.
rpcbind is now considered a security risk for some sites.
Since an NFSv4 only NFS server does not need rpcbind,
it makes sense to have an option that implements this.

This patch adds a "-R" option that disables the Mount
protocol (not used by NFSv4) and does not register
with rpcbind.

Changes are required to /etc/rc.d/mountd and /etc/rc.d/nfsd.
Those will be in a separate commit.

Reviewed by:	freqlabs, asomers
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D26746
2020-10-24 22:48:28 +00:00
Richard Scheffenegger
ea8f1280a2 Add network QoS support for PCP to iscsi target.
Mak the Ethernet PCP codepoint configurable
for L2 local traffic, to allow lower latency for
iSCSI block IO. This addresses the target
side only.

Reviewed by:	mav, trasz, bcr
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D26740
2020-10-24 21:10:53 +00:00
Richard Scheffenegger
4dfbcffbb9 Add network QoS support for PCP to iscsi initiator.
Make the Ethernet PCP codepoint configurable
for L2 local traffic, to allow lower latency for
iSCSI block IO. This addresses the initiator
side only.

Reviewed by:	mav, trasz, bcr
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D26739
2020-10-24 21:07:13 +00:00
Mark Johnston
a792802f2b rtsold: Remove an incorrect __unused annotation
MFC after:	1 week
2020-10-23 14:56:17 +00:00
Alexander Motin
7dbbd1aeae Negotiate iSCSIProtocolLevel of 2 (RFC 7144) in initiator.
It does not change anything immediately, but allows further support of
Command Priority, Status Qualifier and new task management functions.

MFC after:	1 month
Sponsored by:	iXsystems, Inc.
2020-10-22 20:26:27 +00:00
Gordon Bergling
ad5e10ec0c stablerestart(5): Fix some issues reported by mandoc
- New sentence, new line
2020-10-22 19:25:01 +00:00
Gordon Bergling
1f57220934 pnfsserver(4): Fix some issues reported by mandoc
- new sentence, new line
2020-10-22 19:19:42 +00:00
Ryan Moeller
b8adbe1c15 efibootmgr: Use returned error code for error message, not errno
efivar_unix_path_to_device_path returns the error code, it does not set errno.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D26852
2020-10-19 10:38:40 +00:00
Baptiste Daroussin
ae659caa0a Use asprintf instead of sbuf 2020-10-19 07:26:42 +00:00
Ryan Moeller
60dc6bee1f bhyve: Update TX descriptor base address and host mapping on change
bhyve sometimes segfaults when using an e1000 NIC with a Windows guest.

We are only updating our tdba and cached host mapping when the low address
register is written and when tx is set enabled, but not when the high address
or length registers are written. It is observed that Windows 10 is occasionally
enabling tx first then writing the registers in the order low, high, len. This
leaves us with a bogus base address and mapping, which causes a segfault later
when we try to copy from a descriptor that has unpredictable garbage in a
pointer.

Updating the address and mapping when any of those registers change seems to fix
that particular issue.

Reviewed by:	mav, grehan (bhyve)
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D26798
2020-10-16 20:27:20 +00:00
Jessica Clarke
a98fa52ec6 kldxref: Avoid buffer overflows in parse_pnp_list
We convert a string like "W32:vendor/device" into "I:vendor;I:device",
where the output is longer than the input, but only allocate space equal
to the length of the input, leading to a buffer overflow.

Instead use open_memstream so we get a safe dynamically-grown buffer.

Found by:	CHERI
Reviewed by:	imp, jhb (mentor)
Approved by:	imp, jhb (mentor)
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D26637
2020-10-15 18:03:14 +00:00
Adrian Chadd
5c3bf25fee [traceroute6] Don't do the casper bits when we're not doing casper
This with the previous patch I committed makes traceroute6/traceroute
compile fine when libcasper isn't enabled.

This complains strongly with unused variables and such when compiled
with gcc-6 on mips32.

Tested:

* compiled/run on mips32 hardware (AR9344)

Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D26773
2020-10-14 00:01:17 +00:00
Robert Wing
915dcdb7ac ctl.conf(5): fix LUN size in UCL format example.
Remove quotes around size in the LUN section and change the suffix to 'GB'. The
UCL format does recognize 'G' on its own, which uses a base 10 multiplier where
'GB' uses a 2 power multiplier.

Document the difference between valid suffixes when using ctl.conf(5) in the
general syntax form or in UCL format.

Reviewed by:    kevans, mav
Approved by:    kevans (mentor)
Differential Revision: https://reviews.freebsd.org/D26716
2020-10-13 18:00:23 +00:00
Gordon Bergling
7f78912159 pnfsdsfile(8): Remove dublicate word 'the'
MFC after:	1 week
2020-10-10 14:38:01 +00:00
Gordon Bergling
2911dc6cea cxgbetool(8): Remove dublicate word 'whether'
MFC after:	1 week
2020-10-10 14:36:16 +00:00
Rick Macklem
2ffad162f3 Modify mountd.c so that it does not always malloc 4K for the map credentials.
r362163 upgraded mountd so that it could handle MAX_NGROUPS
groups for the anonymous user credentials (the ones provided by
-maproot and -mapall exports options).
The problem is that this resulted in every export structure growing by
about 4Kbytes, because the cr_groups field went from 16->MAX_NGROUPS.

This patch fixes this by only including a small 32 element cr_groups in the
structure and then malloc()'ng cr_groups when a larger one is needed.
The value of SMALLNGROUPS is arbitrarily set to 32, assuming most users
used by -maproot or -mapall will be in <= 32 groups.

Reviewed by:	kib, freqlabs
Differential Revision:	https://reviews.freebsd.org/D26521
2020-10-10 00:01:40 +00:00
Gordon Bergling
3d265fce43 Fix a few mandoc issues
- skipping paragraph macro: Pp after Sh
- sections out of conventional order: Sh EXAMPLES
- whitespace at end of input line
- normalizing date format
2020-10-09 19:12:44 +00:00
Mark Johnston
b0eefff78b syslogd: Avoid trimming host names in RFC 5424 mode
RFC 5424 says that implementations should log hostnames in FQDN
format.  Only trim host names in RFC 3164 mode.

PR:		250014
Submitted by:	Dmitry Wagin <dmitry.wagin@ya.ru>
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D26644
2020-10-09 15:19:29 +00:00
Richard Scheffenegger
bfabdade5c Add DSCP support for network QoS to iscsi initiator.
Allow the DSCP codepoint also to be configurable
for the traffic in the direction from the initiator
to the target, such that writes and any requests
are also treated in the appropriate QoS class.

Reviewed by:	mav
MFC after:	2 weeks
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D26714
2020-10-09 14:33:09 +00:00
Gordon Bergling
6d6d6c3603 Fix a few mandoc issues
- no blank before trailing delimiter
- whitespace at end of input line
- sections out of conventional order
- normalizing date format
- AUTHORS section without An macro
2020-10-09 14:03:45 +00:00
Warner Losh
c6d56081c9 Initial support for implementing the bootXXX.efi workaround
Too many version of UEFI firmware (so far only confirmed on amd64)
don't really support efibootmgr selection of boot. That's the most
reliable, when it works, since there's no guesswork. However, many do
not save, unmolested, the variables that efibootmgr sets, so as a
fallback we also install loader.efi as bootXXX.efi (where XXX is
either aa64 or x64) if it doesn't already exist in /efi/boot on the
ESP. The standard only defines this for removable devices, but it's
almost ubiquitously used as a fallback. Many BIOSes implement a drive
selection feature that takes over the efibootmgr protocol, rendinering
it useless (either generally, or for those vendors not on the short
list). bootxxx.efi works around this. However, we don't install it
unconditionally there, as that breaks some popular multi-boot setups.

MFC After: 1 week
Differential Revision: https://reviews.freebsd.org/D26428
2020-10-09 00:16:26 +00:00