]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
roms: Flush icache when writing roms to guest memory
authorAlexander Graf <agraf@suse.de>
Thu, 12 Dec 2013 09:29:19 +0000 (10:29 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 13 Dec 2013 12:38:50 +0000 (13:38 +0100)
commita94b36ddd6af28593c8a5171b5100e6c3dfc063e
treecd7c104fa7e08538dcff948109b21ae4a5b1ce97
parent0522604b09b8cff54ba2450a7478da2a4d084817
roms: Flush icache when writing roms to guest memory

We use the rom infrastructure to write firmware and/or initial kernel
blobs into guest address space. So we're basically emulating the cache
off phase on very early system bootup.

That phase is usually responsible for clearing the instruction cache for
anything it writes into cachable memory, to ensure that after reboot we
don't happen to execute stale bits from the instruction cache.

So we need to invalidate the icache every time we write a rom into guest
address space. We do not need to do this for every DMA since the guest
expects it has to flush the icache manually in that case.

This fixes random reboot issues on e5500 (booke ppc) for me.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
exec.c
hw/core/loader.c
include/exec/cpu-common.h