summaryrefslogtreecommitdiffstats
path: root/hw/core/loader.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin2014-11-17 06:49:21 +0100
committerMichael S. Tsirkin2014-11-24 19:57:10 +0100
commitad5b88b1f198182642b6cbf3dacb4cade0c80fb9 (patch)
tree9a476fecc99c7ac1179cf88af462a3c2bc50a978 /hw/core/loader.c
parenthw/pci: fix crash on shpc error flow (diff)
downloadqemu-ad5b88b1f198182642b6cbf3dacb4cade0c80fb9.tar.gz
qemu-ad5b88b1f198182642b6cbf3dacb4cade0c80fb9.tar.xz
qemu-ad5b88b1f198182642b6cbf3dacb4cade0c80fb9.zip
acpi-build: mark RAM dirty on table update
acpi build modifies internal FW CFG RAM on first access but we forgot to mark it dirty. If this RAM has been migrated already, it won't be migrated again, returning corrupted tables to guest. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/core/loader.c')
-rw-r--r--hw/core/loader.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/core/loader.c b/hw/core/loader.c
index fc155359f8..7527fd3036 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -811,12 +811,12 @@ err:
return -1;
}
-void *rom_add_blob(const char *name, const void *blob, size_t len,
+ram_addr_t rom_add_blob(const char *name, const void *blob, size_t len,
hwaddr addr, const char *fw_file_name,
FWCfgReadCallback fw_callback, void *callback_opaque)
{
Rom *rom;
- void *data = NULL;
+ ram_addr_t ret = RAM_ADDR_MAX;
rom = g_malloc0(sizeof(*rom));
rom->name = g_strdup(name);
@@ -828,11 +828,13 @@ void *rom_add_blob(const char *name, const void *blob, size_t len,
rom_insert(rom);
if (fw_file_name && fw_cfg) {
char devpath[100];
+ void *data;
snprintf(devpath, sizeof(devpath), "/rom@%s", fw_file_name);
if (rom_file_has_mr) {
data = rom_set_mr(rom, OBJECT(fw_cfg), devpath);
+ ret = memory_region_get_ram_addr(rom->mr);
} else {
data = rom->data;
}
@@ -841,7 +843,7 @@ void *rom_add_blob(const char *name, const void *blob, size_t len,
fw_callback, callback_opaque,
data, rom->romsize);
}
- return data;
+ return ret;
}
/* This function is specific for elf program because we don't need to allocate