Discussion:
[SeaBIOS] running vga bios on resume from S3
Gleb Natapov
2010-02-24 09:59:26 UTC
Permalink
Shouldn't we make CONFIG_S3_RESUME_VGA_INIT=1 by default. Otherwise
console doesn't work on Linux after resume.

--
Gleb.
Kevin O'Connor
2010-02-25 04:34:17 UTC
Permalink
Post by Gleb Natapov
Shouldn't we make CONFIG_S3_RESUME_VGA_INIT=1 by default. Otherwise
console doesn't work on Linux after resume.
As far as I can tell, a real BIOS does not call the video bios on
resume. As such, enabling that define seems to be working around a
problem in either the video system or Linux. I fear it will cause
problems in more advanced situations (like device passthrough in
KVM).

As such, I don't think it should be enabled by default.

-Kevin
Gleb Natapov
2010-02-25 06:36:11 UTC
Permalink
Post by Kevin O'Connor
Post by Gleb Natapov
Shouldn't we make CONFIG_S3_RESUME_VGA_INIT=1 by default. Otherwise
console doesn't work on Linux after resume.
As far as I can tell, a real BIOS does not call the video bios on
resume. As such, enabling that define seems to be working around a
problem in either the video system or Linux. I fear it will cause
problems in more advanced situations (like device passthrough in
KVM).
As such, I don't think it should be enabled by default.
Googling "Run VGA Bios if S3 Resume" suggest that there are real BIOSes that
run video bios on resume. I don't see how resume can work otherwise for
non-GUI setups.

--
Gleb.
Kevin O'Connor
2010-02-28 19:27:19 UTC
Permalink
Post by Gleb Natapov
Post by Kevin O'Connor
Post by Gleb Natapov
Shouldn't we make CONFIG_S3_RESUME_VGA_INIT=1 by default. Otherwise
console doesn't work on Linux after resume.
As far as I can tell, a real BIOS does not call the video bios on
resume.
[...]
Post by Gleb Natapov
Post by Kevin O'Connor
As such, I don't think it should be enabled by default.
Googling "Run VGA Bios if S3 Resume" suggest that there are real BIOSes that
run video bios on resume.
Interesting.

Though, the presence of a bios option seems to indicate that always
running the vga rom may not be a good idea.
Post by Gleb Natapov
I don't see how resume can work otherwise for
non-GUI setups.
I don't know either - this topic has me confused. The ACPI spec is
clear though (section 15.3):

Functional device configuration. The BIOS doesn't need to
configure/restore context of functional devices such as a network
interface (even if it is physically included in chipset) or interrupt
controller. OSPM is responsible for restoring all context of these
devices. The only requirement for the hardware and BIOS is to ensure
that interrupts are not asserted by devices when the control is
passed to OS.

Also, I've read through the PCI specs, and I haven't seen anything
that indicates a VGA BIOS should support being run from S3 resume. As
such, I'm not confident that a generic VGA BIOS wont write to memory
(corrupting the resume state) if it is run.

It would be nice to know what the "auto" option that some BIOS' have
for "Run VGA Bios if S3 Resume" does. I wonder what they look at to
determine whether or not to run the vga bios.

-Kevin
Peter Stuge
2010-03-01 04:50:19 UTC
Permalink
Post by Kevin O'Connor
It would be nice to know what the "auto" option that some BIOS'
have for "Run VGA Bios if S3 Resume" does. I wonder what they
look at to determine whether or not to run the vga bios.
Maybe which OSPM is running the ACPI bytecode.


//Peter
Gleb Natapov
2010-03-01 07:28:31 UTC
Permalink
Post by Kevin O'Connor
Post by Gleb Natapov
Post by Kevin O'Connor
Post by Gleb Natapov
Shouldn't we make CONFIG_S3_RESUME_VGA_INIT=1 by default. Otherwise
console doesn't work on Linux after resume.
As far as I can tell, a real BIOS does not call the video bios on
resume.
[...]
Post by Gleb Natapov
Post by Kevin O'Connor
As such, I don't think it should be enabled by default.
Googling "Run VGA Bios if S3 Resume" suggest that there are real BIOSes that
run video bios on resume.
Interesting.
Though, the presence of a bios option seems to indicate that always
running the vga rom may not be a good idea.
Or it may indicate that there are BIOSes that always run VGA Bios on
resume, but we can provide similar option that will be passed on qemu
command line.
Post by Kevin O'Connor
Post by Gleb Natapov
I don't see how resume can work otherwise for
non-GUI setups.
I don't know either - this topic has me confused.
May be because it can't :) Here is the same problem with real HW:
http://www.nvnews.net/vbulletin/showthread.php?t=130909
Post by Kevin O'Connor
The ACPI spec is
It is never for me :(
Post by Kevin O'Connor
Functional device configuration. The BIOS doesn't need to
configure/restore context of functional devices such as a network
interface (even if it is physically included in chipset) or interrupt
controller. OSPM is responsible for restoring all context of these
devices. The only requirement for the hardware and BIOS is to ensure
that interrupts are not asserted by devices when the control is
passed to OS.
That is for the devices that are under OSPM control. VGA console in text
mode is hardly under OSPM control. When graphics is in use the device
driver is responsible to restore device state, but generic vga driver
cannot know how to restore internal state of different HW. This is the
reason Windows doesn't allow S3 when vga driver is used.
Post by Kevin O'Connor
Also, I've read through the PCI specs, and I haven't seen anything
that indicates a VGA BIOS should support being run from S3 resume. As
such, I'm not confident that a generic VGA BIOS wont write to memory
(corrupting the resume state) if it is run.
We should definitely audit our VGA BIOS for such things. Also moder VGA
BIOS should use PPM for memory allocation no?
Post by Kevin O'Connor
It would be nice to know what the "auto" option that some BIOS' have
for "Run VGA Bios if S3 Resume" does. I wonder what they look at to
determine whether or not to run the vga bios.
-Kevin
--
Gleb.

Loading...