From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=0mnwiyhn; spf=none, err=permanent DNS error (domain: merlin.srs.infradead.org, ip: 205.233.59.134, mailfrom: batv+4a5a9edcbe01b6acb2b7+5785+infradead.org+dwmw2@merlin.srs.infradead.org) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by groups.io with SMTP; Wed, 26 Jun 2019 04:37:48 -0700 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=rKufMGDiGzYw7jgmqgh/I3X3kmcMtjSEBRLQFYSBTpQ=; b=0mnwiyhnsnCULzbRh8P5wVBGic GChogs7zRxRdEBAq0sQJ2lhOn9Tg569XQ8a4gGJ/KCBfJhdOciJp+wDgrUo0YffeJB6EaliEjB3c+ lkAuZoSJjUzE13zfp82fcrhJd04B1N7UwkmLZ7vWS7+2rRStefRLc6/QNkGcsUWu/hD/q2agVrbXK YS3F5MCab3peLrGG6wHEei6b1OXsCqIAkqov4b0fd8OwlLCsoN79B/oF0W7TXvZxTh2ByvgJ4ugSg s2SdfqSNt25FOAVHg776t6zRSmJkir/fxU62V0PEBfjWlvd+kmAP0wEuAMwDwYRn0MNkVSRyJpX/e /TeIr4HA==; Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hg6FD-0006UB-EP; Wed, 26 Jun 2019 11:37:43 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hg6FC-003RKK-LU; Wed, 26 Jun 2019 12:37:42 +0100 From: "David Woodhouse" To: devel@edk2.groups.io Cc: Laszlo Ersek Subject: [PATCH v3 3/4] OvmfPkg: Don't build in QemuVideoDxe when we have CSM Date: Wed, 26 Jun 2019 12:37:41 +0100 Message-Id: <20190626113742.819933-4-dwmw2@infradead.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190626113742.819933-1-dwmw2@infradead.org> References: <20190626113742.819933-1-dwmw2@infradead.org> MIME-Version: 1.0 Sender: David Woodhouse X-SRS-Rewrite: SMTP reverse-path rewritten from by merlin.infradead.org. See http://www.infradead.org/rpr.html Content-Transfer-Encoding: 8bit QemuVideoDxe installs its own legacy INT 10h handler for the benefit of systems like Windows 2008r2 which attempt to use INT 10h even when booted via EFI. This interacts extremely badly with a CSM actually attempting to install a real video BIOS. The last thing done before invoking a legacy OpROM is to call INT 10h to set a plain text mode. In the case where it's the video BIOS OpROM being loaded, INT 10h will normally point to an iret stub in the CSM itself. Unless QemuVideoDxe has changed INT10h to point to a location in the 0xC0000 segment that it didn't allocate properly, so the real OpROM has been shadowed over them top of it, and the INT 10h vector now points to some random place in the middle of the newly-shadowed OpROM. Don't Do That Then. QemuVideoDxe doesn't do any acceleration and just sets up a linear framebuffer, so we don't lose much by just unconditionally using BiosVideoDxe instead when CSM is present. Signed-off-by: David Woodhouse Reviewed-by: Laszlo Ersek --- OvmfPkg/OvmfPkgIa32.dsc | 2 ++ OvmfPkg/OvmfPkgIa32.fdf | 5 +++-- OvmfPkg/OvmfPkgIa32X64.dsc | 2 ++ OvmfPkg/OvmfPkgIa32X64.fdf | 5 +++-- OvmfPkg/OvmfPkgX64.dsc | 2 ++ OvmfPkg/OvmfPkgX64.fdf | 5 +++-- 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 473eaba24613..87716123997a 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -738,7 +738,9 @@ [Components] MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf +!ifndef $(CSM_ENABLE) OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf +!endif OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf OvmfPkg/VirtioGpuDxe/VirtioGpu.inf diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf index 14100356b4f6..785affeb90c8 100644 --- a/OvmfPkg/OvmfPkgIa32.fdf +++ b/OvmfPkg/OvmfPkgIa32.fdf @@ -305,9 +305,10 @@ [FV.DXEFV] INF OvmfPkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf INF OvmfPkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf INF RuleOverride=CSM OvmfPkg/Csm/Csm16/Csm16.inf -!endif - +!else INF OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf +!endif + INF OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf INF OvmfPkg/VirtioGpuDxe/VirtioGpu.inf INF OvmfPkg/PlatformDxe/Platform.inf diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 73f33b721832..639e33cb285f 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -747,7 +747,9 @@ [Components.X64] MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf +!ifndef $(CSM_ENABLE) OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf +!endif OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf OvmfPkg/VirtioGpuDxe/VirtioGpu.inf diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf index 5af3cdc93d20..74407072563b 100644 --- a/OvmfPkg/OvmfPkgIa32X64.fdf +++ b/OvmfPkg/OvmfPkgIa32X64.fdf @@ -311,9 +311,10 @@ [FV.DXEFV] INF OvmfPkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf INF OvmfPkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf INF RuleOverride=CSM OvmfPkg/Csm/Csm16/Csm16.inf -!endif - +!else INF OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf +!endif + INF OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf INF OvmfPkg/VirtioGpuDxe/VirtioGpu.inf INF OvmfPkg/PlatformDxe/Platform.inf diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 39ac79156529..69a3497c2c9e 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -745,7 +745,9 @@ [Components] MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf +!ifndef $(CSM_ENABLE) OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf +!endif OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf OvmfPkg/VirtioGpuDxe/VirtioGpu.inf diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf index 5af3cdc93d20..74407072563b 100644 --- a/OvmfPkg/OvmfPkgX64.fdf +++ b/OvmfPkg/OvmfPkgX64.fdf @@ -311,9 +311,10 @@ [FV.DXEFV] INF OvmfPkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf INF OvmfPkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf INF RuleOverride=CSM OvmfPkg/Csm/Csm16/Csm16.inf -!endif - +!else INF OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf +!endif + INF OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf INF OvmfPkg/VirtioGpuDxe/VirtioGpu.inf INF OvmfPkg/PlatformDxe/Platform.inf -- 2.21.0