All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] crc64: Tweak intrinsics code and enable it for ARM
@ 2026-03-30 14:46 Ard Biesheuvel
  2026-03-30 14:46 ` [PATCH 1/5] lib/crc: arm64: Drop unnecessary chunking logic from crc64 Ard Biesheuvel
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Ard Biesheuvel @ 2026-03-30 14:46 UTC (permalink / raw)
  To: linux-crypto
  Cc: linux-arm-kernel, Ard Biesheuvel, Demian Shulhan, Eric Biggers

Apply some tweaks to the new arm64 crc64 NEON intrinsics code, and wire
it up for the 32-bit ARM build. Note that true 32-bit ARM CPUs usually
don't implement the prerequisite 64x64 PMULL instructions, but 32-bit
kernels are commonly used on 64-bit capable hardware too, which do
implement the 32-bit versions of the crypto instructions if they are
implemented for the 64-bit ISA (as per the architecture).

Cc: Demian Shulhan <demyansh@gmail.com>
Cc: Eric Biggers <ebiggers@kernel.org>

Ard Biesheuvel (5):
  lib/crc: arm64: Drop unnecessary chunking logic from crc64
  lib/crc: arm64: Use existing macros for kernel-mode FPU cflags
  ARM: Add a neon-intrinsics.h header like on arm64
  lib/crc: arm64: Simplify intrinsics implementation
  lib/crc: arm: Enable arm64's NEON intrinsics implementation of crc64

 Documentation/arch/arm/kernel_mode_neon.rst |   4 +-
 arch/arm/include/asm/neon-intrinsics.h      |  64 ++++++++++++
 lib/crc/Kconfig                             |   1 +
 lib/crc/Makefile                            |   8 +-
 lib/crc/arm/crc64.h                         |  36 +++++++
 lib/crc/arm64/crc64-neon-inner.c            | 108 ++++++++++++--------
 lib/crc/arm64/crc64.h                       |  12 +--
 7 files changed, 179 insertions(+), 54 deletions(-)
 create mode 100644 arch/arm/include/asm/neon-intrinsics.h
 create mode 100644 lib/crc/arm/crc64.h


base-commit: 63432fd625372a0e79fb00a4009af204f4edc013
-- 
2.53.0.1018.g2bb0e51243-goog



^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [PATCH 4/5] lib/crc: arm64: Simplify intrinsics implementation
@ 2026-03-31 21:56 kernel test robot
  0 siblings, 0 replies; 19+ messages in thread
From: kernel test robot @ 2026-03-31 21:56 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "low confidence static check warning: lib/crc/arm64/crc64-neon-inner.c:29:9: sparse: sparse: Trying to use reserved word 'return' as identifier"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20260330144630.33026-11-ardb@kernel.org>
References: <20260330144630.33026-11-ardb@kernel.org>
TO: Ard Biesheuvel <ardb@kernel.org>
TO: linux-crypto@vger.kernel.org
CC: linux-arm-kernel@lists.infradead.org
CC: Ard Biesheuvel <ardb@kernel.org>
CC: Demian Shulhan <demyansh@gmail.com>
CC: Eric Biggers <ebiggers@kernel.org>

Hi Ard,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 63432fd625372a0e79fb00a4009af204f4edc013]

url:    https://github.com/intel-lab-lkp/linux/commits/Ard-Biesheuvel/lib-crc-arm64-Drop-unnecessary-chunking-logic-from-crc64/20260331-150617
base:   63432fd625372a0e79fb00a4009af204f4edc013
patch link:    https://lore.kernel.org/r/20260330144630.33026-11-ardb%40kernel.org
patch subject: [PATCH 4/5] lib/crc: arm64: Simplify intrinsics implementation
:::::: branch date: 15 hours ago
:::::: commit date: 15 hours ago
config: arm64-randconfig-r134-20260401 (https://download.01.org/0day-ci/archive/20260401/202604010522.5iUE599X-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260401/202604010522.5iUE599X-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202604010522.5iUE599X-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   lib/crc/arm64/crc64-neon-inner.c: note: in included file (through arch/arm64/include/asm/neon-intrinsics.h):
   /opt/cross/clang-87f0227cb6/lib/clang/20/include/arm_neon.h:28:2: sparse: sparse: "NEON intrinsics not available with the soft-float ABI. Please use -mfloat-abi=softfp or -mfloat-abi=hard"
   lib/crc/arm64/crc64-neon-inner.c:18:26: sparse: sparse: Expected ; at end of declaration
   lib/crc/arm64/crc64-neon-inner.c:18:26: sparse: sparse: got pmull64
   lib/crc/arm64/crc64-neon-inner.c:22:1: sparse: sparse: Expected ; at the end of type declaration
   lib/crc/arm64/crc64-neon-inner.c:22:1: sparse: sparse: got }
   lib/crc/arm64/crc64-neon-inner.c:27:20: sparse: sparse: Expected ; at end of declaration
   lib/crc/arm64/crc64-neon-inner.c:27:20: sparse: sparse: got m
>> lib/crc/arm64/crc64-neon-inner.c:29:9: sparse: sparse: Trying to use reserved word 'return' as identifier
   lib/crc/arm64/crc64-neon-inner.c:29:16: sparse: sparse: Expected ; at end of declaration
   lib/crc/arm64/crc64-neon-inner.c:29:16: sparse: sparse: got vreinterpretq_u64_p128
   lib/crc/arm64/crc64-neon-inner.c:30:1: sparse: sparse: Expected ; at the end of type declaration
   lib/crc/arm64/crc64-neon-inner.c:30:1: sparse: sparse: got }
   lib/crc/arm64/crc64-neon-inner.c:36:1: sparse: sparse: Expected ; at the end of type declaration
   lib/crc/arm64/crc64-neon-inner.c:36:1: sparse: sparse: got }
   lib/crc/arm64/crc64-neon-inner.c:41:20: sparse: sparse: Expected ; at end of declaration
   lib/crc/arm64/crc64-neon-inner.c:41:20: sparse: sparse: got v0
   lib/crc/arm64/crc64-neon-inner.c:42:20: sparse: sparse: Expected ; at end of declaration
   lib/crc/arm64/crc64-neon-inner.c:42:20: sparse: sparse: got zero
   lib/crc/arm64/crc64-neon-inner.c:44:14: sparse: sparse: Expected ) in function declarator
   lib/crc/arm64/crc64-neon-inner.c:44:14: sparse: sparse: got ;
>> lib/crc/arm64/crc64-neon-inner.c:44:9: sparse: sparse: Trying to use reserved word 'for' as identifier
   lib/crc/arm64/crc64-neon-inner.c:44:16: sparse: sparse: Expected ; at the end of type declaration
   lib/crc/arm64/crc64-neon-inner.c:44:16: sparse: sparse: got )
   lib/crc/arm64/crc64-neon-inner.c:47:19: sparse: sparse: Expected ; at end of declaration
   lib/crc/arm64/crc64-neon-inner.c:47:19: sparse: sparse: got +=
   lib/crc/arm64/crc64-neon-inner.c:48:21: sparse: sparse: Expected ; at end of declaration
   lib/crc/arm64/crc64-neon-inner.c:48:21: sparse: sparse: got -=
   lib/crc/arm64/crc64-neon-inner.c:49:25: sparse: sparse: Expected ) in function declarator
   lib/crc/arm64/crc64-neon-inner.c:49:25: sparse: sparse: got <
>> lib/crc/arm64/crc64-neon-inner.c:49:17: sparse: sparse: Trying to use reserved word 'if' as identifier
   lib/crc/arm64/crc64-neon-inner.c:53:9: sparse: sparse: Expected ; at the end of type declaration
   lib/crc/arm64/crc64-neon-inner.c:53:9: sparse: sparse: got }
   lib/crc/arm64/crc64-neon-inner.c:59:20: sparse: sparse: Expected ; at end of declaration
   lib/crc/arm64/crc64-neon-inner.c:59:20: sparse: sparse: got bconsts
   lib/crc/arm64/crc64-neon-inner.c:60:20: sparse: sparse: Expected ; at end of declaration
   lib/crc/arm64/crc64-neon-inner.c:60:20: sparse: sparse: got final
   lib/crc/arm64/crc64-neon-inner.c:62:12: sparse: sparse: Expected ; at end of declaration
   lib/crc/arm64/crc64-neon-inner.c:62:12: sparse: sparse: got ^=
   lib/crc/arm64/crc64-neon-inner.c:64:9: sparse: sparse: Trying to use reserved word 'return' as identifier
   lib/crc/arm64/crc64-neon-inner.c:64:16: sparse: sparse: Expected ; at end of declaration
   lib/crc/arm64/crc64-neon-inner.c:64:16: sparse: sparse: got vgetq_lane_u64
   lib/crc/arm64/crc64-neon-inner.c:65:1: sparse: sparse: Expected ; at the end of type declaration
   lib/crc/arm64/crc64-neon-inner.c:65:1: sparse: sparse: got }
   lib/crc/arm64/crc64-neon-inner.c:52:22: sparse: sparse: undefined identifier 'pmull64'
   lib/crc/arm64/crc64-neon-inner.c:52:49: sparse: sparse: undefined identifier 'pmull64_high'

vim +/return +29 lib/crc/arm64/crc64-neon-inner.c

63432fd625372a Demian Shulhan 2026-03-29  23  
38163ec975bb4f Ard Biesheuvel 2026-03-30  24  static inline uint64x2_t pmull64_high(uint64x2_t a, uint64x2_t b)
38163ec975bb4f Ard Biesheuvel 2026-03-30  25  {
38163ec975bb4f Ard Biesheuvel 2026-03-30  26  	poly64x2_t l = vreinterpretq_p64_u64(a);
38163ec975bb4f Ard Biesheuvel 2026-03-30  27  	poly64x2_t m = vreinterpretq_p64_u64(b);
63432fd625372a Demian Shulhan 2026-03-29  28  
38163ec975bb4f Ard Biesheuvel 2026-03-30 @29  	return vreinterpretq_u64_p128(vmull_high_p64(l, m));
38163ec975bb4f Ard Biesheuvel 2026-03-30  30  }
63432fd625372a Demian Shulhan 2026-03-29  31  
38163ec975bb4f Ard Biesheuvel 2026-03-30  32  static inline uint64x2_t pmull64_hi_lo(uint64x2_t a, uint64x2_t b)
38163ec975bb4f Ard Biesheuvel 2026-03-30  33  {
38163ec975bb4f Ard Biesheuvel 2026-03-30  34  	return vreinterpretq_u64_p128(vmull_p64(vgetq_lane_u64(a, 1),
38163ec975bb4f Ard Biesheuvel 2026-03-30  35  						vgetq_lane_u64(b, 0)));
38163ec975bb4f Ard Biesheuvel 2026-03-30  36  }
63432fd625372a Demian Shulhan 2026-03-29  37  
38163ec975bb4f Ard Biesheuvel 2026-03-30  38  u64 crc64_nvme_arm64_c(u64 crc, const u8 *p, size_t len)
38163ec975bb4f Ard Biesheuvel 2026-03-30  39  {
38163ec975bb4f Ard Biesheuvel 2026-03-30  40  	uint64x2_t fold_consts = vld1q_u64(fold_consts_val);
38163ec975bb4f Ard Biesheuvel 2026-03-30  41  	uint64x2_t v0 = { crc, 0 };
38163ec975bb4f Ard Biesheuvel 2026-03-30  42  	uint64x2_t zero = { };
63432fd625372a Demian Shulhan 2026-03-29  43  
38163ec975bb4f Ard Biesheuvel 2026-03-30 @44  	for (;;) {
38163ec975bb4f Ard Biesheuvel 2026-03-30  45  		v0 ^= vreinterpretq_u64_u8(vld1q_u8(p));
63432fd625372a Demian Shulhan 2026-03-29  46  
63432fd625372a Demian Shulhan 2026-03-29  47  		p += 16;
63432fd625372a Demian Shulhan 2026-03-29  48  		len -= 16;
38163ec975bb4f Ard Biesheuvel 2026-03-30 @49  		if (len < 16)

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2026-04-03 20:01 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-30 14:46 [PATCH 0/5] crc64: Tweak intrinsics code and enable it for ARM Ard Biesheuvel
2026-03-30 14:46 ` [PATCH 1/5] lib/crc: arm64: Drop unnecessary chunking logic from crc64 Ard Biesheuvel
2026-03-31 22:33   ` Eric Biggers
2026-04-01  0:09     ` Eric Biggers
2026-04-01  6:57     ` Ard Biesheuvel
2026-03-30 14:46 ` [PATCH 2/5] lib/crc: arm64: Use existing macros for kernel-mode FPU cflags Ard Biesheuvel
2026-03-30 14:46 ` [PATCH 3/5] ARM: Add a neon-intrinsics.h header like on arm64 Ard Biesheuvel
2026-03-30 14:46 ` [PATCH 4/5] lib/crc: arm64: Simplify intrinsics implementation Ard Biesheuvel
2026-03-30 14:46 ` [PATCH 5/5] lib/crc: arm: Enable arm64's NEON intrinsics implementation of crc64 Ard Biesheuvel
2026-03-31  6:47   ` Christoph Hellwig
2026-03-31  8:20     ` Ard Biesheuvel
2026-03-31 22:41   ` Eric Biggers
2026-04-01 16:48     ` Ard Biesheuvel
2026-04-01 19:59 ` [PATCH 0/5] crc64: Tweak intrinsics code and enable it for ARM Eric Biggers
2026-04-02  8:52   ` Ard Biesheuvel
2026-04-02 23:40     ` Eric Biggers
2026-04-03  6:49       ` Ard Biesheuvel
2026-04-03 19:59         ` Eric Biggers
  -- strict thread matches above, loose matches on Subject: below --
2026-03-31 21:56 [PATCH 4/5] lib/crc: arm64: Simplify intrinsics implementation kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.