Commit Graph

283688 Commits

Author SHA1 Message Date
Konstantin Belousov
e704f88f3d amd64: initialize APs kpmap_store in init_secondary()
The APs pcpu area is zeroed in init_secondary() by pcpu_init(), so the
early initialization in pmap_bootstrap() is nop.

Fixes:	42f722e721cd010ae5759a4b0d3b7b93c2b9cad2ESC
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D39945
2023-05-04 18:39:22 +03:00
Ed Maste
5eab6333fa Vendor import of spleen font 1.9.3 2023-05-04 11:05:42 -04:00
Joseph Mingrone
6b96668d5b
Import libpcap 1.10.4
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2023-05-04 11:57:30 -03:00
Ed Maste
f3d044c73b Vendor import of spleen font 1.6.0
Obtained from:	https://github.com/fcambus/spleen
2023-05-04 10:39:10 -04:00
Warner Losh
5fd34912b4 stand: Fix oversight in updating OpenZFS: Add com.klarasystems:vdev_zaps_v2
com.klarasystems:vdev_zaps_v2 is a new feature that the last OpenZFS
import brought in. It needs to be on the list of supported features, but
that update didn't happen so I woke up to a mailbox with multiple
complaints.

CirrusCI test to boot twice with a zpool update inbetween coming later
today.

Sponsored by:		Netflix
2023-05-04 08:25:46 -06:00
Li-Wen Hsu
5282ada06b
ObsoleteFiles: Complete 20201025: Remove cal data files
Fixes:	d20d655018 calendar: remove all datafiles except freebsd one
MFC after:	3 days
2023-05-04 12:28:52 +08:00
Ameer Hamza
82ac409acc
zpool import -m also removing spare and cache when log device is missing
spa_import() relies on a pool config fetched by spa_try_import() for
spare/cache devices. Import flags are not passed to spa_tryimport(),
which makes it return early due to a missing log device and missing
retrieving the cache device and spare eventually. Passing
ZFS_IMPORT_MISSING_LOG to spa_tryimport() makes it fetch the correct
configuration regardless of the missing log device.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes #14794
2023-05-03 15:10:32 -07:00
Ed Maste
4194bbb34c release: Report disk image filename
For someone new to the release bits it's not always clear what files are
being created. Report the disk image name explicitly.

Reviewed by:	gjb
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39953
2023-05-03 16:58:22 -04:00
Chuck Silvers
4064755812 fsck_ffs: fix the previous change that skipped pass 5 in some cases
The previous change involved calling check_cgmagic() twice in a row
for the same CG in order to differentiate when the CG was already ok vs.
when the CG was rebuilt, but that doesn't work because the second call
(which was supposed to rebuild the CG) returns 0 (indicating that
the CG was not rebuilt) due to the prevfailcg check causing an early
failure return.  Fix this by moving the rebuild part of check_cgmagic()
out into a separate function which is called by pass1() when it wants to
rebuild a CG.

Fixes: da86e7a20d
Reported by:	pho
Discussed with:	mckusick
Sponsored by:	Netflix
2023-05-03 13:31:32 -07:00
Simon J. Gerraty
9f27341c33 local.meta.sys.mk set BOOTSTRAPPING
When building for host on non-FreeBSD
some makefiles want to see BOOTSTRAPPING defined.

With this libmd and hence nmtree build ok
2023-05-03 12:20:02 -07:00
Michael Tuexen
04ede3675e sctp: only start shutdown guard timer when sending SHUTDOWN chunk
The intention is to protect a malicious peer not following the
shutdown procedures.

MFC after:	1 week
2023-05-03 20:28:46 +02:00
buzzingwires
a46001adb9
Allow zhack label repair to restore detached devices.
This commit expands on the zhack label repair command in d04b5c9 by
adding the -u option to undetach a device by regenerating uberblocks,
in addition to the existing functionality of fixing checksums, now
represented by -c. Previous behavior is retained in the case of no
options.

The changes are heavily inspired by Jeff Bonwick's labelfix
utility, as archived at:

https://gist.github.com/jjwhitney/baaa63144da89726e482

Additionally, it is now capable of properly determining the size of
block devices and other media, as well as handling sizes which are
not divisible by 2^18. This should make it viable for use on physical
devices and partitions, in addition to files.

These changes should make it possible to import zpools that have had
their uberblocks erased, such as in the case of pools rendered
inaccessible by erroneous detach commands.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: buzzingwires <buzzingwires@outlook.com>
Closes #14773
2023-05-03 09:03:57 -07:00
George Amanakis
9de5300c7f
Optimize check_filesystem() and process_error_log()
Integrate check_clones() into check_filesystem() and implement a list
instead of iterating recursively over the clones, thus eliminating the
risk of a stack overflow.

Also use kmem_zalloc() to allocate large structures in
process_error_log() reducing its stack size from ~700 to ~128 bytes.

Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes #14744
2023-05-03 09:00:14 -07:00
Mark Johnston
e8f6e5b2d9 unix: Fix locking in uipc_peeraddr()
After the locking protocol changed in commit 75a67bf3d0 ("AF_UNIX:
make unix socket locking finer grained"), uipc_peeraddr() was not
updated accordingly.

The link lock now only protects global socket lists.  The PCB lock is
used to protect the link between connected PCBs, so use that.  Remove an
old comment which appears to be noting that unp_conn is not set for
connected SOCK_DGRAM sockets (in one direction anyway).

Reviewed by:	glebius
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39855
2023-05-03 11:56:46 -04:00
Ed Maste
fc2e2c950d src.conf: add WITH_TOOLCHAIN description
It is not used by the in-tree default configuration, but adding it
allows downstream projects with different defaults to make use of
Cirrus-CI (as the makeman test added in 85e8c2a034 requires that
there are no missing option descriptions).

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39936
2023-05-03 11:41:58 -04:00
Michael Tuexen
d9ae4adff2 sctp: improve shutdown(..., SHUT_WR) handling
When shutdown(..., SHUT_WR) is called in the front states, send a
SHUTDOWN chunk when a COOKIE ACK chunk is received and there is
no outstanding data.

MFC after:	1 week
2023-05-03 17:33:49 +02:00
Ed Maste
81f964e2ff authpf: do not sprintf to a null pointer
The fgetln loop will terminate with buf = NULL at EOF.

Reported by:	GCC
Reviewed by:	kp
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39947
2023-05-03 10:03:27 -04:00
Martin Matuska
d411c1d696 zfs: merge openzfs/zfs@d96e29576
Notable upstream pull request merges:

  #11680 Add support for zpool user properties
  #14145 Storage device expansion "silently" fails on degraded vdev
  #14405 Create zap for root vdev
  #14659 Allow MMP to bypass waiting for other threads
  #14674 Miscellaneous FreBSD compilation bugfixes
  #14692 Fix some signedness issues in arc_evict()
  #14702 Fix typo in check_clones()
  #14715 module: small fixes for FreeBSD/aarch64
  #14716 Trim needless zeroes from checksum events
  #14719 vdev: expose zfs_vdev_max_ms_shift as a module parameter
  #14722 Fix "Detach spare vdev in case if resilvering does not happen"
  #14723 freebsd clone range fixes
  #14728 Fix BLAKE3 aarch64 assembly for FreeBSD and macOS
  #14735 Fix in check_filesystem()
  #14739 Fix data corruption when cloning embedded blocks
  #14758 Fix VERIFY(!zil_replaying(zilog, tx)) panic
  #14761 Revert "ZFS_IOC_COUNT_FILLED does unnecessary txg_wait_synced()"
  #14774 FreeBSD .zfs fixups
  #14776 FreeBSD: make zfs_vfs_held() definition consistent with declaration
  #14779 powerpc64: Support ELFv2 asm on Big Endian
  #14788 FreeBSD: add missing vop_fplookup assignments
  #14789 PAM: support the authentication facility
  #14790 Revert "Fix data race between zil_commit() and zil_suspend()"
  #14795 Fix positive ABD size assertion in abd_verify()
  #14798 Mark TX_COMMIT transaction with TXG_NOTHROTTLE
  #14804 Correct ABD size for split block ZIOs
  #14806 Use correct block pointer in block cloning case.
  #14808 blake3: fix up bogus checksums in face of cpu migration

Obtained from:	OpenZFS
OpenZFS commit:	d96e29576c
2023-05-03 12:04:55 +02:00
Kajetan Staszkiewicz
16303d2ba6 pf: improve source node error handling
Functions manipulating source nodes can fail due to various reasons like
memory allocation errors, hitting configured limits or lack of
redirection targets. Ensure those errors are properly caught and
propagated in the code. Increase the error counters not only when
parsing the main ruleset but the NAT ruleset too.

Cherry-picked from development of D39880

Reviewed by:	kp
Sponsored by:	InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D39940
2023-05-03 10:31:05 +02:00
Kristof Provost
7b67669885 pf: simplify structs with anonymous unions
Rather than playing preprocessor hacks use actual anonymous unions.
No functional change.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-05-03 10:24:20 +02:00
Emmanuel Vadot
1d7355248b RELNOTES: Document TI code removal from armv7 GENERIC kernel
Suggested by:	mhorne
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-05-03 09:21:58 +02:00
Emmanuel Vadot
f15b2e1afd RELNOTES: Add fwget entry
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-05-03 09:20:35 +02:00
Mateusz Guzik
cf0fc64bc2 vfs: reduce audit branching in namei_setup 2023-05-03 06:56:10 +00:00
Jessica Clarke
f78cc42f10 riscv: Add pass(4) to GENERIC kernel
Whilst we don't have ahci(4) currently, we do have umass(4), and need
pass(4) for smartctl(8) to be able to talk to such devices.

Reported by:	David Gilbert <dgilbert@daveg.ca>
MFC after:	1 week
2023-05-03 05:14:57 +01:00
Ed Maste
ec1e83782d rtld: don't add extraneous -L directory when MK_TOOLCHAIN == no
rtld's Makefile used to add -L${LIBDIR} to LDFLAGS when MK_TOOLCHAIN was
no.  This was done as part of a change to fix building rtld with
MK_TOOLCHAIN == no (although I'm not sure this part was necessary).

In any case as of 5f2e84015d libc_pic.a is built independent of the
MK_TOOLCHAIN setting and the main part of the workaround has already
been removed.  Remove the rest now.

This reverts commit c0f5aeb032.

Reviewed by:	jrtc27
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39938
2023-05-02 18:01:43 -04:00
Christos Margiolis
0ebc92bf3d vmrun.sh: mention new edk2 package
uefi-edk2-bhyve no longer exists.

Reviewed by:	markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39937
2023-05-02 15:19:09 -04:00
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
Pawel Jakub Dawidek
d96e29576c
Use correct block pointer in block cloning case.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #14806
2023-05-02 09:24:26 -07:00
Brian Behlendorf
012829df0c
Wrap clang specific pragma
Clang specific pragmas need to be wrapped to prevent a build
warning when compiling with gcc.

Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #14814
2023-05-02 09:21:47 -07: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
Mateusz Guzik
e2a92d726e
blake3: fix up bogus checksums in face of cpu migration
This is a temporary measure until a better fix is sorted out.

Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Closes #14785
Closes #14808
2023-05-01 17:21:27 -07:00
Serapheim Dimitropoulos
0c93d86f01
Correct ABD size for split block ZIOs
Currently when layering the ABD buffer of each split block on top of
an indirect vdev's ZIO ABD we don't specify the split block's ABD.
This results in those ABDs being incorrectly sized by inheriting
the size of their parent ABD which is larger than what each split
block needs.

The above behavior isn't causing any bugs currently but can lead
to unexpected ABD sizes for people analyzing and/or working on
the ZIO codepath. This patch fixes this behavior by properly setting
the ABD size for split block ZIOs.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Mark Maybee <mark.maybee@delphix.com>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Closes #14804
2023-05-01 17:18:42 -07: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