[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 22/31] exec: keep ram block across fork when using qtest
From: |
Stefan Hajnoczi |
Subject: |
[PULL 22/31] exec: keep ram block across fork when using qtest |
Date: |
Sat, 22 Feb 2020 08:50:21 +0000 |
From: Alexander Bulekov <address@hidden>
Ram blocks were marked MADV_DONTFORK breaking fuzzing-tests which
execute each test-input in a forked process.
Signed-off-by: Alexander Bulekov <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Darren Kenny <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
exec.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/exec.c b/exec.c
index 8e9cc3b47c..c930040f83 100644
--- a/exec.c
+++ b/exec.c
@@ -35,6 +35,7 @@
#include "sysemu/kvm.h"
#include "sysemu/sysemu.h"
#include "sysemu/tcg.h"
+#include "sysemu/qtest.h"
#include "qemu/timer.h"
#include "qemu/config-file.h"
#include "qemu/error-report.h"
@@ -2305,8 +2306,15 @@ static void ram_block_add(RAMBlock *new_block, Error
**errp, bool shared)
if (new_block->host) {
qemu_ram_setup_dump(new_block->host, new_block->max_length);
qemu_madvise(new_block->host, new_block->max_length,
QEMU_MADV_HUGEPAGE);
- /* MADV_DONTFORK is also needed by KVM in absence of synchronous MMU */
- qemu_madvise(new_block->host, new_block->max_length,
QEMU_MADV_DONTFORK);
+ /*
+ * MADV_DONTFORK is also needed by KVM in absence of synchronous MMU
+ * Configure it unless the machine is a qtest server, in which case
+ * KVM is not used and it may be forked (eg for fuzzing purposes).
+ */
+ if (!qtest_enabled()) {
+ qemu_madvise(new_block->host, new_block->max_length,
+ QEMU_MADV_DONTFORK);
+ }
ram_block_notify_add(new_block->host, new_block->max_length);
}
}
--
2.24.1
- [PULL 12/31] module: check module wasn't already initialized, (continued)
- [PULL 12/31] module: check module wasn't already initialized, Stefan Hajnoczi, 2020/02/22
- [PULL 13/31] fuzz: add FUZZ_TARGET module type, Stefan Hajnoczi, 2020/02/22
- [PULL 14/31] qtest: add qtest_server_send abstraction, Stefan Hajnoczi, 2020/02/22
- [PULL 15/31] libqtest: add a layer of abstraction to send/recv, Stefan Hajnoczi, 2020/02/22
- [PULL 16/31] libqtest: make bufwrite rely on the TransportOps, Stefan Hajnoczi, 2020/02/22
- [PULL 17/31] qtest: add in-process incoming command handler, Stefan Hajnoczi, 2020/02/22
- [PULL 18/31] libqos: rename i2c_send and i2c_recv, Stefan Hajnoczi, 2020/02/22
- [PULL 19/31] libqos: split qos-test and libqos makefile vars, Stefan Hajnoczi, 2020/02/22
- [PULL 21/31] fuzz: add fuzzer skeleton, Stefan Hajnoczi, 2020/02/22
- [PULL 20/31] libqos: move useful qos-test funcs to qos_external, Stefan Hajnoczi, 2020/02/22
- [PULL 22/31] exec: keep ram block across fork when using qtest,
Stefan Hajnoczi <=
- [PULL 23/31] main: keep rcu_atfork callback enabled for qtest, Stefan Hajnoczi, 2020/02/22
- [PULL 24/31] fuzz: support for fork-based fuzzing., Stefan Hajnoczi, 2020/02/22
- [PULL 25/31] fuzz: add support for qos-assisted fuzz targets, Stefan Hajnoczi, 2020/02/22
- [PULL 26/31] fuzz: add target/fuzz makefile rules, Stefan Hajnoczi, 2020/02/22
- [PULL 27/31] fuzz: add configure flag --enable-fuzzing, Stefan Hajnoczi, 2020/02/22
- [PULL 28/31] fuzz: add i440fx fuzz targets, Stefan Hajnoczi, 2020/02/22
- [PULL 29/31] fuzz: add virtio-net fuzz target, Stefan Hajnoczi, 2020/02/22