[SeaBIOS] [RFC] paravirt: Only enable sercon in NOGRAPHIC mode if no other console specified

Kevin O'Connor posted 1 patch 6 years, 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/seabios tags/patchew/20171110172438.31256-1-kevin@koconnor.net
src/fw/paravirt.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
[SeaBIOS] [RFC] paravirt: Only enable sercon in NOGRAPHIC mode if no other console specified
Posted by Kevin O'Connor 6 years, 5 months ago
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
---

I wonder if it would be better to only enable sercon with 0x3f8 in the
nographic case if QEMU has neither specified a sercon-port and has not
requested sgabios to be loaded.  This is just an idea.

-Kevin

---
 src/fw/paravirt.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/fw/paravirt.c b/src/fw/paravirt.c
index 9674ab8..0770c47 100644
--- a/src/fw/paravirt.c
+++ b/src/fw/paravirt.c
@@ -513,12 +513,6 @@ qemu_cfg_legacy(void)
     qemu_romfile_add("etc/irq0-override", QEMU_CFG_IRQ0_OVERRIDE, 0, 1);
     qemu_romfile_add("etc/max-cpus", QEMU_CFG_MAX_CPUS, 0, 2);
 
-    // serial console
-    u16 nogfx = 0;
-    qemu_cfg_read_entry(&nogfx, QEMU_CFG_NOGRAPHIC, sizeof(nogfx));
-    if (nogfx)
-        const_romfile_add_int("etc/sercon-port", PORT_SERIAL1);
-
     // NUMA data
     u64 numacount;
     qemu_cfg_read_entry(&numacount, QEMU_CFG_NUMA, sizeof(numacount));
@@ -620,4 +614,11 @@ void qemu_cfg_init(void)
         acpi_pm_base = 0x0600;
         dprintf(1, "Moving pm_base to 0x%x\n", acpi_pm_base);
     }
+
+    // serial console
+    u16 nogfx = 0;
+    qemu_cfg_read_entry(&nogfx, QEMU_CFG_NOGRAPHIC, sizeof(nogfx));
+    if (nogfx && !romfile_find("etc/sercon-port")
+        && !romfile_find("vgaroms/sgabios.bin"))
+        const_romfile_add_int("etc/sercon-port", PORT_SERIAL1);
 }
-- 
2.9.5


_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios
Re: [SeaBIOS] [RFC] paravirt: Only enable sercon in NOGRAPHIC mode if no other console specified
Posted by Gerd Hoffmann 6 years, 5 months ago
On Fri, Nov 10, 2017 at 12:24:38PM -0500, Kevin O'Connor wrote:
> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
> ---
> 
> I wonder if it would be better to only enable sercon with 0x3f8 in the
> nographic case if QEMU has neither specified a sercon-port and has not
> requested sgabios to be loaded.  This is just an idea.

Looks good to me.

cheers,
  Gerd


_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios
Re: [SeaBIOS] [RFC] paravirt: Only enable sercon in NOGRAPHIC mode if no other console specified
Posted by Kevin O'Connor 6 years, 5 months ago
On Mon, Nov 13, 2017 at 08:51:37AM +0100, Gerd Hoffmann wrote:
> On Fri, Nov 10, 2017 at 12:24:38PM -0500, Kevin O'Connor wrote:
> > Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
> > ---
> > 
> > I wonder if it would be better to only enable sercon with 0x3f8 in the
> > nographic case if QEMU has neither specified a sercon-port and has not
> > requested sgabios to be loaded.  This is just an idea.
> 
> Looks good to me.

Thanks.  I committed this patch.

-Kevin

_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios