Commit graph

18969 commits

Author SHA1 Message Date
Mitchell Horne
6b2ccad297 pmccontrol: improve -L with pmu-events
Check if the pmu utils are supported rather than carrying a
machine-dependent #ifdef.

Reviewed by:	gnn, ray, emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30526

(cherry picked from commit 167cdaa7e3)
2021-07-29 12:01:10 -03:00
Mitchell Horne
b040b03d32 libpmc: eliminate pmc_pmu_stat_mode()
There is a single consumer, the pmc utility, that clearly has knowledge
of which counters it is expecting. Remove this function and have it
use common counter aliases instead.

Reviewed by:	gnn
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30528

(cherry picked from commit ec66cc955b)
2021-07-29 12:01:10 -03:00
Renato Botelho
c3c458ce3c bsdinstall: Only show menu if there are more items to be installed
Obtained from:	Rubicon Communications, LLC ("Netgate")
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 95f0da5be1)
2021-07-27 16:05:41 -04:00
Li-Wen Hsu
192a4072d7
freebsd-update: Update URL of supported platforms information
MFC after:	3 days

(cherry picked from commit 86d0d3aadb)
2021-07-28 03:19:55 +08:00
Alan Somers
1b58943ef8 [skip ci] correct a few SPDX license tags
These were all incorrectly labeled as 2-clause BSD licenses by a
semi-automated process, when in fact they are 3-clause.

Discussed with:	pfg, imp
Sponsored by:	Axcient

(cherry picked from commit 3874c0abb0)
2021-07-27 11:57:17 -06:00
Oskar Holmund
120e7f7399 usr.sbin/pwm/pwm add support for flags
The pwm utility cant set the only flag defined (PWM_POLARITY_INVERTED) so this
patch add the option -I (capital letter i) to send it to the drivers.

None of existing PWM driver have implemented support for flags.
But soon:ish I will put up an review of a pwm driver using TI OMAP DMTimer.

Differential Revision: https://reviews.freebsd.org/D29137
MFC after:   2 weeks

(cherry picked from commit 17b14d8f77)
2021-07-22 18:39:57 +02:00
Gordon Bergling
2800c163f0 nfsd: Fix some issues found by mandoc
- consider using OS macro: Fx

Reviewed by:	bcr
Differential Revision:	https://reviews.freebsd.org/D31145

(cherry picked from commit 4c87085d35)
2021-07-19 08:16:01 +02:00
Chuck Tuffli
a7761d19da bhyve: Fix NVMe iovec construction for large IOs
The UEFI driver included with Rocky Linux 8.4 uncovered an existing bug
in the NVMe emulation's construction of iovec's.

By default, NVMe data transfer operations use a scatter-gather list in
which all entries point to a fixed size memory region. For example, if
the Memory Page Size is 4KiB, a 2MiB IO requires 512 entries. Lists
themselves are also fixed size (default is 512 entries).

Because the list size is fixed, the last entry is special. If the IO
requires more than 512 entries, the last entry in the list contains the
address of the next list of entries. But if the IO requires exactly 512
entries, the last entry points to data.

The NVMe emulation missed this logic and unconditionally treated the
last entry as a pointer to the next list. Fix is to check if the
remaining data is greater than the page size before using the last entry
as a pointer to the next list.

PR:		256422
Reported by:	dave@syix.com
Tested by:	jason@tubnor.net
Relnotes:	yes

(cherry picked from commit 91064841d7)
2021-07-09 07:24:14 -07:00
Ryan Moeller
4b74458ddd bsdinstall: Avoid double-mounting /dev
After 34766aa8cb we are mounting and
unmounting devfs elsewhere already.

Reviewed by:	nwhitehorn
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D30877

(cherry picked from commit b50db44f02)
2021-07-06 17:04:28 +00:00
Alex Richardson
a259db87ed usr.sbin/pkg: Don't re-define roundup2
The file already includes sys/param.h and should use that definition.
I found this while testing D28332.

Reviewed By:	bapt
Differential Revision: https://reviews.freebsd.org/D28331

(cherry picked from commit 9a0a48b12d)
2021-07-05 10:46:11 +01:00
Alan Somers
fd5b089776 periodic: by default, skip 221.backup-gpart in jails
It can still be enabled as usual in /etc/periodic.conf

PR:		256253
Reported by:	delphij
Submitted by:	Miroslav Lachman <000.fbsd@quip.cz>

(cherry picked from commit fcf2227a55)
2021-07-03 20:30:05 -06:00
Marko
3f65cb8fda bhyvectl: print a better error message when vm_open() fails
libvmm: explicitly save and restore errno in vm_open()

Use errno to print a more descriptive error message when vm_open() fails

PR:             250671
Reviewed by:	grehan
Differential Revision:	https://reviews.freebsd.org/D29109

(cherry picked from commit 6bb140e3ca)
(cherry picked from commit a7f81b488d)
2021-07-01 19:17:12 -08:00
Mark Johnston
6aee785518 rpc.lockd: Use libc strnlen() instead of reimplementing it
No functional change intended.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 2bbeada0f7)
2021-06-30 08:18:09 -04:00
Emmanuel Vadot
e39af9beda pkgbase: Put the mibs and defs in the bnsmp package
Differential Revision:	https://reviews.freebsd.org/D30756
Sponsored by:	Diablotin Systems
2021-06-30 09:24:33 +02:00
Emmanuel Vadot
35466a69bb pkgbase: Move ctld/ctladm to iscsi package
While here only compile both of them if WITH_ISCSI is set (this is the default).

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D30755
Sponsored by:	Diablotin Systems
2021-06-30 09:24:33 +02:00
Emmanuel Vadot
624d52af5b pkgbase: Create a FreeBSD-nfs package
And move all the nfs related commands there.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D30754
Sponsored by:	Diablotin Systems
2021-06-30 09:24:32 +02:00
Chuck Tuffli
0e6ba56338 bhyve: add SMBIOS Baseboard Information
Add the System Management BIOS Baseboard (or Module) Information
a.k.a. Type 2 structure to the SMBIOS emulation.

(cherry picked from commit 0c6282e842)
2021-06-28 08:48:26 -07:00
Corvin Köhne
4bb2057c13 bhyve: implement rdmsr for MSR_IA32_FEATURE_CONTROL
Without the -w option, Windows guests crash on boot. This is caused by a rdmsr
of MSR_IA32_FEATURE_CONTROL. Windows checks this MSR to determine enabled VMX
features. This MSR isn't emulated in bhyve, so a #GP exception is injected
which causes Windows to crash.

Fix by returning a rdmsr of MSR_IA32_FEATURE_CONTROL with Lock Bit set and
VMX disabled to informWindows that VMX isn't available.

(cherry picked from commit 17d214c2ca)
2021-06-28 20:08:56 +10:00
Nathan Whitehorn
5a4dffac60 Fix scripted installation from media without local distfiles.
The bsdinstall script target did not have the infrastructure to fetch
distfiles from a remote server the way the interactive installer does
on e.g. bootonly media. Solve this by factoring out the parts of the
installer that deal with fetching missing distributions into a new
install stage called 'fetchmissingdists', which is called by both the
interactive and scripted installer frontends.

In the course of these changes, cleaned up a few other issues with
the fetching of missing distribution files and added a warning if
fetching the MANIFEST file, which is used to verify the integrity of
the distribution files. We should at some point add cryptographic
signatures to MANIFEST so that it can be fetched safely if not present
on the install media (which it is for bootonly media).

Initial patch by: Vinícius Zavam
PR:		255659, 250928
Reviewed by:	dteske
MFC after:	4 weeks
Differential Revision:	https://reviews.freebsd.org/D27121

(cherry picked from commit 40923b0c81)
2021-06-25 20:35:04 -04:00
Jamie Gritton
6e2623c012 jail: Don't allow substitution of valueless jail parameters.
PR:		256544
Reported by:	cryptogranny at gmail.com

(cherry picked from commit 5bf6dca2c6)
2021-06-24 10:51:27 -07:00
Kristof Provost
a20c597c6d bsnmp: Fix incorrect use of libpfctl
When we introduced libpfctl in bnsmpd this was done incorrectly, and a
GETRULE call was replaced by pfctl_add_rule().
Change it to pfctl_get_rule().

