From 582b55a96ac4f66cea64d82e47651bd5ef38a8ec Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Wed, 11 Dec 2013 14:17:44 +0100 Subject: 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 --- include/exec/cpu-common.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/exec/cpu-common.h') diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index e4996e19c3..8f33122c9f 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -110,6 +110,7 @@ void stq_phys(hwaddr addr, uint64_t val); void cpu_physical_memory_write_rom(hwaddr addr, const uint8_t *buf, int len); +void cpu_flush_icache_range(hwaddr start, int len); extern struct MemoryRegion io_mem_rom; extern struct MemoryRegion io_mem_notdirty; -- cgit v1.2.3