1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-20 02:38:43 +00:00
Commit Graph

19191 Commits

Author SHA1 Message Date
Ed Maste
eaeff15960 bsdinstall: Remove unused sysctl.h header #include
(cherry picked from commit 3e5bff102b)
2022-02-08 15:50:32 -05:00
Alfredo Dal'Ava Junior
04d4de5e60 kldxref: add R_PPC64_ADDR64 handler
Implements R_PPC64_ADDR64 handler for kldxref, addressing
"kldxref: unhandled relocation type 38" when running
"kldxref /boot/kernel"

Reviewed by:	jhibbits
MFC after:	1 week
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D33615

(cherry picked from commit c3d9c63329)
2022-02-07 19:42:16 -03:00
Gordon Bergling
b42a942f7e cpucontrol(8): Fix a typo in an error message
- s/incorret/incorrect/

(cherry picked from commit ee6d379be7)
2022-02-02 09:49:08 +01:00
Gordon Bergling
888410c948 mergemaster(8): Fix a typo in an error message
- s/differnt/different/

(cherry picked from commit 575c1773bf)
2022-01-29 09:44:30 +01:00
Ryan Moeller
51ce77b261 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

(cherry picked from commit b252fb2430)
2022-01-28 14:32:31 +00:00
Corvin Köhne
9e502c25f7 bhyve: add nvlist functions for setting unset nodes
If an emulation uses those functions instead of set_config_value_node
or set_config_value, it allows the config values to get
overwritten. Introducing new functions is much more readable than
if else statements in the emulation code.

Reviewed by:	khng
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33770

(cherry picked from commit fe453891d7)
2022-01-28 08:11:03 +01:00
Gordon Bergling
d780042fbf pmcstudy: Fix a typo in a usage message
-s /measurments/measurements/

(cherry picked from commit 340e08beee)
2022-01-27 10:20:04 +01:00
Alexander Motin
bbed4b4b1a sesutil: Avoid setting reserved bits.
Weird side of SES specification is that some bits have different
meaning or semantics in status and control pages.  This patch fixes
non-zero writes into reserved fields, that caused errors on some
enclosures when trying to control locate/fault LEDs, keeping other
bits unchanged.

MFC after:	2 weeks
Sposonred by:	iXsystems, Inc.

(cherry picked from commit 2e19fae49f)
2022-01-26 19:52:19 -05:00
Joerg Wunsch
60889b2a61
usbconfig: actually set the exit code in usage()
Oversight in previous commit: usage() had been turned to accept
an "exitcode" parameter, but it hasn't been used.

MFC after:	2 weeks

(cherry picked from commit 1654b51455)
2022-01-18 22:12:48 +01:00
Joerg Wunsch
800bc81676
usbconfig: implement a -v option
Implement a -v option to usbconfig(8), as a shortcut for the most
frequently needed commands dump_device_desc, dump_curr_config_desc,
and show_ifdrv.

While here, implement a real -h option that has been promised by the
man page.

Use <sysexits.h> to declare the utility return codes.

Reviewed by:	hselasky
Differential Revision:	https://reviews.freebsd.org/D33586
MFC after:	2 weeks

(cherry picked from commit d69b9cc26d)
2022-01-18 22:12:43 +01:00
Joerg Wunsch
313f267bb0
usbconfig: documentation fixes, mainly for -i option
* in usage(), clearly mark -i interface as optional
* both, -u busnum and -a devaddr are optional as well
* various minor man page fixes
* clearly mark those two commands that actually use -i ifaceidx
* remove unused bitfield tag got_iface
* fix indentation level according to review comment

Differential Revision:	https://reviews.freebsd.org/D33579/
Reviewed by:	hselasky
MFC after:	2 weeks

(cherry picked from commit cae1884d47)
2022-01-18 22:12:35 +01:00
Joerg Wunsch
a423411a1c
usbconfig: use getopt(3) for option handling
This makes option handling consistent with other utilities as well as
Posix rules. By that, it's no longer important whether option name and
its argument are separated by a space or not, so -d5.3 works the same
as -d 5.3.

Also, recognize either /dev/ugen or ugen as prefix to the -d argument.

Note that this removes the undocumented feature that allowed to
specify multiple -d n.m options interleaved with commands referring to
that particular device in a single run.

(cherry picked from commit ae450e6de9)
2022-01-18 22:12:00 +01:00
Corvin Köhne
ff1e10c8f6 bhyve: dynamically register FwCtl ports
Qemu's FwCfg uses the same ports as Bhyve's FwCtl. Static allocated
ports wouldn't allow to switch between Qemu's FwCfg and Bhyve's
FwCtl.

Reviewed by:    markj
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:  https://reviews.freebsd.org/D33496

(cherry picked from commit 9fe79f2f2b)
2022-01-17 13:53:28 +01:00
Corvin Köhne
5775540d36 bhyve: add more slop to 64 bit BARs
Bhyve allocates small 64 bit BARs below 4 GB and generates ACPI tables
based on this allocation. If the guest decides to relocate those BARs
above 4 GB, it could lead to mismatching ACPI tables. Especially
when using OVMF with enabled bus enumeration it could cause
issues. OVMF relocates all 64 bit BARs above 4 GB. The guest OS
may be unable to recover from this situation and disables some PCI
devices because their BARs are located outside of the MMIO space
reported by ACPI. Avoid this situation by giving the guest more
space for relocating BARs.

Let's be paranoid. The available space for BARs below 4 GB is 512 MB
large. Use a slop of 512 MB. It'll allow the guest to relocate all
BARs below 4 GB to an address above 4 GB. We could run into issues
when we exceeding the memlimit above 4 GB. However, this space has
a size of 32 GB. Even when using many PCI device with large BARs
like framebuffer or when using multiple PCI busses, it's very
unlikely that we run out of space due to the large slop.
Additionally, this situation will occur on startup and not at runtime
which is much better.

Reviewed by:    markj
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:  https://reviews.freebsd.org/D33118

(cherry picked from commit 7d55d29508)
2022-01-17 13:53:22 +01:00
Corvin Köhne
e6674c8f7f bhyve: allow reading of fwctl signature multiple times
At the moment, you only have one single chance to read the fwctl
signature. At boot bhyve is in the state IDENT_WAIT. It's then
possible to switch to IDENT_SEND. After bhyve sends the signature,
it switches to REQ. From now on it's impossible to switch back to
IDENT_SEND to read the signature. For that reason, only a single
driver can read the signature. A guest can't use two drivers to
identify that fwctl is present. It gets even worse when using
OVMF. OVMF uses a library to access fwctl. Therefore, every single
OVMF driver would try to read the signature. Currently, only a
single OVMF driver accesses the fwctl. So, there's no issue with
it yet. However, no OS driver would have a chance to detect fwctl when
using OVMF because it's signature was already consumed by OVMF.

Reviewed by:    markj
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:  https://reviews.freebsd.org/D31981

(cherry picked from commit 8ec366ec6c)
2022-01-17 13:53:17 +01:00
Corvin Köhne
104c83a999 bhyve: enumerate BARs by size
E.g. Framebuffers can require large space and BARs need to be aligned
by their size. If BARs aren't allocated by size, it'll cause much
fragmentation of the MMIO space. Reduce fragmentation by ordering
the BAR allocation on their size to reduce the risk of
OUT_OF_MMIO_SPACE issues.

Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D28278

(cherry picked from commit 01f9362ef4)
2022-01-17 13:53:10 +01:00
Konstantin Belousov
c1df4eef12 msdosfs: clusterfree() is used only in error handling cases
(cherry picked from commit 65990b68a2)
2022-01-14 20:11:02 +02:00
Corvin Köhne
16bd6661a9 bhyve: emulate reads of MSI-X capabilities for passthru devices
Reads of the MSI-X capabilites aren't emulated by passthru devices
yet. The guest will read the host MSI-X capabilites which could
cause issues.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D32686
Sponsored by:	Beckhoff Automation GmbH & Co. KG

(cherry picked from commit fe66bcf9ff)
2022-01-14 15:18:08 +01:00
Corvin Köhne
6448a0a51a bhyve: keep physical and virtual COMMAND reg in sync
On startup all virtual BARs are registered.
Additionally, the encoding bit in the virtual cmd register is set.
After that, the passthru emulation overwrites the virtual cmd register with
the physical one.
This could lead to a mismatch between registered BARs and the encoding
bits in the cmd register.
Instead of writing the physical to the virtual cmd register,
write the virtual to the physical cmd register to solve this issue.

Reviewed by:	  markj
Differential Revision:	https://reviews.freebsd.org/D32687
Sponsored by:	Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 2eb2079554)
2022-01-14 15:18:08 +01:00
Corvin Köhne
f281bda11a bhyve: use a fixed 32 bit BAR base address
OVMF always uses 0xC0000000 as base address for 32 bit PCI MMIO space.
For that reason, we should use that address too.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D31051
Sponsored by:	Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 5cf21e48cc)

bhyve: Fix compile

We need err.h

Fixes:	5cf21e48cc ("bhyve: use a fixed 32 bit BAR base address")
Sponsored by:	Bechoff Automation GmbH & Co. KG

(cherry picked from commit fc7207c877)
2022-01-14 15:18:03 +01:00
Corvin Köhne
366b4fc2d5 bhyve: move 64 bit BAR location to match OVMF assumptions
OVMF will fail, if large 64 bit BARs are used. GCD-Map doesn't cover
64 bit addresses of BARs.
OVMF assumes that 64 bit addresses of BARS are located on next 32 GB
boundary behind Top of High RAM.

This patch moves 64 bit BARs on next 32 GB boundary behind Top of High
RAM to match OVMF assumptions.

Differential Revision:	https://reviews.freebsd.org/D27970
Sponsored by: Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 4a4053e1b0)
2022-01-14 15:17:32 +01:00
Corvin Köhne
e5fb2bbad2 bhyve: do not explicitly map fbuf framebuffer
Allocating a BAR will call baraddr which maps the framebuffer. No need
to allocate it explicitly on init.

Reviewed by:     grehan
Sponsored by:    Beckhoff Autmation GmbH & Co. KG
Differential Revision:    https://reviews.freebsd.org/D32596

(cherry picked from commit 5085153ae4)
2022-01-14 15:17:28 +01:00
Corvin Köhne
aa5eea98b9 bhyve: use physical lobits for BARs of passthru devices
Tell the guest whether a BAR uses prefetched memory or not for
passthru devices by using the same lobits as the physical device.

