Commit Graph

284440 Commits

Author SHA1 Message Date
Johannes Totz
ec0bd8b07f rc.suspend: update man pages for new keyword
rc.suspend has gained an rcorder keyword recently. Document it alongside
the existing resume keyword.

Reviewed By:	mhorne, Pau Amma <pauamma@gundo.com>
Differential Revision:	https://reviews.freebsd.org/D40484
2023-06-16 13:51:10 -03:00
Mitchell Horne
5fc97cc325 hwpmc(4): document debugging options
The debug options for hwpmc are not documented in detail anywhere, and
setting it up was error-prone the first time I had to figure it out (and
each time I've had to remember it). Add some explanation of the required
options and describe the kern.hwpmc.debugflags sysctl format.

Reviewed by:	emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40545
2023-06-16 13:44:54 -03:00
Mitchell Horne
569f89b2f4 hwpmc: add error for HWPMC_DEBUG without KTR
The option is a no-op otherwise, but this is not necessarily obvious.
Failing the compile gives the user a hint.

Reviewed by:	jkoshy, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40544
2023-06-16 13:44:54 -03:00
Mitchell Horne
3977781b98 pmc: clarify and strengthen statements about API/ABI
- Make it clear that applications are not only encouraged to use the
  pmc(3) library, but use of the hwpmc(4) interface directly is a
  use-case we do not support
- Move the COMPATIBILITY section above PROGRAMMING API in hwpmc(4)
- Drop statements about the driver and library being "under development"

Reviewed by:	jkoshy, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40543
2023-06-16 13:44:54 -03:00
Mitchell Horne
0a1a48148c hwpmc(4): more detailed SYNOPSYS
Include some boilerplate similar to other section 4 man pages,
describing how to load the module at boot-time or include it in the
kernel.

Reviewed by:	jkoshy, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40542
2023-06-16 13:44:54 -03:00
Mitchell Horne
0a0c599ab9 hwpmc(4): remove paragraph about Pentium Pro handling
Support for these CPUs was removed in 2018 (e92a1350b5).

Reviewed by:	jkoshy, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40541
2023-06-16 13:44:53 -03:00
Alexander V. Chernikov
7937935535 netlink: convert to IfAPI.
Convert to IfAPI everything except `IF_AFDATA_WLOCK` usage in neigh.c.

Reviewed By: jhibbits
Differential Revision: https://reviews.freebsd.org/D40577
2023-06-16 15:59:34 +00:00
Alexander V. Chernikov
511b35866a ifnet: fix if_strings.h build check 2023-06-16 15:54:29 +00:00
Alexander V. Chernikov
c344eff910 netlink: dump interface capabilities with other interface data.
This change exports interface capabilities using the standard
Netlink attribute type, bitset, and switches `ifconfig(8)` to use
it when displaying interface data.
Bitset comes in two representations. The first one is "compact",
where the bits are exported via two arrays - "mask" listing the
"valid" bits and "values, providing the values for those bits.
The second one is more verbose, listing each bit as a separate item,
with its name, id and value. The latter option is handy when submitting
update requests.

The support for setting capabilities will be added in the upcoming diffs.

Differential Revision: https://reviews.freebsd.org/D40331
2023-06-16 15:33:49 +00:00
Juraj Lutter
e5d7100c09 periodic: Honor kern.localbase
Take kern.localbase into account with fallback to /usr/local and
also allow for LOCALBASE/etc/periodic.conf (similarly to what
many other utilities do).

Reviewed by:		imp
Differential Revision:	https://reviews.freebsd.org/D40435
MFC after:		2 weeks
2023-06-16 16:39:04 +02:00
Alexander V. Chernikov
0fcc603a07 ifconfig: fix armv6 build 2023-06-16 08:23:50 +00:00
Alan Cox
58d4271721 vm_phys: Fix typo in 9e81742892 2023-06-16 03:12:42 -05:00
Alexander V. Chernikov
7e1ec25c8b ipfw: add state/comment tests 2023-06-16 07:24:19 +00:00
Alexander V. Chernikov
a3930cd46c ifconfig: use default (more rigid) WARNS level.
It helps catch more errors at compile time.

Reviewed by:	kp
Differential Revision: https://reviews.freebsd.org/D40536
MFC after:	2 weeks
2023-06-16 07:19:22 +00:00
Alexander V. Chernikov
f414f37e38 ifconfig: remove global 'ifr' usage from ifmedia.c & remove 'ifr'.
Reviewed by:	kp
Differential Revision: https://reviews.freebsd.org/D40535
MFC after:	2 weeks
2023-06-16 07:19:21 +00:00
Alexander V. Chernikov
7fa282e616 ifconfig: remove (most of) the usages of global 'struct ifreq ifr'.
It is hard to reason about the contents of 'ifr' at any given time
as nearly every function sets random fields or pointers in this
structure.
Use local on-stack clean 'struct ifreq' for each function instead.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D40534
MFC after:	2 weeks
2023-06-16 07:19:21 +00:00
Doug Moore
9e81742892 vm_phys: add binary segment search
Replace several sequential searches for a segment that contains a
phyiscal address with a call to a function that does it by binary
search.  In vm_page_reclaim_contig_domain_ext, find the first segment
to reclaim from, and reclaim from each subsequent appropriate segment.
Eliminate vm_phys_scan_contig.

Reviewed by:	alc, markj
Differential Revision:	https://reviews.freebsd.org/D40058
2023-06-16 01:43:45 -05:00
Corvin Köhne
0917f925b4
bhyve: add basic CRB interface for TPM devices
Add a basic emulation for the command and response buffer interface of
TPM devices. This commit only implements some CRB register and resets
them.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40456
2023-06-16 08:22:53 +02:00
Corvin Köhne
11ba214629
bhyve: add basic TPM passthrough emulation
At the moment, the emulation only opens a file descriptor to the TPM
device. Some subsequent commits will read and write from it.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40455
2023-06-16 08:18:55 +02:00
Corvin Köhne
e097785758
bhyve: add basic TPM emulation struct
This struct will be used to implement various TPM emulations like a TPM
passthrough or a virtual TPM.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40454
2023-06-16 08:18:39 +02:00
Corvin Köhne
b3564c2337
bhyve: use assert for missing TPM version
The TPM version config node should always be set. If it's not set,
there's a bug in our code. An assertion is the correct way to check for
this.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40558
2023-06-16 08:18:08 +02:00
Corvin Köhne
71fb2dcb00
bhyve: pass address of OpRegion to the guest
Don't allow access to the physical ASLS register. It contains a host
address which is meaningless for the guest. Additionally, it allows the
guest to safely rewrite this register.

This is the last commit required for GVT-d. Nevertheless, it might not
work due to missing firmware support.

MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D26209
2023-06-16 07:55:16 +02:00
Corvin Köhne
1115cdcf7a
bhyve: copy OpRegion into guest memory
This makes the OpRegion accessible by the guest. However, the guest
doesn't know the address of the OpRegion. This will be fixed by an
upcoming commit.

The range of the OpRegion is added to the e820 table. This allows the
guest firmware to easily pick up this range and to reserve it properly.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40041
2023-06-16 07:55:05 +02:00
Corvin Köhne
6952b9d25e
bhyve: read OpRegion address and size for GVT-d
The OpRegion provides some configuration bits and ACPI methods used by
some Intel drivers. The guest needs access to it. In the first step,
we're reading it's address and size.

Reviewed by:		jhb
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40040
2023-06-16 07:54:53 +02:00
Corvin Köhne
d9fa7c113d
bhyve: emulate graphics stolen memory register
This register contains a host physical address. This address is
meaningless for the guest. We have to emulate it and set it to a valid
guest physical address.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40060
2023-06-16 07:54:27 +02:00
Corvin Köhne
1bd361eea2
bhyve: allocate guest memory for graphics stolen memory
The graphics stolen memory is only GPU accessible. So, we don't have to
copy any data to it as the guest will be unable to access it anyway. We
just have to allocate and reserve some memory. That's done by adding an
E820 entry for the graphics stolen memory. The guest firmware will pick
up the E820 and reserve this range.

Note that we try to reuse the host address as Intel states that newer
Tiger Lake platforms need this [1].

[1]
e28d6fbfdf/devicemodel/hw/pci/passthrough.c (L626-L629)

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40059
2023-06-16 07:54:02 +02:00
Corvin Köhne
4a9bf50f40
bhyve: read out graphics stolen memory address and size
This is the first step to emulate the graphics stolen memory register.

Note that the graphics stolen memory is somehow confusing. On the one
hand the Intel Open Source HD Graphics Programmers' Reference Manual
states that it's only GPU accessible. As the CPU can't access the area,
the guest shouldn't need it. On the other hand, the Intel GOP driver
refuses to work properly, if it's not set to a proper address.

Intel itself maps it into the guest by EPT [1]. At the moment, we're not
aware of any situation where this EPT mapping is required, so we don't
do it yet.

Intel also states that the Windows driver for Tiger Lake reads the
address of the graphics stolen memory [2]. As the GVT-d code doesn't
support Tiger Lake in its first implementation, we can't check how it
behaves. We should keep an eye on it.

[1]
e28d6fbfdf/devicemodel/hw/pci/passthrough.c (L655-L657)
[2]
e28d6fbfdf/devicemodel/hw/pci/passthrough.c (L626-L629)

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40039
2023-06-16 07:53:46 +02:00
Corvin Köhne
90c3a1b662
bhyve: add empty GVT-d emulation
Don't emulate anything yet. Just check if the user would like to pass an
Intel GPU to the guest.

Reviewed by:		jhb, markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40038
2023-06-16 07:53:44 +02:00
Ka Ho Ng
9f135336f5 SYSCALL_MODULE(9): fix references to modfind(2) and modstat(2)
Sponsored by:	Juniper Networks, Inc.
Reviewed by:	delphij
MFC after:	1 week
2023-06-15 15:39:53 -04:00
Dag-Erling Smørgrav
b7412da2e1 asa: Add some unit tests.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D40564
2023-06-15 19:24:59 +00:00
Dag-Erling Smørgrav
f08f90e698 asa: Read from stdin if *argv is "-".
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D40563
2023-06-15 19:24:58 +00:00
Dag-Erling Smørgrav
9e379f9639 asa: Error out if writing to stdout failed.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D40562
2023-06-15 19:24:58 +00:00
Mark Johnston
19aebfbf80 bhyve: Sort SRCS
No functional change intended.

Reviewed by:	corvink, jhb
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D40553
2023-06-15 12:39:27 -04:00
Mark Johnston
50e1cc94a1 arm64: Make a debug print conditional on bootverbose
It doesn't seem particularly useful to have it enabled by default, and
it spits several dozen lines into the dmesg on a test system.

Reviewed by:	andrew
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D40499
2023-06-15 12:39:27 -04:00
Mark Johnston
e1390215af bhyve: Remove special no-op handling for I/O port 0x488
This appears to have been reserved for some kind of debug hook, but it's
not implemented and appears never to have been used.

Reviewed by:	corvink, jhb
MFC after:	1 week
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D40555
2023-06-15 12:39:27 -04:00
Mark Johnston
6281147a96 dtrace/arm64: Fix user memory access routines
Use unprivileged loads to access user memory.  Without this, the
accesses trap and various dtrace actions such as ustack() fail.

Reviewed by:	andrew
MFC after:	1 week
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D40540
2023-06-15 12:39:21 -04:00
Mark Johnston
91522683d4 dtrace/arm64: Store the fault address when suppressing a page fault
Reviewed by:	andrew
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D40539
2023-06-15 12:38:45 -04:00
Mark Johnston
d325184232 arm64: Remove struct arm64_frame
It was used in one place and was added specifically to support dtrace
stack unwinding code.  Write an equivalent expression using struct
unwind_state instead.  No functional change intended.

Reviewed by:	andrew
MFC after:	1 week
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D40538
2023-06-15 12:38:45 -04:00
Mark Johnston
1ee66195db armv8crypto: Avoid overriding -march when compiling some source files
At least one downstream (CheriBSD) overrides -march here.  Instead of
hard-coding the target, simply append the crypto extension to whatever's
already there.

No functional change intended.

Reviewed by:	imp, andrew
MFC after:	1 week
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D40537
2023-06-15 12:38:45 -04:00
Brooks Davis
4591322980 oce(4): deprecate
The Emulex OneConnect NIC driver hasn't seen any commits other than ioctl
bug fixes (some severe) and sweeping commits since 2016.  There is no
indication of new parts since 2014 or earlier.  As such, deprecate the
driver with the aim of removing it prior to FreeBSD 15.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D40531
2023-06-15 17:35:12 +01:00
Brooks Davis
758927a982 oce(4): Don't directly access usespace
Replace direct stores to userspace addresses (never safe and broken on
modern CPUs) with a copyout.  Use a static assert on the size to ensure
we don't overflow the field.

Reviewed by:	markj, jhb
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D40519
2023-06-15 17:34:54 +01:00
Warner Losh
e27c618e20 mpi3mr: Add bare-bones manual
The mpi3mr driver is written by Broadcom for the 9600 Series 24G PCIe
4.0 Tri-Mode RAID Adapters and eHBAs boards. This is 3rd-Generation
Tri-Mode x8 and x16 NVMe/SAS/SATA (although Broadcom/Avago did muddy the
waters by having multiple 2nd generations cards and referring to them
inconsistently).

Sponsored by:		Netflix
2023-06-15 09:03:41 -06:00
Sumit Saxena
2d1d418e1e mpi3mr: 3rd Generation Tri-Mode NVMe/SAS/SATA MegaRaid / eHBA
This is Broadcom's mpi3mr driver for FreeBSD version 8.6.0.2.0.
The mpi3mr driver supports Broadcom SAS4116-based cards in the 9600
series: 9670W-16i, 9670-24i, 9660-16i, 9620-16i, 9600-24i, 9600-16i,
9600W-16e, 9600-16e, 9600-8i8e.

Initially only available as a module and on amd64/arm64, since that's
how it has been tested to date. Future commits will add it to the kernel
build and may expand the architectures it is supported on.

Co-authored-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Feedback-by: ken (prior versions)
Reviewed-by: imp
RelNotes: yes
Differential-Revision: https://reviews.freebsd.org/D36771
Differential-Revision: https://reviews.freebsd.org/D36772
2023-06-15 08:52:40 -06:00
Alexander V. Chernikov
2b5dd8b890 ipfw: use function return value to fetch insn argument.
This is a prerequsite for splitting compile_rule() into smaller
chunks.

MFC after:	2 weeks
2023-06-15 06:46:42 +00:00
Alexander V. Chernikov
84b41342da ipfw: add eaction tests
MFC after:	2 weeks
2023-06-15 06:36:16 +00:00
Marko Zec
32b28e3ae2 route.8: mention DXR in FIB_ALGO section
While here, add a sentence describing DPDK DIR24-8 principle of
operation.

MFC after:	2 weeks.
2023-06-15 07:21:51 +02:00
Kyle Evans
f5e5dcdbeb caroot: update the root bundle
Summary:
- Zero (0) newly trusted
- Five (5) modified
- Nine (9) distrusted

MFC after:	3 days
2023-06-14 23:30:19 -05:00
Jessica Clarke
456c1199d3 resizewin: Stop printing bogus NUL to TTY
A char array has an implicit NUL terminating it, which sizeof will
include, so we need to subtract 1 here. Printing a NUL can cause issues
for things like CI environments that aren't expecting it, especially
with recent Jenkins being stricter about not putting NUL in XML files.

Fixes:		3d222369ac ("Add a small tool, resizewin(1), to query terminal for window size")
MFC after:	1 week
2023-06-14 23:58:36 +01:00
Gleb Smirnoff
6eb2dbfa63 tcp: add missing static keywords
Without them compilation with -O0 would produce kernel modules
that depend on symbol that doesn't exist.
2023-06-14 14:21:28 -07:00
Colin Percival
bcf9147144 EC2: Default to "uefi-preferred" boot mode
In EC2, UEFI boots faster than BIOS, but not all amd64 instance types
support UEFI.  AMIs need to have their boot mode designated, which
created a dilemma: Faster boots, or wider compatibility?

The recently added "uefi-preferred" option solves this: AMIs can be
marked to use UEFI where it's available, but fall back to BIOS on
instance types which do not support UEFI.

This uses bsdec2-image-upload 1.4.6, which recently landed in the
ports tree.

PR:		265697
Reviewed by:	delphij, imp
MFC after:	1 week
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D40470
2023-06-14 11:31:10 -07:00