From: "Gerd Hoffmann" <kraxel@redhat.com>
To: devel@edk2.groups.io
Cc: Min Xu <min.m.xu@intel.com>,
Ard Biesheuvel <ardb+tianocore@kernel.org>,
Gerd Hoffmann <kraxel@redhat.com>,
Michael Roth <michael.roth@amd.com>,
Jiewen Yao <jiewen.yao@intel.com>,
Jian J Wang <jian.j.wang@intel.com>,
Jordan Justen <jordan.l.justen@intel.com>,
Pawel Polawski <ppolawsk@redhat.com>,
Oliver Steffen <osteffen@redhat.com>,
Tom Lendacky <thomas.lendacky@amd.com>,
Xiaoyu Lu <xiaoyu1.lu@intel.com>,
Erdem Aktas <erdemaktas@google.com>,
Guomin Jiang <guomin.jiang@intel.com>,
James Bottomley <jejb@linux.ibm.com>
Subject: [PATCH 04/11] OvmfPkg: Add Crypto driver support, add more OvmfCrypto*.inc files.
Date: Fri, 3 Feb 2023 14:27:59 +0100 [thread overview]
Message-ID: <20230203132806.2275708-5-kraxel@redhat.com> (raw)
In-Reply-To: <20230203132806.2275708-1-kraxel@redhat.com>
This patch adds optional CryptoDriver support to OvmfCryptoLibs.dsc.inc.
This can be enabled by setting USE_CRYPTO_DRIVER to TRUE.
Using the crypto driver needs changes in more places (configure
CryptoDriver, add the driver to flash images etc.), so this patch
adds more include files for that.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
.../Include/Dsc/OvmfCryptoComponents.dsc.inc | 41 +++++++++++++++++++
OvmfPkg/Include/Dsc/OvmfCryptoDefines.dsc.inc | 5 +++
OvmfPkg/Include/Dsc/OvmfCryptoLibs.dsc.inc | 18 ++++++++
OvmfPkg/Include/Fdf/OvmfCryptoDxeSmm.fdf.inc | 12 ++++++
OvmfPkg/Include/Fdf/OvmfCryptoPei.fdf.inc | 9 ++++
5 files changed, 85 insertions(+)
create mode 100644 OvmfPkg/Include/Dsc/OvmfCryptoComponents.dsc.inc
create mode 100644 OvmfPkg/Include/Dsc/OvmfCryptoDefines.dsc.inc
create mode 100644 OvmfPkg/Include/Fdf/OvmfCryptoDxeSmm.fdf.inc
create mode 100644 OvmfPkg/Include/Fdf/OvmfCryptoPei.fdf.inc
diff --git a/OvmfPkg/Include/Dsc/OvmfCryptoComponents.dsc.inc b/OvmfPkg/Include/Dsc/OvmfCryptoComponents.dsc.inc
new file mode 100644
index 000000000000..e34444dde470
--- /dev/null
+++ b/OvmfPkg/Include/Dsc/OvmfCryptoComponents.dsc.inc
@@ -0,0 +1,41 @@
+##
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+# mostly following CryptoPkg/Readme.md recommendations
+##
+
+!if $(USE_CRYPTO_DRIVER) == TRUE
+
+ CryptoPkg/Driver/CryptoPei.inf {
+ <LibraryClasses>
+ BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
+ TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+ <PcdsFixedAtBuild>
+!include CryptoPkg/Include/Dsc/CryptoServicePcd.min_pei.dsc.inc
+ }
+
+ CryptoPkg/Driver/CryptoSmm.inf {
+ <LibraryClasses>
+ BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
+ TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+ <PcdsFixedAtBuild>
+!include CryptoPkg/Include/Dsc/CryptoServicePcd.min_dxe_smm.dsc.inc
+ }
+
+ CryptoPkg/Driver/CryptoDxe.inf {
+ <LibraryClasses>
+ BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+!if $(NETWORK_TLS_ENABLE) == TRUE
+ TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
+!else
+ TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
+ OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+!endif
+ <PcdsFixedAtBuild>
+!include CryptoPkg/Include/Dsc/CryptoServicePcd.min_dxe_smm.dsc.inc
+ }
+
+!endif
diff --git a/OvmfPkg/Include/Dsc/OvmfCryptoDefines.dsc.inc b/OvmfPkg/Include/Dsc/OvmfCryptoDefines.dsc.inc
new file mode 100644
index 000000000000..362146e04de8
--- /dev/null
+++ b/OvmfPkg/Include/Dsc/OvmfCryptoDefines.dsc.inc
@@ -0,0 +1,5 @@
+##
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+ DEFINE USE_CRYPTO_DRIVER = FALSE
diff --git a/OvmfPkg/Include/Dsc/OvmfCryptoLibs.dsc.inc b/OvmfPkg/Include/Dsc/OvmfCryptoLibs.dsc.inc
index a9028352a45e..dc5440ca30c5 100644
--- a/OvmfPkg/Include/Dsc/OvmfCryptoLibs.dsc.inc
+++ b/OvmfPkg/Include/Dsc/OvmfCryptoLibs.dsc.inc
@@ -13,6 +13,22 @@ [LibraryClasses.common.SEC]
TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+!if $(USE_CRYPTO_DRIVER) == TRUE
+
+[LibraryClasses.common]
+ BaseCryptLib|CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.inf
+ TlsLib|CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.inf
+
+[LibraryClasses.common.PEIM]
+ BaseCryptLib|CryptoPkg/Library/BaseCryptLibOnProtocolPpi/PeiCryptLib.inf
+ TlsLib|CryptoPkg/Library/BaseCryptLibOnProtocolPpi/PeiCryptLib.inf
+
+[LibraryClasses.common.DXE_SMM_DRIVER]
+ BaseCryptLib|CryptoPkg/Library/BaseCryptLibOnProtocolPpi/SmmCryptLib.inf
+ TlsLib|CryptoPkg/Library/BaseCryptLibOnProtocolPpi/SmmCryptLib.inf
+
+!else
+
[LibraryClasses.common]
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
!if $(NETWORK_TLS_ENABLE) == TRUE
@@ -37,3 +53,5 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+
+!endif
diff --git a/OvmfPkg/Include/Fdf/OvmfCryptoDxeSmm.fdf.inc b/OvmfPkg/Include/Fdf/OvmfCryptoDxeSmm.fdf.inc
new file mode 100644
index 000000000000..ad425a7acfaf
--- /dev/null
+++ b/OvmfPkg/Include/Fdf/OvmfCryptoDxeSmm.fdf.inc
@@ -0,0 +1,12 @@
+##
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+!if $(USE_CRYPTO_DRIVER) == TRUE
+
+INF CryptoPkg/Driver/CryptoDxe.inf
+!if $(SMM_REQUIRE) == TRUE
+INF CryptoPkg/Driver/CryptoSmm.inf
+!endif
+
+!endif
diff --git a/OvmfPkg/Include/Fdf/OvmfCryptoPei.fdf.inc b/OvmfPkg/Include/Fdf/OvmfCryptoPei.fdf.inc
new file mode 100644
index 000000000000..7c357d748acb
--- /dev/null
+++ b/OvmfPkg/Include/Fdf/OvmfCryptoPei.fdf.inc
@@ -0,0 +1,9 @@
+##
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+!if $(USE_CRYPTO_DRIVER) == TRUE
+
+INF CryptoPkg/Driver/CryptoPei.inf
+
+!endif
--
2.39.1
next prev parent reply other threads:[~2023-02-03 13:28 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-03 13:27 [PATCH 00/11] OvmfPkg: add Crypto Driver support Gerd Hoffmann
2023-02-03 13:27 ` [PATCH 01/11] CryptoPkg: move Driver PCD configs to include files Gerd Hoffmann
2023-02-03 13:27 ` [PATCH 02/11] OvmfPkg: add OvmfCryptoLibs.dsc.inc Gerd Hoffmann
2023-02-03 13:27 ` [PATCH 03/11] OvmfPkg: OvmfPkgX64: use Crypto Libs include Gerd Hoffmann
2023-02-03 13:27 ` Gerd Hoffmann [this message]
2023-02-03 13:28 ` [PATCH 05/11] OvmfPkg: OvmfPkgX64: use new Crypto support includes Gerd Hoffmann
2023-02-03 13:28 ` [PATCH 06/11] OvmfPkg: add OVMF_X64_CRYPTO_DRIVER test case Gerd Hoffmann
2023-02-03 13:28 ` [PATCH 07/11] OvmfPkg: OvmfPkgIa32X64: use crypto includes Gerd Hoffmann
2023-02-03 13:28 ` [PATCH 08/11] OvmfPkg: OvmfPkgIa32: " Gerd Hoffmann
2023-02-03 13:28 ` [PATCH 09/11] OvmfPkg: Microvm: " Gerd Hoffmann
2023-02-03 13:28 ` [PATCH 10/11] OvmfPkg: IntelTdx: " Gerd Hoffmann
2023-02-03 13:28 ` [PATCH 11/11] OvmfPkg: AmdSev: " Gerd Hoffmann
2023-02-03 13:33 ` [PATCH 00/11] OvmfPkg: add Crypto Driver support Ard Biesheuvel
2023-02-03 15:36 ` [edk2-devel] " Gerd Hoffmann
2023-02-03 15:57 ` Ard Biesheuvel
2023-02-03 16:28 ` Gerd Hoffmann
2023-02-03 19:45 ` Pedro Falcato
2023-02-03 23:24 ` Ard Biesheuvel
2023-02-04 1:08 ` Pedro Falcato
2023-02-04 7:56 ` Ard Biesheuvel
2023-02-04 1:13 ` Marvin Häuser
2023-02-04 8:05 ` Ard Biesheuvel
2023-02-04 9:58 ` Marvin Häuser
2023-02-04 8:10 ` Ard Biesheuvel
2023-02-06 8:21 ` Gerd Hoffmann
2023-02-07 3:15 ` Li, Yi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230203132806.2275708-5-kraxel@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox