mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Restore ASMABI and other Unify work
Make sure all SHA2 transform function has wrappers For ASMABI to work, it is required the calling convention is consistent. Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Signed-off-by: Joergen Lundman <lundman@lundman.net> Closes #14569
This commit is contained in:
@@ -29,9 +29,10 @@
|
||||
#include <sys/simd.h>
|
||||
|
||||
#include <sha2/sha2_impl.h>
|
||||
#include <sys/asm_linkage.h>
|
||||
|
||||
#define TF(E, N) \
|
||||
extern void E(uint32_t s[8], const void *, size_t); \
|
||||
extern void ASMABI E(uint32_t s[8], const void *, size_t); \
|
||||
static inline void N(uint32_t s[8], const void *d, size_t b) { \
|
||||
kfpu_begin(); E(s, d, b); kfpu_end(); \
|
||||
}
|
||||
@@ -44,10 +45,19 @@ static inline boolean_t sha2_is_supported(void)
|
||||
|
||||
#if defined(__x86_64)
|
||||
|
||||
extern void zfs_sha256_transform_x64(uint32_t s[8], const void *, size_t);
|
||||
/* Users of ASMABI requires all calls to be from wrappers */
|
||||
extern void ASMABI
|
||||
zfs_sha256_transform_x64(uint32_t s[8], const void *, size_t);
|
||||
|
||||
static inline void
|
||||
tf_sha256_transform_x64(uint32_t s[8], const void *d, size_t b)
|
||||
{
|
||||
zfs_sha256_transform_x64(s, d, b);
|
||||
}
|
||||
|
||||
const sha256_ops_t sha256_x64_impl = {
|
||||
.is_supported = sha2_is_supported,
|
||||
.transform = zfs_sha256_transform_x64,
|
||||
.transform = tf_sha256_transform_x64,
|
||||
.name = "x64"
|
||||
};
|
||||
|
||||
|
||||
@@ -29,9 +29,10 @@
|
||||
#include <sys/simd.h>
|
||||
|
||||
#include <sha2/sha2_impl.h>
|
||||
#include <sys/asm_linkage.h>
|
||||
|
||||
#define TF(E, N) \
|
||||
extern void E(uint64_t s[8], const void *, size_t); \
|
||||
extern void ASMABI E(uint64_t s[8], const void *, size_t); \
|
||||
static inline void N(uint64_t s[8], const void *d, size_t b) { \
|
||||
kfpu_begin(); E(s, d, b); kfpu_end(); \
|
||||
}
|
||||
@@ -44,10 +45,18 @@ static inline boolean_t sha2_is_supported(void)
|
||||
|
||||
#if defined(__x86_64)
|
||||
|
||||
extern void zfs_sha512_transform_x64(uint64_t s[8], const void *, size_t);
|
||||
/* Users of ASMABI requires all calls to be from wrappers */
|
||||
extern void ASMABI
|
||||
zfs_sha512_transform_x64(uint64_t s[8], const void *, size_t);
|
||||
|
||||
static inline void
|
||||
tf_sha512_transform_x64(uint64_t s[8], const void *d, size_t b)
|
||||
{
|
||||
zfs_sha512_transform_x64(s, d, b);
|
||||
}
|
||||
const sha512_ops_t sha512_x64_impl = {
|
||||
.is_supported = sha2_is_supported,
|
||||
.transform = zfs_sha512_transform_x64,
|
||||
.transform = tf_sha512_transform_x64,
|
||||
.name = "x64"
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user