Skip to contentSkip to conversation

loongarch/crc32: add missing dependency on 64BIT

PATCH In review Eric Biggers 2 participants 2 messages Nov 3, 2024 – Nov 4, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 loongarch/crc32: add missing dependency on 64BIT

From: Eric Biggers <[email protected]>

The LoongArch CRC32 instructions are only specified for LA64 (64-bit) and cannot be assembled in 32-bit mode. Therefore only build the LoongArch-optimized CRC32 functions when CONFIG_64BIT.

Fixes 2f1648220214 ("LoongArch: crypto: Add crc32 and crc32c hw acceleration")
---
 arch/loongarch/crypto/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/loongarch/crypto/Kconfig +1 -0
index 200a6e8b43b1..b68b9a797f83 100644
@@ -2,10 +2,11 @@
 
 menu "Accelerated Cryptographic Algorithms for CPU (loongarch)"
 
 config CRYPTO_CRC32_LOONGARCH
 	tristate "CRC32c and CRC32"
+	depends on 64BIT
 	select CRC32
 	select CRYPTO_HASH
 	help
 	  CRC32c and CRC32 CRC algorithms
 

base-commit: 886b7e80ab19841f640cafd8b5ab053409b9b931

Signature · 1 line
2.47.0
maintainer
#1 lore raw

Hi, Eric and Yuli,

Quoted 6 lines · Eric Biggers

From: Eric Biggers <[email protected]>

The LoongArch CRC32 instructions are only specified for LA64 (64-bit) and cannot be assembled in 32-bit mode. Therefore only build the LoongArch-optimized CRC32 functions when CONFIG_64BIT.

I think there are no build errors, just that it technically depends on 64BIT?

If so, there are a bunch of config options need to depend on 64BIT, such as ARCH_HAS_PTE_DEVMAP, ARCH_SUPPORTS_HUGETLBFS, HAVE_ARCH_TRANSPARENT_HUGEPAGE, HAVE_ARCH_KASAN, etc.

However, the dependencies exist at first, but then removed from Arnd's suggestion. Because we have no 32BIT support now, so just keep it as simple as possible.

This patch can be applied when we add 32BIT support, but not now.

Huacai

Quoted 31 lines
Fixes 2f1648220214 ("LoongArch: crypto: Add crc32 and crc32c hw acceleration")
---
 arch/loongarch/crypto/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/loongarch/crypto/Kconfig +1 -0
index 200a6e8b43b1..b68b9a797f83 100644
@@ -2,10 +2,11 @@
 
 menu "Accelerated Cryptographic Algorithms for CPU (loongarch)"
 
 config CRYPTO_CRC32_LOONGARCH
        tristate "CRC32c and CRC32"
+       depends on 64BIT
        select CRC32
        select CRYPTO_HASH
        help
          CRC32c and CRC32 CRC algorithms
 

base-commit: 886b7e80ab19841f640cafd8b5ab053409b9b931 --
2.47.0