mirror of https://github.com/xemu-project/xemu.git
i386: firmware parsing and sev setup for -bios loaded firmware
Don't register firmware as rom, not needed (see comment). Add x86_firmware_configure() call for proper sev initialization. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Xiaoyao Li <xiaoyao.li@intel.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Tested-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20220425135051.551037-4-kraxel@redhat.com>
This commit is contained in:
parent
966f1ca56f
commit
a8152c4e46
|
@ -1115,6 +1115,18 @@ void x86_bios_rom_init(MachineState *ms, const char *default_firmware,
|
||||||
}
|
}
|
||||||
bios = g_malloc(sizeof(*bios));
|
bios = g_malloc(sizeof(*bios));
|
||||||
memory_region_init_ram(bios, NULL, "pc.bios", bios_size, &error_fatal);
|
memory_region_init_ram(bios, NULL, "pc.bios", bios_size, &error_fatal);
|
||||||
|
if (sev_enabled()) {
|
||||||
|
/*
|
||||||
|
* The concept of a "reset" simply doesn't exist for
|
||||||
|
* confidential computing guests, we have to destroy and
|
||||||
|
* re-launch them instead. So there is no need to register
|
||||||
|
* the firmware as rom to properly re-initialize on reset.
|
||||||
|
* Just go for a straight file load instead.
|
||||||
|
*/
|
||||||
|
void *ptr = memory_region_get_ram_ptr(bios);
|
||||||
|
load_image_size(filename, ptr, bios_size);
|
||||||
|
x86_firmware_configure(ptr, bios_size);
|
||||||
|
} else {
|
||||||
if (!isapc_ram_fw) {
|
if (!isapc_ram_fw) {
|
||||||
memory_region_set_readonly(bios, true);
|
memory_region_set_readonly(bios, true);
|
||||||
}
|
}
|
||||||
|
@ -1122,6 +1134,7 @@ void x86_bios_rom_init(MachineState *ms, const char *default_firmware,
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
goto bios_error;
|
goto bios_error;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
g_free(filename);
|
g_free(filename);
|
||||||
|
|
||||||
/* map the last 128KB of the BIOS in ISA space */
|
/* map the last 128KB of the BIOS in ISA space */
|
||||||
|
|
Loading…
Reference in New Issue