Reviewed by:	 grehan
Sponsored by:	 Beckhoff Autmation GmbH & Co. KG
Differential Revision:	  https://reviews.freebsd.org/D32685

(cherry picked from commit e87a6f3ef2)
2022-01-14 15:17:18 +01:00
Corvin Köhne
99cc129ea4 bhyve: ignore low bits of CFGADR
Bhyve could emulate wrong PCI registers.
In the best case, the guest reads wrong registers and the device driver would
report some errors.
In the worst case, the guest writes to wrong PCI registers and could brick
hardware when using PCI passthrough.

According to Intels specification, low bits of CFGADR should be
ignored. Some OS like linux may rely on it. Otherwise, bhyve could
emulate a wrong PCI register.

E.g.
If linux would like to read 2 bytes from offset 0x02, following would
happen.
linux:
	outl 0x80000002 at CFGADR
	inw  at CFGDAT + 2
bhyve:
	cfgoff = 0x80000002 & 0xFF = 0x02
	coff   = cfgoff + (port - CFGDAT) = 0x02 + 0x02 = 0x04
Bhyve would emulate the register at offset 0x04 not 0x02.

Reviewed By: #bhyve, grehan
Differential Revision: https://reviews.freebsd.org/D31819
Sponsored by:	       Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 1b0e2f0b60)
2022-01-14 14:51:44 +01:00
Bjoern A. Zeeb
7ea16192a0 bhyve: passthru: enable BARs before possibly mmap(2)ing them
The first time we start bhyve with a passthru device everything is fine
as on boot we do enable BARs.  If a driver (unload) inside bhyve disables
the BAR(s) as some Linux drivers do, we need to make sure we re-enable
them on next bhyve start.

If we are trying to mmap a disabled BAR for MSI-X (PCIOCBARMMAP)
the kernel will give us an EBUSY.
While we were re-enabling the BAR(s) in the current code loop
cfginit() was writing the changes out too late to the real hardware.

Move the call to init_msix_table() after the register on the real
hardware was updated.  That way the kernel will be happy and the
mmap will succeed and bhyve will start.
Also simplify the code given the last argument to init_msix_table()
is unused we do not need to do checks for each bar. [1]

Some passthru devices only support MSI instead of MSI-X. For those
devices the initialization of MSI-X table will fail. Re-add (or in
the MFC case keep) the check erroneously removed in the initial commit. [2]

PR:		260148
Pointed out by:	markj [1]
Sponsored by:	The FreeBSD Foundation
Reviewed by:	markj
Differential Revision: https://reviews.freebsd.org/D33628
Submitted by:	(C.Koehne beckhoff.com) [2]
Reviewed by:	manu, bz
Differential Revision:	https://reviews.freebsd.org/D33728

(cherry picked from commit f1442847c9)
(cherry picked from commit 338a1be836)
2022-01-09 02:38:58 +00:00
Mark Johnston
fa3cc60e6d bhyve: Map the right BAR in init_msix_table()
The PBA and MSI-X table can reside in different BARs.

Reported by:	Andy Fiddaman <andy@omniosce.org>
Reviewed by:	jhb
Fixes:		7fa2335347 ("bhyve: Map the MSI-X table unconditionally for passthrough")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 76b45e688a)
2022-01-08 10:22:08 -05:00
Mark Johnston
0ea87a8fbc bhyve: Correct unmapping of the MSI-X table BAR
The starting address passed to mprotect was wrong, so in the case where
the last page containing the table is not the last page of the BAR, the
wrong region would be unmapped.

Reported by:	Andy Fiddaman <andy@omniosce.org>
Reviewed by:	jhb
Fixes:		7fa2335347 ("bhyve: Map the MSI-X table unconditionally for passthrough")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 4558c11f1b)
2022-01-08 10:21:58 -05:00
Hans Petter Selasky
05dfe5a5e4 service(8): Fix typo in man page.
Differential revision:  https://reviews.freebsd.org/D32582
Submitted by:   christos@
Sponsored by:   NVIDIA Networking

(cherry picked from commit 66d795ec19)
(cherry picked from commit 808108da32)
2022-01-07 14:22:46 +01:00
Toomas Soome
1d15c6b3e5 bhyve smbios type 3 structure is incorrect
If you look at the SMBIOS specification, we'll find something is
missing. In particular at offset 0Dh is supposed to be the OEM-defined
field. This should go between security and height. It is not legal to
actually skip this and will lead to other folks not properly
interpreting later parts of the table.

https://www.illumos.org/issues/14312

Reviewed by:	jhb
Submitted by:	Robert Mustacchi <rm@fingolfin.org>
Obtained from:	ilumos
Differential Revision: https://reviews.freebsd.org/D33682

(cherry picked from 04f55b5b0e)
2022-01-06 13:37:09 +02:00
Emmanuel Vadot
2c7441c86e pkgbase: Add a FreeBSD-pkg-bootstrap package
And put pkg and its keys in it.
It's easier for small image to depend on this package rather than the
larger utilities one.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33458

(cherry picked from commit ec0ea6efa1)
2022-01-05 18:23:53 +01:00
Emmanuel Vadot
967a990f76 pkgbase: Put certctl in the FreeBSD-caroot package
There is no reason that this shouldn't be there.
Change the dependency of caroot from utilities to openssl as it's
the only command that it uses not in runtime.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33458

(cherry picked from commit 380073af3a)
2022-01-05 18:23:53 +01:00
Emmanuel Vadot
629c89d951 pkgbase: Create a FreeBSD-newsyslog package
This allow one to install it without having to install FreeBSD-utilities.
While here put some newsyslog.d file in their own package.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33456

(cherry picked from commit 26ea904caa)
2022-01-05 18:23:52 +01:00
Emmanuel Vadot
e7a69f5613 pkgbase: Create a FreeBSD-syslogd package
This allow one to not install syslogd and use syslog-ng or any other
syslog daemon.
While here put some syslog.d file in their own package.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33455

(cherry picked from commit 25367c806b)
2022-01-05 18:23:52 +01:00
Emmanuel Vadot
d11dfcf2b0 pkgbase: Create a FreeBSD-periodic package
While here put the periodic files for some utilities in their own
packages.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33454

(cherry picked from commit b3d14eaccc)
2022-01-05 18:23:52 +01:00
Emmanuel Vadot
317c92dd63 pkgbase: Create a FreeBSD-mtree package
And put the mtree binary and files in it.
Useful to create small mfsroot using /etc/rc.d/var without
having to install FreeBSD-utilities.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33442

(cherry picked from commit dcf9d46a3f)
2022-01-05 18:23:52 +01:00
Emmanuel Vadot
d9a4b7b7bd pkgbase: Create a FreeBSD-tcpd package
And put the tcp-wrapper utilities in it.

Reviewed by:	emaste
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33439

(cherry picked from commit 078b764da3)
2022-01-05 18:23:52 +01:00
Emmanuel Vadot
b2d245a0b0 pkgbase: Put more binaries/lib in runtime
Move some needed binaries/libs from FreeBSD-utilities to FreeBSD_runtime.
This is everything needed to boot to multiuser with FreeBSD-rc installed.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33435

(cherry picked from commit 93c4369096)
2022-01-05 18:23:51 +01:00
Emmanuel Vadot
2480a7ae9e pkgbase: Put autofs config files in the FreeBSD-autofs package
Reviewed by:	emaste
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33434

(cherry picked from commit eb14f050a3)
2022-01-05 18:23:51 +01:00
Emmanuel Vadot
26c7445164 pkgbase: Put yellow pages programs to its own package
YP is less and less used, split them to users have the choice to not
install them.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33441

(cherry picked from commit 5abb10faa1)
2022-01-05 18:23:51 +01:00
Emmanuel Vadot
04fb6e4380 pkgbase: Move back mlxcontrol in the default package
mlxcontrol(8) is a tool for mlx(4) raid card and isn't related to
Mellanox card.

Reported by:	jhb

(cherry picked from commit 06cce53d56)
2022-01-05 18:23:51 +01:00
Emmanuel Vadot
e6e5d8e7aa pkgbase: Remove libefivar package and add a efi-tools one
Put all the efi related tools into FreeBSD-efi-tools.

Differential Revision:	https://reviews.freebsd.org/D31803

(cherry picked from commit d8d41d3b84)
2022-01-05 18:23:50 +01:00
Emmanuel Vadot
f5ab36c2e1 pkgbase: Create a FreeBSD-kerberos package
This allows users to install or not kerberos related utilities
and libs.

Differential Revision:	https://reviews.freebsd.org/D31801

(cherry picked from commit a30235a4c3)
2022-01-05 18:23:50 +01:00
Emmanuel Vadot
a4e8cac918 pkgbase: Create a mlx-tools package
mlx* are only useful for users who have a Mellanox card.
Create a package for it so users that don't have this card can
avoid having this program.

Differential Revision:	https://reviews.freebsd.org/D31795

(cherry picked from commit 80645e1ce5)
2022-01-05 18:23:49 +01:00
Emmanuel Vadot
8fe89b718a pkgbase: Create a cxgbe-tools package
cxgbetool is only useful for users who have a Chelsio card.
Create a package for it so users that don't have this card can
avoid having this program.

Differential Revision:	https://reviews.freebsd.org/D31793

(cherry picked from commit b8876cac2d)
2022-01-05 18:23:49 +01:00
Cy Schubert
189fdfd6b7 ntp: Revert "Disable stack gap for ntpd during build."
This reverts commit af949c590b because
889b56c8cd fixes the underlying problem.

(cherry picked from commit 733a832fb5)
2022-01-03 15:04:06 -08:00
Emmanuel Vadot
52ce808aba bsdinstall: zfsboot: Prompt user for zpool name if the pool already exists
If one install FreeBSD on multiple disks (say 13 and CURRENT) the first created
pool will always be used.
Prompt the user for a new pool name if we detect that the default or supplied one
already exists.

Reviewed by:	imp
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33331

(cherry picked from commit 9935b0e8ea)
2021-12-30 10:10:05 +01:00
Emmanuel Vadot
477fbe6732 bsdinstall: bootconfig: Try to clean old efi boot entries
If one install FreeBSD on the same machine multiple times in a row or
on different harddrive they have a lot of 'FreeBSD' efi boot entries added.
With this patch we now do :
- If there is no 'FreeBSD' entry we add one like before
- If there is one or more entries we ask the user if they want to delete
  them all and add a new one
  - If they say yes we do that
  - If they say no we prompt them an inputbox so they can enter a different
    entry name if they want, it defaults to 'FreeBSD'

