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: <20250811153934.671070-1-xiangrongl@nvidia.com>
Date: Mon, 11 Aug 2025 15:39:30 +0000
From: Ron Li <xiangrongl@...dia.com>
To: <hdegoede@...hat.com>, <ilpo.jarvinen@...ux.intel.com>,
	<vadimp@...dia.com>, <alok.a.tiwari@...cle.com>, <kblaiech@...dia.com>,
	<davthompson@...dia.com>
CC: <platform-driver-x86@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	"Ron Li" <xiangrongl@...dia.com>
Subject: [PATCH v2 0/4] platform/mellanox: Add mlxbf_pka driver for BlueField DPU

This patch series adds the mlxbf_pka driver to support the BlueField DPU Public
Key Acceleration (PKA) hardware. The four patches in this series are:

Patch 1: The base implementation of the mlxbf_pka driver for the BlueField DPU.
        This patch implements the platform driver, probe and
        initialization/configuration of the PKA hardware blocks. Most of the
        kernel APIs used in this patch are also compatible with earlier kernel
        versions that are actively supported and used by the BlueField DPU
        OS distributions. As a result, this base implementation can be
        cherry-picked to earlier kenerl versions.

Patch 2: Add guard() and scoped_guard() to handle resource cleanup.

Patch 3: Add devm_mutex_init() to handle mutex initialization.

Patch 4: Add __free(kfree) to handle memory allocation.

Patch 2~4 are added to version 2 of this patch series to adopt the latest kernel
APIs and improve the memory management.

Signed-off-by: Ron Li <xiangrongl@...dia.com>
---
v1->v2:
For patch 0001:
- Move ioctl related definition to include/uapi/linux/mlxbf-pka.h.
- Changed the ioctl number from 0xB7 to 0xBF, to avoid conflict with other
  drivers.
- Remove interrupt related code, since the PKA driver uses polling instread
  of interrupt.
- Use devm_kcalloc() to allocate memory with calculated length.
- Use read_poll_timeout() to handle infinite loop checking.
- Use lockdep_assert_held() to enforce serialization.
- Create mlxbf_pka_drv_verify_bootup_status() to handle duplicated code.
- Remove error handling in ***_remove_device functions since nothing useful
  can be done.
- Fix the rollbacks in some functions by adding proper goto rollback path.
- Updated all comments to under 80 characters per line.
- Upgrade some constant with kernel definitions.
- Include missing kernel libraries.
- Update some pr_xxx() to dev_xxx().
- Use FIELD_PREP and GENMASK to handle mask and offset of register access.
- Refactor some code snippet to improve readability.
- Update the comments of some functions and type definitions.
- The FRO in the source code stands for Free Running Oscillator.
- Fix typos.

---
Ron Li (4):
  platform/mellanox/mlxbf_pka: Add mlxbf_pka driver for BlueField DPU
  platform/mellanox/mlxbf_pka: add guard() and scoped_guard()
  platform/mellanox/mlxbf_pka: add devm_mutex_init() to initialize mutex
  platform/mellanox/mlxbf_pka: add __free(kfree) to handle memory
    allocation

 .../ABI/testing/sysfs-platform-mellanox-pka   |   35 +
 .../userspace-api/ioctl/ioctl-number.rst      |    3 +
 MAINTAINERS                                   |    8 +
 drivers/platform/mellanox/Kconfig             |   10 +
 drivers/platform/mellanox/Makefile            |    1 +
 drivers/platform/mellanox/mlxbf_pka/Makefile  |   10 +
 .../mellanox/mlxbf_pka/mlxbf_pka_dev.c        | 1925 +++++++++++++++++
 .../mellanox/mlxbf_pka/mlxbf_pka_dev.h        |  649 ++++++
 .../mellanox/mlxbf_pka/mlxbf_pka_drv.c        | 1017 +++++++++
 include/uapi/linux/mlxbf-pka.h                |  112 +
 10 files changed, 3770 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-platform-mellanox-pka
 create mode 100644 drivers/platform/mellanox/mlxbf_pka/Makefile
 create mode 100644 drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_dev.c
 create mode 100644 drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_dev.h
 create mode 100644 drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c
 create mode 100644 include/uapi/linux/mlxbf-pka.h

---
2.43.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