[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 17/23] hw/misc/nrf51_rng: Use qemu_guest_getr
From: |
Joel Stanley |
Subject: |
Re: [Qemu-devel] [PATCH v3 17/23] hw/misc/nrf51_rng: Use qemu_guest_getrandom_nofail |
Date: |
Fri, 15 Mar 2019 03:52:18 +0000 |
On Fri, 15 Mar 2019 at 03:26, Richard Henderson
<address@hidden> wrote:
>
> The random number is intended for use by the guest. As such, we should
> honor the -seed argument for reproducibility. Use the *_nofail routine
> instead of error_abort directly.
>
> Cc: address@hidden
> Cc: Joel Stanley <address@hidden>
> Signed-off-by: Richard Henderson <address@hidden>
Reviewed-by: Joel Stanley <address@hidden>
> ---
> hw/misc/nrf51_rng.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/misc/nrf51_rng.c b/hw/misc/nrf51_rng.c
> index d188f044f4..3400e90a9b 100644
> --- a/hw/misc/nrf51_rng.c
> +++ b/hw/misc/nrf51_rng.c
> @@ -14,7 +14,7 @@
> #include "qapi/error.h"
> #include "hw/arm/nrf51.h"
> #include "hw/misc/nrf51_rng.h"
> -#include "crypto/random.h"
> +#include "qemu/guest-random.h"
>
> static void update_irq(NRF51RNGState *s)
> {
> @@ -145,7 +145,7 @@ static void nrf51_rng_timer_expire(void *opaque)
> {
> NRF51RNGState *s = NRF51_RNG(opaque);
>
> - qcrypto_random_bytes(&s->value, 1, &error_abort);
> + qemu_guest_getrandom_nofail(&s->value, 1);
>
> s->event_valrdy = 1;
> qemu_set_irq(s->eep_valrdy, 1);
> --
> 2.17.2
>
- [Qemu-devel] [PATCH v3 14/23] linux-user/aarch64: Use qemu_guest_getrandom for PAUTH keys, (continued)
- [Qemu-devel] [PATCH v3 14/23] linux-user/aarch64: Use qemu_guest_getrandom for PAUTH keys, Richard Henderson, 2019/03/14
- [Qemu-devel] [PATCH v3 11/23] linux-user: Initialize pseudo-random seeds for all guest cpus, Richard Henderson, 2019/03/14
- [Qemu-devel] [PATCH v3 07/23] ui/vnc: Split out authentication_failure, Richard Henderson, 2019/03/14
- [Qemu-devel] [PATCH v3 15/23] linux-user: Remove srand call, Richard Henderson, 2019/03/14
- [Qemu-devel] [PATCH v3 10/23] cpus: Initialize pseudo-random seeds for all guest cpus, Richard Henderson, 2019/03/14
- [Qemu-devel] [PATCH v3 06/23] crypto: Change the qcrypto_random_bytes buffer type to void*, Richard Henderson, 2019/03/14
- [Qemu-devel] [PATCH v3 17/23] hw/misc/nrf51_rng: Use qemu_guest_getrandom_nofail, Richard Henderson, 2019/03/14
- Re: [Qemu-devel] [PATCH v3 17/23] hw/misc/nrf51_rng: Use qemu_guest_getrandom_nofail,
Joel Stanley <=
- [Qemu-devel] [PATCH v3 09/23] util: Add qemu_guest_getrandom and associated routines, Richard Henderson, 2019/03/14
- [Qemu-devel] [PATCH v3 12/23] linux-user: Call qcrypto_init if not using -seed, Richard Henderson, 2019/03/14
- [Qemu-devel] [PATCH v3 05/23] crypto: Use getrandom for qcrypto_random_bytes, Richard Henderson, 2019/03/14
- [Qemu-devel] [PATCH v3 03/23] crypto: Do not fail for EINTR during qcrypto_random_bytes, Richard Henderson, 2019/03/14
- [Qemu-devel] [PATCH v3 01/23] crypto: Merge crypto-obj-y into libqemuutil.a, Richard Henderson, 2019/03/14
- Re: [Qemu-devel] [PATCH v3 00/23] Add qemu_getrandom and ARMv8.5-RNG etc, Daniel P . Berrangé, 2019/03/15