Reviewed by:	bapt, imp
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33330

(cherry picked from commit 40c928e7b8)
2021-12-30 10:09:57 +01:00
Vitaliy Gusev
6d4d4e531d bhyve: Only snapshot initialized VirtIO queues
If the virtio device is not fully initialized, then suspend fails with:

  vi_pci_snapshot_queues: invalid address: vq->vq_desc
  Failed to snapshot virtio-rnd; ret=14

Reviewed by:	jhb

(cherry picked from commit d079fc197a)
2021-12-26 19:15:00 -05:00
Florian Walpen
30c3a5f248 Add idle priority scheduling privilege group to MAC/priority
(cherry picked from commit a9545eede4)
2021-12-19 04:42:51 +02:00
Florian Walpen
984b9d89f8 MAC/priority module for realtime privilege group
PR:	239125

(cherry picked from commit bf2fa8d9d1)
2021-12-19 04:42:51 +02:00
Andrew Turner
efa2061377 Only change the fadt revision in acpidump on i386
There is a workaround in acpidump for an old IBM laptop. This is being
hit on a modern arm64 system causing acpidump to use the wrong field
when reading a later address.

As the laptop has a 32-bit CPU the only FreeBSD support for it is i386.
As such limit the workaround to that architecture.

Reviewed by:	emaste, jkim, jhb (all earlier version)
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32573

(cherry picked from commit 01593a0ff9)
2021-12-14 10:58:01 +00:00
Mateusz Piotrowski
4bad5bb129 inetd: Use the synopsis from the manual page
Also, document -s in the usage message.

MFC after:	7 days

(cherry picked from commit 648b9ce80e)
2021-12-13 02:10:26 +01:00
Mike Karels
e5d4e532a0 mountd: deprecate exports to a network without mask
The exports file format allows export to a network using an explicit
mask or prefix length (CIDR).  It also allows a network with just
a dotted address, in which case the historical mask was used.
Deprecate this usage, and warn when it is used.  Document that this
is deprecated.

(cherry picked from commit 92aebdeaff)
2021-12-10 10:26:37 -06:00
Michael Tuexen
30cc621895 tcpdrop: tweak comments
Sponsored by:	Netflix, Inc.

(cherry picked from commit c2b53b107e)
2021-12-10 11:45:33 +01:00
Michael Tuexen
4ab3d3d91f tcpdrop: explicitly choose TCP as the transport protocol
Sponsored by:	Netflix, Inc.

(cherry picked from commit 8ea363c8c6)
2021-12-10 11:45:05 +01:00
Michael Tuexen
cec14fd194 tcpdrop: allow TCP connections to be filtered by cc-algo
In addition to filtering by stack and state, allow filtering
by the congestion control module used.  Choose the command line
options to be consistent with the ones of sockstat.

Sponsored by:	Netflix, Inc.

(cherry picked from commit 31537ea583)
2021-12-10 11:44:23 +01:00
Michael Tuexen
d749a2e870 tcpdrop: update man page, since the fastack stack has been removed
Sponsored by:	Netflix, Inc.

(cherry picked from commit 7ef45bd3cf)
2021-12-10 11:43:52 +01:00
Michael Tuexen
61deed379f tcpdrop: use a better name of a variable.
No functional change intended.

Sponsored by:	Netflix, Inc.

(cherry picked from commit 300914a0ff)
2021-12-10 11:42:34 +01:00
Mateusz Piotrowski
e99e7f1738 inetd.8: Lint the file
Remove Tn macros and fix other style warnings.

MFC after:	3 days

(cherry picked from commit aab6fe0c2c)
2021-12-09 10:17:55 +01:00
Mateusz Piotrowski
b834c56a18 inetd.8: Sort options
While here:

- Cluster flags without arguments together.
- Simplify the synopsis of the -a flag. There is no need to distinguish
  between address and hostname there.
- Add a missing argument to the -a flag in the description section.
- Fix some typos.

MFC after:	3 days

(cherry picked from commit 593ad024e4)
2021-12-09 10:17:55 +01:00
Alexander Motin
5d8bf1ffba mpsutil: Fix data truncation by too short buffers.
Length of some string buffers was insufficient for cases of more that
99 targets per HBA or slots per enclosure.  Some others are tuned just
for better alignment.  While there also fix output formatting issues.

MFC after:	1 week
Sponsored by:	iXsystems, Inc.

(cherry picked from commit f5b0083302)
2021-12-07 23:07:01 -05:00
Elyes HAOUAS
27fceea98c Fix typo on "Celsius"
"Celcius" --> "Celsius"

Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Pull Request: https://github.com/freebsd/freebsd-src/pull/551/files
(cherry picked from commit 9097ac9af4)
2021-12-06 08:55:55 -07:00
Rick Macklem
afb6f83074 mountd: Fix handling of usernames that start with a digit
yocalebo_gmail.com submitted a patch for mountd.c that
fixes the case where a username starts with a digit.
Without this patch, the username that starts with a
digit is misinterpreted as a numeric uid.
With this patch, any string that does not entirely
convert to a decimal number via strtoul() is considered
a user/group name.

