]> git.proxmox.com Git - mirror_zfs.git/blobdiff - module/Kbuild.in
Linux 6.5 compat: check BLK_OPEN_EXCL is defined
[mirror_zfs.git] / module / Kbuild.in
index 581d50e64b4257e25d791f7cc84750040a4075c2..fb22bfe733c0703aa5a7681dd0c4c6816c0f8a70 100644 (file)
@@ -34,6 +34,20 @@ ifeq ($(CONFIG_KASAN),y)
 ZFS_MODULE_CFLAGS += -Wno-error=frame-larger-than=
 endif
 
+# Generated binary search code is particularly bad with this optimization.
+# Oddly, range_tree.c is not affected when unrolling is not done and dsl_scan.c
+# is not affected when unrolling is done.
+# Disable it until the following upstream issue is resolved:
+# https://github.com/llvm/llvm-project/issues/62790
+ifeq ($(CONFIG_X86),y)
+ifeq ($(CONFIG_CC_IS_CLANG),y)
+CFLAGS_zfs/dsl_scan.o += -mllvm -x86-cmov-converter=false
+CFLAGS_zfs/metaslab.o += -mllvm -x86-cmov-converter=false
+CFLAGS_zfs/range_tree.o += -mllvm -x86-cmov-converter=false
+CFLAGS_zfs/zap_micro.o += -mllvm -x86-cmov-converter=false
+endif
+endif
+
 ifneq ($(KBUILD_EXTMOD),)
 @CONFIG_QAT_TRUE@ZFS_MODULE_CFLAGS += -I@QAT_SRC@/include
 @CONFIG_QAT_TRUE@KBUILD_EXTRA_SYMBOLS += @QAT_SYMBOLS@
@@ -42,6 +56,12 @@ endif
 asflags-y := $(ZFS_MODULE_CFLAGS) $(ZFS_MODULE_CPPFLAGS)
 ccflags-y := $(ZFS_MODULE_CFLAGS) $(ZFS_MODULE_CPPFLAGS)
 
+ifeq ($(CONFIG_ARM64),y)
+CFLAGS_REMOVE_zcommon/zfs_fletcher_aarch64_neon.o += -mgeneral-regs-only
+CFLAGS_REMOVE_zfs/vdev_raidz_math_aarch64_neon.o += -mgeneral-regs-only
+CFLAGS_REMOVE_zfs/vdev_raidz_math_aarch64_neonx2.o += -mgeneral-regs-only
+endif
+
 # Suppress unused-value warnings in sparc64 architecture headers
 ccflags-$(CONFIG_SPARC64) += -Wno-unused-value
 
@@ -59,6 +79,7 @@ SPL_OBJS := \
        spl-kstat.o \
        spl-proc.o \
        spl-procfs-list.o \
+       spl-shrinker.o \
        spl-taskq.o \
        spl-thread.o \
        spl-trace.o \
@@ -79,7 +100,6 @@ ICP_OBJS := \
        algs/blake3/blake3.o \
        algs/blake3/blake3_generic.o \
        algs/blake3/blake3_impl.o \
-       algs/blake3/blake3_x86-64.o \
        algs/edonr/edonr.o \
        algs/modes/cbc.o \
        algs/modes/ccm.o \
@@ -88,7 +108,9 @@ ICP_OBJS := \
        algs/modes/gcm.o \
        algs/modes/gcm_generic.o \
        algs/modes/modes.o \
-       algs/sha2/sha2.o \
+       algs/sha2/sha2_generic.o \
+       algs/sha2/sha256_impl.o \
+       algs/sha2/sha512_impl.o \
        algs/skein/skein.o \
        algs/skein/skein_block.o \
        algs/skein/skein_iv.o \
@@ -114,51 +136,57 @@ ICP_OBJS_X86_64 := \
        asm-x86_64/blake3/blake3_avx512.o \
        asm-x86_64/blake3/blake3_sse2.o \
        asm-x86_64/blake3/blake3_sse41.o \
+       asm-x86_64/sha2/sha256-x86_64.o \
+       asm-x86_64/sha2/sha512-x86_64.o \
        asm-x86_64/modes/aesni-gcm-x86_64.o \
        asm-x86_64/modes/gcm_pclmulqdq.o \
-       asm-x86_64/modes/ghash-x86_64.o \
-       asm-x86_64/sha2/sha256_impl.o \
-       asm-x86_64/sha2/sha512_impl.o
-
+       asm-x86_64/modes/ghash-x86_64.o
 
 ICP_OBJS_X86 := \
        algs/aes/aes_impl_aesni.o \
        algs/aes/aes_impl_x86-64.o \
        algs/modes/gcm_pclmulqdq.o
 
+ICP_OBJS_ARM := \
+       asm-arm/sha2/sha256-armv7.o \
+       asm-arm/sha2/sha512-armv7.o
 
 ICP_OBJS_ARM64 := \
        asm-aarch64/blake3/b3_aarch64_sse2.o \
-       asm-aarch64/blake3/b3_aarch64_sse41.o
-
+       asm-aarch64/blake3/b3_aarch64_sse41.o \
+       asm-aarch64/sha2/sha256-armv8.o \
+       asm-aarch64/sha2/sha512-armv8.o
 
 ICP_OBJS_PPC_PPC64 := \
        asm-ppc64/blake3/b3_ppc64le_sse2.o \
