Commit Graph

2209 Commits

Author SHA1 Message Date
Bjoern A. Zeeb
dd4f32ae62 ath11k: import ath11k driver
Import BSD-3-Clause-Clear ath11k driver assumed to be
based on Linux kvalo/ath.git master at
6bae9de622d3ef4805aba40e763eb4b0975c4f6d.

Complement the driver to make compile on FreeBSD
using LinuxKPI with changes covered by #ifdef (__FreeBSD__).
Further select updates were applied since the initial import
in order to keep compiling along with other LinuxKPI based
drivers.

Add the module build framework but keep disconnected from the
build for now.
The current driver (or rather LinuxKPI) lacks support for some
"qcom" bits needed in order to get things working.
There was interest by various people to enhance support further.

We initially only plan to support PCI parts but it would be great
to further enhance qcom SoC support to run on several (cheap) APs.

The firmware is provided by port net/wifi-firmware-ath11k-kmod.

Given the lack of full license texts on most files this is
imported under the draft policy for handling SPDX files (D29226)
and with approval for BSD-3-Clause-Clear. [1]

Approved by:    core (jhb, 2023-05-11) [1]
MFC after:      2 months
2023-05-12 11:21:16 +00:00
Martin Matuska
e639e0d27c zfs: merge openzfs/zfs@e61076683
Notable upstream pull request merges:
  #14744 Optimize check_filesystem() and process_error_log()
  #14773 Allow zhack label repair to restore detached devices
  #14794 zpool import -m also removing spare and cache when log device
         is missing
  #14805 Simplify and optimize random_int_between()
  #14813 Enable the head_errlog feature to remove errors
  #14816 Fix two abd_gang_add_gang() issues
  #14817 Verify block pointers before writing them out
  #14819 Add dmu_tx_hold_append() interface
  #14823 Remove single parent assertion from zio_nowait()
  #14824 Plug memory leak in zfsdev_state
  #14825 Block cloning dbuf fixes
  #14828 Remove duplicate code in l2arc_evict()
  #14837 Fixes in head_errlog feature with encryption
  #14839 Prevent panic during concurrent snapshot rollback and zvol read
  #14853 zil: Don't expect zio_shrink() to succeed

Obtained from:	OpenZFS
OpenZFS commit:	e610766838
2023-05-12 13:13:33 +02: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
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
Kyle Evans
087a2e64ba openzfs: re-enable FPU usage on aarch64
The BLAKE3 generated assembly files have now been updated to avoid
clobbering x18, we can safely re-enable FPU usage on aarch64.
2023-04-26 19:47:14 -05:00
Tino Reichardt
42f0ac5f1b Fix BLAKE3 aarch64 assembly for FreeBSD and macOS
The x18 register isn't useable within FreeBSD kernel space, so we
have to fix the BLAKE3 aarch64 assembly for not using it.

The source files are here: https://github.com/mcmilk/BLAKE3-tests

Reviewed-by: Kyle Evans <kevans@FreeBSD.org>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Closes #14728
2023-04-26 19:46:47 -05:00
Mateusz Guzik
d09a955a60 zfs: Fix positive ABD size assertion in abd_verify().
This cherry-picks upstream:
commit bba7cbf0a4
Author: Alexander Motin <mav@FreeBSD.org>
Date:   Wed Apr 26 12:20:43 2023 -0400

    Fix positive ABD size assertion in abd_verify().

    Gang ABDs without childred are legal, and they do have zero size.
    For other ABD types zero size doesn't have much sense and likely
    not working correctly now.

    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by:  Alexander Motin <mav@FreeBSD.org>
    Sponsored by:   iXsystems, Inc.
    Closes #14795

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-26 18:00:36 +00:00
Kyle Evans
ce5a210997 openzfs: arm64: implement kfpu_begin/kfpu_end
This is part one of a fix for booting with ZFS on arm64 using
accelerated checksum implementations.  Checksum benchmarking will
attempt to use the FPU, so we currently panic quickly on boot.  BLAKE3
is still broken, as it clobbers x18 and we promptly discover that fact
as soon as we attempt to fetch curthread in kfpu_end().

Note that _STANDALONE is special-cased here, but ideally we wouldn't be
building the code that uses kfpu_begin()/kfpu_end() at all in the loader
environment.

