Michael Gmelin [Wed, 7 Sep 2022 16:56:49 +0000 (18:56 +0200)]
stand: Unbreak FAT32 in loader
This corrects an issue introduced in b4cb3fe0e39a3, where a freshly
allocated `DOS_FS` structure would not be initialized properly before
use in `dos_open`.
In case of FAT32 file systems, this would leave `fs->dirents`
uninitialized and - depending on its content and due to checks in
`parsebs` - prevent mounting the file system successfully.
This particularily impacted the EFI loader, as it was sometimes not
able to read files from a FAT32-formatted EFI partition, including
LoaderEnv (`/efi/freebsd/loader.env`).
Leandro Lupori [Thu, 14 Oct 2021 16:13:27 +0000 (13:13 -0300)]
powerpc64: make radix with superpages default
As Radix MMU with superpages enabled is now stable, make it the
default choice on supported hardware (POWER9 and above), since its
performance is greater than that of HPT MMU.
Reviewed by: alfredo, jhibbits
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D30797
When running in a virtualized environment, TLB invalidations can only
be performed on process scope, as only the hypervisor is allowed to
invalidate a global scope, or else a Program Interrupt is triggered.
Since we are here, also make sure that the register process table
hypercall returns success.
Reviewed by: jhibbits
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D31775
Justin Hibbits [Thu, 12 Aug 2021 00:03:27 +0000 (19:03 -0500)]
powerpc/pseries: Allow radix pmap in pseries for ISA 3.0
ISA 3.0 allows for nested radix translations with minimal to no
involvement of the hypervisor. This should make pseries signficantly
faster on POWER9 pseries instances, as fewer hypercalls are needed to
manage pmap now.
Leandro Lupori [Thu, 25 Nov 2021 19:41:46 +0000 (16:41 -0300)]
powerpc64le: fix boot when using QEMU PowerNV
When using QEMU PowerNV with latest op-build release (v2.7), its
kexec transfers control to FreeBSD kernel in BE mode, causing an
instant exception on LE kernels. Make kboot able to detect and
swap endian to fix this.
Reviewed by: imp
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D33104
Martin Matuska [Tue, 4 Oct 2022 15:52:09 +0000 (17:52 +0200)]
zfs: merge openzfs/zfs@6a6bd4939 (zfs-2.1-release) into stable/13
OpenZFS release 2.1.6
Notable upstream pull requeset merges:
#11733 ICP: Add missing stack frame info to SHA asm files
#12274 Optimize txg_kick() process
#12284 Add Module Parameter Regarding Log Size Limit
#12285 Introduce a tunable to exclude special class buffers from L2ARC
#12287 Remove refcount from spa_config_*()
#12425 Avoid small buffer copying on write
#12516 Fix NFS and large reads on older kernels
#12678 spa.c: Replace VERIFY(nvlist_*(...) == 0) with fnvlist_*
#12789 Improve log spacemap load time
#13022 Add more control/visibility and speedup spa_load_verify()
#13106 add physical device size to SIZE column in 'zpool list -v'
#13388 Improve mg_aliquot math
#13405 Revert "Reduce dbuf_find() lock contention"
#13452 More speculative prefetcher improvements
#13476 Refactor Log Size Limit
#13540 AVL: Remove obsolete branching optimizations
#13553 Reduce ZIO io_lock contention on sorted scrub
#13555 Scrub mirror children without BPs
#13563 FreeBSD: Improve crypto_dispatch() handling
#13576 Several sorted scrub optimizations
#13579 Fix and disable blocks statistics during scrub
#13582 Several B-tree optimizations
#13591 Avoid two 64-bit divisions per scanned block
#13606 Avoid memory copies during mirror scrub
#13613 Avoid memory copy when verifying raidz/draid parity
#13643 Fix scrub resume from newly created hole
#13756 FreeBSD: Mark ZFS_MODULE_PARAM_CALL as MPSAFE
#13767 arcstat: fix -p option
#13781 Importing from cachefile can trip assertion
#13794 Apply arc_shrink_shift to ARC above arc_c_min
#13798 Improve too large physical ashift handling
#13811 Fix column width in 'zpool iostat -v' and 'zpool list -v'
#13842 make DMU_OT_IS_METADATA and DMU_OT_IS_ENCRYPTED return B_TRUE
or B_FALSE
#13855 zfs recv hangs if max recordsize is less than received
recordsize
#13861 Fix use-after-free in btree code
#13865 vdev_draid_lookup_map() should not iterate outside draid_maps
#13878 Delay ZFS_PROP_SHARESMB property to handle it for encrypted
raw receive
#13882 FreeBSD: Fix integer conversion for vnlru_free{,_vfsops}()
#13885 Fix incorrect size given to bqueue_enqueue() call in dmu_redact.c
#13908 FreeBSD: stop passing LK_INTERLOCK to VOP_LOCK
#13930 zpool: Don't print "repairing" on force faulted drives
#13954 Fix bad free in skein code
When WITHOUT_SENDMAIL is enabled and WITHOUT_MAILWRAPPER is disabled
we install /bin/rmail as a link to the /usr/sbin/mailwrapper.
Ensure make delete-old does not unlink /bin/rmail in that case.
Justin Hibbits [Tue, 4 Jan 2022 15:22:04 +0000 (09:22 -0600)]
busdma: Fix powerpc DMA alignment check
The original logic was to check if there's no filter and the address is
misaligned relative to the requirements. The refactoring in c606ab59e7f9423f7027320e9a4514c7db39658d missed this, and instead caused
it to return failure if the address *is* properly aligned.
Doug Moore [Thu, 8 Sep 2022 04:46:19 +0000 (23:46 -0500)]
rb_tree: reduce duplication in balancing code
Change RB_INSERT_COLOR and RB_REMOVE_COLOR so that the blocks of code
that are identical except for left and right being exchanged are made
only one block with a variable to indicate left- or right-handedness.
Rename RB macros so that those not intended for external use begin
with an underscore.
Add comments to the balancing code so that another might understand it.
Doug Moore [Sun, 18 Sep 2022 08:34:47 +0000 (03:34 -0500)]
rb_tree: silence unused function warnings
With DIAGNOSTIC set a kernel build generates warnings about the
defined-but-unused RB_RANK method. Don't set _RB_DIAGNOSTIC
automatically, to silence these warnings.
Doug Moore [Thu, 8 Sep 2022 02:40:05 +0000 (21:40 -0500)]
rb_tree: test rank balance
With _RB_DIAGNOSTIC defined, provide an RB_RANK method to compute the
rank of a node in an rb-tree, if the subtree rooted at that node is
rank-balanced, and -1 otherwise.
In rb_test, rewrite a bit to avoid malloc/free and nondeterministic
running times because of randomness. Allocate all the nodes on the
stack, and shuffle a set of keys to get randomness for the testing.
Mark Johnston [Fri, 23 Sep 2022 23:41:30 +0000 (19:41 -0400)]
sched_4bsd: Fix a racy thread state modification
When a thread switching off-CPU is migrating to a remote CPU,
sched_switch() may trigger a rescheduling of the thread currently
running on that CPU. When doing so, it must ensure that that thread is
locked before modifying thread state. If the thread's lock is not the
scheduler lock, then the thread is in the process of switching off-CPU
and no extra effort is needed, and the initiator does not hold the
thread's lock and thus should not modify any thread state.
Mark Johnston [Sat, 24 Sep 2022 13:20:48 +0000 (09:20 -0400)]
amd64: Ignore 1GB mappings in pmap_advise()
This assertion can be triggered by usermode since vm_map_madvise()
doesn't force advice to be applied to an entire largepage mapping. I
can't see any reason not to permit it, however, since MADV_DONTNEED and
_FREE are advisory and we can simply do nothing when a 1GB mapping is
encountered.