From 72b511c091895b6ea267ad1305afd94ffe580135 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 20 Mar 2021 21:08:14 -0500 Subject: [PATCH] xbox: Fix for MCPX ROM overlay when not specified --- hw/xbox/xbox.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/xbox/xbox.c b/hw/xbox/xbox.c index 80361c4bfd..333285a961 100644 --- a/hw/xbox/xbox.c +++ b/hw/xbox/xbox.c @@ -162,14 +162,14 @@ static void xbox_flash_init(MemoryRegion *rom_memory) assert(rc == bootrom_size); close(fd); g_free(filename); - - MemoryRegion *mcpx = g_malloc(sizeof(MemoryRegion)); - memory_region_init_ram(mcpx, NULL, "xbox.mcpx", bios_size, - &error_fatal); - rom_add_blob_fixed("xbox.mcpx", bios_data, bios_size, -bios_size); - memory_region_add_subregion_overlap(rom_memory, -bios_size, mcpx, 1); } + // Leave last BIOS image overlay writeable to satisfy cache dependency + MemoryRegion *mcpx = g_malloc(sizeof(MemoryRegion)); + memory_region_init_ram(mcpx, NULL, "xbox.mcpx", bios_size, &error_fatal); + rom_add_blob_fixed("xbox.mcpx", bios_data, bios_size, -bios_size); + memory_region_add_subregion_overlap(rom_memory, -bios_size, mcpx, 1); + g_free(bios_data); /* duplicated by `rom_add_blob_fixed` */ }