Blame SOURCES/kvm-Revert-pc-Disable-the-use-flash-device-for-BIOS-unle.patch

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