diff --git a/include/os/freebsd/spl/sys/simd_aarch64.h b/include/os/freebsd/spl/sys/simd_aarch64.h index 847c2ed291..df33bdaecc 100644 --- a/include/os/freebsd/spl/sys/simd_aarch64.h +++ b/include/os/freebsd/spl/sys/simd_aarch64.h @@ -45,6 +45,7 @@ #include #include +#include #define kfpu_allowed() 1 #define kfpu_initialize(tsk) do {} while (0) diff --git a/include/os/freebsd/spl/sys/simd_arm.h b/include/os/freebsd/spl/sys/simd_arm.h index f6362cd6bb..178fbc3b3c 100644 --- a/include/os/freebsd/spl/sys/simd_arm.h +++ b/include/os/freebsd/spl/sys/simd_arm.h @@ -44,6 +44,7 @@ #include #include +#include #define kfpu_allowed() 1 #define kfpu_initialize(tsk) do {} while (0) diff --git a/include/os/freebsd/spl/sys/simd_x86.h b/include/os/freebsd/spl/sys/simd_x86.h index 6512d4fcba..8e93b558df 100644 --- a/include/os/freebsd/spl/sys/simd_x86.h +++ b/include/os/freebsd/spl/sys/simd_x86.h @@ -45,6 +45,10 @@ fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX);\ } +#ifndef PCB_FPUNOSAVE +#define PCB_FPUNOSAVE PCB_NPXNOSAVE +#endif + #define kfpu_end() { \ if (__predict_false(curpcb->pcb_flags & PCB_FPUNOSAVE)) \ fpu_kern_leave(curthread, NULL); \ diff --git a/include/os/freebsd/spl/sys/vnode.h b/include/os/freebsd/spl/sys/vnode.h index 483d12ae59..ab1727dca0 100644 --- a/include/os/freebsd/spl/sys/vnode.h +++ b/include/os/freebsd/spl/sys/vnode.h @@ -143,6 +143,10 @@ vn_flush_cached_data(vnode_t *vp, boolean_t sync) /* * Attributes of interest to the caller of setattr or getattr. */ + +#undef AT_UID +#undef AT_GID + #define AT_MODE 0x00002 #define AT_UID 0x00004 #define AT_GID 0x00008 diff --git a/module/icp/algs/blake3/blake3.c b/module/icp/algs/blake3/blake3.c index 4f93e4ff20..0bab7a3a75 100644 --- a/module/icp/algs/blake3/blake3.c +++ b/module/icp/algs/blake3/blake3.c @@ -25,6 +25,7 @@ * Copyright (c) 2021-2022 Tino Reichardt */ +#include #include #include diff --git a/module/icp/algs/blake3/blake3_generic.c b/module/icp/algs/blake3/blake3_generic.c index ca7197a26f..fbe1849696 100644 --- a/module/icp/algs/blake3/blake3_generic.c +++ b/module/icp/algs/blake3/blake3_generic.c @@ -25,6 +25,7 @@ * Copyright (c) 2021-2022 Tino Reichardt */ +#include #include #include "blake3_impl.h" diff --git a/module/icp/algs/blake3/blake3_impl.c b/module/icp/algs/blake3/blake3_impl.c index b59fde1a4d..f3f48c2dfa 100644 --- a/module/icp/algs/blake3/blake3_impl.c +++ b/module/icp/algs/blake3/blake3_impl.c @@ -23,10 +23,10 @@ * Copyright (c) 2021-2022 Tino Reichardt */ +#include #include #include #include -#include #include "blake3_impl.h" diff --git a/module/icp/algs/sha2/sha256_impl.c b/module/icp/algs/sha2/sha256_impl.c index 278d7e577d..01ce5cbd81 100644 --- a/module/icp/algs/sha2/sha256_impl.c +++ b/module/icp/algs/sha2/sha256_impl.c @@ -23,10 +23,10 @@ * Copyright (c) 2022 Tino Reichardt */ +#include #include #include #include -#include #include #include @@ -118,7 +118,7 @@ const sha256_ops_t sha256_shani_impl = { }; #endif -#elif defined(__aarch64__) || defined(__arm__) +#elif defined(__aarch64__) || (defined(__arm__) && __ARM_ARCH > 6) static boolean_t sha256_have_neon(void) { return (kfpu_allowed() && zfs_neon_available()); @@ -192,7 +192,7 @@ static const sha256_ops_t *const sha256_impls[] = { #if defined(__x86_64) && defined(HAVE_SSE4_1) &sha256_shani_impl, #endif -#if defined(__aarch64__) || defined(__arm__) +#if defined(__aarch64__) || (defined(__arm__) && __ARM_ARCH > 6) &sha256_armv7_impl, &sha256_neon_impl, &sha256_armv8_impl, diff --git a/module/icp/algs/sha2/sha512_impl.c b/module/icp/algs/sha2/sha512_impl.c index 991e832b15..27b35a639a 100644 --- a/module/icp/algs/sha2/sha512_impl.c +++ b/module/icp/algs/sha2/sha512_impl.c @@ -23,10 +23,10 @@ * Copyright (c) 2022 Tino Reichardt */ +#include #include #include #include -#include #include #include @@ -108,7 +108,7 @@ const sha512_ops_t sha512_armv8_impl = { .name = "armv8-ce" }; -#elif defined(__arm__) +#elif defined(__arm__) && __ARM_ARCH > 6 extern void zfs_sha512_block_armv7(uint64_t s[8], const void *, size_t); const sha512_ops_t sha512_armv7_impl = { .is_supported = sha2_is_supported, @@ -168,7 +168,7 @@ static const sha512_ops_t *const sha512_impls[] = { &sha512_armv7_impl, &sha512_armv8_impl, #endif -#if defined(__arm__) +#if defined(__arm__) && __ARM_ARCH > 6 &sha512_armv7_impl, &sha512_neon_impl, #endif diff --git a/module/os/freebsd/zfs/zfs_vnops_os.c b/module/os/freebsd/zfs/zfs_vnops_os.c index 9169244b1a..b3405b7593 100644 --- a/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/module/os/freebsd/zfs/zfs_vnops_os.c @@ -29,12 +29,12 @@ /* Portions Copyright 2007 Jeremy Teo */ /* Portions Copyright 2010 Robert Milkowski */ - #include #include #include #include #include +#include #include #include #include @@ -85,7 +85,6 @@ #include #include #include -#include #include #include #include @@ -6241,6 +6240,7 @@ zfs_freebsd_copy_file_range(struct vop_copy_file_range_args *ap) struct mount *mp; struct uio io; int error; + uint64_t len = *ap->a_lenp; /* * TODO: If offset/length is not aligned to recordsize, use @@ -6289,7 +6289,8 @@ zfs_freebsd_copy_file_range(struct vop_copy_file_range_args *ap) goto unlock; error = zfs_clone_range(VTOZ(invp), ap->a_inoffp, VTOZ(outvp), - ap->a_outoffp, ap->a_lenp, ap->a_fsizetd->td_ucred); + ap->a_outoffp, &len, ap->a_fsizetd->td_ucred); + *ap->a_lenp = (size_t)len; unlock: if (invp != outvp) diff --git a/module/zcommon/zfs_fletcher.c b/module/zcommon/zfs_fletcher.c index 1d9b1cffc0..619ddef024 100644 --- a/module/zcommon/zfs_fletcher.c +++ b/module/zcommon/zfs_fletcher.c @@ -136,8 +136,8 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/module/zcommon/zfs_prop.c b/module/zcommon/zfs_prop.c index 9c65702b8d..3db6fd13f4 100644 --- a/module/zcommon/zfs_prop.c +++ b/module/zcommon/zfs_prop.c @@ -30,6 +30,10 @@ /* Portions Copyright 2010 Robert Milkowski */ +#if defined(_KERNEL) +#include +#endif + #include #include #include @@ -1037,8 +1041,6 @@ zfs_prop_align_right(zfs_prop_t prop) #if defined(_KERNEL) -#include - #if defined(HAVE_KERNEL_FPU_INTERNAL) uint8_t **zfs_kfpu_fpregs; EXPORT_SYMBOL(zfs_kfpu_fpregs); diff --git a/module/zfs/vdev_raidz_math.c b/module/zfs/vdev_raidz_math.c index 66f211c430..e12b96170f 100644 --- a/module/zfs/vdev_raidz_math.c +++ b/module/zfs/vdev_raidz_math.c @@ -22,6 +22,7 @@ * Copyright (C) 2016 Gvozden Nešković. All rights reserved. */ +#include #include #include #include @@ -29,7 +30,6 @@ #include #include #include -#include /* Opaque implementation with NULL methods to represent original methods */ static const raidz_impl_ops_t vdev_raidz_original_impl = {