env var to disable qemu caching

This commit is contained in:
Andrea Fioraldi
2019-11-27 17:02:43 +01:00
parent 8c0d247126
commit b2896c79c6

View File

@ -84,6 +84,8 @@ __thread abi_ulong afl_prev_loc;
/* Set in the child process in forkserver mode: */
static int forkserver_installed = 0;
static int disable_caching = 0;
unsigned char afl_fork_child;
unsigned int afl_forksrv_pid;
unsigned char is_persistent;
@ -205,6 +207,8 @@ static void afl_setup(void) {
behaviour, and seems to work alright? */
rcu_disable_atfork();
disable_caching = getenv("AFL_QEMU_DISABLE_CACHE") != NULL;
is_persistent = getenv("AFL_QEMU_PERSISTENT_ADDR") != NULL;
@ -422,6 +426,8 @@ static void afl_request_tsl(target_ulong pc, target_ulong cb, uint32_t flags,
uint32_t cf_mask, TranslationBlock *last_tb,
int tb_exit) {
if (disable_caching) return;
struct afl_tsl t;
struct afl_chain c;