diff options
| author | Stefan Hajnoczi <stefanha@redhat.com> | 2025-01-22 09:59:02 -0500 |
|---|---|---|
| committer | Stefan Hajnoczi <stefanha@redhat.com> | 2025-01-22 09:59:02 -0500 |
| commit | cf86770c7aa31ebd6e56f4eeb25c34107f92c51e (patch) | |
| tree | 856dd878627a0270e9426f8829a85da79019e35d /crypto/pbkdf.c | |
| parent | 32a97c5d05c5deb54a42315d48cecf86cbeadaf4 (diff) | |
| parent | 9744ceb94bf963ed42685c7d28024a77de2fbe78 (diff) | |
| download | focaccia-qemu-cf86770c7aa31ebd6e56f4eeb25c34107f92c51e.tar.gz focaccia-qemu-cf86770c7aa31ebd6e56f4eeb25c34107f92c51e.zip | |
Merge tag 'pull-request-2025-01-21v2' of https://gitlab.com/thuth/qemu into staging
* Fix bugs related to the new "boot order" feature in the s390-ccw bios * Fix crash that occurs when introspecting older s390-virtio-ccw machines * Fix error in pbkdf code on fast machines (e.g. s390x with crypto adapter) * Convert kvm_xen_guest avocado test to the functional framework # -----BEGIN PGP SIGNATURE----- # # iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmeQpIYRHHRodXRoQHJl # ZGhhdC5jb20ACgkQLtnXdP5wLbXYKA/9HddJS8Ljxwwme2XL1uSXreTGGKjE4QO1 # NKaEyJFfu5KAXCgufr/L4mLLxc8Bdf+qEux1v9u49OadMlYf/WzG5BYW42bLBrnK # zhZZGnuLZHU6kzhK3OMQ0kJLYVGneKU8WahHiPaOfIjuEr+6SoMfb5N8ttSOG7ry # Np3HvA5K5m4pOL0kSMJiiCqKSzRPbzWaxxwwB5j+iD4NB5NfLo8kEH1iXqRqkEBQ # zkM0ab0pYYYZil6DqpNQ84QbWY0qJfhj+1GhsVugTE46ePdr7t7v3K1TFq27cGPw # seJiUAdQwjUfblmlyjcuZfXr1p2sNAY2xocg/6dyIqroOVU9SxVwqrZAOvXd9t2r # 7UEoT0EfEkDaEaL3T2me6AEtxpkXwEw/usVHv/79vdAVX4VxHUQz3YxUnG4kByXJ # AEwUzq9Pm7mIV6I3zZ1AZHmBxENshhL0pBGdsL9F/Wv1tkPEf1WnDJ+1d2v2Hpag # Pr5i6RikG0x8LoT1+G2Swr43fhOLGybqIiy7T4d4WiCuR3szfj1FCeJoMTEK6jHg # 29Fps7ypQhfkSCcMCvk8VwImb+lc5bQPrV1PKcpEnLZbf3jU6myO/Ac3j2cnfYd6 # 3HidYK3GTpL7hMegyYh/nmFNp/edsgcky7SnDvcxsedVbwLxX112DaVed1ngPXmu # 6ZLrIhNk7BU= # =4IXO # -----END PGP SIGNATURE----- # gpg: Signature made Wed 22 Jan 2025 02:55:50 EST # gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5 # gpg: issuer "thuth@redhat.com" # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full] # gpg: aka "Thomas Huth <thuth@redhat.com>" [full] # gpg: aka "Thomas Huth <huth@tuxfamily.org>" [full] # gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown] # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * tag 'pull-request-2025-01-21v2' of https://gitlab.com/thuth/qemu: pc-bios: Update the s390 bios images with the recent changes pc-bios/s390-ccw: Abort IPL on invalid loadparm pc-bios/s390-ccw/netmain: Fix error messages with regards to the TFTP server pc-bios/s390-ccw: Fix boot problem with virtio-net devices pc-bios/s390-ccw/virtio: Add a function to reset a virtio device hw/s390x: Fix crash that occurs when inspecting older versioned machines types crypto: fix bogus error benchmarking pbkdf on fast machines MAINTAINERS: Remove myself as Avocado Framework reviewer tests/functional: Convert the kvm_xen_guest avocado test Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'crypto/pbkdf.c')
| -rw-r--r-- | crypto/pbkdf.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/crypto/pbkdf.c b/crypto/pbkdf.c index 0dd7c3aeaa..2989fc0a40 100644 --- a/crypto/pbkdf.c +++ b/crypto/pbkdf.c @@ -107,7 +107,7 @@ static void *threaded_qcrypto_pbkdf2_count_iters(void *data) size_t nsalt = iters_data->nsalt; size_t nout = iters_data->nout; Error **errp = iters_data->errp; - + size_t scaled = 0; uint64_t ret = -1; g_autofree uint8_t *out = g_new(uint8_t, nout); uint64_t iterations = (1 << 15); @@ -131,7 +131,17 @@ static void *threaded_qcrypto_pbkdf2_count_iters(void *data) delta_ms = end_ms - start_ms; - if (delta_ms == 0) { /* sanity check */ + /* + * For very small 'iterations' values, CPU (or crypto + * accelerator) might be fast enough that the scheduler + * hasn't incremented getrusage() data, or incremented + * it by a very small amount, resulting in delta_ms == 0. + * Once we've scaled 'iterations' x10, 5 times, we really + * should be seeing delta_ms != 0, so sanity check at + * that point. + */ + if (scaled > 5 && + delta_ms == 0) { /* sanity check */ error_setg(errp, "Unable to get accurate CPU usage"); goto cleanup; } else if (delta_ms > 500) { @@ -141,6 +151,7 @@ static void *threaded_qcrypto_pbkdf2_count_iters(void *data) } else { iterations = (iterations * 1000 / delta_ms); } + scaled++; } iterations = iterations * 1000 / delta_ms; |