On Thu, Sep 19, 2019 at 02:01:53PM +0000, Oleinik, Alexander wrote: > On Thu, 2019-09-19 at 13:54 +0100, Stefan Hajnoczi wrote: > > On Wed, Sep 18, 2019 at 11:19:44PM +0000, Oleinik, Alexander wrote: > > > diff --git a/exec.c b/exec.c > > > index 235d6bc883..d3838f4ea4 100644 > > > --- a/exec.c > > > +++ b/exec.c > > > @@ -2295,7 +2295,9 @@ static void ram_block_add(RAMBlock > > > *new_block, Error **errp, bool shared) > > > 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 */ > > > +#ifndef CONFIG_FUZZ /* This conflicts with fork-based fuzzing */ > > > qemu_madvise(new_block->host, new_block->max_length, > > > QEMU_MADV_DONTFORK); > > > +#endif > > > ram_block_notify_add(new_block->host, new_block- > > > >max_length); > > > } > > > } > > > > I didn't check Makefile changes but regular softmmu binaries should > > continue to work with --enable-fuzzing so we cannot use #ifdef here. > > Perhaps this should be a runtime check similar to qtest_enabled() > > Yes - I'll add a runtime check. The makefile requires a make clean > between softmmu and fuzzer builds, since the ".o"s for the fuzzer build > are compiled with fsanitize=fuzzer(must be linked against libfuzzer). > I can see that the #ifndef CONFIG_FUZZ is a proper softmmu builds with > --enable-fuzzer are currently broken due to the ifndef CONFIG_FUZZ > check. In that case the fuzzer is a whole different make target and shouldn't share .o files with *-softmmu/ build directories. Stefan