qemu-cr16/scripts
Daniel P. Berrangé 24ad5e1995 crypto: implement workaround for GNUTLS thread safety problems
When TLS 1.3 is negotiated on a TLS session, GNUTLS will perform
automatic rekeying of the session after 16 million records. This
is done for all algorithms except CHACHA20_POLY1305 which does
not require rekeying.

Unfortunately the rekeying breaks GNUTLS' promise that it is safe
to use a gnutls_session_t object concurrently from multiple threads
if they are exclusively calling gnutls_record_send/recv.

This patch implements a workaround for QEMU that adds a mutex lock
around any gnutls_record_send/recv call to serialize execution
within GNUTLS code. When GNUTLS calls into the push/pull functions
we can release the lock so the OS level I/O calls can at least
have some parallelism.

The big downside of this is that the actual encryption/decryption
code is fully serialized, which will halve performance of that
cipher operations if two threads are contending.

The workaround is not enabled by default, since most use of GNUTLS
in QEMU does not tickle the problem, only non-multifd migration
with a return path open is affected. Fortunately the migration
code also won't trigger the halving of performance, since only
the outbound channel diretion needs to sustain high data rates,
the inbound direction is low volume.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/qemu-devel/20250718150514.2635338-2-berrange@redhat.com
[add stub for qcrypto_tls_session_require_thread_safety; fix unused var]
Signed-off-by: Fabiano Rosas <farosas@suse.de>
2025-07-22 19:39:29 -03:00
..
ci lcitool: use newer Rust for Debian and Ubuntu 2025-05-06 16:02:04 +02:00
coccinelle hw: Define new device_class_set_legacy_reset() 2024-09-13 15:31:44 +01:00
codeconverter qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
coverage
coverity-scan include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
kvm target/i386: enumerate VMX nested-exception support 2024-06-08 10:33:38 +02:00
modules
oss-fuzz fuzz: disable leak-detection for oss-fuzz builds 2024-05-29 12:41:56 +02:00
performance
qapi qapi: Fix undocumented return values by generating something 2025-07-14 12:03:03 +02:00
qemu-guest-agent qemu-ga: Optimize freeze-hook script logic of logging error 2025-01-06 12:57:13 +02:00
qemugdb scripts/qemu-gdb: Support coroutine dumps in coredumps 2025-02-06 13:59:00 +01:00
qmp
rust rust: use native Meson support for clippy and rustdoc 2025-06-03 22:42:18 +02:00
simplebench
tracetool tracetool: removed the unused vcpu property 2025-07-22 10:44:49 -04:00
analyse-9p-simpletrace.py
analyse-locks-simpletrace.py
analyze-inclusions include/system: Move exec/memory.h to system/memory.h 2025-04-23 14:08:21 -07:00
analyze-migration.py migration: Add MIG_CMD_SWITCHOVER_START and its load handler 2025-03-06 06:47:33 +01:00
archive-source.sh subprojects: add the foreign crate 2025-06-05 20:24:51 +02:00
block-coroutine-wrapper.py block-coroutine-wrapper: use qemu_get_current_aio_context() 2023-12-21 22:49:28 +01:00
check_sparse.py
checkpatch.pl scripts/checkpatch.pl: mandate SPDX tag for Rust src files 2025-05-22 11:24:41 +01:00
clean-header-guards.pl
clean-includes include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
cleanup-trace-events.pl
cocci-macro-file.h win32: remove usage of attribute gcc_struct 2025-01-17 10:45:13 +00:00
compare-machine-types.py scripts: add script to compare compatibility properties 2024-04-25 10:12:48 +02:00
cpu-x86-uarch-abi.py scripts: drop comment about autogenerated CPU API file 2024-02-09 12:48:07 +00:00
decodetree.py
device-crash-test scripts: replace FSF postal address with licenses URL 2025-06-26 00:42:37 +02:00
disas-objdump.pl
dump-guest-memory.py
entitlement.sh
extract-vsssdk-headers
feature_to_c.py gdbstub: Add members to identify registers to GDBFeature 2024-02-28 09:10:11 +00:00
fix-multiline-comments.sh
get_maintainer.pl
git-submodule.sh
git.orderfile
hxtool
kernel-doc license: Update deprecated SPDX tag GPL-2.0 to GPL-2.0-only 2024-09-20 10:11:59 +03:00
make-config-poison.sh
make-release subprojects: add the foreign crate 2025-06-05 20:24:51 +02:00
meson-buildoptions.py scripts: dump stdin on meson-buildoptions error 2025-03-06 12:44:46 +01:00
meson-buildoptions.sh crypto: implement workaround for GNUTLS thread safety problems 2025-07-22 19:39:29 -03:00
meson.build
minikconf.py minikconf: print error entirely on stderr 2024-10-03 19:33:55 +02:00
modinfo-collect.py modinfo: lookup compile_commands.json by object 2025-05-12 16:08:24 +02:00
modinfo-generate.py
mtest2make.py tests/qtest: add TIMEOUT_MULTIPLIER 2024-12-12 10:25:38 -03:00
nsis.py Fix objdump output parser in "nsis.py" 2025-04-13 13:45:41 +03:00
probe-gdb-support.py testing: Enhance gdb probe script 2024-10-24 09:56:45 +01:00
python_qmp_updater.py
qapi-gen.py
qcow2-to-stdout.py scripts/qcow2-to-stdout.py: Add script to write qcow2 images to stdout 2025-03-13 17:57:23 +01:00
qemu-binfmt-conf.sh binfmt: Add --ignore-family option 2025-03-04 15:42:54 +10:00
qemu-gdb.py scripts/qemu-gdb: Always do full stack dump for python errors 2025-02-06 13:59:00 +01:00
qemu-plugin-symbols.py plugins: detect qemu plugin API symbols from header 2024-11-25 10:27:43 +00:00
qemu-stamp.py
qemu-trace-stap scripts: improve error from qemu-trace-stap on missing 'stap' 2025-02-12 10:03:18 -05:00
qemu-version.sh
qom-cast-macro-clean-cocci-gen.py licenses: Remove SPDX tags not being license identifier for Linaro 2025-01-30 13:01:22 +03:00
rdma-migration-helper.sh qtest/migration/rdma: Add test for rdma migration with ipv6 2025-05-20 11:26:32 -04:00
refresh-pxe-roms.sh
render_block_graph.py
replay-dump.py tests/avocado: excercise scripts/replay-dump.py in replay tests 2024-08-16 14:04:19 +01:00
shaderinclude.py
signrom.py
simpletrace.py
symlink-install-tree.py scripts/symlink-install-tree.py: Fix MESONINTROSPECT parsing 2024-10-29 15:04:46 +00:00
tracetool.py tracetool: remove redundant --target-type / --target-name args 2024-03-12 14:52:07 -04:00
u2f-setup-gen.py
undefsym.py
update-linux-headers.sh linux-headers: Remove the 32-bit arm headers 2025-07-21 07:58:57 +02:00
update-mips-syscall-args.sh
update-syscalltbl.sh linux-user,loongarch: move to syscalltbl file 2024-09-22 09:30:18 +02:00
userfaultfd-wrlat.py
vmstate-static-checker.py scripts/vmstate-static-checker.py: Add new hpet entry for num_timers 2025-05-20 11:26:32 -04:00
xen-detect.c
xml-preprocess-test.py
xml-preprocess.py