]> git.ipfire.org Git - thirdparty/qemu.git/commit
exec.c: Factor out before/after actions for notdirty memory writes
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 20 Nov 2017 18:08:27 +0000 (18:08 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 21 Nov 2017 12:09:25 +0000 (12:09 +0000)
commit27266271977c5a30f2f7d493e042be1897827bdd
tree868a090274abc1c4419b8f6fba94f46d84920b58
parenta61d343986c13d9ea607f42e5dadea3261c14ba5
exec.c: Factor out before/after actions for notdirty memory writes

The function notdirty_mem_write() has a sequence of actions
it has to do before and after the actual business of writing
data to host RAM to ensure that dirty flags are correctly
updated and we flush any TCG translations for the region.
We need to do this also in other places that write directly
to host RAM, most notably the TCG atomic helper functions.
Pull out the before and after pieces into their own functions.

We use an API where the prepare function stashes the various
bits of information about the write into a struct for the
complete function to use, because in the calls for the atomic
helpers the place where the complete function will be called
doesn't have the information to hand.

Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1511201308-23580-2-git-send-email-peter.maydell@linaro.org
exec.c
include/exec/memory-internal.h