Commit graph

2506 commits

Author SHA1 Message Date
Warner Losh
3ae56f659a Revert "ophgo: import new .dts"
This reverts commit b55d106df9.

Per request of original author, manu, and mmel, revert this
change. While this is a genuinely cool device, there's some issues that
need to be sorted out before moving forward:

o Imported dt-bindings that weren't used and could interfere in the
  future.
o no platform code for sophgo, though it likely needs it
o Potential interference from the dts/dtsi files imported for future
  linux device-tree imports. These are the dts files from the vendor
  sdk, and history has down often upstream introduces enough change
  that keeping them here in the mean time lays the groundwork for
  merge conflicts in the future.

That makes this import premature.  Revert until it's more mature.
2026-01-10 08:08:30 -07:00
Martin Filla
b55d106df9 ophgo: import new .dts
Some checks are pending
Cross-build Kernel / amd64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / amd64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / amd64 macos-latest (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 macos-latest (clang-18) (push) Waiting to run
Signed-off-by: Martin Filla <freebsd@sysctl.cz>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1844
2026-01-09 22:05:38 -07:00
Dimitry Andric
eb1b6ec7a7 zfs: emit .note.GNU-stack section for all ELF targets
On FreeBSD, linking the zfs kernel module with binutils ld 2.44 shows
the following warning:

    ld: warning: aesni-gcm-avx2-vaes.o: missing .note.GNU-stack section implies executable stack
    ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker

Some of the `.S` files under `module/icp/asm-x86_64/modes` check whether
to emit the `.note.GNU-stack` section using:

    #if defined(__linux__) && defined(__ELF__)

We could add `&& defined(__FreeBSD__)` to the test, but since all other
`.S` files in the OpenZFS tree use:

    #ifdef __ELF__

it would seem more logical to use that instead. Any recent ELF platform
should support these note sections by now.

Reviewed by:	emaste, kib, imp
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D54578
2026-01-08 09:51:36 +01:00
Dimitry Andric
bcd9ea853b zfs: rename several printf attribute declarations to __printf__
For kernel builds, we redefine `__printf__` to `__freebsd_kprintf__`, to
support FreeBSD kernel printf(9) extensions with clang.

In OpenZFS various printf related functions are declared with
__attribute__((format(printf, X, Y))), so these won't work with the
above redefinition. With clang 21 and higher, this leads to errors
similar to:

    sys/contrib/openzfs/module/zfs/spa_misc.c:414:38: error: passing 'printf' format string where 'freebsd_kprintf' format string is expected [-Werror,-Wformat]
      414 |         (void) vsnprintf(buf, sizeof (buf), fmt, adx);
          |                                             ^

Since attribute names can always be spelled with leading and trailing
double underscores, rename these instances.

Note that in FreeBSD proper we usually use `__printflike` from
<sys/cdefs.h>, but that does not apply to OpenZFS.

Reviewed by:	emaste
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D54388
2025-12-30 13:50:45 +01:00
Martin Matuska
546d3d08e5 zfs: merge openzfs/zfs@962e68865
Notable upstream pull request merges:
 #16307 1d43387dd zdb: Add -O option for -r to specify object-id
 #17965 a62c62120 ARC: Pre-convert zfs_arc_min_prefetch_ms
 #17970 d393166c5 ARC: Increase parallel eviction batching
 #17981 20f09eae4 ZIO: ZIO_STAGE_DDT_WRITE is a blocking stage
 #17983 ff47dd35e Fix ddtprune causing space leak
 #18015 86b064469 FreeBSD: Fix a potential null dereference
                  in zfs_freebsd_fsync() (already merged)
 #18020 ff47dd35e Ensure 64-bit `off_t` is used in user space
                  instead of `loff_t`
 #18028 09492e0f2 Reduce dataset buffers re-dirtying
 #18033 f72fd378c Defer async destroys on pool import
 #18043 3d76ba273 Improve async destroy processing timing
 #18044 46d6f1fe5 DDT: Move logs searches out of the lock
 #18047 ff5414406 DDT: Switch to using ZAP _by_dnode() interfaces
 #18048 3b1ff816b DDT: Add/use zap_lookup_length_uint64_by_dnode()
 #18055 22e89aca8 DDT: Fix compressed entry buffer size
 #18059 0550abd4b RAIDZ: Remove some excessive logging
 #18060 a83bb15fc Reduce minimal scrub/resilver times
 #18061 962e68865 Use reduced precision for scan times
 #18063 051a8c749 Bypass snprintf() in quota checks if no quotas set
 #18064 7ff329ac2 Fix rangelock test for growing block size

Obtained from:	OpenZFS
OpenZFS commit:	962e68865e
2025-12-19 21:45:10 +01:00
Jung-uk Kim
1efb6541c6 acpica: Merge ACPICA 20251212
Some checks are pending
Cross-build Kernel / amd64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / amd64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / amd64 macos-latest (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 macos-latest (clang-18) (push) Waiting to run
Merge commit '5cab380e2a2644aaa920b93f1580a1cfc803a8de'
2025-12-19 00:43:14 -05:00
Mark Johnston
fa259d156d zfs: Merge commit 86b064469d from OpenZFS
FreeBSD: Fix a potential null dereference in zfs_freebsd_fsync()

  In general it's possible for a vnode to not have an associated VM
  object.  This happens in particular with named pipes, which have
  some distinct VOPs, defined in zfs_fifoops.  Thus, this chunk of
  zfs_freebsd_fsync() needs to check for the FIFO case, like other
  vm_object_mightbedirty() callers do.

  (Note that vn_flush_cached_data() calls are predicated on
  zn_has_cached_data() returning true, and it checks for a NULL v_object
  pointer already.)

  Fixes: ef4058fcdc
  Reported-by: Collin Funk <collin.funk1@gmail.com>
  Reviewed-by: Sean Eric Fagan <sef@FreeBSD.org>
  Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
  Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
  Signed-off-by: Mark Johnston <markj@FreeBSD.org>
  Closes #18015

MFC after:	3 days
2025-12-14 17:44:37 +00:00
Martin Matuska
66e8575559 zfs: merge openzfs/zfs@89f729dcc
Notable upstream pull request merges:
 #17932 1f3444f2b zpool: fix special vdev -v -o conflict
 #17934 -multiple Remove libuutil
 #17941 88d012a1d Fix snapshot automount expiry cancellation deadlock
 #17942 36e4f1888 Fix taskq NULL pointer dereference on timer race
 #17946 39303feba chksum: run 256K benchmark on demand, preserve
                  chksum_stat_data
 #17948 -multiple Remove libtpool
 #17957 e37937f42 ztest: fix broken random call
 #17960 928eccc5b DDT: Reduce global DDT lock scope during writes
 #17961 48f33c1ef DDT: Make children writes inherit allocator
 #17975 7f7d4934c FreeBSD: Fix uninitialized variable error
 #17980 a5b665df3 DDT: Switch to using wmsums for lookup stats
 #18004 ffaea0831 FreeBSD: Remove HAVE_INLINE_FLSL use

Obtained from:	OpenZFS
OpenZFS commit:	89f729dcca
2025-12-07 22:38:13 +01:00
Bjoern A. Zeeb
9c2f321630 ath11k: start making compile some more
There is more work to do to make this compile again but we will do that
when we get to the driver.  For now just take the most noise out of it.
2025-12-06 10:21:31 +00:00
Bjoern A. Zeeb
c95ea407b3 ath11k: update Atheros/QCA's ath11k driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
7d0a66e4bb9081d75c82ec4957c50034cb0ea449 ( tag: v6.18 ).

Merge commit '989a88787ef2c1a73f44b82031a6f4f4470e2676'

Sponsored by:   The FreeBSD Foundation
2025-12-06 10:16:36 +00:00
Bjoern A. Zeeb
9954217599 ath10k: update Atheros/QCA's ath10k driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
7d0a66e4bb9081d75c82ec4957c50034cb0ea449 ( tag: v6.18 ).

Merge commit 'f4669ef6cf7860919442e67106e83f616ed36f51'.

Sponsored by:	The FreeBSD Foundation
2025-12-06 09:51:10 +00:00
Bjoern A. Zeeb
28125d24c9 ath-common: update common Atheros/QCA code
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
e5f0a698b34ed76002dc5cff3804a61c80233a7a ( tag: v6.17 ).

Merge commit '99ad6f4f54c86845d6e3f03541913c07fcdeef59'
2025-12-06 09:47:42 +00:00
Bjoern A. Zeeb
8b4477f6b8 rtw88: update Realtek's rtw88 driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
7d0a66e4bb9081d75c82ec4957c50034cb0ea449 ( tag: v6.18 ).

Merge commit 'e543442afe3ad5b27616575be2d2402b988656eb' into rtw88

Sponsored by:	The FreeBSD Foundation
2025-12-06 09:41:49 +00:00
Bjoern A. Zeeb
853e0440c9 mt76: add LINUXKPI_PARAM_PREFIX for module_param*
In order to not overwrite sysctl/tunables under compat.linuxkpi
we need to prefix the module_param* names with a per-driver/file
designator to make them (more) uniq.  Add the FreeBSD specific
LINUXKPI_PARAM_PREFIX defines for that where missing in mt76.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-12-03 19:54:45 +00:00
Bjoern A. Zeeb
9492230fd3 mt76: util.h: extend worker name
In mt76_worker_setup() add the "name" argument to the description
for the worker thread.  That way we have a chance to keep them apart.

While here, rename a variable and shorten the the (c)/SPDX section
according to new style.

MFC after:	3 days
2025-12-03 19:54:44 +00:00
Bjoern A. Zeeb
c67fd35e58 mt76: ieee80211_is_first_frag() operates on the seq_ctrl field not on fc.
Pass the correct field to ieee80211_is_first_frag(); otherwise the results
may vary.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
X-To-Upstream:	yes
2025-12-03 19:54:44 +00:00
Konstantin Belousov
1ecf01065b libuvmem: usermode port of vmem(9)
The quantum cache is disabled, there is no uma.

Intent is to use this for resource allocation in bhyve(8), for start.
Addition of -luvmem to bhyve linking was done to test changes to share/mk.

Reviewed by:	bnovkov, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27220
2025-12-02 05:41:13 +02:00
Warner Losh
3e69618d4b openzfs: We are FreeBSD, not posix.
Partially revert:
99d7453b43
which introduced this file upstream. This causes this definition to be
preferred for all builds. Make the smallest change possible to this file
to change the default to FreeBSD. We're talking to the upstraem folks
about the right fix. Feel free to revert this in the future, so long as
`bectl activate -t` still works properly afterwards.

Sponsored by:		Netflix
2025-11-26 14:01:05 -07:00
Emmanuel Vadot
55de86dac8 dts: Revert its addition for rk356x
Rockchip have two erratas (#3568001 and #3568002) for the GIC on RK356x.

Until we have a way to handle them revert the changes that uses ITS instead of
GIC for PCIe.
2025-11-22 18:32:54 +01:00
Emmanuel Vadot
833e5d42ab Import device-tree files from Linux 6.17 2025-11-22 12:29:29 +01:00
Emmanuel Vadot
ae5de77ed7 Import device-tree files from Linux 6.16 2025-11-22 12:28:38 +01:00
Emmanuel Vadot
8ccc0d235c Import device-tree files from Linux 6.15 2025-11-22 12:26:43 +01:00
Emmanuel Vadot
2846c90520 Import device-tree files from Linux 6.14 2025-11-22 12:21:01 +01:00
Emmanuel Vadot
5f62a964e9 Import device-tree files from Linux 6.13 2025-11-22 12:19:36 +01:00
Bjoern A. Zeeb
9040277864 iwlwifi/mld: only get tid after checking that it is a dataqos frame
Like we did for mvm, only get the tid after all the other checks are
done by the function in order to not trigger an assert.  Linux will
likely return a random value there which later is not used as the
driver does an early return.  In LinuxKPI we do check that the frame
assumptions hold up, which does not go so well for a random frame.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
PR:		290808
2025-11-19 02:25:38 +00:00
Martin Matuska
bb8580e7a6 zfs: fix cross-build after openzfs/zfs@e63d026b9d
Workaround multiple cross-build issues in OpenZFS code

TBD: discuss long-term fix with OpenZFS
2025-11-17 17:12:03 +01:00
Martin Matuska
4303bde429 zfs: fix build after openzfs/zfs@e63d026b9
Fix Makefiles
Update zfs_config.h and zfs_gitrev.h
2025-11-17 17:11:56 +01:00
Martin Matuska
8ac904ce09 zfs: merge openzfs/zfs@e63d026b9
Notable upstream pull request merges:
 #17477 02fdd26e5 Add knob to disable slow io notifications
 #17792 d0294aa75 Update dnode_next_offset_level to accept blkid instead
                  of offset
 #17824 8c225ff1b Fix gang write late_arrival bug
 #17861 -multiple Lift userspace definitions out of zfs_context.h
 #17872 dcada084b Pass flags to more DMU write/hold functions
 #17875 ec268cdf9 Fix caching of DDT log and BRT
 #17875 ea125eeb5 BRT: Round bv_entcount up to BRT_BLOCKSIZE
 #17877 6cfc3dba9 Cleanup ZIO_FLAG_IO_RETRY vs TRYHARD usage
 #17885 e63d026b9 cmd/zpool cstyle issues
 #17890 b4f073b5a Add BRT support to zpool prefetch command
 #17903 baefe098e ZIO: Set minimum number of free issue threads to 32
 #17906 6e12f0bd7 spa_misc: add an API for spa_namespace_lock
 #17908 e26b9fc87 FreeBSD: Add support for _PC_CASE_INSENSITIVE
 #17911 -multiple Update library ABI versions for v2.4.0
 #17915 8aaed7dc4 BRT: Fix ranges to blocks conversion math
 #17916 cc5cae547 BRT: Increase block size from 4KB to 8KB
 #17921 72b2a9571 ZAP: Remove dmu_object_info_from_dnode() call

Obtained from:	OpenZFS
OpenZFS commit:	e63d026b91
2025-11-17 17:11:32 +01:00
Warner Losh
3c5ca68b9b stand: Fix secureboot build
Some checks are pending
Cross-build Kernel / amd64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / amd64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / amd64 macos-latest (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 macos-latest (clang-18) (push) Waiting to run
Make libesecureboot build, enabled when WITH_BEARSSL=y
WITH_LOADER_EFI_SECUREBOOT=y.

Copy EDK2 files related to secure boot to sys/contrib/edk2 and delete
duplicates under libsecreboot/efi/include.
Adjust efi_variables.c to build in the new environment.

Undefine MIN and MAX before include sys/param.h in libsecureboot.h. I'm
not sure that sys/param.h is needed here, but either the param.h or the
Base.h definitions are fine.

Fix include paths to reflect the new way.

Fixes:		43b8edb320
Sponsored by:	Netflix
2025-11-16 22:58:36 -07:00
Warner Losh
c570deb1cc edk2: Import UefiCpuPkg/Include/Protocol/RiscVBootProtocol.h
Import UefiCpuPkg/Include/Protocol/RiscVBootProtocol.h to
Include/Protocol. This is another direct copy that needs to be carefully
considered in future imports. For now, it's easier to add this
incrementally here.

Sponsored by:		Netflix
2025-11-16 22:08:22 -07:00
Warner Losh
499d2ed109 Base.h: Ifdef out always char purity test.
Some checks are pending
Cross-build Kernel / amd64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / amd64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / amd64 macos-latest (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 macos-latest (clang-18) (push) Waiting to run
Now that we've moved to always using this, it turns out the the funky
thing we have for L'a' is everywhere. Removing this check until I can
sort it out. This breaks the build on armv7 otherwise.

Fixes:		43b8edb320
Sponsored by:	Netflix
2025-11-16 19:42:24 -07:00
Warner Losh
af6d77c0bd edk2: Bring in Guid/Fdt.h
This one is from EmbeddedPkg/Include/Guid/Fdt.h, which is our first
EmbeddedPkg addition. For the moment, I'm doing this as an ad-hoc basis,
but in the next import may need to reconsider the strategy.

Sponsored by:		Netflix
2025-11-16 16:55:13 -07:00
Warner Losh
1aa241b4ee tpm20: Bring in the edk2 includes for TPM 2.0 support
Some checks are pending
Cross-build Kernel / amd64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / amd64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / amd64 macos-latest (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 macos-latest (clang-18) (push) Waiting to run
Bring these in from edk2-stable202502. They will be used in a
forthcoming TPM 2.0 support code.

Sponsored by:		Netflix
2025-11-16 11:29:04 -07:00
Warner Losh
f439973d67 edk2: Pull in more headers from edk2
Pull in more headers from edk2-stable202502 that will be needed as we
transition the building to using only EDK2 headers in the boot loader,
finally ditching our home-grown ones from a super-obsolete SDK from the
early days of EFI.

Note to future importers: My apologies if this not being a mege commit
causes problems. Except for ProcessorBind.h, all files should be exactly
as we got them from EDK2, and if that breaks the build on future
imports, we should adjust our code.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D53654
2025-11-16 11:29:03 -07:00
Warner Losh
473786a131 edk2: Tweak the tests for UEFI Specification Data Type requirements
On x86 these trigger for 32-bit builds. We only ever (will) do that for
the 32-bit loader that starts a 64 bit kernel for ia32. For the moment,
take the training wheels off, though most likely some compile flags need
to be used to change the i386 ABI to force *int64_t alignment to 64
bits or some other horror as yet ill-concieved. Despite this assertion,
the ia32 to boot 64-bit kernels loaders seem to work.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D53653
2025-11-16 11:29:03 -07:00
Warner Losh
67c7e94315 edk2: Move ProcessorBind.h to contrib/edk2
Have our own ProcessorBind.h. It just includes sys/efi-edk2.h, but
undefines TRUE, FALSE and MAC. The first two are from acpica and are
redefined to something almost the same. MAC is a global option that,
well, interferes with using EDK2, dangit. I suppose I should redefine it
after, but I don't think you can save the value of a pre-processor
variable.

This breaks a little with the tradition of having this in a seprate
directory and using build magic. However, the build is already magical
enough and having this here makes things less magical. Also, EDK2 puts
this in a processor specific directory, so we won't have conflicts (they
need it there since they run on more processors than we do: we can just
include sys/efi-edk2.h which covers the smallar variance we have in
processors).

Sponsored by:		Netflix
2025-11-16 11:29:03 -07:00
Marco Devesas Campos
70e73c43a4 vchiq: add compat_freebsd32 ioctls and respective datatypes
Submitted by: Marco Devesas Campos <devesas.campos@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D37879
2025-11-14 19:27:51 -08:00
Marco Devesas Campos
aa6b871ea7 arm64: Add support to vchiq and bcm2835_audio (plus some fixes)
Add 64 bit support to vchiq:

 * update fields to the appropriate fixed bit-size variants (everywhere [cf. e.g., ref:sizes and ref:sizes2])
 * refer to event semaphores (that go into the very 32 bit VC) by offset instead of pointers [ref:sems]
 * dsb() is dsb(sy) in arm64 (vchiq_{core.c,core.h,kmod.c}) [ref:dsb]
 * comment out some unneeded code in parse_rx_slots around VCHIQ_MSG_BULK_RX (cf. [ref:deadcode])
 * adapt remote_event_signal to arm64 caching behaviours (vchiq_kmod.c)
 * refactor synchronization around remote_event_signal, forcing a wmb to be on the safe side; thereby make it look more like what linux does [ref:sync] (vchiq_{core,kmod}.c); and make a comment in vchiq_core.c true (wasn't before)
 * add a few more syncs to be on the safe side (vchiq_2835_arm.c)
 * use arm64 dcache invalidation mechanisms (vchiq_2835_arm.c)
 * explicitly invalidate pages on arm64 post bulk-read (vchiq_2835_arm.c)
 * support bulk transfers on rpi-4 (aka "long address space" transfers), by hard-coding their vc offset (0) and different bit-shift [ref:longbulk] (vchiq_2835_arm.c)
 * refactor a loop-of-constant-test (vchiq_2835_arm.c)
 * use the correct (hard-coded) cache-line size on arm64
 * rework the handling of chipset "features" to account for the extra behaviours with 64 bit chipsets. (vchiq_kmod.c)
 * add sysctl-s (log, arm_log) to control debug (vchiq_kmod.c)
 * add example kernel config (GENERIC-VCHIQ)

Fixes:

 * Rework error handling in create_pagelist, avoiding a potential panic when
   freeing memory that had been dmamem_alloc, a potential null dereference,
   and a leak when having problems pinning pages (vchiq_2835_arm.c)
 * fix a confusion about the behaviour cv_wait_sig that lead to
   uninterruptible looping (vchiq_bsd.c)
 * implement detection of fatal signals (vchiq_bsd.c)
 * fix a confusion with the name of a variable introduced by #a0b8746
   that could lead to a panic when closing the cdev file (vchiq_arm.c)
 * release user connection when destructing cdevpriv and avoid user processes
   sharing connection data, which lead to stalls and data corruption. (vchiq_arm.c)

Update bcm2835_audio to work on 64bit systems:

 * update VC audio fields (vc_vchi_audioserv_defs.h, bcm2835_audio.c)
 * repurpose the hitherto unused callback field to help push a 64 bit pointer in (bcm2835_audio.c)
 * increase (hopefully) the robustness of the code that shifts data to VC (bcm2835_audio.c)
 * add a sysctl to control the amount of debugging info output by bcm2835_audio.c

Tested on zero, zero2 and 4+ with ping, functional, bulk and control vchiq_test-s, and omxplayer

  [ref:dsb]: 35b7ebda57
  [ref:sems]: 24a4262afb
  [ref:sizes]: e64568b8ea
  [ref:sizes2]: f9bee6dd24
  [ref:deadcode]: 14f4d72fb7
  [ref:sync]: 51c0712650
  [ref:longbulk]: 37f6f19a83

Differential Revision:	https://reviews.freebsd.org/D37878
Submitted by: Marco Devesas Campos <devesas.campos@gmail.com>
2025-11-14 19:27:46 -08:00
Adrian Chadd
0726d6e87a vchiq: fix compilation error on armv7 in CI and local armv7 builds
This happens in CI and on local armv7 builds, but not when I cross
compile to armv7 locally.

> /usr/src/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c:549:71: error: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Werror,-Wformat]
>   549 |                 "free_pagelist - %zx, %d (%u bytes @%p)", (size_t)pagelist, actual, pagelist->length, bi->buf);

So just be very specific about the printf types and explicitly
cast things.
2025-11-01 10:23:12 -07:00
Marco Devesas Campos
8b43286fc3 vchiq: fix another logging format string for 32/64 bit
This is from work from https://reviews.freebsd.org/D37878.

Submitted by: Marco Devesas Campos <devesas.campos@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D53372
2025-10-29 17:48:12 -07:00
Adrian Chadd
1d100747d7 vchiq: update printf-s to more architecture-independent format specifiers
Some checks are pending
Cross-build Kernel / amd64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / amd64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / amd64 macos-latest (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 macos-latest (clang-18) (push) Waiting to run
This migrates a bunch of format strings to compile on both 32 and
64 bit platforms.

This should be a no-op, and it isn't yet used by a 64 bit kernel build
as the 64 bit changes to vchiq are not yet in the tree.

Differential Revision:	https://reviews.freebsd.org/D36431
Submitted by: Marco Devesas Campos <devesas.campos@gmail.com>
2025-10-26 15:47:59 -07:00
Martin Matuska
e6e941e659 zfs: merge openzfs/zfs@0455150f1
Notable upstream pull request merges:
 #17836 adacf020c Fix return value for setting zvol threading
 #17839 44704616b zpool: fix conflict with -v and -o options
 #17851 3a55e76b8 FreeBSD: zfs_getpages: Don't zero freshly allocated pages
 #17863 0455150f1 FreeBSD zio_crypt.c: initialize uio variables before
                  access

Obtained from:	OpenZFS
OpenZFS commit:	0455150f11
2025-10-25 10:01:38 +02:00
Bjoern A. Zeeb
14b53301e8 mt76: update Mediatek's mt76 driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
e5f0a698b34ed76002dc5cff3804a61c80233a7a ( tag: v6.17 ).

MFC after:	3 days
2025-10-23 21:26:07 +00:00
Bjoern A. Zeeb
354a030185 rtw89: update Realtek's rtw89 driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
e5f0a698b34ed76002dc5cff3804a61c80233a7a ( tag: v6.17 ).

MFC after:	3 days
2025-10-23 21:26:04 +00:00
Bjoern A. Zeeb
eb15fdb1b7 rtw88: update Realtek's rtw88 driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
e5f0a698b34ed76002dc5cff3804a61c80233a7a ( tag: v6.17 ).

MFC after:	3 days
2025-10-23 21:26:02 +00:00
Bjoern A. Zeeb
6b627f8858 iwlwifi: update Intel's mvm/mld drivers
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
e5f0a698b34ed76002dc5cff3804a61c80233a7a ( tag: v6.17 ).

Some of the changes we reported upstream got incorporated in this
(or the v6.16) release.

This also includes a change from iwlwifi-next.git::next for missing symbols

iwl_mvm_v3_rate_from_fw() and iwl_mvm_v3_rate_to_fw() were originally
comitted to mvm/rs.[ch] which we do not have.  That left us with
unresolved symbols.  For the never comitted v6.16 driver update I had
started to piece these together but they have been migrated out to
utils.c so take them from there until the next release hopefully ships
this change.

Obtained from:	git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git
	branch next, 1b49af228594452206d5c50a33b6a341428edb63

MFC after:	3 days
2025-10-23 21:26:00 +00:00
Jean-Sébastien Pédron
b596b44965
zfs: zfs_getpages: Don't zero freshly allocated pages
Initially, `zfs_getpages()` is provided with an array of busy pages by
the vnode pager. It then tries to acquire the range lock, but if there
is a concurrent `zfs_write()` running and fails to acquire that range
lock, it "unbusies" the pages to avoid a deadlock with `zfs_write()`.
After that, it grabs the pages again and retries to acquire the range
lock, and so on.

Once it got the range lock, it filters out valid pages, then copy DMU
data to the remaining invalid pages.

The problem is that freshly allocated zero'd pages it grabbed itself are
marked as valid. Therefore they are skipped by the second part of the
function and DMU data is never copied to these pages. This causes mapped
pages to contain zeros instead of the expected file content.

This was discovered while working on RabbitMQ on FreeBSD. I could
reproduce the problem easily with the following commands:

    git clone https://github.com/rabbitmq/rabbitmq-server.git
    cd rabbitmq-server/deps/rabbit

    gmake distclean-ct RABBITMQ_METADATA_STORE=mnesia \
      ct-amqp_client t=cluster_size_3:leader_transfer_stream_send

The testsuite fails because there is a sendfile(2) that can happen
concurrently to a write(2) on the same file. This leads to sendfile(2)
or read(2) (after the sendfile) sending/returning data with zeros, which
causes a function to crash.

The patch consists of not setting the `VM_ALLOC_ZERO` flag when
`zfs_getpages()` grabs pages again. Then, the last page is zero'd if it
is invalid, in case it would be partially filled with the end of the
file content. Other pages are either valid (and will be skipped) or they
will be entirely overwritten by the file content.

This patch was submitted to OpenZFS as openzfs/zfs#17851 which was
approved.

Reviewed by:	avg, mav
Obtained from:	OpenZFS
OpenZFS commit:	8a3533a366e6df2ea770ad7d80b7b68a94a81023
MFC after:	3 days
Differential revision: https://reviews.freebsd.org/D53219
2025-10-20 21:16:43 +02:00
Martin Matuska
6e6cde8f2b zfs: merge openzfs/zfs@6ae99d269
Notable upstream pull request merges:
 #17750 6e5b836e9 FreeBSD: Correct _PC_MIN_HOLE_SIZE
 #17803 1861a329f zvol: verify IO type is supported
 #17826 51de2d76f Explicit set ashift for non-leaf vdevs
 #17830 f4276479c Suppress some ashift warnings
 #17843 6ae99d269 mmap_seek: print error code and text on failure

Obtained from:	OpenZFS
OpenZFS commit:	6ae99d2692
2025-10-20 12:30:00 +02:00
Konstantin Belousov
3613896984 knotes: kqueue: handle copy for trivial filters
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D52045
2025-10-18 08:12:37 +03:00
Ed Maste
654a3aa9a1 zfs: Emit warning upon use of legacy sysctls
The introduction of OpenZFS moved some sysctls, and legacy compat shims
were added.  For example:

Old (legacy) name: vfs.zfs.min_auto_ashift
New name:          vfs.zfs.vdev.min_auto_ashift

Upstream OpenZFS removed these, but we've temporarily restored them in
FreeBSD.

Note that l2arc sysctls use generic sysctl functions (e.g. SYSCTL_UQUAD)
and thus cannot trivially have warnings added, so they are not handled.

PR:		266374
Reviewed by:	jlduran
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53033
2025-10-16 12:34:15 -04:00