aboutsummaryrefslogtreecommitdiffstats
path: root/module/icp
diff options
context:
space:
mode:
authorJustin Hibbits <[email protected]>2023-04-27 15:49:21 -0400
committerGitHub <[email protected]>2023-04-27 12:49:21 -0700
commit5a83f761c7c7445dda39d3fd3c5aa2a7bcb353f1 (patch)
treef573820d774636f085de72e89799f9d52a3ba20f /module/icp
parent2fd1c30423620a5b198ac1a5aa2cff8e1e57b7f3 (diff)
powerpc64: Support ELFv2 asm on Big Endian
FreeBSD/powerpc64 is all ELFv2 since FreeBSD 13, even big endian. The existing sha256 and sha512 asm code assumes that BE is all ELFv1, and LE is ELFv2. Minor changes to add ELFv2 in the BE side gets this working correctly on FreeBSD with latest OpenZFS import. Reviewed-by: Tino Reichardt <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Justin Hibbits <[email protected]> Closes #14779
Diffstat (limited to 'module/icp')
-rw-r--r--module/icp/asm-ppc64/sha2/sha256-p8.S15
-rw-r--r--module/icp/asm-ppc64/sha2/sha256-ppc.S15
-rw-r--r--module/icp/asm-ppc64/sha2/sha512-p8.S16
-rw-r--r--module/icp/asm-ppc64/sha2/sha512-ppc.S15
4 files changed, 61 insertions, 0 deletions
diff --git a/module/icp/asm-ppc64/sha2/sha256-p8.S b/module/icp/asm-ppc64/sha2/sha256-p8.S
index 6bbfe23b6..dc3c4cea6 100644
--- a/module/icp/asm-ppc64/sha2/sha256-p8.S
+++ b/module/icp/asm-ppc64/sha2/sha256-p8.S
@@ -21,6 +21,7 @@
#if (defined(__PPC64__) && defined(__BIG_ENDIAN__))
+#if (!defined(_CALL_ELF) || _CALL_ELF == 1)
.text
.globl zfs_sha256_power8
@@ -33,6 +34,16 @@ zfs_sha256_power8:
.previous
.align 6
.zfs_sha256_power8:
+#else
+.abiversion 2
+.text
+
+.globl zfs_sha256_power8
+.type zfs_sha256_power8,@function
+.align 6
+zfs_sha256_power8:
+.localentry zfs_sha256_power8,0
+#endif
stdu 1,-384(1)
mflr 8
li 10,207
@@ -677,8 +688,12 @@ zfs_sha256_power8:
.long 0
.byte 0,12,4,1,0x80,6,3,0
.long 0
+#if (!defined(_CALL_ELF) || _CALL_ELF == 1)
.size .zfs_sha256_power8,.-.zfs_sha256_power8
.size zfs_sha256_power8,.-.zfs_sha256_power8
+#else
+.size zfs_sha256_power8,.-zfs_sha256_power8
+#endif
.align 6
.LPICmeup:
mflr 0
diff --git a/module/icp/asm-ppc64/sha2/sha256-ppc.S b/module/icp/asm-ppc64/sha2/sha256-ppc.S
index 2219e313c..d039bc36e 100644
--- a/module/icp/asm-ppc64/sha2/sha256-ppc.S
+++ b/module/icp/asm-ppc64/sha2/sha256-ppc.S
@@ -21,6 +21,7 @@
#if (defined(__PPC64__) && defined(__BIG_ENDIAN__))
+#if (!defined(_CALL_ELF) || _CALL_ELF == 1)
.text
.globl zfs_sha256_ppc
@@ -33,6 +34,16 @@ zfs_sha256_ppc:
.previous
.align 6
.zfs_sha256_ppc:
+#else
+.abiversion 2
+.text
+
+.globl zfs_sha256_ppc
+.type zfs_sha256_ppc,@function
+.align 6
+zfs_sha256_ppc:
+.localentry zfs_sha256_ppc,0
+#endif
stdu 1,-320(1)
mflr 0
sldi 5,5,6
@@ -1312,8 +1323,12 @@ zfs_sha256_ppc:
blr
.long 0
.byte 0,12,0x14,0,0,0,0,0
+#if (!defined(_CALL_ELF) || _CALL_ELF == 1)
.size .zfs_sha256_ppc,.-.zfs_sha256_ppc
.size zfs_sha256_ppc,.-.zfs_sha256_ppc
+#else
+.size zfs_sha256_ppc,.-zfs_sha256_ppc
+#endif
.align 6
.LPICmeup:
mflr 0
diff --git a/module/icp/asm-ppc64/sha2/sha512-p8.S b/module/icp/asm-ppc64/sha2/sha512-p8.S
index 39a90ede3..2409c5338 100644
--- a/module/icp/asm-ppc64/sha2/sha512-p8.S
+++ b/module/icp/asm-ppc64/sha2/sha512-p8.S
@@ -21,6 +21,7 @@
#if (defined(__PPC64__) && defined(__BIG_ENDIAN__))
+#if (!defined(_CALL_ELF) || _CALL_ELF == 1)
.text
.globl zfs_sha512_power8
@@ -33,6 +34,17 @@ zfs_sha512_power8:
.previous
.align 6
.zfs_sha512_power8:
+#else
+.abiversion 2
+.text
+
+.globl zfs_sha512_power8
+.type zfs_sha512_power8,@function
+.align 6
+zfs_sha512_power8:
+.localentry zfs_sha512_power8,0
+#endif
+
stdu 1,-384(1)
mflr 8
li 10,207
@@ -679,8 +691,12 @@ zfs_sha512_power8:
.long 0
.byte 0,12,4,1,0x80,6,3,0
.long 0
+#if (!defined(_CALL_ELF) || _CALL_ELF == 1)
.size .zfs_sha512_power8,.-.zfs_sha512_power8
.size zfs_sha512_power8,.-.zfs_sha512_power8
+#else
+.size zfs_sha512_power8,.-zfs_sha512_power8
+#endif
.align 6
.LPICmeup:
mflr 0
diff --git a/module/icp/asm-ppc64/sha2/sha512-ppc.S b/module/icp/asm-ppc64/sha2/sha512-ppc.S
index 37070115c..57213f68a 100644
--- a/module/icp/asm-ppc64/sha2/sha512-ppc.S
+++ b/module/icp/asm-ppc64/sha2/sha512-ppc.S
@@ -21,6 +21,7 @@
#if (defined(__PPC64__) && defined(__BIG_ENDIAN__))
+#if (!defined(_CALL_ELF) || _CALL_ELF == 1)
.text
.globl zfs_sha512_ppc
@@ -33,6 +34,16 @@ zfs_sha512_ppc:
.previous
.align 6
.zfs_sha512_ppc:
+#else
+.abiversion 2
+.text
+
+.globl zfs_sha512_ppc
+.type zfs_sha512_ppc,@function
+.align 6
+zfs_sha512_ppc:
+.localentry zfs_sha512_ppc,0
+#endif
stdu 1,-384(1)
mflr 0
sldi 5,5,7
@@ -1350,8 +1361,12 @@ zfs_sha512_ppc:
blr
.long 0
.byte 0,12,0x14,0,0,0,0,0
+#if (!defined(_CALL_ELF) || _CALL_ELF == 1)
.size .zfs_sha512_ppc,.-.zfs_sha512_ppc
.size zfs_sha512_ppc,.-.zfs_sha512_ppc
+#else
+.size zfs_sha512_ppc,.-zfs_sha512_ppc
+#endif
.align 6
.LPICmeup:
mflr 0