[SeaBIOS] S3 resume is broken on QEMU

Gleb Natapov gleb at redhat.com
Thu Jan 19 11:16:25 CET 2012


On Thu, Jan 19, 2012 at 10:52:19AM +0100, Gerd Hoffmann wrote:
>   Hi,
> 
> >> 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.
> 
> S3 support in qemu isn't (yet) very useful anyway, so I don't think we
> have to worry too much, especially about older versions.  Beside that I
> guess older qemus don't work anyway, for me it works like this (with
> rhel-5 as guest):
> 
> Setting etc/s3-resume-vga-init to 1 makes resume hang with "Running
> option rom at c000:0003" being the last line seabios prints.  Maybe
> vgabios attempts to do something which is illegal on resume and blows up.
> 
I did a lot of suspend and resumes with different qemus and never saw
this problem. Furthermore WHQL testing does suspend and resumes and I
never got similar bug report from those who run it too. So lets not make
big "OMG S3 is completely broken" issue from your specific problem
before we even know what is the reason behind it.

There is absolutely nothing that vgabios may attempt to do that is
illegal on resume and may cause this kind of hang. The only thing that
is illegal on resume is to use non reserved RAM, but this will cause
OS to fail after resume, not vgabios to hang.

> When setting etc/s3-resume-vga-init to 0 linux resumes fine.  vga text
> console is dead indeed.  Serial console works fine though and the system
> is alive.  When suspending with cirrus vga and X11 being active the
> system comes out of standby with vga console being functional too.
X has i8086 interpreter to run vgabios. It is very likely what it does
here. BTW there is vga_reset utility in svgalib package that runs
vgabios in emulator and can restore working console after resume too.

> 
> > I am also not asking to change SeaBIOS default. Just get us back compile
> > time option to always enable it.
> 
> I think using etc/s3-resume-vga-init to control this is just fine ...
> 
If and only if QEMU will enable it conditionally it is appropriate to
introduce it. Otherwise compile time option, that served us well, should be
reintroduced.

--
			Gleb.



More information about the SeaBIOS mailing list