Commit Graph

283401 Commits

Author SHA1 Message Date
Justin Hibbits
0785c323f3 Convert nfs bootp/diskless to use IfAPI
Use the new IfAPI interface and address iterators so the nfs driver
doesn't need direct access to the interface structures.

Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38962
2023-05-02 14:35:58 -04:00
Justin Hibbits
4db5958a06 Mechanically convert if_hn(4) to IfAPI
Reviewed by:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37855
2023-05-02 14:34:47 -04:00
Justin Hibbits
f766d1d5a7 IfAPI: Add if_maddr_empty() to check for any maddrs
if_llmaddr_count() only counts link-level multicast addresses.
hv_netvsc(4) needs to know if there are any multicast addresses.  Since
hv_netvsc(4) is the only instance where this would be used, make it a
simple boolean.  If others need a if_maddr_count(), that can be added in
the future.

Reviewed by:	melifaro
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D39493
2023-05-02 14:34:47 -04:00
Mitchell Horne
c32b6c742f riscv: retire the FPE kernel option
We always build the kernel floating point support. Now that the
riscv64sf userspace variant has been removed the option is required for
correct operation.

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39851
2023-05-02 15:01:31 -03:00
Mitchell Horne
f5d39047b0 riscv: remove unused string from swtch.S
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2023-05-02 15:01:00 -03:00
Kristof Provost
476babaea7 rtsol: introduce an 'always' script
In addition to the 'M' and 'O' scripts (for when 'Managed' and 'Other'
flags are set) also introduce an 'always' script that is called for any
router advertisement (so even if M and O are not set).

This is primarly useful for systems like pfSense that wish to be
informed of routers for further system configuration.

See also https://redmine.pfsense.org/issues/14072

Reviewed by:	melifaro
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D39931
2023-05-02 18:07:36 +02:00
Konstantin Belousov
a1d71cebc0 fstatat(2): restore AT_EMPTY_PATH handling
Fixes:	cb858340dc
Reported by:	markj
Sponsored by:	The FreeBSD Foundation
2023-05-02 18:11:39 +03:00
Jason A. Harmening
6f378116e9 Intel DMAR: remove parsing of 6-level paging capability
Early versions of the VT-d spec mentioned 6-level paging support as a
possible value for the SAGAW capability, but later versions removed it
and SAGAW=0x10 is currently listed as a reserved value.

The 6-level (agaw=64) entry in sagaw_bits is furthermore problematic
with clang15 because the attempted comparison against 1ULL << 64 in
dmar_maxaddr2mgaw() causes the compiler to elide the last iteration
of the initial loop, which bypasses the subsequent logic to find the
greatest HW-supported address width.  This results in 5-level paging
always being selected regardless of whether the hardware supports it,
which can result address translation failure due to invalid context-
entry programming.

Reviewed by:	kib
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D39896
2023-05-02 09:06:11 -05:00
Konstantin Belousov
42f722e721 amd64: store pcids pmap data in pcpu zone
This change eliminates the struct pmap_pcid array embedded into struct
pmap and sized by MAXCPU, which would bloat with MAXCPU increase.  Also
it removes false sharing of cache lines, since the array elements are
mostly locally accessed by corresponding CPUs.

