forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sha256 x86_64 optimization v2 openzfs#2351
This is a revision of openzfs#2332 Currently, the optimization only applies to kernel space, because I haven't figured out how to it properly in user space. AVX2 is untested because I don't have such CPU. So use it with you own discretion.
- Loading branch information
1 parent
1d96633
commit c6ee1ba
Showing
23 changed files
with
2,041 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/asm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
COMMON_H = \ | ||
$(top_srcdir)/include/asm-generic/sha256.h | ||
|
||
KERNEL_H = | ||
|
||
USER_H = | ||
|
||
EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H) | ||
|
||
if CONFIG_USER | ||
libzfsdir = $(includedir)/libzfs/linux | ||
libzfs_HEADERS = $(COMMON_H) $(USER_H) | ||
endif | ||
|
||
if CONFIG_KERNEL | ||
kerneldir = /usr/src/zfs-$(VERSION)/include/linux | ||
kernel_HEADERS = $(COMMON_H) $(KERNEL_H) | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef _ASM_SHA256_H | ||
#define _ASM_SHA256_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
static inline void arch_sha256_init(void) { } | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* _ASM_SHA256_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
COMMON_H = \ | ||
$(top_srcdir)/include/asm-x86_64/sha256.h | ||
|
||
KERNEL_H = | ||
|
||
USER_H = | ||
|
||
EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H) | ||
|
||
if CONFIG_USER | ||
libzfsdir = $(includedir)/libzfs/linux | ||
libzfs_HEADERS = $(COMMON_H) $(USER_H) | ||
endif | ||
|
||
if CONFIG_KERNEL | ||
kerneldir = /usr/src/zfs-$(VERSION)/include/linux | ||
kernel_HEADERS = $(COMMON_H) $(KERNEL_H) | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef _ASM_SHA256_H | ||
#define _ASM_SHA256_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#ifdef _KERNEL | ||
extern void arch_sha256_init(void); | ||
#else | ||
static inline void arch_sha256_init(void) { } | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* _ASM_SHA256_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef _SYS_SHA256_H | ||
#define _SYS_SHA256_H | ||
|
||
#include <sys/zfs_context.h> | ||
#include <asm/sha256.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#define SHA256_SHIFT (6) | ||
#define SHA256_BLOCK (1<<SHA256_SHIFT) | ||
|
||
extern void (*sha256_transform)(const void *, uint32_t *, uint64_t); | ||
extern void sha256_transform_generic(const void *, uint32_t *, uint64_t); | ||
|
||
extern void zio_checksum_SHA256_init(void); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* _SYS_SHA256_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ | |
/.tmp_versions | ||
/Module.markers | ||
/Module.symvers | ||
|
||
!Makefile.in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
$(MODULE)-objs += asm-x86_64/sha256-ssse3-asm.o | ||
$(MODULE)-objs += asm-x86_64/sha256-avx-asm.o | ||
$(MODULE)-objs += asm-x86_64/sha256-avx2-asm.o | ||
$(MODULE)-objs += asm-x86_64/sha256_x86_64.o |
Oops, something went wrong.