edk2/SOURCES/0038-OvmfPkg-wire-up-RngDxe.patch

302 lines
12 KiB
Diff
Raw Permalink Normal View History

2024-11-12 08:41:04 +00:00
From 0aa96c512c689426838ec1cf4aa78ff088c03a1e Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Fri, 24 May 2024 12:51:17 +0200
Subject: [PATCH] OvmfPkg: wire up RngDxe
2024-07-25 08:07:47 +00:00
2024-11-12 08:41:04 +00:00
Add OvmfRng include snippets with the random number generator
configuration for OVMF. Include RngDxe, build with BaseRngLib,
so the rdrand instruction is used (if available).
2024-07-25 08:07:47 +00:00
2024-11-12 08:41:04 +00:00
Also move VirtioRng to the include snippets.
2024-07-25 08:07:47 +00:00
2024-11-12 08:41:04 +00:00
Use the new include snippets for OVMF builds.
2024-07-25 08:07:47 +00:00
2024-11-12 08:41:04 +00:00
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 712797cf19acd292bf203522a79e40e7e13d268b)
2024-07-25 08:07:47 +00:00
---
OvmfPkg/AmdSev/AmdSevX64.dsc | 2 +-
2024-11-12 08:41:04 +00:00
OvmfPkg/AmdSev/AmdSevX64.fdf | 2 +-
2024-07-25 08:07:47 +00:00
OvmfPkg/Include/Dsc/OvmfRngComponents.dsc.inc | 9 +++++++++
OvmfPkg/Include/Fdf/OvmfRngDxe.fdf.inc | 6 ++++++
OvmfPkg/IntelTdx/IntelTdxX64.dsc | 2 +-
2024-11-12 08:41:04 +00:00
OvmfPkg/IntelTdx/IntelTdxX64.fdf | 2 +-
2024-07-25 08:07:47 +00:00
OvmfPkg/Microvm/MicrovmX64.dsc | 2 +-
2024-11-12 08:41:04 +00:00
OvmfPkg/Microvm/MicrovmX64.fdf | 2 +-
2024-07-25 08:07:47 +00:00
OvmfPkg/OvmfPkgIa32.dsc | 2 +-
2024-11-12 08:41:04 +00:00
OvmfPkg/OvmfPkgIa32.fdf | 2 +-
2024-07-25 08:07:47 +00:00
OvmfPkg/OvmfPkgIa32X64.dsc | 2 +-
2024-11-12 08:41:04 +00:00
OvmfPkg/OvmfPkgIa32X64.fdf | 2 +-
2024-07-25 08:07:47 +00:00
OvmfPkg/OvmfPkgX64.dsc | 2 +-
2024-11-12 08:41:04 +00:00
OvmfPkg/OvmfPkgX64.fdf | 2 +-
14 files changed, 27 insertions(+), 12 deletions(-)
2024-07-25 08:07:47 +00:00
create mode 100644 OvmfPkg/Include/Dsc/OvmfRngComponents.dsc.inc
create mode 100644 OvmfPkg/Include/Fdf/OvmfRngDxe.fdf.inc
diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc
2024-11-12 08:41:04 +00:00
index cf1ad83e09..4edc2a9069 100644
2024-07-25 08:07:47 +00:00
--- a/OvmfPkg/AmdSev/AmdSevX64.dsc
+++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
2024-11-12 08:41:04 +00:00
@@ -649,7 +649,6 @@
2024-07-25 08:07:47 +00:00
OvmfPkg/Virtio10Dxe/Virtio10.inf
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
- OvmfPkg/VirtioRngDxe/VirtioRng.inf
!if $(PVSCSI_ENABLE) == TRUE
OvmfPkg/PvScsiDxe/PvScsiDxe.inf
!endif
2024-11-12 08:41:04 +00:00
@@ -740,6 +739,7 @@
OvmfPkg/AmdSev/Grub/Grub.inf
!include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc
2024-07-25 08:07:47 +00:00
+!include OvmfPkg/Include/Dsc/OvmfRngComponents.dsc.inc
OvmfPkg/PlatformDxe/Platform.inf
OvmfPkg/AmdSevDxe/AmdSevDxe.inf {
diff --git a/OvmfPkg/AmdSev/AmdSevX64.fdf b/OvmfPkg/AmdSev/AmdSevX64.fdf
2024-11-12 08:41:04 +00:00
index c56c98dc85..480837b0fa 100644
2024-07-25 08:07:47 +00:00
--- a/OvmfPkg/AmdSev/AmdSevX64.fdf
+++ b/OvmfPkg/AmdSev/AmdSevX64.fdf
2024-11-12 08:41:04 +00:00
@@ -227,7 +227,6 @@ INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
2024-07-25 08:07:47 +00:00
INF OvmfPkg/Virtio10Dxe/Virtio10.inf
INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
INF OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
-INF OvmfPkg/VirtioRngDxe/VirtioRng.inf
!if $(PVSCSI_ENABLE) == TRUE
INF OvmfPkg/PvScsiDxe/PvScsiDxe.inf
!endif
2024-11-12 08:41:04 +00:00
@@ -318,6 +317,7 @@ INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
2024-07-25 08:07:47 +00:00
!include OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc
2024-11-12 08:41:04 +00:00
!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc
2024-07-25 08:07:47 +00:00
+!include OvmfPkg/Include/Fdf/OvmfRngDxe.fdf.inc
2024-11-12 08:41:04 +00:00
2024-07-25 08:07:47 +00:00
################################################################################
diff --git a/OvmfPkg/Include/Dsc/OvmfRngComponents.dsc.inc b/OvmfPkg/Include/Dsc/OvmfRngComponents.dsc.inc
new file mode 100644
index 0000000000..68839a0caa
--- /dev/null
+++ b/OvmfPkg/Include/Dsc/OvmfRngComponents.dsc.inc
@@ -0,0 +1,9 @@
+##
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+ SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf {
+ <LibraryClasses>
+ RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf
+ }
+ OvmfPkg/VirtioRngDxe/VirtioRng.inf
diff --git a/OvmfPkg/Include/Fdf/OvmfRngDxe.fdf.inc b/OvmfPkg/Include/Fdf/OvmfRngDxe.fdf.inc
new file mode 100644
index 0000000000..99cb4a32b1
--- /dev/null
+++ b/OvmfPkg/Include/Fdf/OvmfRngDxe.fdf.inc
@@ -0,0 +1,6 @@
+##
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+INF SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf
+INF OvmfPkg/VirtioRngDxe/VirtioRng.inf
diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
2024-11-12 08:41:04 +00:00
index 9f49b60ff0..4b7e1596fc 100644
2024-07-25 08:07:47 +00:00
--- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
+++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
2024-11-12 08:41:04 +00:00
@@ -636,7 +636,6 @@
2024-07-25 08:07:47 +00:00
OvmfPkg/Virtio10Dxe/Virtio10.inf
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
- OvmfPkg/VirtioRngDxe/VirtioRng.inf
!if $(PVSCSI_ENABLE) == TRUE
OvmfPkg/PvScsiDxe/PvScsiDxe.inf
!endif
2024-11-12 08:41:04 +00:00
@@ -719,6 +718,7 @@
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
!include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc
2024-07-25 08:07:47 +00:00
+!include OvmfPkg/Include/Dsc/OvmfRngComponents.dsc.inc
!if $(SECURE_BOOT_ENABLE) == TRUE
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.fdf b/OvmfPkg/IntelTdx/IntelTdxX64.fdf
2024-11-12 08:41:04 +00:00
index ce5d542048..88d0f75ae2 100644
2024-07-25 08:07:47 +00:00
--- a/OvmfPkg/IntelTdx/IntelTdxX64.fdf
+++ b/OvmfPkg/IntelTdx/IntelTdxX64.fdf
@@ -285,7 +285,6 @@ READ_LOCK_STATUS = TRUE
#
INF MdeModulePkg/Universal/EbcDxe/EbcDxe.inf
INF OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
-INF OvmfPkg/VirtioRngDxe/VirtioRng.inf
!if $(PVSCSI_ENABLE) == TRUE
INF OvmfPkg/PvScsiDxe/PvScsiDxe.inf
!endif
2024-11-12 08:41:04 +00:00
@@ -326,6 +325,7 @@ INF OvmfPkg/VirtioGpuDxe/VirtioGpu.inf
2024-07-25 08:07:47 +00:00
INF OvmfPkg/PlatformDxe/Platform.inf
2024-11-12 08:41:04 +00:00
!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc
2024-07-25 08:07:47 +00:00
+!include OvmfPkg/Include/Fdf/OvmfRngDxe.fdf.inc
2024-11-12 08:41:04 +00:00
2024-07-25 08:07:47 +00:00
################################################################################
diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc
2024-11-12 08:41:04 +00:00
index fb73f2e089..9206f01816 100644
2024-07-25 08:07:47 +00:00
--- a/OvmfPkg/Microvm/MicrovmX64.dsc
+++ b/OvmfPkg/Microvm/MicrovmX64.dsc
2024-11-12 08:41:04 +00:00
@@ -760,7 +760,6 @@
2024-07-25 08:07:47 +00:00
OvmfPkg/Virtio10Dxe/Virtio10.inf
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
- OvmfPkg/VirtioRngDxe/VirtioRng.inf
OvmfPkg/VirtioSerialDxe/VirtioSerial.inf
MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
2024-11-12 08:41:04 +00:00
@@ -846,6 +845,7 @@
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
!include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc
2024-07-25 08:07:47 +00:00
+!include OvmfPkg/Include/Dsc/OvmfRngComponents.dsc.inc
!if $(SECURE_BOOT_ENABLE) == TRUE
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
diff --git a/OvmfPkg/Microvm/MicrovmX64.fdf b/OvmfPkg/Microvm/MicrovmX64.fdf
2024-11-12 08:41:04 +00:00
index 055e659a35..c8268d7e8c 100644
2024-07-25 08:07:47 +00:00
--- a/OvmfPkg/Microvm/MicrovmX64.fdf
+++ b/OvmfPkg/Microvm/MicrovmX64.fdf
2024-11-12 08:41:04 +00:00
@@ -207,7 +207,6 @@ INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
2024-07-25 08:07:47 +00:00
INF OvmfPkg/Virtio10Dxe/Virtio10.inf
INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
INF OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
-INF OvmfPkg/VirtioRngDxe/VirtioRng.inf
INF OvmfPkg/VirtioSerialDxe/VirtioSerial.inf
!if $(SECURE_BOOT_ENABLE) == TRUE
2024-11-12 08:41:04 +00:00
@@ -299,6 +298,7 @@ INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
2024-07-25 08:07:47 +00:00
INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
2024-11-12 08:41:04 +00:00
!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc
2024-07-25 08:07:47 +00:00
+!include OvmfPkg/Include/Fdf/OvmfRngDxe.fdf.inc
2024-11-12 08:41:04 +00:00
2024-07-25 08:07:47 +00:00
################################################################################
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
2024-11-12 08:41:04 +00:00
index 65a866ae0c..b64c215585 100644
2024-07-25 08:07:47 +00:00
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
2024-11-12 08:41:04 +00:00
@@ -784,7 +784,6 @@
2024-07-25 08:07:47 +00:00
OvmfPkg/Virtio10Dxe/Virtio10.inf
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
- OvmfPkg/VirtioRngDxe/VirtioRng.inf
OvmfPkg/VirtioSerialDxe/VirtioSerial.inf
!if $(PVSCSI_ENABLE) == TRUE
OvmfPkg/PvScsiDxe/PvScsiDxe.inf
2024-11-12 08:41:04 +00:00
@@ -888,6 +887,7 @@
!include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc
!include OvmfPkg/Include/Dsc/MorLock.dsc.inc
2024-07-25 08:07:47 +00:00
+!include OvmfPkg/Include/Dsc/OvmfRngComponents.dsc.inc
!if $(SECURE_BOOT_ENABLE) == TRUE
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
2024-11-12 08:41:04 +00:00
index 10eb6fe72b..c31276e4a3 100644
2024-07-25 08:07:47 +00:00
--- a/OvmfPkg/OvmfPkgIa32.fdf
+++ b/OvmfPkg/OvmfPkgIa32.fdf
2024-11-12 08:41:04 +00:00
@@ -231,7 +231,6 @@ INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
2024-07-25 08:07:47 +00:00
INF OvmfPkg/Virtio10Dxe/Virtio10.inf
INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
INF OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
-INF OvmfPkg/VirtioRngDxe/VirtioRng.inf
INF OvmfPkg/VirtioSerialDxe/VirtioSerial.inf
!if $(PVSCSI_ENABLE) == TRUE
INF OvmfPkg/PvScsiDxe/PvScsiDxe.inf
2024-11-12 08:41:04 +00:00
@@ -356,6 +355,7 @@ INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
2024-07-25 08:07:47 +00:00
2024-11-12 08:41:04 +00:00
!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc
!include OvmfPkg/Include/Fdf/MorLock.fdf.inc
2024-07-25 08:07:47 +00:00
+!include OvmfPkg/Include/Fdf/OvmfRngDxe.fdf.inc
2024-11-12 08:41:04 +00:00
2024-07-25 08:07:47 +00:00
!if $(LOAD_X64_ON_IA32_ENABLE) == TRUE
INF OvmfPkg/CompatImageLoaderDxe/CompatImageLoaderDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
2024-11-12 08:41:04 +00:00
index 679e25501b..ececac3757 100644
2024-07-25 08:07:47 +00:00
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
2024-11-12 08:41:04 +00:00
@@ -798,7 +798,6 @@
2024-07-25 08:07:47 +00:00
OvmfPkg/Virtio10Dxe/Virtio10.inf
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
- OvmfPkg/VirtioRngDxe/VirtioRng.inf
OvmfPkg/VirtioSerialDxe/VirtioSerial.inf
!if $(PVSCSI_ENABLE) == TRUE
OvmfPkg/PvScsiDxe/PvScsiDxe.inf
2024-11-12 08:41:04 +00:00
@@ -902,6 +901,7 @@
!include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc
!include OvmfPkg/Include/Dsc/MorLock.dsc.inc
2024-07-25 08:07:47 +00:00
+!include OvmfPkg/Include/Dsc/OvmfRngComponents.dsc.inc
!if $(SECURE_BOOT_ENABLE) == TRUE
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
2024-11-12 08:41:04 +00:00
index ff06bbfc6f..a7b4aeac08 100644
2024-07-25 08:07:47 +00:00
--- a/OvmfPkg/OvmfPkgIa32X64.fdf
+++ b/OvmfPkg/OvmfPkgIa32X64.fdf
2024-11-12 08:41:04 +00:00
@@ -232,7 +232,6 @@ INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
2024-07-25 08:07:47 +00:00
INF OvmfPkg/Virtio10Dxe/Virtio10.inf
INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
INF OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
-INF OvmfPkg/VirtioRngDxe/VirtioRng.inf
INF OvmfPkg/VirtioSerialDxe/VirtioSerial.inf
!if $(PVSCSI_ENABLE) == TRUE
INF OvmfPkg/PvScsiDxe/PvScsiDxe.inf
2024-11-12 08:41:04 +00:00
@@ -363,6 +362,7 @@ INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
2024-07-25 08:07:47 +00:00
2024-11-12 08:41:04 +00:00
!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc
!include OvmfPkg/Include/Fdf/MorLock.fdf.inc
2024-07-25 08:07:47 +00:00
+!include OvmfPkg/Include/Fdf/OvmfRngDxe.fdf.inc
2024-11-12 08:41:04 +00:00
2024-07-25 08:07:47 +00:00
################################################################################
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
2024-11-12 08:41:04 +00:00
index d294fd4625..0ab4d3df06 100644
2024-07-25 08:07:47 +00:00
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
2024-11-12 08:41:04 +00:00
@@ -866,7 +866,6 @@
2024-07-25 08:07:47 +00:00
OvmfPkg/Virtio10Dxe/Virtio10.inf
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
- OvmfPkg/VirtioRngDxe/VirtioRng.inf
OvmfPkg/VirtioSerialDxe/VirtioSerial.inf
!if $(PVSCSI_ENABLE) == TRUE
OvmfPkg/PvScsiDxe/PvScsiDxe.inf
2024-11-12 08:41:04 +00:00
@@ -970,6 +969,7 @@
!include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc
!include OvmfPkg/Include/Dsc/MorLock.dsc.inc
2024-07-25 08:07:47 +00:00
+!include OvmfPkg/Include/Dsc/OvmfRngComponents.dsc.inc
!if $(SECURE_BOOT_ENABLE) == TRUE
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
2024-11-12 08:41:04 +00:00
index f3b787201f..ae08ac4fe9 100644
2024-07-25 08:07:47 +00:00
--- a/OvmfPkg/OvmfPkgX64.fdf
+++ b/OvmfPkg/OvmfPkgX64.fdf
2024-11-12 08:41:04 +00:00
@@ -263,7 +263,6 @@ INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
2024-07-25 08:07:47 +00:00
INF OvmfPkg/Virtio10Dxe/Virtio10.inf
INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
INF OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
-INF OvmfPkg/VirtioRngDxe/VirtioRng.inf
INF OvmfPkg/VirtioSerialDxe/VirtioSerial.inf
!if $(PVSCSI_ENABLE) == TRUE
INF OvmfPkg/PvScsiDxe/PvScsiDxe.inf
2024-11-12 08:41:04 +00:00
@@ -403,6 +402,7 @@ INF OvmfPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.inf
2024-07-25 08:07:47 +00:00
2024-11-12 08:41:04 +00:00
!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc
!include OvmfPkg/Include/Fdf/MorLock.fdf.inc
2024-07-25 08:07:47 +00:00
+!include OvmfPkg/Include/Fdf/OvmfRngDxe.fdf.inc
2024-11-12 08:41:04 +00:00
2024-07-25 08:07:47 +00:00
################################################################################