|
|
Log in / Subscribe / Register

riscv: fix PIO helpers and add optimized percpu ops

From:  Yunhui Cui <cuiyunhui-AT-bytedance.com>
To:  pjw-AT-kernel.org, palmer-AT-dabbelt.com, aou-AT-eecs.berkeley.edu, alex-AT-ghiti.fr, dennis-AT-kernel.org, tj-AT-kernel.org, cl-AT-gentwo.org, ast-AT-kernel.org, daniel-AT-iogearbox.net, andrii-AT-kernel.org, martin.lau-AT-linux.dev, eddyz87-AT-gmail.com, memxor-AT-gmail.com, song-AT-kernel.org, yonghong.song-AT-linux.dev, jolsa-AT-kernel.org, bjorn-AT-kernel.org, pulehui-AT-huawei.com, puranjay-AT-kernel.org, thuth-AT-redhat.com, ajones-AT-ventanamicro.com, ben.dooks-AT-codethink.co.uk, rkrcmar-AT-ventanamicro.com, cuiyunhui-AT-bytedance.com, samuel.holland-AT-sifive.com, zong.li-AT-sifive.com, conor.dooley-AT-microchip.com, tglx-AT-kernel.org, debug-AT-rivosinc.com, seanwascoding-AT-gmail.com, andybnac-AT-gmail.com, menglong8.dong-AT-gmail.com, cyrilbur-AT-tenstorrent.com, wangruikang-AT-iscas.ac.cn, atishp-AT-rivosinc.com, apatel-AT-ventanamicro.com, linux-riscv-AT-lists.infradead.org, linux-kernel-AT-vger.kernel.org, linux-mm-AT-kvack.org, bpf-AT-vger.kernel.org, arnd-AT-arndb.de, nathan-AT-kernel.org, nick.desaulniers+lkml-AT-gmail.com, morbo-AT-google.com, justinstitt-AT-google.com, qingfang.deng-AT-siflower.com.cn, linux-arch-AT-vger.kernel.org, llvm-AT-lists.linux.dev
Subject:  [PATCH v7 0/3] riscv: fix PIO helpers and add optimized percpu ops
Date:  Thu, 02 Jul 2026 10:54:40 +0800
Message-ID:  <20260702025443.83389-1-cuiyunhui@bytedance.com>
Archive-link:  Article

Changes in v7:
- Address the Sashiko comment about inconsistent AND helper naming: rename
  the RISC-V internal percpu helpers from andnot to and, and make all
  this_cpu_and_*() wrappers pass the operand directly.  This is a readability
  cleanup only; the generated operations still implement the same plain AND
  semantics required by this_cpu_and().
- Undefine internal percpu helper macros prior to including <asm-generic/percpu.h>
  as recommended by bpf-ci/Sashiko review. This prevents macro leakage into the
  global namespace and has no impact on generated code or runtime behavior.

Yunhui Cui (3):
  riscv: io: avoid null-pointer arithmetic in PIO helpers
  riscv: introduce percpu.h into include/asm
  riscv: store percpu offset into thread_info

 arch/riscv/include/asm/asm.h         |   6 +-
 arch/riscv/include/asm/io.h          |   8 +
 arch/riscv/include/asm/percpu.h      | 300 +++++++++++++++++++++++++++
 arch/riscv/include/asm/switch_to.h   |   8 +
 arch/riscv/include/asm/thread_info.h |   3 +-
 arch/riscv/kernel/asm-offsets.c      |   1 +
 arch/riscv/kernel/smpboot.c          |   8 +
 arch/riscv/net/bpf_jit_comp64.c      |   9 +-
 8 files changed, 329 insertions(+), 14 deletions(-)
 create mode 100644 arch/riscv/include/asm/percpu.h

-- 
2.39.5




Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds