Commit Graph

18628 Commits

Author SHA1 Message Date
Eugene Grosbein
dca51295b2 bsnmptools: make it print protocol errors to stderr instead of stdout
Reviewed by:		syrinx, bz
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D25911
2020-08-05 09:19:41 +00:00
Gordon Bergling
3422ca83ba iovctl.conf(5): Use Lk macro for the URL of the UCL website
PR:		248334
Reported by:	chuck at tuffli dot net
Reviewed by:	bcr, 0mp
Approved by:	bcr, 0mp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25891
2020-08-04 11:13:13 +00:00
Alex Richardson
c4bd82d701 Allow bootstrapping mtree on Linux systems
Linux glibc has a dummy lchmod that always fails and emitting a linker
warning when used. Don't fail the build due to that warning when
bootstrapping by setting LD_FATAL_WARNINGS=no.

Reviewed By:	brooks, emaste
Differential Revision: https://reviews.freebsd.org/D25930
2020-08-03 18:08:10 +00:00
Peter Grehan
f1c3dac414 Replace magic numbers in Identify page register 0 with ATA definitions.
No functional change. Verified with objdump output before/after.

Requested by:	rpokala
Reviewed by:	rpokala
MFC after:	3 weeks
2020-07-31 12:10:28 +00:00
Alexander Motin
3b11655c7e When modifying LUN pass "special" options too.
Before switching to nvlists CTL merged previous and new options, so
any options not passed just kept previous value.  Now CTL completely
replaces them, so we must pass everything still relevant.

MFC after:	1 week
Sponsored by:	iXsystems, Inc.
2020-07-28 22:32:50 +00:00
Yoshihiro Takahashi
8f11c99715 - Cleanups related to sparc64 removal.
- Remove remains of sparc64 files.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D25831
2020-07-28 10:58:37 +00:00
Mateusz Piotrowski
d421b01028 nologin.8: Improve wording
Reported by:	yuripv
Reviewed by:	bcr, yuripv
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D25814
2020-07-27 10:45:47 +00:00
Peter Grehan
9af3bcd7c9 Support the setting of additional AHCI controller parameters.
Allow the serial number, firmware revision, model number and nominal media
rotation rate (nmrr) parameters to be set from the command line.

Note that setting the nmrr value can be	used to	indicate the AHCI
device is an SSD.

