Re: [Qemu-devel] [SeaBIOS] [PATCH 5/5] [wip] sercon: initial split-output implementation
On Thu, 13 Oct 2016 09:17:51 +0200 Gerd Hoffmann wrote: > Hi, > > > So far plan is merge it into QEMU 2.8. > > I've amended QEMU counterpart according to Radim's and Paolo's reviews > > and plan to respin it soon. > > No respin yet on the list it seems. What is the status? Do you wait > for Radim's patches land upstream first? yep, I'm was waiting on Radim's patches to be ready first. By now they all have been reviewed and I don't expect to any changes in them. So I'll respin v3 todayish as well as v6 of this series. > Can you cc me if you post it? sure > > > It will depend on Radim's > > https://lists.gnu.org/archive/html/qemu-devel/2016-09/msg08292.html > > though, so my series will be merged after that > > That series is at v5 now and seems to be ready for merge, even though it > didn't land in master yet. > > cheers, > Gerd >
Re: [Qemu-devel] [SeaBIOS] [PATCH 5/5] [wip] sercon: initial split-output implementation
Hi, > So far plan is merge it into QEMU 2.8. > I've amended QEMU counterpart according to Radim's and Paolo's reviews > and plan to respin it soon. No respin yet on the list it seems. What is the status? Do you wait for Radim's patches land upstream first? Can you cc me if you post it? > It will depend on Radim's > https://lists.gnu.org/archive/html/qemu-devel/2016-09/msg08292.html > though, so my series will be merged after that That series is at v5 now and seems to be ready for merge, even though it didn't land in master yet. cheers, Gerd
Re: [Qemu-devel] [SeaBIOS] [PATCH 5/5] [wip] sercon: initial split-output implementation
On Tue, 04 Oct 2016 10:49:41 +0200 Gerd Hoffmann wrote: > Hi, > > > Interesting. I'm curious how the memory scan works, because I > > didn't think there was any way to find the vga entry point except > > from the int10 vector. > > Run the init code in emulator? > > > Were you looking to include this series in SeaBIOS v1.10? We can > > either delay the release or push the changes into the next release. > > 1.10 release in october would be great for qemu as freeze for the 2.8 > release is november 1st. That doesn't leave much room to delay > things ... > > I think that means either merge the current sercon version (posted to > the list last Wednesday, have you looked at it?) for 1.10 or move it > into the next release. > > > Also not sure where Igor's patches stand wrt inclusion into QEMU. > > Good question. It isn't yet in the qemu master branch. > Igor? Do you have a status update? So far plan is merge it into QEMU 2.8. I've amended QEMU counterpart according to Radim's and Paolo's reviews and plan to respin it soon. It will depend on Radim's https://lists.gnu.org/archive/html/qemu-devel/2016-09/msg08292.html though, so my series will be merged after that > > cheers, > Gerd >
Re: [Qemu-devel] [SeaBIOS] [PATCH 5/5] [wip] sercon: initial split-output implementation
Hi, > Interesting. I'm curious how the memory scan works, because I didn't > think there was any way to find the vga entry point except from the > int10 vector. Run the init code in emulator? > Were you looking to include this series in SeaBIOS v1.10? We can > either delay the release or push the changes into the next release. 1.10 release in october would be great for qemu as freeze for the 2.8 release is november 1st. That doesn't leave much room to delay things ... I think that means either merge the current sercon version (posted to the list last Wednesday, have you looked at it?) for 1.10 or move it into the next release. > Also not sure where Igor's patches stand wrt inclusion into QEMU. Good question. It isn't yet in the qemu master branch. Igor? Do you have a status update? cheers, Gerd
Re: [Qemu-devel] [SeaBIOS] [PATCH 5/5] [wip] sercon: initial split-output implementation
On Tue, Sep 27, 2016 at 02:00:08PM +0200, Gerd Hoffmann wrote: > On Fr, 2016-07-15 at 10:35 -0400, Kevin O'Connor wrote: > > On Fri, Jul 15, 2016 at 01:49:49PM +0200, Gerd Hoffmann wrote: > > > > Finally, one high level observation is that we know there are a number > > > > of quirks in various vgabios emulators. For example, we know some > > > > emulators don't handle certain 32bit instructions when in 16bit mode > > > > (hence scripts/vgafixup.py), we know some versions of Windows use an > > > > emulator that doesn't like some stack relative instructions (hence the > > > > vgabios is compiled without -fomit-frame-pointer), and we know Windows > > > > Vista doesn't like the extra stack in high ram (the skifree bug). Any > > > > thoughts on what happens with these quirks if the main seabios code > > > > hooks int10? > > > > > > Good question. Do the emulators (both win, xorg) use the int10 vector > > > set by seabios in the first place? Or go they load the vgabios and run > > > it, including the initialization, and use whatever entry point the init > > > code sets up? I suspect it is the latter. But needs investigation and > > > testing. > > > > I think they just call the existing int10 handler. In general, it's > > not safe to rerun the vga init code. Also, if they did run the init > > it would lead to extra copies of the SeaVGABIOS version banners in the > > debug logs, which I don't recall seeing. > > Finally found the time to continue with this and ran a bunch of tests. > RHEL-5 (known to be affected by x86emu issue) continues to work fine. > Xorg server log looks like it goes scan memory for the vgabios instead > of depending on the int10 vector: Interesting. I'm curious how the memory scan works, because I didn't think there was any way to find the vga entry point except from the int10 vector. Were you looking to include this series in SeaBIOS v1.10? We can either delay the release or push the changes into the next release. Also not sure where Igor's patches stand wrt inclusion into QEMU. -Kevin
Re: [Qemu-devel] [SeaBIOS] [PATCH 5/5] [wip] sercon: initial split-output implementation
On Fr, 2016-07-15 at 10:35 -0400, Kevin O'Connor wrote: > On Fri, Jul 15, 2016 at 01:49:49PM +0200, Gerd Hoffmann wrote: > > > Finally, one high level observation is that we know there are a number > > > of quirks in various vgabios emulators. For example, we know some > > > emulators don't handle certain 32bit instructions when in 16bit mode > > > (hence scripts/vgafixup.py), we know some versions of Windows use an > > > emulator that doesn't like some stack relative instructions (hence the > > > vgabios is compiled without -fomit-frame-pointer), and we know Windows > > > Vista doesn't like the extra stack in high ram (the skifree bug). Any > > > thoughts on what happens with these quirks if the main seabios code > > > hooks int10? > > > > Good question. Do the emulators (both win, xorg) use the int10 vector > > set by seabios in the first place? Or go they load the vgabios and run > > it, including the initialization, and use whatever entry point the init > > code sets up? I suspect it is the latter. But needs investigation and > > testing. > > I think they just call the existing int10 handler. In general, it's > not safe to rerun the vga init code. Also, if they did run the init > it would lead to extra copies of the SeaVGABIOS version banners in the > debug logs, which I don't recall seeing. Finally found the time to continue with this and ran a bunch of tests. RHEL-5 (known to be affected by x86emu issue) continues to work fine. Xorg server log looks like it goes scan memory for the vgabios instead of depending on the int10 vector: (II) VESA(0): initializing int10 (II) VESA(0): Primary V_BIOS segment is: 0xc000 (II) VESA(0): VESA BIOS detected (II) VESA(0): VESA VBE Version 3.0 (II) VESA(0): VESA VBE Total Mem: 16384 kB (II) VESA(0): VESA VBE OEM: SeaBIOS VBE(C) 2011 (II) VESA(0): VESA VBE OEM Software Rev: 0.0 (II) VESA(0): VESA VBE OEM Vendor: SeaBIOS Developers (II) VESA(0): VESA VBE OEM Product: SeaBIOS VBE Adapter (II) VESA(0): VESA VBE OEM Product Rev: Rev. 1 Running tests with win7 doesn't show any problems too, so I suspect they are basically doing the same. Given these results I think I'll stick to the current approach of integrating this directly into seabios (instead of creating a sgabios-like rom using the seavgabios sources). cheers, Gerd
Re: [Qemu-devel] [SeaBIOS] [PATCH 5/5] [wip] sercon: initial split-output implementation
Hi, Short status update: Project isn't dead. But I'm busy with other stuff and that will not change in August due to holiday season and kvm forum, so don't expect new patches from me before September. For anyone who wants play with this: Pushed my current devel branch to https://www.kraxel.org/cgit/seabios/log/?h=serial (basically the most recent patch series with some not-yet squashed incremental fixes on top). > Have you considered implementing the serial support as a kind of > "serial seavgabios" instead of directly in seabios? That would have > the advantage of pulling in all the existing vgabios quirk handling. Indeed, didn't consider that yet. Briefly looked at this a while back, figured doing this as "serial seavgabios" would allow the reuse of some vgabios code. On the other hand the keyboard handling is easier to do directly in seabios: can queue key events using internal seabios interfaces, no need to hook timer irq (or better serial irq?). I've noticed you've cleaned up vgabios a bit, possibly with the intention to make implementing a serial seavgabios easier? In case you want give it a try: Feel free to grab my branch and run with it. cheers, Gerd
Re: [Qemu-devel] [SeaBIOS] [PATCH 5/5] [wip] sercon: initial split-output implementation
On Fri, Jul 15, 2016 at 01:49:49PM +0200, Gerd Hoffmann wrote: > > Finally, one high level observation is that we know there are a number > > of quirks in various vgabios emulators. For example, we know some > > emulators don't handle certain 32bit instructions when in 16bit mode > > (hence scripts/vgafixup.py), we know some versions of Windows use an > > emulator that doesn't like some stack relative instructions (hence the > > vgabios is compiled without -fomit-frame-pointer), and we know Windows > > Vista doesn't like the extra stack in high ram (the skifree bug). Any > > thoughts on what happens with these quirks if the main seabios code > > hooks int10? > > Good question. Do the emulators (both win, xorg) use the int10 vector > set by seabios in the first place? Or go they load the vgabios and run > it, including the initialization, and use whatever entry point the init > code sets up? I suspect it is the latter. But needs investigation and > testing. I think they just call the existing int10 handler. In general, it's not safe to rerun the vga init code. Also, if they did run the init it would lead to extra copies of the SeaVGABIOS version banners in the debug logs, which I don't recall seeing. > Also a serial console for windows guests isn't that useful, so I > wouldn't worry too much about windows emulator issues. It's not uncommon (at least on real hardware) to add sgabios to a system for the boot menus, but then use a regular OS at runtime. The problem with the vga emulation quirks is that they often result in mysterious system failures. Have you considered implementing the serial support as a kind of "serial seavgabios" instead of directly in seabios? That would have the advantage of pulling in all the existing vgabios quirk handling. -Kevin
Re: [Qemu-devel] [SeaBIOS] [PATCH 5/5] [wip] sercon: initial split-output implementation
Hi, > I'm okay with the cut-and-paste. But, another option would be to use > the iretw at the end of the existing irqentry_extrastack to implement > the ljmpw into the main vgabios. Something like (totally untested): > > entry_10_hooked: > pushfw // Setup for iretw in irqentry_arg > pushl %cs:sercon_int10_hook_resume > > pushl $handle_10 > #if CONFIG_ENTRY_EXTRASTACK > jmp irqentry_arg_extrastack > #else > jmp irqentry_arg > #endif Good idea, I'll try it. > Separately, have you considered choosing a separate entry point for > entry_10_hooked. That is, changing the above pushl to > $handle_sercon_hooked and introducing that function in sercon.c. It > seems it would reduce a number of "if (!sercon_splitmode())" checks in > the main code, as handle_sercon_hooked() could just use a smaller > switch statement and ignore requests it doesn't need to support. Makes sense indeed. All functions which only return information are not needed in the splitmode case. > Finally, one high level observation is that we know there are a number > of quirks in various vgabios emulators. For example, we know some > emulators don't handle certain 32bit instructions when in 16bit mode > (hence scripts/vgafixup.py), we know some versions of Windows use an > emulator that doesn't like some stack relative instructions (hence the > vgabios is compiled without -fomit-frame-pointer), and we know Windows > Vista doesn't like the extra stack in high ram (the skifree bug). Any > thoughts on what happens with these quirks if the main seabios code > hooks int10? Good question. Do the emulators (both win, xorg) use the int10 vector set by seabios in the first place? Or go they load the vgabios and run it, including the initialization, and use whatever entry point the init code sets up? I suspect it is the latter. But needs investigation and testing. /me places the item on the todo list. Also a serial console for windows guests isn't that useful, so I wouldn't worry too much about windows emulator issues. cheers, Gerd
Re: [Qemu-devel] [SeaBIOS] [PATCH 5/5] [wip] sercon: initial split-output implementation
On Thu, Jul 14, 2016 at 10:53:02AM +0200, Gerd Hoffmann wrote: > Signed-off-by: Gerd Hoffmann > --- > src/optionroms.c | 2 ++ > src/romlayout.S | 39 ++ > src/sercon.c | 99 > +++- > 3 files changed, 111 insertions(+), 29 deletions(-) > > diff --git a/src/optionroms.c b/src/optionroms.c > index f9e9593..f08fcb1 100644 > --- a/src/optionroms.c > +++ b/src/optionroms.c > @@ -442,6 +442,8 @@ vgarom_setup(void) > } > > VgaROM = (void*)BUILD_ROM_START; > +if (romfile_loadint("etc/sercon-enable", 0)) > +sercon_enable(); Minor nit, but why not unconditionally call sercon_enable() and let sercon_enable() check romfile_loadint(). [...] > --- a/src/romlayout.S > +++ b/src/romlayout.S > @@ -522,6 +522,45 @@ irqentry_arg: > DECL_IRQ_ENTRY hwpic1 > DECL_IRQ_ENTRY hwpic2 > > +// hooked int10, for sercon > +DECLFUNC entry_10_hooked > +entry_10_hooked: > + pushl $ handle_10 > +#if CONFIG_ENTRY_EXTRASTACK > + // FIXME: too much cut+paste I'm okay with the cut-and-paste. But, another option would be to use the iretw at the end of the existing irqentry_extrastack to implement the ljmpw into the main vgabios. Something like (totally untested): entry_10_hooked: pushfw // Setup for iretw in irqentry_arg pushl %cs:sercon_int10_hook_resume pushl $handle_10 #if CONFIG_ENTRY_EXTRASTACK jmp irqentry_arg_extrastack #else jmp irqentry_arg #endif Separately, have you considered choosing a separate entry point for entry_10_hooked. That is, changing the above pushl to $handle_sercon_hooked and introducing that function in sercon.c. It seems it would reduce a number of "if (!sercon_splitmode())" checks in the main code, as handle_sercon_hooked() could just use a smaller switch statement and ignore requests it doesn't need to support. Finally, one high level observation is that we know there are a number of quirks in various vgabios emulators. For example, we know some emulators don't handle certain 32bit instructions when in 16bit mode (hence scripts/vgafixup.py), we know some versions of Windows use an emulator that doesn't like some stack relative instructions (hence the vgabios is compiled without -fomit-frame-pointer), and we know Windows Vista doesn't like the extra stack in high ram (the skifree bug). Any thoughts on what happens with these quirks if the main seabios code hooks int10? -Kevin