Reviewed by:	donner
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 67cef6d411)
2021-06-22 23:00:33 +02:00
Dan Nelson
659f777660 cpucontrol: fix extended signature matching code to avoid fallthough
PR:		256502

(cherry picked from commit 87799c5f85)
2021-06-20 15:10:21 -04:00
Philip Paeps
e5d8c43e17 bsdconfig: add a new mirror in Bulgaria
Provided by Telepoint Mirror Service.

Reported by:	Valentin Nikolov <mirror@telepoint.bg>

(cherry picked from commit 1c9605fe1e)
2021-06-20 11:23:44 +08:00
Philip Paeps
f36e15feb0 bsdinstall: add a new mirror in Bulgaria
Provided by Telepoint Mirror Service.

Reported by:	Valentin Nikolov <mirror@telepoint.bg>

(cherry picked from commit 7daa45becf)
2021-06-20 11:21:39 +08:00
Vladimir Kondratyev
e9dd950507 iwmbtfw(8): Improve Intel 7260/7265 adaptors handling
- Allow firmware downloading for hw_variant #8;
- Enter manufacturer mode for setting of event mask;
- Handle multi-event response on HCI commands for 7260;
  This allows to remove kludge with skipping of 0xfc2f opcode.
- Disable patch and exit manufacturer mode on downloading failure;
- Use default firmware if correct firmware file is not found;

Reviewed by:	Philippe Michaud-Boudreault <pitwuu_AT_gmail_DOT_com>
Tested by:	arrowd
Differential revision:	https://reviews.freebsd.org/D30543

(cherry picked from commit da93a73f83)
2021-06-14 00:59:38 +03:00
Andrew Turner
ade8b810b0 Create VM_MEMATTR_DEVICE on all architectures
This is intended to be used with memory mapped IO, e.g. from
bus_space_map with no flags, or pmap_mapdev.

Use this new memory type in the map request configured by
resource_init_map_request, and in pciconf.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D29692

(cherry picked from commit 5d2d599d3f)
2021-06-13 16:49:36 +01:00
Marcin Wojtas
2a8921c5d1 pciconf: Use VM_MEMATTR_DEVICE on supported architectures
Some architectures - armv7, armv8 and riscv use VM_MEMATTR_DEVICE
when mapping device registers in kernel. Do the same in pciconf.
On armada8k SoC all reads from BARs mapped with hitherto attribute
(VM_MEMATTR_UNCACHEABLE) return 0xff's.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: kib
Obtained from: Semihalf
Sponsored by: Marvell
Differential revision: https://reviews.freebsd.org/D29603

(cherry picked from commit 1c1ead9b94)
2021-06-13 16:49:36 +01:00
Li-Wen Hsu
90372d8ec3
Add freeze/thaw description to devctl(8)
This is a follow-up to 5fa2979791 .

PR:		256311
Reviewed by:	imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D29867

(cherry picked from commit 315674fb6a)
2021-06-10 23:28:29 +08:00
Math Ieu
21d163f8a1
Fix test case header function name
This restores the expected behavior (skip) when running with non-root user

MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D30584

(cherry picked from commit 847b7d5054)
2021-06-10 23:22:24 +08:00
John Baldwin
c417b618b9 etcupdate: Add -D destdir to usage for 'extract'.
Reported by:	Mark Millard <marklmi@yahoo.com>

(cherry picked from commit 5eb9c93a20)
2021-06-09 14:19:39 -07:00
John Baldwin
960c954c55 etcupdate: Add a revert mode to restore one or more stock files.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D29846

(cherry picked from commit ba30215ae0)
2021-06-09 14:19:39 -07:00
John Baldwin
76a0f6f3bf etcupdate: Trim trailing whitespace.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D29845

(cherry picked from commit ada7fd17d5)
2021-06-09 14:19:38 -07:00
John Baldwin
6d55189fe7 etcupdate: Gracefully handle SIGINT when building trees.
Run the 'build_tree' function inside of a subshell and trap SIGINT to
return an error to the caller.  This allows callers to gracefully
cleanup a partially created tree.

While here, redirect stdout/stderr of the subshell to the log file
instead of applying redirections individually to each command executed
while building the tree.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D29844

(cherry picked from commit 1f7afa9364)
2021-06-09 14:19:38 -07:00
John Baldwin
5452cb6bf9 etcupdate: Always extract to a temporary tree.
etcupdate has had a somewhat nasty race condition since its creation
in that its state machine can get very confused if it is interrupted
while building the tree to compare against.  This is exacerbated by
the fact that etcupdate doesn't emit any output while building the
tree which can take several seconds (especially in recent years with
the addition of the tree-wide buildconfig/installconfig passes).

To mitigate this, always install a new tree into a temporary directory
created via mktemp as was previously done only for dry-runs via -n.
The existing trees are only rotated and the new tree installed as
/var/db/etcupdate/current after the update command has completed.

Reported by:	dim, np (and many others)
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D29843

(cherry picked from commit 0611aec3cf)
(cherry picked from commit b0df36580d)
2021-06-09 14:19:38 -07:00
David Bright
7f06d6f3fd pciconf: Fix up pciconf -lc output
The pciconf command fails to emit newlines when particular ecap field
values are seen. Fix them up. This has been seen on several systems at
$JOB. The documentation for PCI capabilities says that capability
type 0 should not be used once the spec for PCI capabilities was
published, but that seems more wishful-thinking than reality. pciconf
also chooses not to print fields related to field values that are
zero, but it seems several of these fields are zero on actual
hardware.

Sponsored by:	Dell EMC Isilon
Submitted by:	Robert Herndon (Robert.Herndon@dell.com)

(cherry picked from commit 2f176a2b20)
2021-06-09 11:17:58 -05:00
Oleksandr Tymoshenko
c69de02065 cron: consume blanks in system crontabs before options
On system crontabs, multiple blanks are not being consumed after reading the
username. This change adds blank consumption before parsing any -[qn] options.
Without this change, an entry like:

  * * * * * username  -n true  # Two spaces between username and option.

will fail, as the shell will try to execute (' -n true'), while an entry like:

  * * * * * username -n true   # One space between username and option.

works as expected (executes 'true').

For user crontabs, this is not an issue as the preceding (day of week
or @shortcut) processing consumes any leading whitespace.

PR:		253699
Submitted by:	Eric A. Borisch <eborisch@gmail.com>
MFC after:	1 week

(cherry picked from commit 37cd6c20db)
2021-06-05 15:49:45 -07:00
Alan Somers
d94aa742b5 daemon: add some basic tests
Sponsored by:	Axcient
Differential Revision:	https://reviews.freebsd.org/D29316

(cherry picked from commit 3b57d80c7a)
2021-06-03 20:48:47 -06:00
Cy Schubert
19cfc8e655 MFV d60fa10fd8:
Update unbound 1.13.0 --> 1.13.1.

Includes numerous bugfixes documented at:
https://www.nlnetlabs.nl/projects/unbound/download/#unbound-1-13-1

(cherry picked from commit f44e67d120)
2021-06-02 17:54:29 -07:00
Hans Petter Selasky
4c4416a098 Implement own command line option for the frequently used -i usbusX -f Y syntax,
-d ugenX.Y, similar to what usbconfig(8) does.

Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit c904e20cc9)
2021-06-02 13:25:20 +02:00
Nathan Whitehorn
4aaf6dd0a6 Fix scripted installs on EFI systems using ZFS root with zfsboot.
Unlike attended installations, scripted installs did not mount non-ZFS
partitions when ZFS root (via zfsboot) was selected. Since this included
the ESP, the EFI loader was not installed. Copy logic from the
attended-install path to make this work.

PR:		255824, 255081
MFC after:	1 week
Obtained from:	Mark Huizer

(cherry picked from commit 34766aa8cb)
2021-05-28 09:43:35 -04:00
Konstantin Belousov
2585f892e0 kldxref: do not error out if specified path is not directory, for -d mode
(cherry picked from commit d7751071bc)
2021-05-27 03:33:10 +03:00
Philippe Michaud-Boudreault
0be693b3d5 iwmbtfw(8): Add support for Intel 7260/7265 bluetooth adapter firmwares
To use it comms/iwmbt-firmware port should be updated to 20210315 version.

