On Mon, May 12, 2014 at 10:41 AM, Laszlo Ersek <ler...@redhat.com> wrote: > On 05/12/14 18:03, Jordan Justen wrote: >> On Mon, May 12, 2014 at 6:18 AM, Laszlo Ersek <ler...@redhat.com> >> wrote: >>> Additionally, there's another (similarly downstream only) patch >>> >>> OvmfPkg: Don't build in QemuVideoDxe when we have CSM >>> >>> Did you include the presence of this patch in your question? >> >> No. I want to remove this patch from being needed, and also rely upon >> your shim patch (for this OS) when CSM is enabled. > > (The question was "If CSM is enabled, we will fail to allocate, right?") > > OK, so we have: > > * "LegacyBios: Add UmbStart,UmbEnd fields to EFI_COMPATIBILITY16_TABLE" > (I tried to replace it with David's new patch that he just posted > <http://thread.gmane.org/gmane.comp.bios.tianocore.devel/7065>, > but it doesn't apply for me.) > * OvmfPkg/Csm/Csm16/Csm16.bin (the SeaBIOS binary) > * -D CSM_ENABLE, resulting in > - OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf > (built into IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf) > - IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf > - IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf > * this patch > > I'm seeing the following: > > (1) LegacyBiosDxe is loaded first. LegacyBiosInstall() --> > AllocateLegacyMemory() succeeds and takes the page at zero. > [IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c] > > (2) QemuVideoDxe binds the card before VideoDxe gets there (this used to > be the reason for excluding QemuVideoDxe from the CSM build). It can't > allocate the page at zero: > > QemuVideoControllerDriverStart() [OvmfPkg/QemuVideoDxe/Driver.c] > InstallVbeShim() [OvmfPkg/QemuVideoDxe/VbeShim.c] > gBS->AllocatePages() > > Therefore the binding fails. (Answering your question with "yes".)
I don't want to fail to start QemuVideoDxe whenever a CSM is enabled. Although it is a bit of a hack to go write to the int 0x10 vector even if QemuVideoDxe doesn't allocate page 0, I still want to consider it. I think in my patch I probed the int 0x10 vector to see if it looked like a vbios had been installed. If it didn't look like it, then I went ahead and installed the stub even if the allocation didn't succeed. I think the stub could then work for this OS while QemuVideoDxe is attached to the device (and a CSM is enabled). -Jordan > (3) VideoDxe binds the card and POSTs it: > > BiosVideoDriverBindingStart() > [IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/BiosVideo.c] > LegacyBiosInstallPciRom() > [IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyPci.c] > LegacyBiosInstallRom() > handle_csm_0005() [SeaBIOS, src/fw/csm.c] > callrom() > vga_post() [vgasrc/vgainit.c] > > and then Windows uses (emulates) SeaVGABIOS code for mode switching. > > Laszlo ------------------------------------------------------------------------------ "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel