[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v9 15/23] main: keep rcu_atfork callback enabled for qtest
From: |
Alexander Bulekov |
Subject: |
[PATCH v9 15/23] main: keep rcu_atfork callback enabled for qtest |
Date: |
Tue, 11 Feb 2020 15:35:02 -0500 |
The qtest-based fuzzer makes use of forking to reset-state between
tests. Keep the callback enabled, so the call_rcu thread gets created
within the child process.
Signed-off-by: Alexander Bulekov <address@hidden>
Reviewed-by: Darren Kenny <address@hidden>
Acked-by: Stefan Hajnoczi <address@hidden>
---
softmmu/vl.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 46a48d09df..78f6530620 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -3813,7 +3813,17 @@ void qemu_init(int argc, char **argv, char **envp)
set_memory_options(&ram_slots, &maxram_size, machine_class);
os_daemonize();
- rcu_disable_atfork();
+
+ /*
+ * If QTest is enabled, keep the rcu_atfork enabled, since system processes
+ * may be forked testing purposes (e.g. fork-server based fuzzing) The fork
+ * should happen before a signle cpu instruction is executed, to prevent
+ * deadlocks. See commit 73c6e40, rcu: "completely disable pthread_atfork
+ * callbacks as soon as possible"
+ */
+ if (!qtest_enabled()) {
+ rcu_disable_atfork();
+ }
if (pid_file && !qemu_write_pidfile(pid_file, &err)) {
error_reportf_err(err, "cannot create PID file: ");
--
2.25.0
- Re: [PATCH v9 02/23] softmmu: move vl.c to softmmu/, (continued)
- [PATCH v9 04/23] module: check module wasn't already initialized, Alexander Bulekov, 2020/02/11
- [PATCH v9 03/23] softmmu: split off vl.c:main() into main.c, Alexander Bulekov, 2020/02/11
- [PATCH v9 05/23] fuzz: add FUZZ_TARGET module type, Alexander Bulekov, 2020/02/11
- [PATCH v9 06/23] qtest: add qtest_server_send abstraction, Alexander Bulekov, 2020/02/11
- [PATCH v9 11/23] libqos: split qos-test and libqos makefile vars, Alexander Bulekov, 2020/02/11
- [PATCH v9 09/23] qtest: add in-process incoming command handler, Alexander Bulekov, 2020/02/11
- [PATCH v9 10/23] libqos: rename i2c_send and i2c_recv, Alexander Bulekov, 2020/02/11
- [PATCH v9 07/23] libqtest: add a layer of abstraction to send/recv, Alexander Bulekov, 2020/02/11
- [PATCH v9 08/23] libqtest: make bufwrite rely on the TransportOps, Alexander Bulekov, 2020/02/11
- [PATCH v9 15/23] main: keep rcu_atfork callback enabled for qtest,
Alexander Bulekov <=
- [PATCH v9 12/23] libqos: move useful qos-test funcs to qos_external, Alexander Bulekov, 2020/02/11
- [PATCH v9 14/23] exec: keep ram block across fork when using qtest, Alexander Bulekov, 2020/02/11
- [PATCH v9 17/23] fuzz: add support for qos-assisted fuzz targets, Alexander Bulekov, 2020/02/11
- [PATCH v9 16/23] fuzz: support for fork-based fuzzing., Alexander Bulekov, 2020/02/11
- [PATCH v9 19/23] fuzz: add configure flag --enable-fuzzing, Alexander Bulekov, 2020/02/11
- [PATCH v9 13/23] fuzz: add fuzzer skeleton, Alexander Bulekov, 2020/02/11
- [PATCH v9 18/23] fuzz: add target/fuzz makefile rules, Alexander Bulekov, 2020/02/11
- [PATCH v9 22/23] fuzz: add virtio-scsi fuzz target, Alexander Bulekov, 2020/02/11
- [PATCH v9 20/23] fuzz: add i440fx fuzz targets, Alexander Bulekov, 2020/02/11