Discussed with:	imp (a bit)
Differential Revision:	https://reviews.freebsd.org/D39448
2023-04-26 12:24:00 -05:00
Justin Hibbits
cfaab41c95 irdma: Convert to IfAPI
Mostly mechanical changes, with some reworking in irdma_cm for iterating
over interfaces and addresses.  Further rework by Bartosz Sobczak.

Reviewed by:	bartosz.sobczak_intel.com
Tested by:	mateusz.moga_intel.com
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38960
2023-04-25 14:25:31 -04:00
Dimitry Andric
64b5d74fff zfs: make zfs_vfs_held() definition consistent with declaration
Noticed while attempting to change boolean_t into an actual bool: in
include/sys/zfs_ioctl_impl.h, zfs_vfs_held() is declared to return a
boolean_t, but in module/os/freebsd/zfs/zfs_ioctl_os.c it is defined to
return an int. Make the definition match the declaration.

Obtained from:	https://github.com/openzfs/zfs/commit/62cc9d4f6
Reviewed by:	jhb
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D39753
2023-04-25 19:58:17 +02:00
Mateusz Guzik
b0695c6abe zfs: Revert "Fix data race between zil_commit() and zil_suspend()"
This reverts commit 4c856fb333.

To quote a pending upstream PR:
This reverts commit 4c856fb to resolve a newly introduced deadlock which
in practice is more disruptive that the issue this commit intended to
address.

Causes deadlocks described in https://github.com/openzfs/zfs/issues/14775

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-25 16:01:22 +00:00
Allan Jude
c98ecfceb3 Add support for zpool user properties
Usage:

    zpool set org.freebsd:comment="this is my pool" poolname

Tests are based on zfs_set's user property tests.

Also stop truncating property values at MAXNAMELEN, use ZFS_MAXPROPLEN.

Reviewed by:	markj
Approved by:	markj
Co-authored-by:	Mateusz Piotrowski <0mp@FreeBSD.org>
Obtained from:	OpenZFS 8eae2d214c Add support for zpool user properties
Sponsored by:	Beckhoff Automation GmbH & Co. KG.
Sponsored by:	Klara Inc.
Differential Revision: https://reviews.freebsd.org/D39657
2023-04-25 17:23:07 +02:00
Mateusz Guzik
b4d3dd8615 zfs: fix up bogus checksums with blake3 in face of cpu migration
This is a temporary measure until a better fix is sorted out.

Upstream report: https://github.com/openzfs/zfs/issues/14785
Reported by:	Evgeniy Khramtsov
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-25 15:20:19 +00:00
John Baldwin
9b02f2daf4 powerpc: Use valid prototypes for function declarations with no arguments.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39733
2023-04-24 08:53:50 -07:00
Bjoern A. Zeeb
da8fa4e37a ath10k: import ath10k driver
Import ISC-licensed ath10k driver assumed to be
based on Linux kvalo/ath.git master at
6bae9de622d3ef4805aba40e763eb4b0975c4f6d.

Import support to redirect fwlogs to kernel messages
from https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/389075

Complement the driver to make compile on FreeBSD
using LinuxKPI with changes covered by #ifdef (__FreeBSD__).
Further select updates were applied since the initial import
in order to keep compiling along with other LinuxKPI based
drivers.

Any other native driver using BUS_PROBE_DEFAULT will attach
ignoring this one by default given bsd_probe_return is set
to a lower priority.

Add the module build framework.

We only support PCI parts.

The firmware is provided by port net/wifi-firmware-ath10k-kmod.

Given the lack of full license texts on most files this is
imported under the draft policy for handling SPDX files (D29226). [1]

Approved by:	core (emaste, 2022-04-08) [1]
MFC after:	2 months
2023-04-23 21:31:07 +00:00
Bjoern A. Zeeb
ebacd8013f athk: import common code for ath1?k drivers
Import common ISC-licensed athk parts assumed to be
based on Linux kvalo/ath.git master at
6bae9de622d3ef4805aba40e763eb4b0975c4f6d.

The only modification should be for FreeBSD module
handling in main.c.

Add the module build framework unconnected to the
build for now.

These files will be shared by ath1?k drivers.

MFC after:	2 months
2023-04-23 21:31:07 +00:00
Bjoern A. Zeeb
6c92544d7c mt76: import mediatek/mt76 driver
Import ISC-licensed driver parts of mediatek/mt76
assumed to be based on Linux wireless-testing at
a02411a5b98612c12be99349836d99f07db12a77 (tag: wt-2022-11-23).

