[SeaBIOS] S3 resume is broken on QEMU

Gleb Natapov gleb at redhat.com
Thu Jan 19 08:02:09 CET 2012

On Wed, Jan 18, 2012 at 09:37:18PM -0500, Kevin O'Connor wrote:
> On Wed, Jan 18, 2012 at 04:09:45PM +0200, Gleb Natapov wrote:
> > On Wed, Jan 18, 2012 at 08:27:31AM -0500, Kevin O'Connor wrote:
> > > On Wed, Jan 18, 2012 at 11:40:28AM +0200, Gleb Natapov wrote:
> > > > Hi Kevin,
> > > > 
> > > > Commit 8b0c509e7cdb broke S3 resume on QEMU. Before this commit QEMU
> > > > compiled bios with S3_RESUME_VGA_INIT enabled. After it this is no
> > > > longer an option.
> > > 
> > > I didn't know QEmu used custom compile options.  I don't see this in
> > > the QEmu source - where does it set it?
> > > 
> > I not sure what QEMU upstream does. In RHEL we have local patch to
> > change the setting. Without it resume does not work correctly.
> > 
> > > Moving the option from compile time to run time should be better all
> > > around.  Can QEmu just set the flag in fwcfg if this functionality is
> > > needed?
> > > 
> > It can I suppose, but then you will not be able to use newer Seabios
> > with older QEMU. The question is if such an option is the way to go
> > forward since for QEMU it will always be set anyway.
> The current SeaBIOS checks fwcfg for a "file" named
> "etc/s3-resume-vga-init" - if it exists it will use it.  This works on
> all versions of qemu (though, of course, on current qemu the file
> isn't found and the default is to not run the vgabios on resume).
This is strange definition of "works" :) It does not run vga rom on
resume which makes Linux fail to resume properly. I wouldn't call that
"works". We can provide "etc/s3-resume-vga-init" through fwcfg in QEMU,
but this will not make older QEMUs magically work.

If it can be shown that with QEMU there is a situation when running
vgabios on resume is actually harmful, then I agree we should add a
command line option to dynamically enable this behaviour and use
"etc/s3-resume-vga-init" to communicate the setting to the SeaBIOS.

> As for the option always being set - we discussed this some time back.
> My read of the ACPI spec says that the firmware should not need to do
> any device initialization on resume (including running the vga bios).
> The ACPI spec definitely doesn't require the firmware to run the vga
> bios (or even allude to the possibility).  Further, I haven't seen any
> spec that indicates the vga bios should be prepared to be executed on
> a resume.  So, in the general case, I see running the vga bios as
> potentially harmful to the resume process.  (We would be executing
> third-party code in a restricted environment and expecting it to not
> touch any memory, with no apparent spec documenting that fact.)
Yes, it was discussed here:

And there I pointed out that many BIOSes has an option to run vga BIOS on
resume and even link to a post with description of the same problem we
have in QEMU + Linux resuming to console. So the problem is a not product
of my imagination.

> If someone can point out a spec to the contrary I'd be happy to change
> the default in SeaBIOS.
There is spec and there is real life. Real life should take precedence.
There is not way OSMP can restore unknown state of a random vga card without
special driver for that card. This is why vgabios exists in the first place.

I am also not asking to change SeaBIOS default. Just get us back compile
time option to always enable it.


More information about the SeaBIOS mailing list