(cherry picked from commit f4bf849bb8)
2021-12-01 17:08:35 -08:00
Alfredo Dal'Ava Junior
060c97abb0 powerpc64: make autoboot possible on powernv machines
It's required to specify a default boot option in order to make
petitboot's autoboot feature work.

Tested on Raptor Blackbird

Reviewed by:	imp, luporl
MFC after:	2 days
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D32838

(cherry picked from commit b6644f529c)
2021-12-01 19:41:49 -03:00
Artem Khramov
23566768d9 syslogd: fix WITHOUT_INET builds
Since 2d82b47 syslogd can't be built with `WITHOUT_INET` or
`WITHOUT_INET6` build variables set, because `iovlist_truncate` is not
defined but used.

This change wraps the problematic `iovlist_truncate` call within ifdef
directive.  It's compiled out in this situation...

Pull Request:	https://github.com/freebsd/freebsd-src/pull/475
Reviewed by:	imp@ (commit message slightly tweaked)

(cherry picked from commit f06fa6f887)

PR:		260098
2021-11-29 10:10:53 -05:00
Gordon Bergling
43c4228c97 lpr(1): Fix a typo in a source code comment
-s /debuging/debugging/

(cherry picked from commit 840d72371b)
2021-11-28 12:42:53 +01:00
John Baldwin
b3d02f0be3 ctld: Always declare MaxRecvDataSegmentLength.
This key is Declarative and should always be sent even if the
initiator did not send it's own limit.  This is similar to the fix in
fc79cf4fea but for the target side.  However, unlike that fix,
failure to send the key simply results in reduced performance.

PR:		259439
Reviewed by:	mav, emaste
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D32651

(cherry picked from commit 7ef7b252ad)
2021-11-23 15:11:44 -08:00
John Baldwin
5f6c2bd03b bhyve: Support setting the disk serial number for VirtIO block devices.
Reviewed by:	allanjude
Obtained from:	illumos
Differential Revision:	https://reviews.freebsd.org/D31983

(cherry picked from commit c6efcb1281)
2021-11-23 15:11:43 -08:00
Colin Percival
a0fc5094bf rtsol/rtsold: Add option to skip random delay
In accordance with a SHOULD in RFC 4861, rtsol and rtsold wait a
random time between zero and one (aka MAX_RTR_SOLICITATION_DELAY)
seconds before sending a Router Solicitation, in order to avoid
network congestion if many hosts come online at once.  (The
question of how many hosts would be required to cause congestion
by each sending a single packet on a Gbps+ network is left to the
reader.)

The new option -i disables this wait and instructs rtsol and rtsold
to send the Router Solicitation immediately.

Relnotes:	yes
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D32956

(cherry picked from commit 231bac4ccc)
2021-11-23 11:48:50 -08:00
Cy Schubert
ec9a2f80fc wpa: Fix WITHOUT_WPA_SUPPLICANT_EAPOL build
Reported by:	FreeBSD Build Option Survey
		https://callfortesting.org/results/bos-2021-11-04/
Fixes:		c1d255d3ff

(cherry picked from commit c9516b83c1)
2021-11-20 17:30:49 -08:00
Cy Schubert
c2ab6e36ec wpa: Fix WITHOUT_OPENSSL build
PR:		259517
Reported by:	emaste, FreeBSD Build Option Survey
		https://callfortesting.org/results/bos-2021-11-04/
Fixes:		c1d255d3ff

(cherry picked from commit ba5de3c2b3)
2021-11-20 17:30:49 -08:00
Cy Schubert
9ed6f73bfb Revert "wpa: Fix WITHOUT_CRYPT build"
This reverts commit a30e8044aa.
WITHOUT_OPENSSL build is a subset of WITHOUT_CRYPT build. It was
incorrect to label this patch as fixing WITHOUT_CRYPT when in fact
it fixes WITHOUT_OPENSSL. The build failure will be addressed in a
fix for WITHOUT_OPENSSL build.

(cherry picked from commit 96e2ac9c48)
2021-11-20 17:30:49 -08:00
Cy Schubert
de0af64420 wpa: Remove duplicate options definitions
Global options are defined in usr.sbin/wpa/Makefile.inc. Those in
usr.sbin/wpa/src/crypto/Makefile are duplicates of those found above.
Remove them.

(cherry picked from commit 3332f1b444)
2021-11-20 17:30:49 -08:00
Bjoern A. Zeeb
f74147e269 bhyve: net_backends, automatically IFF_UP tap devices
If you want communications with the outside world and tell bhyve to
create an interfaces then it should be usable as well.
Rather than relying on the sysctl net.link.tap.up_on_open automatically
try to IFF_UP the opened tap device.

(cherry picked from commit 56be282bc9)
2021-11-19 00:01:27 +00:00
Mateusz Piotrowski
05514f6668 bsdinstall: Fix mirror selection
This is a follow-up to 2697622687,
which fixed 2 out of 3 broken uses of the mirrorselect script.

Reviewed by:	emaste
Approved by:	emaste (src)
MFC after:	7 days
Differential Revision:	https://reviews.freebsd.org/D32927

(cherry picked from commit 4042b356a0)
2021-11-18 07:46:25 +01:00
Mark Johnston
de957de097 bhyve: Fix the WITH_BHYVE_SNAPSHOT build
Note, this breaks compatibility with snapshots generated by older builds
of bhyve(8).

