Hi Peter, Your recommendation is noted. Thanks for your valuable input. I will present V2 with better alignment.
Regards, Tong Ho -----Original Message----- From: Peter Maydell <peter.mayd...@linaro.org> Sent: Friday, September 8, 2023 11:35 AM To: Ho, Tong <tong...@amd.com> Cc: Richard Henderson <richard.hender...@linaro.org>; qemu-...@nongnu.org; qemu-devel@nongnu.org; alist...@alistair23.me; edgar.igles...@gmail.com Subject: Re: [PATCH 1/3] hw/misc: Introduce AMD/Xilix Versal TRNG device On Fri, 8 Sept 2023 at 18:56, Ho, Tong <tong...@amd.com> wrote: > > Hi Peter, > > The Versal TRNG device is required to support both TRNG mode and PRNG > mode, and target/guest software selects and changes the mode at will during > runtime. > > I do agree that, in the TRNG mode, the model using qemu_guest_getrandom() > will work without any issues. > > When software selects the PRNG mode, the Versal TRNG device is > expected to output a reproducible and deterministic sequence of values for a > given seed. This is part of the hardware spec. > > I fail to see how qemu_guest_getrandom() can be used to model such > requirement correctly. If the hardware documents a specific RNG that it must use, then yes, we should model that, and the comments need to make it clear that we're modelling a very specific thing, not merely "here is an arbitrary PRNG". -- PMM