From nobody Mon Feb 9 20:35:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+111091+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+111091+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1699660773; cv=none; d=zohomail.com; s=zohoarc; b=QYppbqeGN2FGWfsp4bvhR6j8vaIxqHwrYcwW6+04SjfmDPGdKI4HfUQaKCoTocP4/FBMKf900bshYvsMzOYbMxv1sDp/rlU/InJwa+EeDQLGCTz6sRqSQBq6ySg2WVL0V8WXPXQOHCk7X3Zte2DDdXt3YNjbR4USrLYBPO+Xl0E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699660773; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=/iiMa90Mi7WoQ2Zgeu+wDRhK7WNufIk4lgq0x/No0ns=; b=fnUDF1QKoGzXI0G6d5vMSV5ddjtlDfwu+BHq3zSKg+ZwshCiLGmq1OpsG+xv3KTm6zku4YGypIVQPxDNSocQgutkcJidA1nAVhlO2sNSAqH8O2bIBys0UEAbdJfKfnFGWDXKb+4ZJHfAC9mwbcBjwEuOqs7ZBued7AfKMy89Sy4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+111091+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1699660773322197.1391405074064; Fri, 10 Nov 2023 15:59:33 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=/iiMa90Mi7WoQ2Zgeu+wDRhK7WNufIk4lgq0x/No0ns=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1699660773; v=1; b=o/gTSHhRI+rtGZt4Q8yEb9E4IzbTj99Ws+a0Uk1JXTwgZspBojhSNcQZkZhUN12B1wofF3HB 8XxBMeLG6It5fOTKRckdWEPZk8yxruobtqXcq06Y0usq+rroLILCnWkffcCAQHClQk1syHfhzEN n0VBMyiTeD+TYIitHi2JJxYE= X-Received: by 127.0.0.2 with SMTP id 2wWxYY1788612xLECAkTq9xS; Fri, 10 Nov 2023 15:59:33 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.42840.1699660772032939325 for ; Fri, 10 Nov 2023 15:59:32 -0800 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-145-MLB_hK_sO1WDP3cD7qakTQ-1; Fri, 10 Nov 2023 18:59:29 -0500 X-MC-Unique: MLB_hK_sO1WDP3cD7qakTQ-1 X-Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 61BC93813F30; Fri, 10 Nov 2023 23:59:29 +0000 (UTC) X-Received: from lacos-laptop-9.usersys.redhat.com (unknown [10.39.192.173]) by smtp.corp.redhat.com (Postfix) with ESMTP id 253D9C1596F; Fri, 10 Nov 2023 23:59:28 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , =?UTF-8?q?Corvin=20K=C3=B6hne?= , Gerd Hoffmann , Jiewen Yao , Rebecca Cran Subject: [edk2-devel] [PATCH 21/37] OvmfPkg: unplug CsmSupportLib from BdsDxe Date: Sat, 11 Nov 2023 00:58:04 +0100 Message-Id: <20231110235820.644381-22-lersek@redhat.com> In-Reply-To: <20231110235820.644381-1-lersek@redhat.com> References: <20231110235820.644381-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: AvyKU7yNV1c4pfKtPBmGvTbKx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1699660773606100013 Content-Type: text/plain; charset="utf-8" CsmSupportLib is effectively a hack. It produces the following protocols: - Legacy Bios Platform, - Legacy Interrupt, - Legacy Region2. (Note that the "OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf" file contains an error where it claims that "Legacy Bios Platform" is "consumed" -- it is not; the lib instance produces that protocol). At the same time, the library instance consumes gEfiLegacyBiosProtocolGuid. This *seemingly* creates a circular dependency with LegacyBiosDxe, because that driver has the exact opposite protocol usage patterns. The solution is that LegacyBiosDxe has a DEPEX on the protocols produced by CsmSupportLib, while CsmSupportLib consumes the Legacy Bios Protocol from LegacyBiosDxe only in the member functions of the protocols it produces. Therefore, once BdsDxe is dispatched, and the CsmSupportLib constructor exposes those three protocols, LegacyBiosDxe can also be started by the DXE dispatcher, and then the protocols from CsmSupportLib become functional. But the main reason why CsmSupportLib is a hack is that it should be a normal platform DXE driver (called e.g. "CsmSupportDxe"), and not a NULL class library that's randomly hooked into BdsDxe. Given that we have removed LegacyBiosDxe earlier (so there is no DEPEX we need to satisfy now, conceptually), unhook CsmSupportLib from BdsDxe. --*-- Note that in the BhyveX64 platform, the pathname "OvmfPkg/Bhyve/Csm/CsmSupportLib/CsmSupportLib.inf" is bogus, and has always been, since commit 656419f922c0 ("Add BhyvePkg, to support the bhyve hypervisor", 2020-07-31). Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Corvin K=C3=B6hne Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Rebecca Cran Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4588 Signed-off-by: Laszlo Ersek --- OvmfPkg/Bhyve/BhyveX64.dsc | 1 - OvmfPkg/OvmfPkgIa32.dsc | 3 --- OvmfPkg/OvmfPkgIa32X64.dsc | 3 --- OvmfPkg/OvmfPkgX64.dsc | 3 --- OvmfPkg/OvmfXen.dsc | 7 +------ 5 files changed, 1 insertion(+), 16 deletions(-) diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc index a3452efc5a84..b26e5053f69b 100644 --- a/OvmfPkg/Bhyve/BhyveX64.dsc +++ b/OvmfPkg/Bhyve/BhyveX64.dsc @@ -666,7 +666,6 @@ [Components] !ifdef $(CSM_ENABLE) !error "CSM is being torn down" - NULL|OvmfPkg/Bhyve/Csm/CsmSupportLib/CsmSupportLib.inf !endif } MdeModulePkg/Logo/LogoDxe.inf diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index eb6022bafed3..d4f4460425c3 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -780,9 +780,6 @@ [Components] MdeModulePkg/Universal/BdsDxe/BdsDxe.inf { XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf -!ifdef $(CSM_ENABLE) - NULL|OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf -!endif } MdeModulePkg/Logo/LogoDxe.inf MdeModulePkg/Application/UiApp/UiApp.inf { diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 5f63596eeb2c..6e87a7a43704 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -794,9 +794,6 @@ [Components.X64] MdeModulePkg/Universal/BdsDxe/BdsDxe.inf { XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf -!ifdef $(CSM_ENABLE) - NULL|OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf -!endif } MdeModulePkg/Logo/LogoDxe.inf MdeModulePkg/Application/UiApp/UiApp.inf { diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 4dcda2ab17c2..1916abdf67f1 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -862,9 +862,6 @@ [Components] MdeModulePkg/Universal/BdsDxe/BdsDxe.inf { XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf -!ifdef $(CSM_ENABLE) - NULL|OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf -!endif } MdeModulePkg/Logo/LogoDxe.inf MdeModulePkg/Application/UiApp/UiApp.inf { diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index ddcc1d7ad48c..4e195b66c379 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -592,12 +592,7 @@ [Components] MdeModulePkg/Universal/Metronome/Metronome.inf EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf - MdeModulePkg/Universal/BdsDxe/BdsDxe.inf { - -!ifdef $(CSM_ENABLE) - NULL|OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf -!endif - } + MdeModulePkg/Universal/BdsDxe/BdsDxe.inf MdeModulePkg/Logo/LogoDxe.inf MdeModulePkg/Application/UiApp/UiApp.inf { -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111091): https://edk2.groups.io/g/devel/message/111091 Mute This Topic: https://groups.io/mt/102518659/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076= /xyzzy [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-