[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <E7AED86A89FD886F+263304da-0529-4b4c-9e23-ea2e5e3cef2c@uniontech.com>
Date: Mon, 4 Nov 2024 10:34:18 +0800
From: WangYuli <wangyuli@...ontech.com>
To: Eric Biggers <ebiggers@...nel.org>
Cc: ardb@...nel.org, linux-arch@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-crypto@...r.kernel.org,
linux-ext4@...r.kernel.org, linux-f2fs-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org, linux-mips@...r.kernel.org,
linux-riscv@...ts.infradead.org, linux-s390@...r.kernel.org,
linux-scsi@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
loongarch@...ts.linux.dev, kernel@...0n.name, chenhuacai@...nel.org,
xry111@...111.site, sparclinux@...r.kernel.org, x86@...nel.org
Subject: Re: [PATCH v2 06/18] loongarch/crc32: expose CRC32 functions through
lib
On 2024/11/3 21:57, Eric Biggers wrote:
> On Sun, Nov 03, 2024 at 09:36:55PM +0800, WangYuli wrote:
>> Even though the narrower CRC instructions doesn't require GRLEN=64, they still *aren't* part of LA32 (LoongArch reference manual v1.10, Volume 1, Table 2-1).
>> Link: https://lore.kernel.org/all/0a7d0a9e-c56e-4ee2-a83b-00164a450abe@xen0n.name/
>>
>> Therefore, we could not directly add ARCH_HAS_CRC32 to config LOONGARCH.
>>
> There's still a runtime CPU feature check of cpu_has(CPU_FEATURE_CRC32).
> See arch/loongarch/lib/crc32-loongarch.c. So it's the same as before.
> ARCH_HAS_CRC32 just means that the file will be compiled.
>
> If you're trying to say that you think this file should be built only when
> CONFIG_64BIT=y, then that would be an existing bug since the existing file
> arch/loongarch/crypto/crc32-loongarch.c was built for both 32-bit and 64-bit.
> But if you think this is a bug, I can fix this too.
>
> - Eric
>
Actually, my originally mean is that directly declaring LoongArch
ARCH_HAS_CRC32 without distinguishing between 32-bit and 64-bit might
mislead those reading the code. And it's not rigorous.
However, according to Huacai Chen's recent reply, there are many similar
issues and they won't cause build errors for now.
Link:
https://lore.kernel.org/all/CAAhV-H5KaXBr-TdpDbJwcr_L0_mbSw=4J30uwQ2xn2YDs=Hg2Q@mail.gmail.com/
So, this change should be fine for now.
Reviewed-by: WangYuli <wangyuli@...ontech.com>
Thanks,
--
WangYuli
Download attachment "OpenPGP_0xC5DA1F3046F40BEE.asc" of type "application/pgp-keys" (633 bytes)
Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (237 bytes)
Powered by blists - more mailing lists