Submitted by:	Wanpeng Qian
Reviewed by:	jhb, grehan (#bhyve)
Approved by:	jhb, grehan
MFC after:	3 weeks
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D24174
2020-07-27 07:56:55 +00:00
Juli Mallett
ce219ecd93 Remove reference to nlist(3) missed in SCCS revision 5.26 by mckusick
when converting rwhod(8) to using kern.boottime ather than extracting
the boot time from kernel memory directly.

Reviewed by:	imp
2020-07-24 16:58:13 +00:00
John-Mark Gurney
98b765e5c2 update example to make it active when creating a new boot method...
Clean up some of the sentences and grammar...

make igor happy..
2020-07-23 22:28:35 +00:00
Brooks Davis
e9b21d432b Correct a type-mismatch between xdr_long and the variable "bad".
Way back in r28911 (August 1997, CVS rev 1.22) we imported a NetBSD
information leak fix via OpenBSD.  Unfortunatly we failed to track the
followup commit that fixed the type of the error code.  Apply the change
from int to long now.

Reviewed by:	emaste
Found by:	CHERI
Obtained from:	CheriBSD
MFC after:	3 days
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D25779
2020-07-22 23:39:58 +00:00
Brooks Davis
d90b364147 Avoid reading one byte before the path buffer.
This happens when there's only one component (e.g. "/foo"). This
(mostly-harmless) bug has been present since June 1990 when it was
commited to mountd.c SCCS version 5.9.

Note: the bug is on the second changed line, the first line is changed
for visual consistency.

Reviewed by:	cem, emaste, mckusick, rmacklem
Found with:	CHERI
Obtained from:	CheriBSD
MFC after:	1 week
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D25759
2020-07-22 21:44:51 +00:00
Kyle Evans
ca7f7593ba pkg-bootstrap: complain on improper pkg bootstrap usage
Right now, the bootstrap will gloss over things like pkg bootstrap -x or
pkg bootstrap -f pkg. Make it more clear that this is incorrect, and hint
at the correct formatting.

Reported by:	jhb (IIRC via IRC)
Approved by:	bapt, jhb, manu
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D24750
2020-07-22 17:33:35 +00:00
Mark Johnston
ca19d0d78f traceroute6: Fix most warnings at the default WARNS level.
Fix some style issues as well.  Leave -Wno-cast-aligned set for now, as
most of the warnings come casts of CMSG_DATA(), which does provide
sufficient alignment in practice.

Submitted by:	Shubh Gupta <shubh@freebsd.org>
Sponsored by:	Google (GSOC 2020)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25603
2020-07-21 15:03:36 +00:00
Toomas Soome
6b8b1bfef0 efibootmgr: typo in long option name
del-timout should be del-timeout

Reported by:	mjg
MFC after:	1 week
2020-07-16 10:20:35 +00:00
Gregory Neil Shapiro
5b0945b570 Merge sendmail 8.16.1 to HEAD: See contrib/sendmail/RELEASE_NOTES for details
Includes build infrastructure & config updates required for changes in 8.16.1

MFC after:	5 days
2020-07-15 18:28:54 +00:00
Adrian Chadd
420306c3b7 [pmc] whoops, remove spurious #'s
pointed out by gonzo@, thanks!
2020-07-14 05:33:23 +00:00
Adrian Chadd
f8e66eb160 [hwpmc] Compile 'pmc' only if we have C++11.
I noticed when compiling with ye olde gcc-6.3.0 on mips that it tripped over
a lack of C++11 bits.  This allows it to compile fine.
2020-07-14 05:10:50 +00:00
Allan Jude
4cf6caac2f Actually install the new 221.backup-gpart periodic script
Submitted by:	Rob Fairbanks <rob.fx907@gmail.com>
Reported by:	Michael Butler <imb@protected-networks.net>
MFC with:	r363110
Sponsored by:	Klara Inc.
2020-07-14 00:46:20 +00:00
Gordon Bergling
aeeff830b9 arp(8) clarify the use of the '-a flag'
PR:		238146
Submitted by:	Andrew Stevenson <andrew at ugh dot net dot au>
Reported by:	Andrew Stevenson <andrew at ugh dot net dot au>
Reviewed by:	bcr (mentor)
Approved by:	bcr (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25645
2020-07-13 15:06:29 +00:00
Allan Jude
ce2fe5b109 Add a periodic script to backup the partition table and boot code
Optionally, alert you if the contents change from the previous backup

PR:		86388
Submitted by:	Rob Fairbanks <rob.fx907@gmail.com>, Miroslav Lachman <000.fbsd@quip.cz> (Original Version)
MFC after:	4 weeks
Relnotes:	yes
Sponsored by:	Klara Inc.
Event:		July 2020 Bugathon
Differential Revision:	https://reviews.freebsd.org/D25628
2020-07-11 20:53:31 +00:00
Allan Jude
86e88c4f54 nscd: does not warn about invalid values what parsing config file
PR:		202135
Submitted by:	amutu@amutu.com
Reported By:	Trond.Endrestol@ximalas.info
Reviewed by:	markj, freqlabs
MFC after:	4 weeks
Sponsored by:	Klara Inc.
Event:		July 2020 Bugathon
Differential Revision:	https://reviews.freebsd.org/D25627
2020-07-11 19:44:12 +00:00
Allan Jude
9d4c84dea4 ppp: Document the fact that ppp_nat is enabled by default
No functional change.

PR:		243062
Submitted by:	Evilham <contact@evilham.com> (original version)
MFC after:	2 weeks
Sponsored by:	Klara Inc.
Event:		July 2020 Bugathon
Differential Revision:	https://reviews.freebsd.org/D25623
2020-07-11 18:24:16 +00:00
Allan Jude
c5acd3a091 bsdinstall: only kill the dhclient for the interface we are restarting
PR:		205821
Reported by:	mjg
MFC after:	2 weeks
Sponsored by:	Klara Inc.
Event:		July 2020 Bugathon
2020-07-11 17:20:17 +00:00
Allan Jude
5b8d2467eb bsdinstall: don't fail if fstab is empty
PR:		210865
Submitted by:	Tim Lukasiewicz <eclipzetech08@gmail.com>, h-fujishima@sakura.ad.jp (original version)
Reported by:	h-fujishima@sakura.ad.jp
Reviewed by:	sef
MFC after:	2 weeks
Sponsored by:	Klara Inc.
Event:		July 2020 Bugathon
2020-07-11 17:06:48 +00:00
Allan Jude
9a55656956 bsdinstall: kill dhclient before starting a new instance
PR:		205821
Submitted by:	William Orr <will@worrbase.com>
MFC after:	2 weeks
Sponsored by:	Klara Inc.
Event:		July 2020 Bugathon
Differential Revision:	https://reviews.freebsd.org/D14572
2020-07-11 15:32:53 +00:00
Peter Grehan
fb5f5a17ef Advertise 64-bit physical-address capability.
This fixes a coredump with NetBSD guests when XHCI is configured.
On seeing the AC64 flag clear, the NetBSD XHCI driver was only writing
to the lower 32-bits of 64-bit physical address registers. The emulation
relies on a write to the hi 32-bits to calculate a host virtual address
for internal use, and has always supported 64-bit addressing.

All other guests were seen to write to both the lo- and hi- address
registers, regardless of the AC64 setting.

Discussed with:  Leon Dang (author)
Tested with:  Ubuntu 16/18/20, Windows10, OpenBSD UEFI guests.

MFC after:	2 weeks.
2020-07-10 07:26:50 +00:00
Cy Schubert
f329ac7dfb Enable support for IEEE 802.11N, 802.11W, 802.11AC and 802.11.AX to
hostapd and wpa_supplicant.

Submitted by:	bz
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	Rubicon Communications, LLC (d/b/a "Netgate")
2020-07-09 23:01:36 +00:00
Takanori Watanabe
2105611236 Add le_rand command.
PR: 247808
Submitted by: Marc Veldman
2020-07-08 03:57:47 +00:00
Peter Grehan
6a7ff0600b Silence ACPI RTC error/warning in Linux guests.
Allow guests to	set the	RTC bit	in the ACPI PM control register.
This eliminates an annoying	(and harmless) Linux kernel boot message.

PR:	244721
Submitted by:	Jose Luis Duran
MFC after:	1 week
2020-07-06 08:36:14 +00:00
Alexander Motin
ebc22d0495 Decode APEI tables (BERT, EINJ, ERST, HEST).
MFC after:	2 weeks
2020-06-30 21:40:34 +00:00
Gordon Bergling
32100375a6 iovctl(8): Correct a typo in the manpage and correct the SYNOPSIS
PR:	246831
Submitted by:	Jose Luis Duran <jlduran at gmail dot com>
Reviewed by:	bcr (mentor)
Approved by:	bcr (mentor)
MFC after:	7 days
2020-06-30 17:21:28 +00:00
Edward Tomasz Napierala
3d10bf72ef Fix misplaced voltages/temperatures labels in 'sesutil show'.
PR:		bin/247384
Reported by:	brd
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D25353
2020-06-30 16:49:43 +00:00
Kyle Evans
70448a5414 mailwrapper: switch mailer.conf to CONFS
This matches what was already being done in dma(8), and should again make
this merge with etcupdate/mergemaster.

Reported by:	jhb
2020-06-29 18:06:00 +00:00
Chuck Tuffli
0ed1d2e484 bhyve: fix NVMe Active Namespace list
The NVMe specification requires unused entries in the Identify, Active
Namespace ID data to be zero. Fix is bzero the provided page, similar to
what is done for the Namespace Descriptors list.

Fixes UNH Tests 2.6 and 2.9

Tested by:	Jason Tubnor
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24901
2020-06-29 00:32:24 +00:00
Chuck Tuffli
a104b18c52 bhyve: NVMe handle zero length DSM ranges
Dataset Management range specifications may have a zero length (a.k.a.
an empty range definition). Handle the case of all ranges being empty by
completing with Success (DSM commands are advisory only). For
Deallocate, skip empty range definitions when sending TRIM's to the
backing storage.

Fixes UNH Test 2.2.4

Reviewed by:	imp
Tested by:	Jason Tubnor
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24900
2020-06-29 00:32:21 +00:00
Chuck Tuffli
7669ea7bb0 bhyve: fix NVMe Get Features, Predictable Latency
If the Predictable Latency Mode is not supported, NVMe Controllers must
return Invalid Field in Command status for the Get Features command
with IDs:
 - Predictable Latency Mode Config
 - Predictable Latency Mode Window

Fixes UNH Tests 3.6

Tested by:	Jason Tubnor
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24899
2020-06-29 00:32:18 +00:00
Chuck Tuffli
f97ed15123 bhyve: add NVMe Feature Interrupt Vector Config
This adds support for NVMe Get Features, Interrupt Vector Config
parameter error checking done by the UNH compliance tests.

Fixes UNH Tests 1.6.8 and 5.5.6

Tested by:	Jason Tubnor
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24898
2020-06-29 00:32:15 +00:00
Chuck Tuffli
46ea627374 bhyve: add basic NVMe Firmware Commit support
This commit updates the Identify Controller data to advertise the
Controller supports a single firmware slot and that firmware slot 1 is
read-only. Additionally, it returns an "Invalid Firmware Slot" error
when the host issues any Firmware Commit command (a.k.a. Firmware
Activate).

Fixes UNH Test 5.5.3

Tested by:	Jason Tubnor
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24897
2020-06-29 00:32:11 +00:00
Chuck Tuffli
106329ef33 bhyve: Add AER support to NVMe emulation
This adds support to bhyve's NVMe device emulation for processing Async
Event Requests but not returning them (i.e. Async Event Notifications).

Fixes UNH Test 5.5.2

Tested by:	Jason Tubnor
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24896
2020-06-29 00:32:08 +00:00
Chuck Tuffli
8bba8666e2 bhyve: validate the NVMe LBA start and count
Add checks that the combination of Starting LBA and Number of Logical
Blocks in a command will not exceed the range of the underlying storage.

Note that because NVMe specifices the Starting LBA as a uint64_t, care
must be taken when converting it and the block count to avoid an integer
overflow.

Fixes UNH Tests 2.2.3, 2.3.2, and 2.4.2

Tested by:	Jason Tubnor
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24895
2020-06-29 00:32:04 +00:00
Chuck Tuffli
7d248cffd9 bhyve: implement NVMe SMART data I/O statistics
SMART data in NVMe includes statistics for number of read and write
commands issued as well as the number of "data units" read and written.
NVMe defines "data unit" as thousands of 512 byte blocks (e.g. 1 data
unit is 1-1,000 512 byte blocks, 3 data units are 2,001-3,000 512 byte
blocks).

This patch implements counters for:
 - Data Units Read
 - Data Units Written
 - Host Read Commands
 - Host Write Commands
and exposes the values when the guest reads the SMART/Health Log Page.

Fixes UNH Test 1.3.8

Tested by:	Jason Tubnor
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24894
2020-06-29 00:32:01 +00:00
Chuck Tuffli
ae638f2bd5 bhyve: validate NVMe deallocate range values
For NVMe emulation, validate the Data Set Management LBA ranges do not
exceed the capacity of the backing storage. If they do, return an "LBA
Out of Range" error.

Fixes UNH Test 2.2.3

Tested by:	Jason Tubnor
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24893
2020-06-29 00:31:58 +00:00
Chuck Tuffli
73cd73c0b8 bhyve: base pci_nvme_ioreq size on advertised MDTS
NVMe controllers advertise their Max Data Transfer Size (MDTS) to limit
the number of page descriptors in an I/O request. Take advantage of this
and size the struct pci_nvme_ioreq accordingly.

Ensuring these values match both future-proofs the code and allows
removing some complexity which only exists to handle this possibility.

Tested by:	Jason Tubnor
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24891
2020-06-29 00:31:54 +00:00
Chuck Tuffli
206edceb73 bhyve: refactor NVMe I/O read/write
Split the NVM I/O function (i.e. nvme_opc_write_read) into separate
functions - one for RAM based backing-store and another for disk based
backing-store for easier maintenance. No functional changes.

Tested by:	Jason Tubnor
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24890
2020-06-29 00:31:51 +00:00
Chuck Tuffli
a0900f46d1 bhyve: implement NVMe Format NVM command
The Format NVM command mainly allows the host to specify the block size
and protection information used for the Namespace. As the bhyve
implementation simply maps the capabilities of the backing storage
through to the guest, there isn't anything to implement. But a side
effect of the format is the NVMe Controller shall not return any data
previously written (i.e. erase previously written data). This patch
implements this later behavior to provide a compliant implementation.

Fixes UNH Test 1.6

Tested by:	Jason Tubnor
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24889
2020-06-29 00:31:47 +00:00
Chuck Tuffli
45cf82682c bhyve: make unsupported NVMe commands a debug message
Tested by:	Jason Tubnor
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24888
2020-06-29 00:31:44 +00:00
Chuck Tuffli
e3ebd4210a bhyve: add more compliant NVMe Get/Set Features
Create a generic Get/Set Features by saving off the contents of CDW11
from the Set command and returning the saved value in the completion of
the Get command. Implementation allows providing optional implementation
for both Set and Get.

Add infrastructure to determine which feature ID's are namespace
specific and flag violations of this category of error.

Also adds the feature specific behavior of Set Features, Number of
Queues to only allow this command once per Controller reset.

Fixes UNH Tests 1.2, 5.4, and 5.5.6

Tested by:	Jason Tubnor
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24887
2020-06-29 00:31:41 +00:00
Chuck Tuffli
d708ced617 bhyve: fix NVMe queue creation and deletion
Add checks for various types of invalid I/O Queue Create and Delete
command parameters, including:
 - QID=0
 - QID>MAX
 - QID already in use
 - Delete an Active CQ
 - Invalid QSIZE
 - Invalid CQID (SQ creation)
 - Invalid interrupt vector (CQ creation)

Fixes UNH Tests 1.4.2-5,7-8

Tested by:	Jason Tubnor
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24886
2020-06-29 00:31:37 +00:00
Chuck Tuffli
f6f02911b6 bhyve: fix NVMe Get Log Page command
Fix the logic in nvme_opc_get_log_page to calculate the number of DWORDS
(uint32_t) instead of WORDS (uint16_t) for the byte length. And only
return the allowed number of Log Page bytes as determined by the user
request and actual size of the requested log page.

Fixes UNH Test 1.3

Tested by:	Jason Tubnor
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24885
2020-06-29 00:31:34 +00:00