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.
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
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
Notable upstream pull request merges:
#163071d43387dd zdb: Add -O option for -r to specify object-id
#17965a62c62120 ARC: Pre-convert zfs_arc_min_prefetch_ms
#17970d393166c5 ARC: Increase parallel eviction batching
#1798120f09eae4 ZIO: ZIO_STAGE_DDT_WRITE is a blocking stage
#17983ff47dd35e Fix ddtprune causing space leak
#1801586b064469 FreeBSD: Fix a potential null dereference
in zfs_freebsd_fsync() (already merged)
#18020ff47dd35e Ensure 64-bit `off_t` is used in user space
instead of `loff_t`
#1802809492e0f2 Reduce dataset buffers re-dirtying
#18033f72fd378c Defer async destroys on pool import
#180433d76ba273 Improve async destroy processing timing
#1804446d6f1fe5 DDT: Move logs searches out of the lock
#18047ff5414406 DDT: Switch to using ZAP _by_dnode() interfaces
#180483b1ff816b DDT: Add/use zap_lookup_length_uint64_by_dnode()
#1805522e89aca8 DDT: Fix compressed entry buffer size
#180590550abd4b RAIDZ: Remove some excessive logging
#18060a83bb15fc Reduce minimal scrub/resilver times
#18061962e68865 Use reduced precision for scan times
#18063051a8c749 Bypass snprintf() in quota checks if no quotas set
#180647ff329ac2 Fix rangelock test for growing block size
Obtained from: OpenZFS
OpenZFS commit: 962e68865e
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
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
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
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
e5f0a698b34ed76002dc5cff3804a61c80233a7a ( tag: v6.17 ).
Merge commit '99ad6f4f54c86845d6e3f03541913c07fcdeef59'
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
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
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
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
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
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
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.
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
Notable upstream pull request merges:
#1747702fdd26e5 Add knob to disable slow io notifications
#17792d0294aa75 Update dnode_next_offset_level to accept blkid instead
of offset
#178248c225ff1b Fix gang write late_arrival bug
#17861 -multiple Lift userspace definitions out of zfs_context.h
#17872dcada084b Pass flags to more DMU write/hold functions
#17875ec268cdf9 Fix caching of DDT log and BRT
#17875ea125eeb5 BRT: Round bv_entcount up to BRT_BLOCKSIZE
#178776cfc3dba9 Cleanup ZIO_FLAG_IO_RETRY vs TRYHARD usage
#17885e63d026b9 cmd/zpool cstyle issues
#17890b4f073b5a Add BRT support to zpool prefetch command
#17903baefe098e ZIO: Set minimum number of free issue threads to 32
#179066e12f0bd7 spa_misc: add an API for spa_namespace_lock
#17908e26b9fc87 FreeBSD: Add support for _PC_CASE_INSENSITIVE
#17911 -multiple Update library ABI versions for v2.4.0
#179158aaed7dc4 BRT: Fix ranges to blocks conversion math
#17916cc5cae547 BRT: Increase block size from 4KB to 8KB
#1792172b2a9571 ZAP: Remove dmu_object_info_from_dnode() call
Obtained from: OpenZFS
OpenZFS commit: e63d026b91
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
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
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
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
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
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
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
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>
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.
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>
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
e5f0a698b34ed76002dc5cff3804a61c80233a7a ( tag: v6.17 ).
MFC after: 3 days
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
e5f0a698b34ed76002dc5cff3804a61c80233a7a ( tag: v6.17 ).
MFC after: 3 days
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
e5f0a698b34ed76002dc5cff3804a61c80233a7a ( tag: v6.17 ).
MFC after: 3 days
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
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
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