Suggested by:	mjg
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D39890
2023-05-02 14:32:47 +03:00
Konstantin Belousov
9c8cbf3819 amd64 pmap_pcid_alloc(): pass a pointer to struct pmap_pcid instead of cpuid
Cpuid is used to index the pmap->pm_pcids array only.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D39890
2023-05-02 14:32:40 +03:00
Konstantin Belousov
9e0143694a amd64: add pmap_get_pcid() helper
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D39890
2023-05-02 14:32:35 +03:00
Konstantin Belousov
86b61ccb34 amd64 pmap: add pmap_pinit_pcids() helper
to initialize pm_pcids array for a new user pmap

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D39890
2023-05-02 14:32:29 +03:00
Konstantin Belousov
32bb28d8ad amd64: move definition of the struct pmap_pcids into _pmap.h
and rename the structure to pmap_pcid.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D39890
2023-05-02 14:32:20 +03:00
Xin LI
d713e0891f MFV: less v632.
MFC after:	2 weeks
2023-05-01 20:43:57 -07:00
Ed Maste
83d5725005 src.conf.5: regen after MK_TOOLCHAIN / MK_INCLUDES decoupling 2023-05-01 20:39:30 -04:00
Ed Maste
0b4568e36f src.opts.mk: Decouple MK_INCLUDES from MK_TOOLCHAIN
Prior to 590461a4b8 installation of include files was controlled
directly by ${MK_TOOLCHAIN}.  590461a4b8 added an INCLUDES knob
defaulting to YES.  Setting WITHOUT_TOOLCHAIN forced it off to retain
existing behaviour.

Decouple them now, as there are reasonable use cases for installing
libraries and include files without a compiler or other tool chain
components.

Reviewed by:	imp, jrtc27
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39918
2023-05-01 20:33:08 -04:00
Warner Losh
a5b4ec5281 stand: More protection against malformed smbios tables
Add some more sanity checks to make sure we don't march off the end of
the table. Typically, smbios structures are well formed, or Windows
wouldn't boot. Sometimes they aren't, and this at least fails safe.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D39794
2023-05-01 15:12:41 -06:00
Warner Losh
c5e433b99e stand: Avoid unaligned access in smbios code
This code was written on x86 where unaligned accesses were
easy. LinuxBoot running on aarch64 uses mmap of /dev/mem to read the
smbios table. Linux's mapping of this memory doesn't allow the normal
unaligned fixup, so we get a bus error instead. We can't use the more
natural le16dec and friends because they optimize into a single,
unaligned memory load. We don't see this issue on aarch64 UEFI because
memory is mapped such that unaligned accesses are fixed up.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D39793
2023-05-01 15:12:34 -06:00
Warner Losh
a083d08676 kboot: Add smbios support
Add support for getting smbios from /sys/firmware/efi/systab, if
any. Add ptov mapping that uses mmap on /dev/mem to do the mapping with
64k pages (usually we only need 1 or two mappings).

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D39792
2023-05-01 15:12:29 -06:00
Warner Losh
facd0edbb2 kboot: Fix an off by one error
Fix an off-by-one error that would mean we'd get stuck on the newline if
ACPI= wasn't first.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D39817
2023-05-01 15:12:24 -06:00
Warner Losh
cf6044857e stand: Testing program for smbios
Write a quick and dirty testing program to dump physical memory to help
test and debug the smbios.c code in new environments.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D39791
2023-05-01 15:12:19 -06:00
Warner Losh
83eabc64ef kboot: Add HOST_MAP_FAILED define
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D39790
2023-05-01 15:11:32 -06:00
Warner Losh
b53ec4e44f stand: Add isspace to FreeBSD ctypes.h
And eliminate blake3_impl_hack.c since it's no longer needed.

Sponsored by:		Netflix
Reviewed by:		delphij
Differential Revision:	https://reviews.freebsd.org/D39899
2023-05-01 15:02:54 -06:00
Warner Losh
6c8358cd7f stand: back out the most of the horrible aarch64 kludge
Add one ifdef to upstrem code and get rid of compiling the horrible
checked-in aarch64 assembler for the boot loader that the loader will
never use. I'll attempt to upstream this and adjust as needed.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D39897
2023-05-01 15:02:54 -06:00
Warner Losh
96b119340e stand: remove ZFS warning about computered but unused variable
Toss a __unused on the unexpected_errors variable. We compute it, but
never use it.

Sponsored by:		Netflix
2023-05-01 15:02:54 -06:00
Warner Losh
cb8179079a stand: Fix warning about variable unused
dflag is unused when LOADER_VERIEXEC isn't defined, so move it under the
ifdef.

