Commit c380030266 for qemu.org
commit c3800302668ff745e10b810f12723eac7068abda
Author: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Date: Tue Nov 24 15:07:02 2026 +0100
hw/ppc/amigaone: Invalidate TBs on NVRAM write
The NVRAM is a ROM device, mapped in romd mode, so the guest can
execute from it. Its write callback stores the byte with a direct
store, which TCG does not see: translated blocks of the byte survive.
Flush the written byte, as the other models (TYPE_PFLASH_CFI01/2
and TYPE_NRF51_NVM) do.
Cc: qemu-stable@nongnu.org
Fixes: addff513a10e ("ppc/amigaone: Implement NVRAM emulation")
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Acked-by: BALATON Zoltan <balaton@eik.bme.hu>
Message-ID: <20261124180138.69682-1-philmd@oss.qualcomm.com>
diff --git a/hw/ppc/amigaone.c b/hw/ppc/amigaone.c
index 2e94e80b56..9b60782172 100644
--- a/hw/ppc/amigaone.c
+++ b/hw/ppc/amigaone.c
@@ -109,6 +109,7 @@ static void nvram_write(void *opaque, hwaddr addr, uint64_t val,
uint8_t *p = memory_region_get_ram_ptr(&s->mr);
p[addr] = val;
+ memory_region_flush_rom_device(&s->mr, addr, 1);
if (s->blk && blk_pwrite(s->blk, addr, 1, &val, 0) < 0) {
error_report("%s: could not write %s", __func__, blk_name(s->blk));
}