[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v8 2/2] target/s390x: support PRNO_TRNG instruction
From: |
Thomas Huth |
Subject: |
Re: [PATCH v8 2/2] target/s390x: support PRNO_TRNG instruction |
Date: |
Mon, 26 Sep 2022 17:11:23 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 |
On 21/09/2022 12.07, Jason A. Donenfeld wrote:
In order for hosts running inside of TCG to initialize the kernel's
random number generator, we should support the PRNO_TRNG instruction,
backed in the usual way with the qemu_guest_getrandom helper. This is
confirmed working on Linux 5.19.
Cc: Thomas Huth <thuth@redhat.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Cornelia Huck <cohuck@redhat.com>
Cc: Harald Freudenberger <freude@linux.ibm.com>
Cc: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
target/s390x/gen-features.c | 1 +
target/s390x/tcg/crypto_helper.c | 30 ++++++++++++++++++++++++++++++
2 files changed, 31 insertions(+)
Seems like this is even working fine with older Linux kernels ... your patch
accidentally broke test_s390x_devices in
tests/avocado/machine_s390_ccw_virtio.py: This test adds two virtio-rng devices
to the guest, then ejects them to see whether /dev/hwrng will be gone ... which
does not happen anymore with the prno-trng feature enabled :-)
I'm going to squash this one-liner to fix this issue:
diff a/tests/avocado/machine_s390_ccw_virtio.py
b/tests/avocado/machine_s390_ccw_virtio.py
--- a/tests/avocado/machine_s390_ccw_virtio.py
+++ b/tests/avocado/machine_s390_ccw_virtio.py
@@ -66,6 +66,7 @@ def test_s390x_devices(self):
'-kernel', kernel_path,
'-initrd', initrd_path,
'-append', kernel_command_line,
+ '-cpu', 'max,prno-trng=off',
'-device', 'virtio-net-ccw,devno=fe.1.1111',
'-device',
'virtio-rng-ccw,devno=fe.2.0000,max_revision=0,id=rn1',
Thomas
[PATCH v8.1 1/2] target/s390x: support SHA-512 extensions, David Hildenbrand, 2022/09/22