qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-block] [SeaBIOS] [PATCH v2 4/5] config: Add toggle for bootdevice


From: Sam Eiderman
Subject: [Qemu-block] [SeaBIOS] [PATCH v2 4/5] config: Add toggle for bootdevice information
Date: Mon, 17 Jun 2019 18:04:18 +0300

Add the "BIOS_GEOMETRY" toggle to remove boot device information received
through fw_cfg.

We will use this toggle in QEMU to reduce the size of the 128k SeaBIOS
rom, which is only used in old compat versions, where this boot device
information does not exist.

Reviewed-by: Karl Heubaum <address@hidden>
Reviewed-by: Arbel Moshe <address@hidden>
Signed-off-by: Sam Eiderman <address@hidden>
---
 src/Kconfig | 7 +++++++
 src/boot.c  | 8 ++++++++
 2 files changed, 15 insertions(+)

diff --git a/src/Kconfig b/src/Kconfig
index 55a87cb7..0b4c1c0d 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -72,6 +72,13 @@ endchoice
         help
             Support controlling of the boot order via the fw_cfg/CBFS
             "bootorder" file.
+    config BIOS_GEOMETRY
+        depends on BOOT
+        bool "Boot device bios geometry override"
+        default y
+        help
+            Support overriding bios (logical) geometry of boot devices via the
+            fw_cfg/CBFS "bios-geometry" file.
 
     config COREBOOT_FLASH
         depends on COREBOOT
diff --git a/src/boot.c b/src/boot.c
index 8162cb74..695bc189 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -95,6 +95,8 @@ static int BiosGeometryCount;
 static void
 loadBiosGeometry(void)
 {
+    if (!CONFIG_BIOS_GEOMETRY)
+        return;
     BiosGeometryCount = 0;
     int fsize;
     char *f = romfile_loadfile("bios-geometry", &fsize);
@@ -163,6 +165,8 @@ boot_lchs_find(const char *glob)
 
 int boot_lchs_find_pci_device(struct pci_device *pci, struct chs_s *chs)
 {
+    if (!CONFIG_BIOS_GEOMETRY)
+        return -1;
     char desc[256];
     build_pci_path(desc, sizeof(desc), "*", pci);
     BootDeviceLCHS *b = boot_lchs_find(desc);
@@ -177,6 +181,8 @@ int boot_lchs_find_pci_device(struct pci_device *pci, 
struct chs_s *chs)
 int boot_lchs_find_scsi_device(struct pci_device *pci, int target, int lun,
                                struct chs_s *chs)
 {
+    if (!CONFIG_BIOS_GEOMETRY)
+        return -1;
     if (!pci)
         // support only pci machine for now
         return -1;
@@ -196,6 +202,8 @@ int boot_lchs_find_scsi_device(struct pci_device *pci, int 
target, int lun,
 int boot_lchs_find_ata_device(struct pci_device *pci, int chanid, int slave,
                               struct chs_s *chs)
 {
+    if (!CONFIG_BIOS_GEOMETRY)
+        return -1;
     if (!pci)
         // support only pci machine for now
         return -1;
-- 
2.13.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]