summaryrefslogtreecommitdiff
path: root/hw/block/pc_sysfw.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/block/pc_sysfw.c')
-rw-r--r--hw/block/pc_sysfw.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/hw/block/pc_sysfw.c b/hw/block/pc_sysfw.c
index 0d95c8a926..aad8614465 100644
--- a/hw/block/pc_sysfw.c
+++ b/hw/block/pc_sysfw.c
@@ -194,11 +194,23 @@ static void old_pc_system_rom_init(MemoryRegion *rom_memory)
bios);
}
+/*
+ * Bug-compatible flash vs. ROM selection enabled?
+ * A few older machines enable this.
+ */
+bool pc_sysfw_flash_vs_rom_bug_compatible;
+
void pc_system_firmware_init(MemoryRegion *rom_memory)
{
DriveInfo *pflash_drv;
PcSysFwDevice *sysfw_dev;
+ /*
+ * TODO This device exists only so that users can switch between
+ * use of flash and ROM for the BIOS. The ability to switch was
+ * created because flash doesn't work with KVM. Once it does, we
+ * should drop this device for new machine types.
+ */
sysfw_dev = (PcSysFwDevice*) qdev_create(NULL, "pc-sysfw");
qdev_init_nofail(DEVICE(sysfw_dev));
@@ -212,7 +224,11 @@ void pc_system_firmware_init(MemoryRegion *rom_memory)
/* Currently KVM cannot execute from device memory.
Use old rom based firmware initialization for KVM. */
- if (kvm_enabled()) {
+ /*
+ * This is a Bad Idea, because it makes enabling/disabling KVM
+ * guest-visible. Do it only in bug-compatibility mode.
+ */
+ if (pc_sysfw_flash_vs_rom_bug_compatible && kvm_enabled()) {
if (pflash_drv != NULL) {
fprintf(stderr, "qemu: pflash cannot be used with kvm enabled\n");
exit(1);
@@ -239,7 +255,7 @@ void pc_system_firmware_init(MemoryRegion *rom_memory)
}
static Property pcsysfw_properties[] = {
- DEFINE_PROP_UINT8("rom_only", PcSysFwDevice, rom_only, 0),
+ DEFINE_PROP_UINT8("rom_only", PcSysFwDevice, rom_only, 1),
DEFINE_PROP_END_OF_LIST(),
};