Complement the driver and LinuxKPI with our own (dummy)
implementations of missing parts (util.h and soc/mediatek/)
as well as changes to make compile on FreeBSD with changes
covered by #ifdef (__FreeBSD__) conditions.
Further select updates were applied since the initial import
in order to keep compiling along with other LinuxKPI based
drivers.

For the moment we only target the mt7915 and mt7921 PCI parts.
More may follow in the future.

Firmware is provided by port net/wifi-firmware-mt76-kmod.

Given the lack of full license texts on non-local files this is
imported under the draft policy for handling SPDX files (D29226). [1]

Approved by:	core (emaste, 2022-04-08) [1]
MFC after:	2 months
2023-04-23 21:29:49 +00:00
Justin Hibbits
0468e89cb3 zfs/powerpc64: Fix big-endian powerpc64 asm
The powerpc asm from openzfs assumes that big-endian is always ELFv1 and
ELFv2 is always little-endian, while FreeBSD uses ELFv2 everywhere.  Add
the necessary bits to the checksum asm to work on big-endian ELFv2.

This was also submitted upstream as PR#14779.

Tested by:	dbaio
2023-04-22 11:27:49 -04:00
Bjoern A. Zeeb
7db7bfe1a7 iwlwifi: quieten more compiler warnings
Quieten some more (valid) gcc warnings and disable dead code.
There are more warnings, some probably a compiler problem, the
other related to firmware structs which I do not want to adjust
just locally.  Leave a comment to revisit after a next driver
update.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-04-20 16:07:05 +00:00
Mateusz Guzik
9c4e270822 zfs: fix up EINVAL from getdirentries on .zfs
PR:	270909
2023-04-20 08:38:28 +00:00
Mateusz Guzik
7ff3143809 zfs: add missing vn state transition for .zfs
Reported by:	des
2023-04-20 08:09:59 +00:00
Bjoern A. Zeeb
f621b087c0 iwlwifi: rtw88: rtw89: fix gcc warnings
Fix -Wno-format and unused variables warnings with gcc by adopting
(to|the) FreeBSD-specific code.

Reported by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	jhb
Differential Revision: https://reviews.freebsd.org/D39673
2023-04-19 12:21:40 +00:00
Pawel Jakub Dawidek
068913e4ba zfs: Add vfs.zfs.bclone_enabled sysctl.
Keep block cloning disabled by default for now, but allow to enable and
use it after setting vfs.zfs.bclone_enabled to 1, so people can easily
try it.

Approved by:	oshogbo
Reviewed by:	mm, oshogbo
Differential Revision:	https://reviews.freebsd.org/D39613
2023-04-17 03:38:30 -07:00
Pawel Jakub Dawidek
1959e122d9 zfs: Merge https://github.com/openzfs/zfs/pull/14739
The zfs_log_clone_range() function is never called from the
zfs_clone_range_replay() function, so I assumed it is safe to assert
that zil_replaying() is never TRUE here. It turns out zil_replaying()
also returns TRUE when the sync property is set to disabled.

Fix the problem by just returning if zil_replaying() returns TRUE.

Reported by: Florian Smeets
Signed-off-by: Pawel Jakub Dawidek pawel@dawidek.net

Approved by: oshogbo, mm
2023-04-17 02:22:56 -07:00
Pawel Jakub Dawidek
e0bb199925 zfs: cherry-pick openzfs/zfs@c71fe7164
Fix data corruption when cloning embedded blocks

Don't overwrite blk_phys_birth, as for embedded blocks it is part of
the payload.

Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Issue #13392
Closes #14739

Approved by: oshogbo, mm
2023-04-17 02:19:49 -07:00
Mateusz Guzik
63ee747feb zfs: Revert "ZFS_IOC_COUNT_FILLED does unnecessary txg_wait_synced()"
This reverts commit 519851122b.

It results in data corruption, see:
https://github.com/openzfs/zfs/issues/14753

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-15 21:34:54 +00:00
Mateusz Guzik
46ac8f2e7d zfs: don't use zfs_freebsd_copy_file_range
There is one data corruption problem reported and fixed upstream, not
cherry-picked here yet.

On top of it the following fires under load:
        VERIFY(zil_replaying(zfsvfs->z_log, tx));

The patch which introduced the entire machinery is a revert candidate,
but as the machinery came with a dedicated feature flag, doing so would
render affected pools read-only at best. To be figured out.

As a temporary bandaid at least stop the active usage.
Note this patch does not make the feature disappear from zpool upgrade.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-15 21:34:54 +00:00
John Baldwin
8e9db62e74 zfs: Appease set by unused warnings for spl_fstrans_*mark stubs.
Use a void cast to mark the cookie value as used in spl_fstrans_unmark.

Reported by:	GCC
Differential Revision:	https://reviews.freebsd.org/D39357
2023-04-10 10:36:14 -07:00
Konstantin Belousov
182b21d462 openzfs: adopt to the new vn_lock_pair() interface
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2023-04-08 02:37:56 +03:00
Mateusz Guzik
d6e2490134 zfs: disable kernel fpu usage on arm and aarc64
It is not implemented and causes panics on boot.

This is a temporary measure until someone(tm) sorts it out.

Reported by:	many
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-07 21:44:49 +00:00
Mateusz Guzik
20be1b4fc4 zfs: try to fallback early if can't do optimized copy
Not complete, but already shaves on some locking.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-07 15:47:45 +00:00
Mateusz Guzik
d012836fb6 zfs: fix up EXDEV handling for clone_range
API contract requires VOPs to handle EXDEV internally, worst case by
falling back to the generic copy routine. This broke with the recent
changes.

While here whack custom loop to lock 2 vnodes with vn_lock_pair, which
provides the same functionality internally. write start/finish around
it plays no role so got eliminated.

One difference is that vn_lock_pair always takes an exclusive lock on
both vnodes. I did not patch around it because current code takes an
exclusive lock on the target vnode. zfs supports shared-locking for
writes, so this serializes different calls to the routine as is, despite
range locking inside. At the same time you may notice the source vnode
can get some traffic if only shared-locked, thus once more this goes
the safer route of exclusive-locking. Note this should be patched to
use shared-locking for both once the feature is considered stable.

Technically the switch to vn_lock_pair should be a separate change, but
it would only introduce churn immediately whacked by the rest of the
patch.

[note: technically the review is still in progress, but so is the
active breakage]

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-07 15:46:20 +00:00
Mateusz Guzik
e2d997d1cb zfs: add missing vop_fplookup_vexec assignments
This happens to be a nop right now.
2023-04-06 15:20:40 +00:00
Martin Matuska
eb1feadc20 zfs: fix null ap->a_fsizetd NULL pointer derefernce
Submitted by:		rmacklem
Reported by:		cy
Tested by:		cy, mm
Reviewed by:		pjd, mm
Differential revision:	https://reviews.freebsd.org/D39418
2023-04-05 09:33:32 +02:00
Martin Matuska
91ef6f14f2 Revert "zfs: fall back if block_cloning feature is disabled"
This reverts commit 8ee579abe0.
2023-04-04 16:34:34 +02:00
Martin Matuska
8ee579abe0 zfs: fall back if block_cloning feature is disabled
If block_cloning is disabled, or other errors from zfs_clone_range()
return an EXDEV we should fall back to vn_generic_copy_file_range().

This fixes issues when copying files on the same dataset with
block_cloning disabled.

Upstreamed as pull request to OpenZFS.

