diff options
author | Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> | 2018-01-10 16:48:46 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-01-16 14:54:52 +0100 |
commit | 15a356c49ac747a7202ed703949a178a054f2a55 (patch) | |
tree | ebd3143081764682bed1ecfe53307338db08dfeb | |
parent | 79f9c75e1707082e56723787e6b3610a46843e20 (diff) | |
download | qemu-15a356c49ac747a7202ed703949a178a054f2a55.zip |
cpu: flush TB cache when loading VMState
Flushing TB cache is required because TBs key in the cache may match
different code which existed in the previous state.
Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Signed-off-by: Maria Klimushenkova <maria.klimushenkova@ispras.ru>
Message-Id: <20180110134846.12940.99993.stgit@pasha-VirtualBox>
[Add comment suggested by Peter Maydell. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
-rw-r--r-- | exec.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -623,6 +623,13 @@ static int cpu_common_post_load(void *opaque, int version_id) cpu->interrupt_request &= ~0x01; tlb_flush(cpu); + /* loadvm has just updated the content of RAM, bypassing the + * usual mechanisms that ensure we flush TBs for writes to + * memory we've translated code from. So we must flush all TBs, + * which will now be stale. + */ + tb_flush(cpu); + return 0; } |