qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Tong Ho <tong.ho@amd.com>, qemu-arm@nongnu.org
Cc: qemu-devel@nongnu.org, alistair@alistair23.me,
	edgar.iglesias@gmail.com, peter.maydell@linaro.org
Subject: Re: [PATCH 1/3] hw/misc: Introduce AMD/Xilix Versal TRNG device
Date: Thu, 31 Aug 2023 16:44:50 -0700	[thread overview]
Message-ID: <622751d4-8a89-b34e-171f-9e9f7ac99972@linaro.org> (raw)
In-Reply-To: <20230831171849.3297497-2-tong.ho@amd.com>

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.ho@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	other threads:[~2023-08-31 23:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-31 17:18 [PATCH 0/3] AMD/Xilinx Versal TRNG support Tong Ho
2023-08-31 17:18 ` [PATCH 1/3] hw/misc: Introduce AMD/Xilix Versal TRNG device Tong Ho
2023-08-31 23:44   ` Richard Henderson [this message]
2023-09-01  4:16     ` Ho, Tong
2023-09-08 13:49       ` Peter Maydell
2023-09-08 17:56         ` Ho, Tong
2023-09-08 18:34           ` Peter Maydell
2023-09-08 18:41             ` Ho, Tong
2023-08-31 17:18 ` [PATCH 2/3] hw/arm: xlnx-versal-virt: Add AMD/Xilinx " Tong Ho
2023-08-31 17:18 ` [PATCH 3/3] tests/qtest: Introduce tests for AMD/Xilinx Versal " Tong Ho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=622751d4-8a89-b34e-171f-9e9f7ac99972@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alistair@alistair23.me \
    --cc=edgar.iglesias@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=tong.ho@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).