Fixes: 7fa2335347 ("bhyve: Map the MSI-X table unconditionally for passthrough")
Reported by:	Greg V <greg@unrelenting.technology>
Reviewed by:	grehan, bz
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 77bc75c7ab)
2021-11-15 13:11:53 -05:00
Mark Johnston
e002d882ac bhyve: Map the MSI-X table unconditionally for passthrough
It is possible for the PBA to reside in the same page as the MSI-X
table.  And, while devices are not supposed to do this, at least some
Intel wifi devices place registers in a page shared with the MSI-X
table.  To handle the first case we currently map the PBA page using
/dev/mem, and the second case is not handled.

Kill two birds with one stone: map the MSI-X table BAR using the
PCIOCBARMMAP ioctl instead of /dev/mem, and map the entire table so that
accesses beyond the bounds of the table can be emulated.  Regions of the
BAR not containing the table are left unmapped.

PR:		251046
Reviewed by:	bz, grehan, jhb
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 7fa2335347)
2021-11-15 13:11:52 -05:00
Felix Johnson
e8e8c6c2bf powerd(8): Add rc.conf(5) to see also
powerd_flags is mentioned in rc.conf(5) and can be set there and pass to
powerd.

PR:		258320
Reported by:	Michael <michael.hmich@gmail.com>

(cherry picked from commit ec071430a7)
2021-11-10 14:12:59 -05:00
Felix Johnson
78bec4ed64 devinfo(8): Remove cross-reference to pnpinfo(8)
devinfo(8) manpage contains reference to pnpinfo(8) which existed at the
time. Remove it.

PR:		232587
Reported by:	Graham Perrin <grahamperrin@gmail.com>

(cherry picked from commit dde6071adc)
2021-11-05 00:54:33 -04:00
Cy Schubert
ef1134110e wpa: Fix WITHOUT_CRYPT build
PASN requires CRYPT and when built WITHOUT_CRYPT buildworld
fails. Only enable PASN when MK_CRYPT is enabled (default).

PR:		259517
Reported by:	emaste
Fixes:		c1d255d3ff

(cherry picked from commit a30e8044aa)
2021-11-04 11:30:25 -07:00
Cy Schubert
580c04df4d wpa: Enable RSN Preauthentication
RSN Preauthentication allows a station autnetnicate to an AP that
it is not associated with yet while associated with a different AP.
This allows athentication to multiple APs simulteneously.

Tested by:	philip

(cherry picked from commit bd452dcbed)
2021-11-04 11:30:24 -07:00
Cy Schubert
3f3676a712 wpa: Enable MBO
Enable WiFi 6 MBO (Multi Band Operation). MBO is a prereq to 802.11ax.

MBO allows the efficient use of multiple frequency bands (channels).

To facilitate MBO, WNM (Wireless Network Monitoring) is a prerequisite.
It is required to build.

Tested by:	philip

(cherry picked from commit 3968b47cd9)
2021-11-04 11:30:24 -07:00
Cy Schubert
0a6760a1de wpa: Import wpa_supplicant/hostapd commits up to b4f7506ff
Merge vendor commits 40c7ff83e7,
efec822389, and
2f6c3ea960.

Tested by:	philip

(cherry picked from commit c1d255d3ff)
2021-11-04 11:30:24 -07:00
Ed Maste
1da2deab7c iscsid: set max_recv_data_segment_length to what we advertise
Previously we updated the conection's conn_max_recv_data_segment_length
only when we received a response containing MaxRecvDataSegmentLength
from the target.  If the target did not send MaxRecvDataSegmentLength
then we left conn_max_recv_data_segment_length at the default (i.e.,
8192).  A target could then send more data than that defult (up to our
advertised maximum), and we would drop the connection.

RFC 7143 specifies that MaxRecvDataSegmentLength is Declarative, not
negotiated.  Just set conn_max_recv_data_segment_length to our
advertised value in login_negotiate().

PR:		259355
Reviewed by:	mav
MFC after:	1 week
Fixes:		a15fbc904a ("Alike to r312190 decouple iSCSI...")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32605

(cherry picked from commit fc79cf4fea)
2021-11-03 16:47:11 -04:00
Felix Johnson
cbd82a22eb config(5): Update upper limit for maxusers on 64-bit systems
The limit of 384 maxusers for auto configuration was only imposed on
32-bit systems. Document that maxusers scales above 384 based on memory
for 64-bit systems.

PR:		204938
Reported by:	David Höppner <0xffea@gmail.com>

(cherry picked from commit 191c624d95)
2021-10-31 15:27:20 -04:00
Mark Johnston
925211125c Revert "bhyve: Map the MSI-X table unconditionally for passthrough"
This reverts commit 382eec24c0.

This change causes a regression where a VM using passthrough no longer
starts.  Until this is resolved, revert the commit.

Reported by:	Raúl Muñoz <raul.munoz@custos.es>
2021-10-31 09:59:59 -04:00
Mark Johnston
712f028b2f Revert "bhyve: Fix the WITH_BHYVE_SNAPSHOT build"
This reverts commit 000b70f038.
2021-10-31 09:59:50 -04:00
Mark Johnston
000b70f038 bhyve: Fix the WITH_BHYVE_SNAPSHOT build
Note, this breaks compatibility with snapshots generated by older builds
of bhyve(8).

