All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Implementing bitops rotate using riscv Zbb extension
@ 2025-06-20 11:16 ` cp0613
  0 siblings, 0 replies; 43+ messages in thread
From: cp0613 @ 2025-06-20 11:16 UTC (permalink / raw)
  To: yury.norov, linux, arnd, paul.walmsley, palmer, aou, alex
  Cc: linux-riscv, linux-arch, linux-kernel, Chen Pei

From: Chen Pei <cp0613@linux.alibaba.com>

This patch series moves the ror*/rol* functions from include/linux/bitops.h
to include/asm-generic/bitops/rotate.h as a generic implementation.

At the same time, an optimized implementation is made based on the bitwise
rotation instructions provided by the RISC-V Zbb extension[1].

Based on the RISC-V processor XUANTIE C908, I tested the performance of
sha3_generic. Compared with the generic implementation, the RISC-V Zbb
instruction implementation performance increased by an average of 6.87%.

Test method:
1. CONFIG_CRYPTO_TEST=m
2. modprobe tcrypt mode=322 sec=3
Different parameters will be selected to test the performance of sha3-224.

[1] https://github.com/riscv/riscv-bitmanip/

Chen Pei (2):
  bitops: generic rotate
  bitops: rotate: Add riscv implementation using Zbb extension

 arch/riscv/include/asm/bitops.h     | 127 ++++++++++++++++++++++++++++
 include/asm-generic/bitops.h        |   2 +-
 include/asm-generic/bitops/rotate.h |  97 +++++++++++++++++++++
 include/linux/bitops.h              |  80 ------------------
 tools/include/asm-generic/bitops.h  |   2 +-
 5 files changed, 226 insertions(+), 82 deletions(-)
 create mode 100644 include/asm-generic/bitops/rotate.h

-- 
2.49.0


^ permalink raw reply	[flat|nested] 43+ messages in thread
* Re: [PATCH 2/2] bitops: rotate: Add riscv implementation using Zbb extension
@ 2025-06-20 17:40 kernel test robot
  0 siblings, 0 replies; 43+ messages in thread
From: kernel test robot @ 2025-06-20 17:40 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "low confidence bisect report"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20250620111610.52750-3-cp0613@linux.alibaba.com>
References: <20250620111610.52750-3-cp0613@linux.alibaba.com>
TO: cp0613@linux.alibaba.com
TO: yury.norov@gmail.com
TO: linux@rasmusvillemoes.dk
TO: arnd@arndb.de
TO: paul.walmsley@sifive.com
TO: palmer@dabbelt.com
TO: aou@eecs.berkeley.edu
TO: alex@ghiti.fr
CC: linux-riscv@lists.infradead.org
CC: linux-arch@vger.kernel.org
CC: linux-kernel@vger.kernel.org
CC: Chen Pei <cp0613@linux.alibaba.com>

Hi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on arnd-asm-generic/master]
[also build test WARNING on linus/master v6.16-rc2 next-20250620]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/cp0613-linux-alibaba-com/bitops-generic-rotate/20250620-192016
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git master
patch link:    https://lore.kernel.org/r/20250620111610.52750-3-cp0613%40linux.alibaba.com
patch subject: [PATCH 2/2] bitops: rotate: Add riscv implementation using Zbb extension
:::::: branch date: 6 hours ago
:::::: commit date: 6 hours ago
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)

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/202506210147.ur3sfq5j-lkp@intel.com/

includecheck warnings: (new ones prefixed by >>)
   arch/riscv/include/asm/bitops.h: asm-generic/bitops/ffs.h is included more than once.
   arch/riscv/include/asm/bitops.h: asm-generic/bitops/fls.h is included more than once.
   arch/riscv/include/asm/bitops.h: asm-generic/bitops/__fls.h is included more than once.
>> arch/riscv/include/asm/bitops.h: asm-generic/bitops/rotate.h is included more than once.
   arch/riscv/include/asm/bitops.h: asm-generic/bitops/__ffs.h is included more than once.

vim +23 arch/riscv/include/asm/bitops.h

    17	
    18	#if !(defined(CONFIG_RISCV_ISA_ZBB) && defined(CONFIG_TOOLCHAIN_HAS_ZBB)) || defined(NO_ALTERNATIVE)
    19	#include <asm-generic/bitops/__ffs.h>
    20	#include <asm-generic/bitops/__fls.h>
    21	#include <asm-generic/bitops/ffs.h>
    22	#include <asm-generic/bitops/fls.h>
  > 23	#include <asm-generic/bitops/rotate.h>
    24	
    25	#else
    26	#define __HAVE_ARCH___FFS
    27	#define __HAVE_ARCH___FLS
    28	#define __HAVE_ARCH_FFS
    29	#define __HAVE_ARCH_FLS
    30	#define __HAVE_ARCH_ROTATE
    31	
    32	#include <asm-generic/bitops/__ffs.h>
    33	#include <asm-generic/bitops/__fls.h>
    34	#include <asm-generic/bitops/ffs.h>
    35	#include <asm-generic/bitops/fls.h>
  > 36	#include <asm-generic/bitops/rotate.h>
    37	

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

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

end of thread, other threads:[~2025-07-03 21:00 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-20 11:16 [PATCH 0/2] Implementing bitops rotate using riscv Zbb extension cp0613
2025-06-20 11:16 ` cp0613
2025-06-20 11:16 ` [PATCH 1/2] bitops: generic rotate cp0613
2025-06-20 11:16   ` cp0613
2025-06-20 15:47   ` kernel test robot
2025-06-20 15:47     ` kernel test robot
2025-06-23 11:59   ` kernel test robot
2025-06-23 11:59     ` kernel test robot
2025-06-20 11:16 ` [PATCH 2/2] bitops: rotate: Add riscv implementation using Zbb extension cp0613
2025-06-20 11:16   ` cp0613
2025-06-20 16:20   ` Yury Norov
2025-06-20 16:20     ` Yury Norov
2025-06-25 16:02     ` David Laight
2025-06-25 16:02       ` David Laight
2025-06-28 12:08       ` cp0613
2025-06-28 12:08         ` cp0613
2025-06-29 10:38         ` David Laight
2025-06-29 10:38           ` David Laight
2025-06-30 12:14           ` cp0613
2025-06-30 12:14             ` cp0613
2025-06-30 17:35             ` David Laight
2025-06-30 17:35               ` David Laight
2025-07-01 13:01               ` cp0613
2025-07-01 13:01                 ` cp0613
2025-06-28 11:13     ` cp0613
2025-06-28 11:13       ` cp0613
2025-06-29  1:48       ` Yury Norov
2025-06-29  1:48         ` Yury Norov
2025-06-30 12:04         ` cp0613
2025-06-30 12:04           ` cp0613
2025-06-30 16:53           ` Yury Norov
2025-06-30 16:53             ` Yury Norov
2025-07-01 12:47             ` cp0613
2025-07-01 12:47               ` cp0613
2025-07-01 18:32               ` Yury Norov
2025-07-01 18:32                 ` Yury Norov
2025-07-02 10:11                 ` David Laight
2025-07-02 10:11                   ` David Laight
2025-07-03 16:58                   ` Yury Norov
2025-07-03 16:58                     ` Yury Norov
2025-07-02 12:30                 ` cp0613
2025-07-02 12:30                   ` cp0613
  -- strict thread matches above, loose matches on Subject: below --
2025-06-20 17:40 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.