Submitted by:	Philippe Michaud-Boudreault <pitwuu@gmail.com>
Tested by:	Helge Oldach <freebsd@oldach.net>
Reviewed by:	wulf
PR:		228787
2021-05-24 01:44:36 +03:00
Robert Wing
942e69146e fstyp(8): define HAVE_ZFS macro when built with zfs
The HAVE_ZFS macro was dropped from the Makefile during the OpenZFS
merge, bring it back.

While here, drop unused WARNS setting.

PR:             255616
Reported by:    Michael Büker <freebsd@michael-bueker.de>
Submitted by:   Michael Büker <freebsd@michael-bueker.de>
Fixes:          9e5787d228
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D30221

(cherry picked from commit 91f251b2ab)
2021-05-21 07:21:00 -08:00
Daniel Austin
395bc3598b mpsutil: extend show adapter information, add NCQ control
'show adapter' now shows PCIe width and speed, IOC Speed, and the
temperature of the controller.

A new command, 'set ncq', is added.
It enables or disables SATA NCQ in the NVRAM of the card.
Its current setting is added to 'show adapter' as well.

PR:		254841
MFC after:	2 weeks
Relnotes:	perhaps

(cherry picked from commit e2ea6942ab)
2021-05-21 13:29:17 +03:00
Navdeep Parhar
98893d4953 cxgbetool(8): Add support for setting the hashfilter mode (filter mask).
Tighten up the validation of filter modes while here.  Unrecognized
keywords will be now be flagged as errors instead of being ignored.

(cherry picked from commit 038148c108)
2021-05-15 19:57:12 -07:00
Dmitry Wagin
55b6c85e0c syslogd: Increase message size limits
Add a -M option to control the maximum length of forwarded messages.
syslogd(8) used to truncate forwarded messages to 1024 bytes, but after
commit 1a874a126a ("Add RFC 5424 syslog message output to syslogd.")
applies a more conservative limit of 480 bytes for IPv4 per RFC 5426
section 3.2.  Restore the old default behaviour of truncating to 1024
bytes.  RFC 5424 specifies no upper limit on the length of forwarded
messages, while for RFC 3164 the limit is 1024 bytes.

Increase MAXLINE to 8192 bytes to correspond to commit 672ef817a192.

Replaced bootfile[] size for MAXPATHLEN used in getbootfile(3) as a
returned value. Using (MAXLINE+1) as a size for bootfile[] is excessive.

PR:		241937
Differential Revision:	https://reviews.freebsd.org/D27206

(cherry picked from commit 2d82b47a5b)
2021-05-14 09:56:17 -04:00
Kristof Provost
c505bdcc4e authpf: Start using libpfctl
Use pfctl_kill_states() rather than the DIOCKILLSTATES ioctl directly.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30057

(cherry picked from commit 2b2ed4a697)
2021-05-14 10:40:12 +02:00
Robert Wing
6fa8a15770 autofs: best effort to maintain mounttab and mountdtab
When an automounted filesystem is successfully unmounted, call
rpc.umntall(8) with the -k flag.

rpc.umntall(8) is used to clean up /var/db/mounttab on the client and
/var/db/mountdtab on the server. This is only useful for NFSv3.

PR:     251906
Reviewed by: trasz
Differential Revision:  https://reviews.freebsd.org/D27801

(cherry picked from commit 88e531f38c)
2021-05-11 15:48:44 -08:00
Kristof Provost
c93907df7b pf: Allow multiple labels to be set on a rule
Allow up to 5 labels to be set on each rule.
This offers more flexibility in using labels. For example, it replaces
the customer 'schedule' keyword used by pfSense to terminate states
according to a schedule.

Reviewed by:	glebius
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D29936

(cherry picked from commit 6fcc8e042a)
2021-05-10 21:45:57 +02:00
Mark Johnston
b2c871b138 bhyve: Set SO_REUSEADDR on the gdb stub socket
Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30037

(cherry picked from commit 02e7a6514e)
2021-05-10 09:35:04 -04:00