Fixes: 7fa2335347 ("bhyve: Map the MSI-X table unconditionally for passthrough")
Reported by:	Greg V <greg@unrelenting.technology>
Reviewed by:	grehan, bz
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 77bc75c7ab)
2021-10-30 10:14:41 -04:00
Mark Johnston
382eec24c0 bhyve: Map the MSI-X table unconditionally for passthrough
It is possible for the PBA to reside in the same page as the MSI-X
table.  And, while devices are not supposed to do this, at least some
Intel wifi devices place registers in a page shared with the MSI-X
table.  To handle the first case we currently map the PBA page using
/dev/mem, and the second case is not handled.

Kill two birds with one stone: map the MSI-X table BAR using the
PCIOCBARMMAP ioctl instead of /dev/mem, and map the entire table so that
accesses beyond the bounds of the table can be emulated.  Regions of the
BAR not containing the table are left unmapped.

Reviewed by:	bz, grehan, jhb
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 7fa2335347)
2021-10-30 10:14:21 -04:00
John Baldwin
34d6b4c352 ctld: Disable TCP DDP for connection sockets.
cxgbei is not able to offload PDU processing for a socket using TCP
DDP offload.

Sponsored by:	Chelsio Communications

(cherry picked from commit 3b5f95d7bd)
2021-10-29 16:38:21 -07:00
John Baldwin
90f0f8dab2 iscsid: Disable TCP DDP for connection sockets.
cxgbei is not able to offload PDU processing for a socket using TCP
DDP offload.

Sponsored by:	Chelsio Communications

(cherry picked from commit 91c62d626d)
2021-10-29 16:38:06 -07:00
Cy Schubert
2d81ecfcbb wpa: Reconnect ndis_events build
ndis_events build was disconnected by the MFC of
25ecdc7d52.
Reconnect it.

This is a direct commit to stable/13.

Reported by:	Scott Allendorf <scott-allendorf@uiowa.edu>
Fixes:		13f32ff71e
2021-10-25 06:29:45 -07:00
Navdeep Parhar
d257477bd0 cxgbetool(8): Update the register definitions used to decode regdump.
Obtained from:	Chelsio Communications
Sponsored by:	Chelsio Communications

(cherry picked from commit 35e62b00c3)
2021-10-20 10:43:21 -07:00
Navdeep Parhar
be25994775 cxgbetool(8): add a 'clip' subcommand to deal with the CLIP table.
Sponsored by:	Chelsio Communications

(cherry picked from commit ac02945f7e)
2021-10-20 10:12:37 -07:00
Mateusz Piotrowski
dbdc8e3e3f bhyve: Update usage and synopsis for the -k flag
Let's make it clear to users that -k is for configuration files.
Also, point to bhyve_config(5) in the paragraph describing the flag.

Reviewed by:	jhb
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D32467

(cherry picked from commit f656df586a)
2021-10-20 08:59:11 +02:00
John Baldwin
023283c642 config: Fix typo in comment.
(cherry picked from commit bcaa6aa153)
2021-10-19 16:53:20 -07:00
Elyes HAOUAS
70db230dcb ntp.conf.5: Fix typos
"certian" --> "certain"
"compatability" --> "compatibility"
"noticable" --> "noticeable"
"limite" --> "limit"
"acutal" --> "actual"
"ba" --> "be"

MFC after:	1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/550
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
(cherry picked from commit da3278ded3)
2021-10-14 10:04:34 -04:00
jfranklin13
16dfe02e38 syslogd: Fix bug that caused -N to drop SecureMode if specified after -s
Pull Request:	https://github.com/freebsd/freebsd-src/pull/541

(cherry picked from commit 9589362bc9)
2021-10-12 20:36:11 -04:00
David Bright
7ee00acd40 RPCBIND: skip ipv6 link local when request is not from link local address
RPCINFO on macOS behaves different compared to other linux clients and
doesn't provide request address in rpcb structure of the
RPCBPROC_GETADDRLIST call which doesn't seem to be forbidden.

In this case RPCBIND uses RPC call's source address and picks a
closest corresponding local address. If there are no addresses in the
same subnet as the source address, return of RPCBIND may vary
depending on the order of addresses returned in getifaddrs. If a link
local precedes global address it may be returned even if the request
comes from neither a link local nor from link local in a different
scope, which will prevent services like nfs from working in tpc6
scenario on macOS clients. Issue can be seen only on FreeBSD rpcbind
port due to changes in workflow of addrmerge call.

Submitted by:	Dmitry Ovsyannikov (Dmitry.Ovsyannikov@dell.com)
Sponsored by:	Dell EMC

(cherry picked from commit d18c9a9197)
2021-10-11 09:19:15 -07:00
Robert Wing
0cfae878f0 prometheus_sysctl_exporter(8): filter output using a regex
Add two options, -i and -e, for filtering prometheus metrics.

Each option takes a regular expression as an argument. The provided
regex will be tested against the prometheus metric name.

The -i option includes metrics matching the given regex.
The -e option excludes metrics matching the given regex.

Sponsored by:   Modirum MDPay
Sponsored by:   Klara Inc.
Reviewed by:	0mp, debdrup
Differential Revision:	https://reviews.freebsd.org/D32269

(cherry picked from commit 8ff2b52241)
2021-10-10 10:15:18 -08:00