lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250319-riscv-swab-v2-0-d53b6d6ab915@iencinas.com>
Date: Wed, 19 Mar 2025 22:09:44 +0100
From: Ignacio Encinas <ignacio@...cinas.com>
To: Paul Walmsley <paul.walmsley@...ive.com>, 
 Palmer Dabbelt <palmer@...belt.com>, Alexandre Ghiti <alex@...ti.fr>, 
 Arnd Bergmann <arnd@...db.de>
Cc: Eric Biggers <ebiggers@...nel.org>, linux-riscv@...ts.infradead.org, 
 linux-kernel@...r.kernel.org, linux-kernel-mentees@...ts.linux.dev, 
 skhan@...uxfoundation.org, Zhihang Shao <zhihang.shao.iscas@...il.com>, 
 Björn Töpel <bjorn@...nel.org>, 
 linux-arch@...r.kernel.org, Ignacio Encinas <ignacio@...cinas.com>
Subject: [PATCH v2 0/2] Implement endianness swap macros for RISC-V

Motivated by [1]. A couple of things to note:

RISC-V needs a default implementation to fall back on. Such
implementation is available in include/uapi/linux/swab.h in the form of 
___constant_swabXX macros. As include/uapi/linux/swab.h can't be 
included from arch/riscv/include/asm/swab.h, the default implementation 
has been moved into asm-generic in the first patch of the series.

Tested with crc_kunit as pointed out in [2]. I can't provide performance 
numbers as I don't have RISC-V hardware yet.

[1] https://lore.kernel.org/all/20250302220426.GC2079@quark.localdomain/
[2] https://lore.kernel.org/all/20250216225530.306980-1-ebiggers@kernel.org/

Signed-off-by: Ignacio Encinas <ignacio@...cinas.com>
---
Changes in v2:
- Introduce first patch factoring out the default implementation into
  asm-generic

Patch 2:
- Remove blank line to make checkpatch happy 
- Instead of duplicating the default implementation for swap macros,
  leverage patch 1 and add an include to asm-generic/swab.h

- Link to v1: https://lore.kernel.org/r/20250310-riscv-swab-v1-1-34652ef1ee96@iencinas.com

---
Ignacio Encinas (2):
      include/uapi/linux/swab.h: move default implementation for swab macros into asm-generic
      riscv: introduce asm/swab.h

 arch/riscv/include/asm/swab.h   | 48 +++++++++++++++++++++++++++++++++++++++++
 include/uapi/asm-generic/swab.h | 32 +++++++++++++++++++++++++++
 include/uapi/linux/swab.h       | 33 +---------------------------
 3 files changed, 81 insertions(+), 32 deletions(-)
---
base-commit: a7f2e10ecd8f18b83951b0bab47ddaf48f93bf47
change-id: 20250307-riscv-swab-b81b94a9ac1b

Best regards,
-- 
Ignacio Encinas <ignacio@...cinas.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