[SeaBIOS] [PATCH 3/6] paravirt: read QEMU_CFG_NOGRAPHIC, store in etc/sercon-enable romfile

Gerd Hoffmann posted 6 patches 7 years, 8 months ago
There is a newer version of this series
[SeaBIOS] [PATCH 3/6] paravirt: read QEMU_CFG_NOGRAPHIC, store in etc/sercon-enable romfile
Posted by Gerd Hoffmann 7 years, 8 months ago
Will be used as runtime switch to enable serial console support.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 src/fw/paravirt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/fw/paravirt.c b/src/fw/paravirt.c
index 5b23d786be..e9cca4fe6e 100644
--- a/src/fw/paravirt.c
+++ b/src/fw/paravirt.c
@@ -210,6 +210,7 @@ qemu_platform_setup(void)
 #define QEMU_CFG_SIGNATURE              0x00
 #define QEMU_CFG_ID                     0x01
 #define QEMU_CFG_UUID                   0x02
+#define QEMU_CFG_NOGRAPHIC              0x04
 #define QEMU_CFG_NUMA                   0x0d
 #define QEMU_CFG_BOOT_MENU              0x0e
 #define QEMU_CFG_NB_CPUS                0x05
@@ -510,6 +511,7 @@ qemu_cfg_legacy(void)
     qemu_romfile_add("etc/show-boot-menu", QEMU_CFG_BOOT_MENU, 0, 2);
     qemu_romfile_add("etc/irq0-override", QEMU_CFG_IRQ0_OVERRIDE, 0, 1);
     qemu_romfile_add("etc/max-cpus", QEMU_CFG_MAX_CPUS, 0, 2);
+    qemu_romfile_add("etc/sercon-enable", QEMU_CFG_NOGRAPHIC, 0, 2);
 
     // NUMA data
     u64 numacount;
-- 
2.9.3


_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 3/6] paravirt: read QEMU_CFG_NOGRAPHIC, store in etc/sercon-enable romfile
Posted by Kevin O'Connor 7 years, 8 months ago
On Fri, Sep 08, 2017 at 08:18:25AM +0200, Gerd Hoffmann wrote:
> Will be used as runtime switch to enable serial console support.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  src/fw/paravirt.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/fw/paravirt.c b/src/fw/paravirt.c
> index 5b23d786be..e9cca4fe6e 100644
> --- a/src/fw/paravirt.c
> +++ b/src/fw/paravirt.c
> @@ -210,6 +210,7 @@ qemu_platform_setup(void)
>  #define QEMU_CFG_SIGNATURE              0x00
>  #define QEMU_CFG_ID                     0x01
>  #define QEMU_CFG_UUID                   0x02
> +#define QEMU_CFG_NOGRAPHIC              0x04
>  #define QEMU_CFG_NUMA                   0x0d
>  #define QEMU_CFG_BOOT_MENU              0x0e
>  #define QEMU_CFG_NB_CPUS                0x05
> @@ -510,6 +511,7 @@ qemu_cfg_legacy(void)
>      qemu_romfile_add("etc/show-boot-menu", QEMU_CFG_BOOT_MENU, 0, 2);
>      qemu_romfile_add("etc/irq0-override", QEMU_CFG_IRQ0_OVERRIDE, 0, 1);
>      qemu_romfile_add("etc/max-cpus", QEMU_CFG_MAX_CPUS, 0, 2);
> +    qemu_romfile_add("etc/sercon-enable", QEMU_CFG_NOGRAPHIC, 0, 2);

Instead of looking at QEMU_CFG_NOGRAPHIC, I think the C code could
check if GET_IVT(0x10).segoff == FUNC16(entry_10).segoff .  This has
the advantage of working whenever a vgarom is not installed (including
on coreboot).

-Kevin

_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 3/6] paravirt: read QEMU_CFG_NOGRAPHIC, store in etc/sercon-enable romfile
Posted by Gerd Hoffmann 7 years, 8 months ago
  Hi,

> > +    qemu_romfile_add("etc/sercon-enable", QEMU_CFG_NOGRAPHIC, 0,
> > 2);
> 
> Instead of looking at QEMU_CFG_NOGRAPHIC, I think the C code could
> check if GET_IVT(0x10).segoff == FUNC16(entry_10).segoff .

It's not that simple.  We need some way to explicitly enable it,
especially in case a vgabios *is* present (aka aplitmode).  And this is
what we've agreed on a few months back, IIRC because we don't have to
extend fw_cfg that way.

Independent from that we have the question what to do by default in
case no vgabios is present.  IIRC by initial patch set did enable
sercon in that case, but I changed it after some discussions.

Don't remember what the reason was though.  Cc'ing Daniel + Paolo

cheers,
  Gerd


_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 3/6] paravirt: read QEMU_CFG_NOGRAPHIC, store in etc/sercon-enable romfile
Posted by Kevin O'Connor 7 years, 8 months ago
On Mon, Sep 11, 2017 at 12:17:04PM +0200, Gerd Hoffmann wrote:
>   Hi,
> 
> > > +    qemu_romfile_add("etc/sercon-enable", QEMU_CFG_NOGRAPHIC, 0,
> > > 2);
> > 
> > Instead of looking at QEMU_CFG_NOGRAPHIC, I think the C code could
> > check if GET_IVT(0x10).segoff == FUNC16(entry_10).segoff .
> 
> It's not that simple.  We need some way to explicitly enable it,
> especially in case a vgabios *is* present (aka aplitmode).  And this is
> what we've agreed on a few months back, IIRC because we don't have to
> extend fw_cfg that way.

Okay.

Separately, how will sercon get the serial port that it is to use?

Looking closer at patch 4 I see:

+    u16 addr = PORT_SERIAL1;
+    SET_LOW(sercon_port, addr);

Is the plan to pull this from a romfile so that it can be set on
coreboot?  If so, perhaps that functionality could be merged with
"etc/sercon-enable" so that coreboot users need only set one cbfs
file.

> Independent from that we have the question what to do by default in
> case no vgabios is present.  IIRC by initial patch set did enable
> sercon in that case, but I changed it after some discussions.
> 
> Don't remember what the reason was though.  Cc'ing Daniel + Paolo

Okay.  It would be nice to have the correct responses to 1000, 1002,
1003, and 100f even if serial output wasn't desired.

-Kevin

_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 3/6] paravirt: read QEMU_CFG_NOGRAPHIC, store in etc/sercon-enable romfile
Posted by Gerd Hoffmann 7 years, 7 months ago
  Hi,

> Separately, how will sercon get the serial port that it is to use?
> 
> Looking closer at patch 4 I see:
> 
> +    u16 addr = PORT_SERIAL1;
> +    SET_LOW(sercon_port, addr);
> 
> Is the plan to pull this from a romfile so that it can be set on
> coreboot?  If so, perhaps that functionality could be merged with
> "etc/sercon-enable" so that coreboot users need only set one cbfs
> file.

No concrete plan yet, other than that I've added a variable for the
port intentionally so runtime configuration can be added easily.

One option would be to have a etc/sercon-ioport file, which will both
enable sercon and specify the io port address.

We could also depend on detect_serial() and lookup the detected io port
address via GET_BDA(port_com[count]).

There is also the question if and how we'll go support non-isa serial
ports.  qemu also has pci-serial for example.  serial-over-lan virtual
ports typically show up as pci device too.

cheers,
  Gerd


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