Sponsored by:		Netflix
2023-05-01 15:02:54 -06:00
Warner Losh
5328f9034f stand/kboot: Simplify
There's plenty of stack in kboot, so use it here rather than the
malloc/free dance.

Sponsored by:		Netflix
Reviewed by:		tsoome, kevans
Differential Revision:	https://reviews.freebsd.org/D39416
2023-05-01 15:02:53 -06:00
Warner Losh
d5babd0d23 stand/efi: Simplify code here
We have plenty of stack in the EFI case, so use it instead of the
complicated malloc / free dance.

Sponsored by:		Netflix
Reviewed by:		tsoome, kevans
Differential Revision:	https://reviews.freebsd.org/D39415
2023-05-01 15:02:53 -06:00
Warner Losh
5ce98ee5f4 stand/userboot: Simplify code
We have way more than 8k of stack for the current value of the zfs
bootonce attribute. Allocate buf on the stack rather than the
complicated malloc / free dance.

Sponsored by:		Netflix
Reviewed by:		tsoome, kevans, jhb
Differential Revision:	https://reviews.freebsd.org/D39414
2023-05-01 15:02:53 -06:00
Warner Losh
0c4183f02e rc.d/zfsbe: Simplify
So $(foo) is a shorter version of "`foo`".

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D39413
2023-05-01 15:02:53 -06:00
Warner Losh
43f7eeff0d stand/boot1.efi: Implement bootonce for ZFS
Implement ZFS bootonce protocol. We pass zfs-bootonce=t to the next boot
stage as a command line argument. Unlike zfsboot -> loader handoff in
the BIOS case, we don't use the OS_BOOTONCE_USED. This would require
modifications to loader.efi which would only server to make it more
complicated. Instead, use the command line parsing interface for the
boot1.efi -> loader.efi to pass in the zfs-bootonce kenv that will be
needed by rc.d/zfsbe to activate the BE if boot progresses that far.

Sponsored by:		Netflix
Reviewed by:		tsoome, kevans
Differential Revision:	https://reviews.freebsd.org/D39412
2023-05-01 15:02:53 -06:00
Warner Losh
b765cfa380 stand/zfs: Refactor zfs_get_bootonce
Lookup the spa and pass it into zfs_get_bootonce_spa to process the boot
once protocol.

Sponsored by:		Netflix
Reviewed by:		tsoome, kevans
Differential Revision:	https://reviews.freebsd.org/D39411
2023-05-01 15:02:53 -06:00
Warner Losh
4dcae288fe stand/zfs: Refactor zfs_set_bootenv
Refactor zfs_set_bootenv to split out the lookup of spa from the
rest. zfs_set_bootenv_spa flushes the benv to the vdevs and updates the
cached benv.

Sponsored by:		Netflix
Reviewed by:		tsoome, kevans
Differential Revision:	https://reviews.freebsd.org/D39410
2023-05-01 15:02:53 -06:00
Warner Losh
6479bd1b7d stand/zfs: Refactor zfs_get_bootenv
Create a new interface to zfs_get_bootenv called zfs_get_bootenv_spa
which takes a spa instead of a void * (effectively a devdesc *). Use
that in zfs_get_bootenv.

Sponsored by:		Netflix
Reviewed by:		tsoome, kevans
Differential Revision:	https://reviews.freebsd.org/D39409
2023-05-01 15:02:53 -06:00
Warner Losh
439a9766ad stand/zfs: Move spa_find_by_dev from zfsimpl.c to zfs.c
zfsimpl.c doesn't know about devdesc at all, but zfs.c does. Move it to
zfs.c, which is the only user. Keep it static for now, but it could be
exposed later if something else were to need it.

Sponsored by:		Netflix
Reviewed by:		tsoome, kevans
Differential Revision:	https://reviews.freebsd.org/D39408
2023-05-01 15:02:52 -06:00
Warner Losh
91ac713b64 stand/boot1.efi: Allow modules to add env variables
Sometimes filesystem modules need to pass details of the state of the
filesystem to later stages of a boot. Provide a generic method to do
so. We'll add them after any env variables set in our config files.

Sponsored by:		Netflix
Reviewed by:		tsoome, kevans
Differential Revision:	https://reviews.freebsd.org/D39407
2023-05-01 15:02:52 -06:00
Ed Maste
5f2e84015d bsd.lib.mk: decouple lib*_pic.a from TOOLCHAIN build knob
A user may use a tool chain from a package or just use an existing
tool chain from a previous installation.  There is no reason for this
to disable the installation of lib${LIB}_pic.a.

This also means we don't need to force MK_TOOLCHAIN=yes in lib/libc.

This reverts part of commit c0f5aeb032.

Reviewed by:	jrtc27
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39917
2023-05-01 16:46:39 -04:00
Ed Maste
ed2e50508c bxe: prefer C99 bool to boolean_t
Differential Revision:	https://reviews.freebsd.org/D20853
2023-05-01 16:23:39 -04:00
Ed Maste
2a3bd08708 pkgbase: hide duplicate METALOG directory warnings under verbose
Creating directories multiple times is an inherent side effect of the
way installation is done.  Hide warnings from duplicate directory
entries (with identical metadata) under metalog_reader's verbose mode.

Duplicate file entries are always reported.  They currently generate
warnings but will be switched to errors once the few instances currently
in the tree are fixed.

PR:		244596, 271178
Reviewed by:	kevans
Sponsored By:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39898
2023-05-01 15:22:36 -04:00
Ed Maste
75baf3765c Cirrus-CI: set PKG_FORMAT via top level env:
This ensures consistency among different CI scripts, including future
ones for pkgbase work.

Sponsored by:	The FreeBSD Foundation
2023-05-01 14:03:32 -04:00
Christos Margiolis
e11d11c543 kinst: test lock in kinst_trampoline_dealloc_locked()
Reviewed by:	markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39883
2023-05-01 11:40:29 -04:00
Christos Margiolis
aad1685066 fbt: get rid of redundant defines
No functional change intended.

Reviewed by:	markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39882
2023-05-01 11:40:29 -04:00
Mark Johnston
56da525b53 hwpmc: Fix a typo
MFC after:	1 week
2023-05-01 11:40:29 -04:00
Tom Hukins
e5bc2547a5 geom(4): Add cross reference to geom(8)
PR:		264387
Reviewed by:	ceri
Pull Request:	https://github.com/freebsd/freebsd-src/pull/702
2023-05-01 11:06:00 -04:00
Tom Hukins
865362061d mfi(4): Refer to mrsas(4)
Reviewed by:	imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/722
2023-05-01 11:06:00 -04:00
Alexander V. Chernikov
88406e631e netlink: whitespace fix in netlink_message_writer.h.
Reported by:	garga
MFC after:	2 weeks
2023-05-01 14:47:11 +00:00
Tom Hukins
a58648a68b wlan(4): Add more related drivers to "See also"
Pull Request:	https://github.com/freebsd/freebsd-src/pull/721
2023-05-01 10:38:09 -04:00
Tom Hukins
7626863e19 pf: Fix a spelling mistake in a comment
Pull Request:	https://github.com/freebsd/freebsd-src/pull/704
2023-05-01 10:30:15 -04:00
Tom Hukins
9c353fa4a9 libc: Fix a documentation spelling mistake
Pull Request:	https://github.com/freebsd/freebsd-src/pull/704
2023-05-01 10:30:15 -04:00
Kajetan Staszkiewicz
db0a2bfd0c pf: reduce number of hashing operations when handling source nodes
Reduce number of hashing operations when handling source nodes by always
having a pointer to the hash row mutex in the source node. Provide
macros for handling and asserting the mutex. Calculate the hash only
once in pf_find_src_node() and then use this hash in subsequent
operations.

Cherry-picked from development of D39880

Reviewed by:	kp, mjg
Sponsored by:	InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D39888
2023-05-01 16:15:30 +02:00