From nobody Tue Dec 12 17:35:25 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 4SqQkM2Rysz54D4p for ; Tue, 12 Dec 2023 17:35:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SqQkM0pGkz3Kt5 for ; Tue, 12 Dec 2023 17:35:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-50be9e6427dso6265997e87.1 for ; Tue, 12 Dec 2023 09:35:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1702402537; x=1703007337; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=pffR6Gi0A+wl+KvwnjXRujz7wVIrcOsnXSoJdUnIQsE=; b=RESm14U7z+7mTMq+m81jE2Ywsy7/fIRTrcywduOSe/cXBkXpJhuNShbZJBrvjFe+Pm XYDyA7SYdgd2TctUxrUc2nJPuClBAMPihjy0aYY2u/wDl2W0RmGSiqHXT1cKB01lo/jW 2ifain0ODBnwEB/05dku+hyyv3YKhKae/D1axEn7Q0iy7sD+2+zKCVu81Hq82kMnSvvj +reipOPv2QPiloZwsV3r8GgU5so2iLDHyCTS6t1EU4Si5C2Ad/zkh6kB1MwIbPGLlFEr 8rAr1pUOiYZ8jex3Q1xd2ITDwa9IFtlpYhuDCZj84Ley0jPbkvQlidgm8bXs89KVMkM3 HY/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702402537; x=1703007337; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pffR6Gi0A+wl+KvwnjXRujz7wVIrcOsnXSoJdUnIQsE=; b=waXme1iEcdjdAtvbdDWeRm6dDgivg/GslM51jnoLfuKV5WLHS961zwTs3trKBMHpEV pnTS3iuynqS72NVJH4AJk5/Zy8UQzM13CDqwe2oAinAL3hefbj40uwlwPC280JX4GnME TKYmJdfGBHj6drjywkohZfy5o/f4GKSRdwOKkeYuRcXlDsKXR+A/A01lIV1//DzdceBF 3g0djRYZsr6LWTOrJeffog8omsNor2QwWQijE+wYAcohSjhVnbRwRz7yJHR6nYlg6xHx zXsT7sWZk6u2jpVJW+y3O2eniTibrTBi6eJxBHlLj9jjaKa4n9/HwjZUG7pIrmPdrEFy IZtQ== X-Gm-Message-State: AOJu0Yzm2jDG+lGbYyk/oaGO/my2LzTNmcMAw9+vQb8iEUVoaEkA+qaL FHm+nfXOW8vA5PE4CKum3vb3y5U8G6WRlNt9bhDh1g== X-Google-Smtp-Source: AGHT+IESRmEsYqgDe2GVwGEWVxu1OYovlybMJy/xb+GJLc2+1jgpZVRpmsNTvdWd3/so/LKq+rwzNR8OQMblTTm+mL0= X-Received: by 2002:a19:5f55:0:b0:50b:f37f:f394 with SMTP id a21-20020a195f55000000b0050bf37ff394mr2943497lfj.14.1702402537067; Tue, 12 Dec 2023 09:35:37 -0800 (PST) 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 References: <202312082310.3B8NA5cI026712@gitrepo.freebsd.org> <098c85ab-4210-455c-a3b9-773bf0ce87b7@FreeBSD.org> In-Reply-To: From: Warner Losh Date: Tue, 12 Dec 2023 10:35:25 -0700 Message-ID: Subject: Re: git: fb17dfa0c83c - main - libicp: unbreak for armv6 after recent OpenZFS import To: Dimitry Andric Cc: John Baldwin , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="0000000000007cb2aa060c537a1c" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4SqQkM0pGkz3Kt5 --0000000000007cb2aa060c537a1c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Dec 12, 2023 at 10:15=E2=80=AFAM Dimitry Andric w= rote: > On 12 Dec 2023, at 17:01, John Baldwin wrote: > > > > On 12/8/23 3:10 PM, Dimitry Andric wrote: > >> The branch main has been updated by dim: > >> URL: > https://cgit.FreeBSD.org/src/commit/?id=3Dfb17dfa0c83cc213400fe7e1ed7a392= 53a4fcefa > >> commit fb17dfa0c83cc213400fe7e1ed7a39253a4fcefa > >> Author: Dimitry Andric > >> AuthorDate: 2023-12-08 23:09:36 +0000 > >> Commit: Dimitry Andric > >> CommitDate: 2023-12-08 23:09:50 +0000 > >> libicp: unbreak for armv6 after recent OpenZFS import > >> The following upstream commit: > >> 727497ccdfcc module/icp/asm-arm/sha2: enable non-SIMD asm kernels > on armv5/6 > >> does indeed enable sha2 asm for earlier arm CPUs, but since > libicp's > >> Makefile was not updated, this leads to: > >> ld: error: undefined reference due to > --no-allow-shlib-undefined: zfs_sha256_block_armv7 > >> Fix it by compiling sha256-armv7.S and sha512-armv7.S for > armv6 too. > >> Fixes: 3494f7c019fc > >> --- > >> cddl/lib/libicp/Makefile | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> diff --git a/cddl/lib/libicp/Makefile b/cddl/lib/libicp/Makefile > >> index 2d9bb3c67cb4..085818f2371a 100644 > >> --- a/cddl/lib/libicp/Makefile > >> +++ b/cddl/lib/libicp/Makefile > >> @@ -21,7 +21,7 @@ ASM_SOURCES_AS =3D \ > >> asm-x86_64/blake3/blake3_sse41.S > >> CFLAGS+=3D -D__amd64 -D_SYS_STACK_H -UHAVE_AES > >> -.elif ${MACHINE_ARCH} =3D=3D "armv7" > >> +.elif ${MACHINE_ARCH} =3D=3D "armv6" || ${MACHINE_ARCH} =3D=3D "armv7= " > > > > Since this applies to all 32-bit arm flavors, should this be using > > ${MACHINE_CPUARCH} =3D=3D "arm" instead? > > You may be right; if I read > https://github.com/openzfs/zfs/commit/727497ccdfcc correctly: > > > module/icp/asm-arm/sha2: enable non-SIMD asm kernels on armv5/6 > > My merged pull request #15557 fixes compilation of sha2 kernels on arm > > v5/6. However, the compiler guards only allows sha256/512_armv7_impl to > > be used when __ARM_ARCH > 6. This patch enables these ASM kernels on al= l > > arm architectures. Some compiler guards are adjusted accordingly to > > avoid the unnecessary compilation of SIMD (e.g., neon, armv8ce) kernels > > on old architectures. > > > > Reviewed-by: Brian Behlendorf > > Signed-off-by: Shengqi Chen > > Closes #15623 > > It's talking about "all arm architectures", but I'm not sure if this > means all arm architectures supported by OpenZFS, or in general. I would > assume the latter. > Yea, John's comments are correct. The OpenZFS code expects this interface to be there and guards appropriately against the use of features only on armv7. Warner --0000000000007cb2aa060c537a1c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Dec 12, 2023 at 10:15=E2=80= =AFAM Dimitry Andric <dim@freebsd.org= > wrote:
= On 12 Dec 2023, at 17:01, John Baldwin <jhb@freebsd.org> wrote:
>
> On 12/8/23 3:10 PM, Dimitry Andric wrote:
>> The branch main has been updated by dim:
>> URL: http= s://cgit.FreeBSD.org/src/commit/?id=3Dfb17dfa0c83cc213400fe7e1ed7a39253a4fc= efa
>> commit fb17dfa0c83cc213400fe7e1ed7a39253a4fcefa
>> Author:=C2=A0 =C2=A0 =C2=A0Dimitry Andric <dim@FreeBSD.org><= br> >> AuthorDate: 2023-12-08 23:09:36 +0000
>> Commit:=C2=A0 =C2=A0 =C2=A0Dimitry Andric <dim@FreeBSD.org><= br> >> CommitDate: 2023-12-08 23:09:50 +0000
>>=C2=A0 =C2=A0 =C2=A0libicp: unbreak for armv6 after recent OpenZFS = import
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 The following upstream commit: >>=C2=A0 =C2=A0 =C2=A0727497ccdfcc module/icp/asm-arm/sha2: enable no= n-SIMD asm kernels on armv5/6
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 does indeed enable sha2 asm for = earlier arm CPUs, but since libicp's
>>=C2=A0 =C2=A0 =C2=A0Makefile was not updated, this leads to:
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ld: error: undefined refe= rence due to --no-allow-shlib-undefined: zfs_sha256_block_armv7
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Fix it by compiling sha256-armv7= .S and sha512-armv7.S for armv6 too.
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Fixes:=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 3494f7c019fc
>> ---
>>=C2=A0 cddl/lib/libicp/Makefile | 2 +-
>>=C2=A0 1 file changed, 1 insertion(+), 1 deletion(-)
>> diff --git a/cddl/lib/libicp/Makefile b/cddl/lib/libicp/Makefile >> index 2d9bb3c67cb4..085818f2371a 100644
>> --- a/cddl/lib/libicp/Makefile
>> +++ b/cddl/lib/libicp/Makefile
>> @@ -21,7 +21,7 @@ ASM_SOURCES_AS =3D \
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 asm-x86_64/blake3/blake3_sse41.S=
>>=C2=A0 =C2=A0 CFLAGS+=3D -D__amd64 -D_SYS_STACK_H -UHAVE_AES
>> -.elif ${MACHINE_ARCH} =3D=3D "armv7"
>> +.elif ${MACHINE_ARCH} =3D=3D "armv6" || ${MACHINE_ARCH}= =3D=3D "armv7"
>
> Since this applies to all 32-bit arm flavors, should this be using
> ${MACHINE_CPUARCH} =3D=3D "arm" instead?

You may be right; if I read
https://github.com/openzfs/zfs/commit/727497ccdfcc= correctly:

> module/icp/asm-arm/sha2: enable non-SIMD asm kernels on armv5/6
> My merged pull request #15557 fixes compilation of sha2 kernels on arm=
> v5/6. However, the compiler guards only allows sha256/512_armv7_impl t= o
> be used when __ARM_ARCH > 6. This patch enables these ASM kernels o= n all
> arm architectures. Some compiler guards are adjusted accordingly to > avoid the unnecessary compilation of SIMD (e.g., neon, armv8ce) kernel= s
> on old architectures.
>
> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
> Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
> Closes #15623

It's talking about "all arm architectures", but I'm not s= ure if this
means all arm architectures supported by OpenZFS, or in general. I would assume the latter.

Yea, John's comm= ents are correct. The OpenZFS code expects this interface
to be t= here and guards appropriately against the use of features only on armv7.

Warner=C2=A0
--0000000000007cb2aa060c537a1c--