-       asm-ppc64/blake3/b3_ppc64le_sse41.o
+       asm-ppc64/blake3/b3_ppc64le_sse41.o \
+       asm-ppc64/sha2/sha256-p8.o \
+       asm-ppc64/sha2/sha512-p8.o \
+       asm-ppc64/sha2/sha256-ppc.o \
+       asm-ppc64/sha2/sha512-ppc.o
 
 zfs-objs             += $(addprefix icp/,$(ICP_OBJS))
 zfs-$(CONFIG_X86)    += $(addprefix icp/,$(ICP_OBJS_X86))
 zfs-$(CONFIG_UML_X86)+= $(addprefix icp/,$(ICP_OBJS_X86))
 zfs-$(CONFIG_X86_64) += $(addprefix icp/,$(ICP_OBJS_X86_64))
+zfs-$(CONFIG_ARM)    += $(addprefix icp/,$(ICP_OBJS_ARM))
 zfs-$(CONFIG_ARM64)  += $(addprefix icp/,$(ICP_OBJS_ARM64))
 zfs-$(CONFIG_PPC)    += $(addprefix icp/,$(ICP_OBJS_PPC_PPC64))
 zfs-$(CONFIG_PPC64)  += $(addprefix icp/,$(ICP_OBJS_PPC_PPC64))
 
 $(addprefix $(obj)/icp/,$(ICP_OBJS) $(ICP_OBJS_X86) $(ICP_OBJS_X86_64) \
-       $(ICP_OBJS_ARM64) $(ICP_OBJS_PPC_PPC64)) : asflags-y += -I$(icp_include)
+       $(ICP_OBJS_ARM64) $(ICP_OBJS_PPC_PPC64)) : asflags-y += -I$(icp_include) -I$(zfs_include)/os/linux/spl -I$(zfs_include)
 
 $(addprefix $(obj)/icp/,$(ICP_OBJS) $(ICP_OBJS_X86) $(ICP_OBJS_X86_64) \
-       $(ICP_OBJS_ARM64) $(ICP_OBJS_PPC_PPC64)) : ccflags-y += -I$(icp_include)
+       $(ICP_OBJS_ARM64) $(ICP_OBJS_PPC_PPC64)) : ccflags-y += -I$(icp_include) -I$(zfs_include)/os/linux/spl -I$(zfs_include)
 
 # Suppress objtool "return with modified stack frame" warnings.
 OBJECT_FILES_NON_STANDARD_aesni-gcm-x86_64.o := y
 
-# Suppress objtool "unsupported stack pointer realignment" warnings. We are
-# not using a DRAP register while aligning the stack to a 64 byte boundary.
+# Suppress objtool "unsupported stack pointer realignment" warnings.
 # See #6950 for the reasoning.
-OBJECT_FILES_NON_STANDARD_sha256_impl.o := y
-OBJECT_FILES_NON_STANDARD_sha512_impl.o := y
-
+OBJECT_FILES_NON_STANDARD_sha256-x86_64.o := y
+OBJECT_FILES_NON_STANDARD_sha512-x86_64.o := y
 
 LUA_OBJS := \
        lapi.o \
@@ -292,6 +320,7 @@ ZFS_OBJS := \
        bpobj.o \
        bptree.o \
        bqueue.o \
+       brt.o \
        btree.o \
        dataset_kstats.o \
        dbuf.o \
@@ -338,7 +367,7 @@ ZFS_OBJS := \
        refcount.o \
        rrwlock.o \
        sa.o \
-       sha256.o \
+       sha2_zfs.o \
        skein_zfs.o \
        spa.o \
        spa_checkpoint.o \
@@ -354,7 +383,6 @@ ZFS_OBJS := \
        uberblock.o \
        unique.o \
        vdev.o \
-       vdev_cache.o \
        vdev_draid.o \
        vdev_draid_rand.o \
        vdev_indirect.o \
@@ -386,6 +414,7 @@ ZFS_OBJS := \
        zfs_chksum.o \
        zfs_fm.o \
        zfs_fuid.o \
+       zfs_impl.o \
        zfs_ioctl.o \
        zfs_log.o \
        zfs_onexit.o \
@@ -417,6 +446,7 @@ ZFS_OBJS_OS := \
        trace.o \
        vdev_disk.o \
        vdev_file.o \
+       vdev_label_os.o \
        zfs_acl.o \
        zfs_ctldir.o \
        zfs_debug.o \
@@ -433,6 +463,7 @@ ZFS_OBJS_OS := \
        zpl_ctldir.o \
        zpl_export.o \
        zpl_file.o \
+       zpl_file_range.o \
        zpl_inode.o \
        zpl_super.o \
        zpl_xattr.o \
@@ -459,6 +490,10 @@ zfs-$(CONFIG_ARM64) += $(addprefix zfs/,$(ZFS_OBJS_ARM64))
 zfs-$(CONFIG_PPC)   += $(addprefix zfs/,$(ZFS_OBJS_PPC_PPC64))
 zfs-$(CONFIG_PPC64) += $(addprefix zfs/,$(ZFS_OBJS_PPC_PPC64))
 
+UBSAN_SANITIZE_zap_leaf.o := n
+UBSAN_SANITIZE_zap_micro.o := n
+UBSAN_SANITIZE_sa.o := n
+
 # Suppress incorrect warnings from versions of objtool which are not
 # aware of x86 EVEX prefix instructions used for AVX512.
 OBJECT_FILES_NON_STANDARD_vdev_raidz_math_avx512bw.o := y