Reviewed by:	Mateusz Guzik <mjguzik@gmail.com>
OpenZFS pull request:	14713
2023-04-04 13:43:34 +02:00
Martin Matuska
2a58b312b6 zfs: merge openzfs/zfs@431083f75
Notable upstream pull request merges:
  #12194 Fix short-lived txg caused by autotrim
  #13368 ZFS_IOC_COUNT_FILLED does unnecessary txg_wait_synced()
  #13392 Implementation of block cloning for ZFS
  #13741 SHA2 reworking and API for iterating over multiple implementations
  #14282 Sync thread should avoid holding the spa config write lock
         when possible
  #14283 txg_sync should handle write errors in ZIL
  #14359 More adaptive ARC eviction
  #14469 Fix NULL pointer dereference in zio_ready()
  #14479 zfs redact fails when dnodesize=auto
  #14496 improve error message of zfs redact
  #14500 Skip memory allocation when compressing holes
  #14501 FreeBSD: don't verify recycled vnode for zfs control directory
  #14502 partially revert PR 14304 (eee9362a7)
  #14509 Fix per-jail zfs.mount_snapshot setting
  #14514 Fix data race between zil_commit() and zil_suspend()
  #14516 System-wide speculative prefetch limit
  #14517 Use rw_tryupgrade() in dmu_bonus_hold_by_dnode()
  #14519 Do not hold spa_config in ZIL while blocked on IO
  #14523 Move dmu_buf_rele() after dsl_dataset_sync_done()
  #14524 Ignore too large stack in case of dsl_deadlist_merge
  #14526 Use .section .rodata instead of .rodata on FreeBSD
  #14528 ICP: AES-GCM: Refactor gcm_clear_ctx()
  #14529 ICP: AES-GCM: Unify gcm_init_ctx() and gmac_init_ctx()
  #14532 Handle unexpected errors in zil_lwb_commit() without ASSERT()
  #14544 icp: Prevent compilers from optimizing away memset()
         in gcm_clear_ctx()
  #14546 Revert zfeature_active() to static
  #14556 Remove bad kmem_free() oversight from previous zfsdev_state_list
         patch
  #14563 Optimize the is_l2cacheable functions
  #14565 FreeBSD: zfs_znode_alloc: lock the vnode earlier
  #14566 FreeBSD: fix false assert in cache_vop_rmdir when replaying ZIL
  #14567 spl: Add cmn_err_once() to log a message only on the first call
  #14568 Fix incremental receive silently failing for recursive sends
  #14569 Restore ASMABI and other Unify work
  #14576 Fix detection of IBM Power8 machines (ISA 2.07)
  #14577 Better handling for future crypto parameters
  #14600 zcommon: Refactor FPU state handling in fletcher4
  #14603 Fix prefetching of indirect blocks while destroying
  #14633 Fixes in persistent error log
  #14639 FreeBSD: Remove extra arc_reduce_target_size() call
  #14641 Additional limits on hole reporting
  #14649 Drop lying to the compiler in the fletcher4 code
  #14652 panic loop when removing slog device
  #14653 Update vdev state for spare vdev
  #14655 Fix cloning into already dirty dbufs
  #14678 Revert "Do not hold spa_config in ZIL while blocked on IO"

Obtained from:	OpenZFS
OpenZFS commit:	431083f75b
2023-04-03 16:49:30 +02:00
Bjoern A. Zeeb
700acdc7b5 rtw89: fix -Wunused-but-set-variable
Fix a -Wunused-but-set-variable warning by adding the field to the
debug logging as is done for other versions handler functions.

MFC after:	3 days
2023-03-23 00:29:38 +00:00
Dimitry Andric
84f06098ef zfs: Use .section .rodata instead of .rodata on FreeBSD
In commit 0a5b942d4 the FreeBSD SECTION_STATIC macro was set to
".rodata". This assembler directive is supported by LLVM (as a
convenience alias for ".section .rodata") by not by GNU as.

This caused the FreeBSD builds that are done with gcc to fail.
Therefore, use ".section .rodata" instead, similar to the other
asm_linkage.h headers.

[mjg: cherry-picked from upstream zfs bf1bec394e
 to unbreak gcc12 build]

Reviewed-by: Mateusz Guzik <mjguzik@gmail.com>
Reviewed-by: Attila Fülöp <attila@fueloep.org>
Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Signed-off-by: Dimitry Andric <dimitry@andric.com>
Closes #14526
2023-03-13 13:48:05 +00:00
Brooks Davis
af0cc0b223 NgATM: Remove netgraph ATM support
Most ATM support was removed prior to FreeBSD 12.  The netgraph support
was kept as it was less intrusive, but it is presumed to be unused.

Reviewed by:	manu
Relnotes:	yes
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D38879
2023-03-09 18:04:02 +00:00
Roger Pau Monné
6f80738b22 xen: fetch dom0 video console information from Xen
It's possible for Xen to switch the video mode set by the boot loader,
so that the information passed in the kernel metadata is no longer
valid.  Fetch the video mode used by Xen using an hypercall and update
the medatada for the kernel to use the correct video mode.

Sponsored by: Citrix Systems R&D
2023-03-09 17:13:17 +01:00
John Baldwin
f4ea84cea2 krping: Use get_cyclecount for get_cycles.
This avoids having to duplicate identical MD code.

