Re: [PATCH 2/2] misc: Add Xilinx PUF driver

From: Arnd Bergmann

Date: Tue Jul 07 2026 - 06:08:12 EST


On Tue, Jul 7, 2026, at 11:56, Harsh Jain wrote:
> Versal devices contain a physically unclonable function (PUF) block
> that derives device-unique secrets from intrinsic silicon
> characteristics. The PUF generates a Key Encryption Key (KEK) used
> internally by the AES engine for secure key storage, which is not
> externally accessible. In addition, the PUF provides a readable
> device-unique identifier derived from the same entropy source.
>
> Add a misc character driver to support PUF registration and regeneration.
> Registration generates a unique secret and outputs binary helper data
> that can later be used during regeneration to reproduce the same
> secrets.
>
> The driver also implements PUF_CLEAR_ID and PUF_CLEAR_KEY ioctls to clear
> the PUF ID and PUF-derived AES key via firmware. They are disabled by default
> unless puf_clear is set.
>
> Signed-off-by: Harsh Jain <h.jain@xxxxxxx>

Hi Harsh,

This description sounds like it should be integrated into the
existing crypto infrastructure of the kernel. I'm not sure
what the exact feature set in your hardware is like, but
please work with the crypto and keyctl maintainers to either
use that infrastructure, or extend it to your requirements
instead of adding a custom ioctl interface.

My guess would be that you can have a driver similar
to drivers/platform/cznic/turris-omnia-mcu-keyctl.c
for managing private keys in the hardware and managing
it through the keyctl(2) infrastructure. Have you looked
at this already?

Arnd