From nobody Sat Apr 22 15:24:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q3ZvS1nkKz46sZ6; Sat, 22 Apr 2023 15:24:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q3ZvS0LQxz3vly; Sat, 22 Apr 2023 15:24:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682177092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6jmwSUgibw7nLSIw5jfcWxW3hAsByLAVcewNcgCkvws=; b=TxbyVaYmOqdZzXlecbVd9tkUGiz77EDG04yYOblX1TNFCKsy9QHsb68Li7mm1dHEIbob8V 7inldPwcP7MVUqltRAuZOyGZEEoIgVnBV5zxRQ9rbzZGwhinezCs1HDEBvLoSKeBsi/qvx vQm4sZXweVIgBj6YitUfJC69pkeIOyenY49asmcONNLbaf7cyOQo0j8HxGEQ38NFT0hTjd NgfLz0Tg1Sk4hp+N3dffP4S+nnU8Df3e/y+0bSDIBdJIApHkEzgoz+H15AqBrCRtFCiLPD Agst/W+KlzT95Iu4+3QuRrQ+GhPb2fHpEnuYcYtUwfST8J6yBvF9GmyuG6oOOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682177092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6jmwSUgibw7nLSIw5jfcWxW3hAsByLAVcewNcgCkvws=; b=WqTwdvgEyrXvqcqaEAPHbv9OUZjSASUGAjVVuTEOwRkLvsvEpsNKxQRc9d39MIUMSeHxM1 xIwAAIBEcDXdWuLVimN0wLeDMi/2C3NOOig+krTJl8v82b0ss0BH5aZr4GlW0p0AAjOvvm moB0o2EYY6xNms2ouuTkoAydq1TwwQyIVF5Uf7FkPqgU/wkPmbDX0v6Hlxt/Jvi5m+Pt6b lxYlstiPISjwRWMrirYxNSk0g0EHAJV1N7Eg2SefgUztuxXGkag6isKSXXq/KppK44nsKO htfAoLCwoK+kQRsIKeImHANW5aejy8UFN8qeLl/R/A6DQnl8C+LTIYzVYxftcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682177092; a=rsa-sha256; cv=none; b=u7dYKyCC10EJOI6sPPsbzxOjfjLmaLRi19el1ALM8aTEblugsJZ9b8l6z/o2qY5999+RsB spzgtgX9Jo8034IUo1Tj91sithJNMvfyQhp1fjgNPU/jRF9IWmZiInjhZRQIOF6X94SrAP KjETILYNcqzN0Azf847/W6PD7n9d74Ov6MG9oSVCy5ZF32LKiazLjQA7O6MqoUYzybbkqz EFM8lbZO01SgaeA8ui1VlYp/64sm1+8XdHj8/oJfq1ekSzjlbPnsZSUuEQoiBS2bpOYsXp p6+i4fHQox9Vevv559vKifes/Xh4MutDeEH+Qc9GImMk5YUdihGgUfzuMnXRoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q3ZvR6LxJz16WJ; Sat, 22 Apr 2023 15:24:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33MFOp6B005835; Sat, 22 Apr 2023 15:24:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33MFOp1l005834; Sat, 22 Apr 2023 15:24:51 GMT (envelope-from git) Date: Sat, 22 Apr 2023 15:24:51 GMT Message-Id: <202304221524.33MFOp1l005834@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 0468e89cb359 - main - zfs/powerpc64: Fix big-endian powerpc64 asm List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0468e89cb35936d608cd2760135a791350f2f161 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=0468e89cb35936d608cd2760135a791350f2f161 commit 0468e89cb35936d608cd2760135a791350f2f161 Author: Justin Hibbits AuthorDate: 2023-04-13 15:26:52 +0000 Commit: Justin Hibbits CommitDate: 2023-04-22 15:27:49 +0000 zfs/powerpc64: Fix big-endian powerpc64 asm The powerpc asm from openzfs assumes that big-endian is always ELFv1 and ELFv2 is always little-endian, while FreeBSD uses ELFv2 everywhere. Add the necessary bits to the checksum asm to work on big-endian ELFv2. This was also submitted upstream as PR#14779. Tested by: dbaio --- sys/contrib/openzfs/lib/libspl/include/sys/simd.h | 2 +- .../openzfs/module/icp/asm-ppc64/sha2/sha256-p8.S | 15 +++++++++++++++ .../openzfs/module/icp/asm-ppc64/sha2/sha256-ppc.S | 15 +++++++++++++++ .../openzfs/module/icp/asm-ppc64/sha2/sha512-p8.S | 16 ++++++++++++++++ .../openzfs/module/icp/asm-ppc64/sha2/sha512-ppc.S | 15 +++++++++++++++ 5 files changed, 62 insertions(+), 1 deletion(-) diff --git a/sys/contrib/openzfs/lib/libspl/include/sys/simd.h b/sys/contrib/openzfs/lib/libspl/include/sys/simd.h index a106967d0725..41f9df506468 100644 --- a/sys/contrib/openzfs/lib/libspl/include/sys/simd.h +++ b/sys/contrib/openzfs/lib/libspl/include/sys/simd.h @@ -551,7 +551,7 @@ zfs_sha512_available(void) #elif defined(__powerpc__) -#define kfpu_allowed() 1 +#define kfpu_allowed() 0 #define kfpu_initialize(tsk) do {} while (0) #define kfpu_begin() do {} while (0) #define kfpu_end() do {} while (0) diff --git a/sys/contrib/openzfs/module/icp/asm-ppc64/sha2/sha256-p8.S b/sys/contrib/openzfs/module/icp/asm-ppc64/sha2/sha256-p8.S index 6bbfe23b6e15..dc3c4cea669c 100644 --- a/sys/contrib/openzfs/module/icp/asm-ppc64/sha2/sha256-p8.S +++ b/sys/contrib/openzfs/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/sys/contrib/openzfs/module/icp/asm-ppc64/sha2/sha256-ppc.S b/sys/contrib/openzfs/module/icp/asm-ppc64/sha2/sha256-ppc.S index 2219e313c9c6..d039bc36ee11 100644 --- a/sys/contrib/openzfs/module/icp/asm-ppc64/sha2/sha256-ppc.S +++ b/sys/contrib/openzfs/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/sys/contrib/openzfs/module/icp/asm-ppc64/sha2/sha512-p8.S b/sys/contrib/openzfs/module/icp/asm-ppc64/sha2/sha512-p8.S index 39a90ede3dc5..2409c53385d6 100644 --- a/sys/contrib/openzfs/module/icp/asm-ppc64/sha2/sha512-p8.S +++ b/sys/contrib/openzfs/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/sys/contrib/openzfs/module/icp/asm-ppc64/sha2/sha512-ppc.S b/sys/contrib/openzfs/module/icp/asm-ppc64/sha2/sha512-ppc.S index 37070115c3ff..57213f68abc5 100644 --- a/sys/contrib/openzfs/module/icp/asm-ppc64/sha2/sha512-ppc.S +++ b/sys/contrib/openzfs/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