Reviewed by:	np, emaste
Differential Revision:	https://reviews.freebsd.org/D38971
2023-03-08 15:06:59 -08:00
Piotr Kubaj
e552cac3d7 powerpc64*: port mlx5, OFED, KTLS and krping
Summary:
This review ports mlx5 driver, kernel's OFED stack (userland is already enabled), KTLS and krping to powerpc64 and powerpc64le.

krping requires a small change since it uses assembly for amd64 / i386.

NOTE: On powerpc64le RDMA works fine in the userspace with libmlx5, but on powerpc64 it does not. The problem is that contrib/ofed/libmlx5/doorbell.h checks for SIZEOF_LONG but this macro exists on neither powerpc64* nor amd64. Thus, the file silently goes to the fallback function written for 32-bit architectures. It works fine on little-endian architectures, but causes a hard fail on big-endian. It's possible it may also cause some runtime issues on little-endian.
Thus, on powerpc64 I verified that RDMA works with krping.

Reviewers: #powerpc, hselasky

Subscribers: bdrewery, imp, emaste, jhibbits

Differential Revision: https://reviews.freebsd.org/D38786
2023-02-26 23:38:33 +01:00
Piotr Kubaj
f5a1c871e6 Revert "powerpc64*: port mlx5, OFED, KTLS and krping"
Wrong push, another commit was supposed to be pushed.

This reverts commit 83d6d8877e.
2023-02-26 00:57:41 +01:00
Piotr Kubaj
83d6d8877e powerpc64*: port mlx5, OFED, KTLS and krping
Summary:
This review ports mlx5 driver, kernel's OFED stack (userland is already enabled), KTLS and krping to powerpc64 and powerpc64le.

krping requires a small change since it uses assembly for amd64 / i386.

NOTE: On powerpc64le RDMA works fine in the userspace with libmlx5, but on powerpc64 it does not. The problem is that contrib/ofed/libmlx5/doorbell.h checks for SIZEOF_LONG but this macro exists on neither powerpc64* nor amd64. Thus, the file silently goes to the fallback function written for 32-bit architectures. It works fine on little-endian architectures, but causes a hard fail on big-endian. It's possible it may also cause some runtime issues on little-endian.
Thus, on powerpc64 I verified that RDMA works with krping.

Reviewers: #powerpc, hselasky

Subscribers: bdrewery, imp, emaste, jhibbits

Differential Revision: https://reviews.freebsd.org/D38786
2023-02-26 00:56:37 +01:00
Mark Johnston
6f48a4acbe ck_queue: add CK_*_FOREACH_FROM
This is a variant of CK_*_FOREACH from FreeBSD queue.h which starts
iteration at the specified item.  If the item pointer is NULL, iteration
starts from the beginning of the list.

Upstream commit 74366be35a6f4635f248a3c62d2d23245a4eb0f4.

MFC after:	2 weeks
Sponsored by:	Klara, Inc.
2023-02-25 10:34:06 -05:00
Allan Jude
8b04c1cbfc Fix per-jail zfs.mount_snapshot setting
When jail.conf set the nopersist flag during startup, it was
incorrectly destroying the per-jail ZFS settings.

PR:	260160
Reported by:	imp (previous version), mm (upstream), freqlabs (upstream)
MFC after:	immediately
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D38662
2023-02-21 22:42:28 +00:00
Xin LI
e37bb444aa MFV: zlib 1.2.13.
Relnotes:	yes
MFC after:	3 days
2023-02-16 23:57:24 -08:00
Martin Matuska
c9539b8901 zfs: merge openzfs/zfs@57cfae4a2 (master)
Notable upstream pull request merges:
  #13816 Fix a race condition in dsl_dataset_sync() when
         activating features
  #14402 Prefetch on deadlists merge
  #14410 Improve resilver ETAs
  #14428 Resilver performance tuning
  #14439 Resolve WS-2021-0184 vulnerability in zstd
  #14440 EIO caused by encryption + recursive gang
  #14448 Fix console progress reporting for recursive send
  #14454 Improve arc_read() error reporting
  #14460 Restore FreeBSD to use .rodata
  #14474 Reduce need for contiguous memory for ioctls

Obtained from:	OpenZFS
OpenZFS commit:	57cfae4a2f
2023-02-16 22:38:51 +01:00