On 8/31/23 10:18, Tong Ho wrote:
This adds a non-cryptographic grade implementation of the
model for the True Random Number Generator (TRNG) component
in AMD/Xilinx Versal device family.

This model is only intended for non-real world testing of
guest software, where cryptographically strong TRNG is not
needed.

This model supports versions 1 & 2 of the Versal TRNG, with
default to be version 2; the 'hw-version' uint32 property
can be set to 0x0100 to override the default.

Other implemented properties:
- 'forced-prng', uint64
   When set to non-zero, "true random reseed" is replaced by
   deterministic reseed based on the given value and other
   deterministic parameters, even when guest software has
   configured the TRNG as "true random reseed".  This option
   allows guest software to reproduce data-dependent defects.

- 'fips-fault-events', uint32, bit-mask
   bit 3: Triggers the SP800-90B entropy health test fault irq
   bit 1: Triggers the FIPS 140-2 continuous test fault irq

Signed-off-by: Tong Ho<tong...@amd.com>
---
  hw/misc/Kconfig                    |   3 +
  hw/misc/meson.build                |   3 +
  hw/misc/xlnx-versal-trng.c         | 725 +++++++++++++++++++++++++++++
  include/hw/misc/xlnx-versal-trng.h |  58 +++
  4 files changed, 789 insertions(+)
  create mode 100644 hw/misc/xlnx-versal-trng.c
  create mode 100644 include/hw/misc/xlnx-versal-trng.h

I don't think you should be inventing another PRNG, or related properties.

We already have qemu/guest-random.h, and the -seed command-line parameter to force the use of a deterministic PRNG with a given seed value.


r~

Reply via email to