0a122b
From ba3bbcb7fe5b4bb2e8be8dee46cfb637333471f6 Mon Sep 17 00:00:00 2001
0a122b
From: Laszlo Ersek <lersek@redhat.com>
0a122b
Date: Sat, 11 Jan 2014 17:59:52 +0100
0a122b
Subject: [PATCH 02/22] Revert "pc: Disable the "use flash device for BIOS unless KVM" misfeature"
0a122b
0a122b
RH-Author: Laszlo Ersek <lersek@redhat.com>
0a122b
Message-id: <1389463208-6278-3-git-send-email-lersek@redhat.com>
0a122b
Patchwork-id: 56614
0a122b
O-Subject: [RHEL-7.0 qemu-kvm PATCH 02/18] Revert "pc: Disable the "use flash device for BIOS unless KVM" misfeature"
0a122b
Bugzilla: 1032346
0a122b
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
0a122b
RH-Acked-by: Amos Kong <akong@redhat.com>
0a122b
RH-Acked-by: Andrew Jones <drjones@redhat.com>
0a122b
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
0a122b
0a122b
This reverts commit 23231f783d082bef74ba1d9fed6b07fdd058cb87.
0a122b
0a122b
RHEL-7 note -- I'll quote Markus' awesome original, RHEL-7-specific commit
0a122b
message here:
0a122b
0a122b
> Use of a flash memory device for the BIOS was added in series "[PATCH
0a122b
> v10 0/8] PC system flash support", commit 4732dca..1b89faf, v1.1.
0a122b
>
0a122b
> Flash vs. ROM is a guest-visible difference.  Thus, flash use had to
0a122b
> be suppressed for machine types pc-1.0 and older.  This was
0a122b
> accomplished by adding a dummy device "pc-sysfw" with property
0a122b
> "rom_only":
0a122b
>
0a122b
> * Non-zero rom_only means "use ROM".  Default for pc-1.0 and older.
0a122b
> * Zero rom_only means "maybe use flash".  Default for newer machines.
0a122b
>
0a122b
> Not only is the dummy device ugly, it was also retroactively added to
0a122b
> the older machine types!  Fortunately, it's not guest-visible (thus no
0a122b
> immediate guest ABI breakage), and has no vmstate (thus no immediate
0a122b
> migration breakage).  Breakage occurs only if the user unwisely
0a122b
> enables flash by setting rom_only to zero.  Patch review FAIL #1.
0a122b
>
0a122b
> Why "maybe use flash"?  Flash didn't work with KVM.  Therefore,
0a122b
> rom_only=0 really means "use flash, except when KVM is enabled, use
0a122b
> ROM".  This is a Bad Idea, because it makes enabling/ disabling KVM
0a122b
> guest-visible.  Patch review FAIL #2.
0a122b
>
0a122b
> Aside: it also precludes migrating between KVM on and off, but that's
0a122b
> not possible for other reasons anyway.
0a122b
>
0a122b
> Upstream commit 9953f88 killed the misfeature for new machine types.
0a122b
> Upstream commit 9e1c2ec reverted the kill, but left a dead variable
0a122b
> behind.  This is what's in RHEL-7 is before this patch.
0a122b
>
0a122b
> KVM has recently been made to support flash (KVM_CAP_READONLY_MEM),
0a122b
> which permitted upstream QEMU to redo the flash vs. ROM switch
0a122b
> properly (commit 338ea90..dafb82e).
0a122b
0a122b
This commit range is Jordan's series that this backport is all about.
0a122b
0a122b
> The required follow-up cleanup
0a122b
> hasn't been committed, yet: Paolo's [PATCH v2 0/3] Remove legacy sysfw
0a122b
> code.
0a122b
0a122b
It has now, I'm including it in the series.
0a122b
0a122b
> Instead of backporting all that, I'm simply ripping out the flash
0a122b
> feature.  ROM has been working just fine for us, and I don't think we
0a122b
> should complicate RHEL-7 maintenance and support by having two ways to
0a122b
> map BIOS, at least not without sufficient business reason.
0a122b
0a122b
The business reason seems to be OVMF...
0a122b
0a122b
> The result behaves just like upstream with the follow-up cleanup
0a122b
> applied, except -pflash doesn't affect the BIOS mapping, but remains
0a122b
> as it always was: it creates an unused drive.
0a122b
0a122b
... and for it we need -pflash to create the real thing.
0a122b
0a122b
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
0a122b
---
0a122b
 hw/block/pc_sysfw.c | 9 ---------
0a122b
 1 file changed, 9 deletions(-)
0a122b
0a122b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
---
0a122b
 hw/block/pc_sysfw.c |    9 ---------
0a122b
 1 files changed, 0 insertions(+), 9 deletions(-)
0a122b
0a122b
diff --git a/hw/block/pc_sysfw.c b/hw/block/pc_sysfw.c
0a122b
index 0bc5b7a..6149b20 100644
0a122b
--- a/hw/block/pc_sysfw.c
0a122b
+++ b/hw/block/pc_sysfw.c
0a122b
@@ -36,7 +36,6 @@
0a122b
 
0a122b
 #define BIOS_FILENAME "bios.bin"
0a122b
 
0a122b
-#if 0   /* Disabled for Red Hat Enterprise Linux */
0a122b
 typedef struct PcSysFwDevice {
0a122b
     SysBusDevice busdev;
0a122b
     uint8_t rom_only;
0a122b
@@ -136,7 +135,6 @@ static void pc_system_flash_init(MemoryRegion *rom_memory,
0a122b
 
0a122b
     pc_isa_bios_init(rom_memory, flash_mem, size);
0a122b
 }
0a122b
-#endif  /* Disabled for Red Hat Enterprise Linux */
0a122b
 
0a122b
 static void old_pc_system_rom_init(MemoryRegion *rom_memory)
0a122b
 {
0a122b
@@ -193,7 +191,6 @@ static void old_pc_system_rom_init(MemoryRegion *rom_memory)
0a122b
                                 bios);
0a122b
 }
0a122b
 
0a122b
-#if 0   /* Disabled for Red Hat Enterprise Linux */
0a122b
 /*
0a122b
  * Bug-compatible flash vs. ROM selection enabled?
0a122b
  * A few older machines enable this.
0a122b
@@ -288,9 +285,3 @@ static void pcsysfw_register (void)
0a122b
 
0a122b
 type_init (pcsysfw_register);
0a122b
 
0a122b
-#else   /* Disabled for Red Hat Enterprise Linux */
0a122b
-void pc_system_firmware_init(MemoryRegion *rom_memory)
0a122b
-{
0a122b
-    old_pc_system_rom_init(rom_memory);
0a122b
-}
0a122b
-#endif
0a122b
-- 
0a122b
1.7.1
0a122b