On Fri, Jan 20, 2012 at 08:48:39AM -0500, Kevin O'Connor wrote:
On Fri, Jan 20, 2012 at 01:50:15PM +0200, Gleb Natapov wrote:
On Thu, Jan 19, 2012 at 08:40:45PM -0500, Kevin O'Connor wrote:
Further, no spec I've seen says an option rom must handle being executed a second time. The option rom can self modify - re-running a modified rom may crash it. Thinking about this further, the vgabios in the seabios repo wont handle being executed twice properly (which, of course, should be fixed).
Not sure how thing works on real HW, but on QEMU S3 actually invokes HW reset. The same reset that is done on reboot, so option rom should be reset to its pristine state. I expect that on real HW things should be similar if device powered down on S3.
I'm 99% sure that wont work. Option roms have to be copied from PCI
You 99% sure it wont work on real HW or on QEMU? IIRC QEMU puts vgabios into 0xc0000 directly.
bars to low memory. If seabios copies the option rom again (to reset its state) then all option roms would need to be copied (the initial option rom size could be larger than the final option rom size). Running all option roms again is surely going to break something.
I do not think I ever talked about running all option roms :)
To be clear, I really don't know the exact interactions between an off the shelf BIOS and a "real world" vga bios on resume. If someone can find a spec or document clarifying that - I'd be happy to conform to it.
I am not asking to change how Seabios works on real HW. What it does currently on real HW has a lot of sense and models behaviour of real BIOSes as far as I can tell.
I understand your point about requesting QEMU specific code. I really prefer to keep things general where ever possible, however. I think both projects are better off if the most code possible can be shared. If QEMU *always* needed this setting, I could see adding it to the init phase of seabios.
I think we can do both. Share the code and be QEMU specific. We can do it like this:
S3ResumeVgaInit = romfile_loadint("etc/s3-resume-vga-init", !CONFIG_COREBOOT);
This way default will be different on QEMU and if QEMU will ever need to disable the option (for vga path through may be) it will be able to do so.
However, Windows doesn't seem to need it, and
it's unclear what VGA pass-through would require (though granted, that has many other hurdles).
Windows is actually smart. It knows that it can support S3 resume on generic VGA so it does not allow you to do S3 suspend when one is in use. We managed to trick WindowsXP + cirrus to allow S3 suspend by DSDT magic, but after resume GUI is not usable. Still good enough for running WHQL. The only way S3 works on all Windowses is by using QXL device and driver that supports S3.
-- Gleb.