Skip to content

Commit

Permalink
OvmfPkg: wire up RngDxe
Browse files Browse the repository at this point in the history
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).

Also move VirtioRng to the include snippets.

Use the new include snippets for OVMF builds.

Signed-off-by: Gerd Hoffmann <[email protected]>
  • Loading branch information
kraxel authored and ardbiesheuvel committed Jun 13, 2024
1 parent a61bc0a commit 712797c
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 12 deletions.
2 changes: 1 addition & 1 deletion OvmfPkg/AmdSev/AmdSevX64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,6 @@
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
Expand Down Expand Up @@ -733,6 +732,7 @@
OvmfPkg/AmdSev/Grub/Grub.inf

!include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc
!include OvmfPkg/Include/Dsc/OvmfRngComponents.dsc.inc

OvmfPkg/PlatformDxe/Platform.inf
OvmfPkg/AmdSevDxe/AmdSevDxe.inf {
Expand Down
2 changes: 1 addition & 1 deletion OvmfPkg/AmdSev/AmdSevX64.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
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
Expand Down Expand Up @@ -321,6 +320,7 @@ INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
!include OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc

!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc
!include OvmfPkg/Include/Fdf/OvmfRngDxe.fdf.inc

################################################################################

Expand Down
9 changes: 9 additions & 0 deletions OvmfPkg/Include/Dsc/OvmfRngComponents.dsc.inc
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions OvmfPkg/Include/Fdf/OvmfRngDxe.fdf.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
##
# SPDX-License-Identifier: BSD-2-Clause-Patent
##

INF SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf
INF OvmfPkg/VirtioRngDxe/VirtioRng.inf
2 changes: 1 addition & 1 deletion OvmfPkg/IntelTdx/IntelTdxX64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,6 @@
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
Expand Down Expand Up @@ -718,6 +717,7 @@
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf

!include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc
!include OvmfPkg/Include/Dsc/OvmfRngComponents.dsc.inc

!if $(SECURE_BOOT_ENABLE) == TRUE
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
Expand Down
2 changes: 1 addition & 1 deletion OvmfPkg/IntelTdx/IntelTdxX64.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -326,6 +325,7 @@ INF OvmfPkg/VirtioGpuDxe/VirtioGpu.inf
INF OvmfPkg/PlatformDxe/Platform.inf

!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc
!include OvmfPkg/Include/Fdf/OvmfRngDxe.fdf.inc

################################################################################

Expand Down
2 changes: 1 addition & 1 deletion OvmfPkg/Microvm/MicrovmX64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,6 @@
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
Expand Down Expand Up @@ -846,6 +845,7 @@
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf

!include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc
!include OvmfPkg/Include/Dsc/OvmfRngComponents.dsc.inc

!if $(SECURE_BOOT_ENABLE) == TRUE
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
Expand Down
2 changes: 1 addition & 1 deletion OvmfPkg/Microvm/MicrovmX64.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
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
Expand Down Expand Up @@ -299,6 +298,7 @@ INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf

!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc
!include OvmfPkg/Include/Fdf/OvmfRngDxe.fdf.inc

################################################################################

Expand Down
2 changes: 1 addition & 1 deletion OvmfPkg/OvmfPkgIa32.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,6 @@
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
Expand Down Expand Up @@ -882,6 +881,7 @@

!include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc
!include OvmfPkg/Include/Dsc/MorLock.dsc.inc
!include OvmfPkg/Include/Dsc/OvmfRngComponents.dsc.inc

!if $(SECURE_BOOT_ENABLE) == TRUE
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
Expand Down
2 changes: 1 addition & 1 deletion OvmfPkg/OvmfPkgIa32.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
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
Expand Down Expand Up @@ -360,6 +359,7 @@ INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf

!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc
!include OvmfPkg/Include/Fdf/MorLock.fdf.inc
!include OvmfPkg/Include/Fdf/OvmfRngDxe.fdf.inc

!if $(LOAD_X64_ON_IA32_ENABLE) == TRUE
INF OvmfPkg/CompatImageLoaderDxe/CompatImageLoaderDxe.inf
Expand Down
2 changes: 1 addition & 1 deletion OvmfPkg/OvmfPkgIa32X64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,6 @@
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
Expand Down Expand Up @@ -896,6 +895,7 @@

!include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc
!include OvmfPkg/Include/Dsc/MorLock.dsc.inc
!include OvmfPkg/Include/Dsc/OvmfRngComponents.dsc.inc

!if $(SECURE_BOOT_ENABLE) == TRUE
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
Expand Down
2 changes: 1 addition & 1 deletion OvmfPkg/OvmfPkgIa32X64.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
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
Expand Down Expand Up @@ -367,6 +366,7 @@ INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf

!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc
!include OvmfPkg/Include/Fdf/MorLock.fdf.inc
!include OvmfPkg/Include/Fdf/OvmfRngDxe.fdf.inc

################################################################################

Expand Down
2 changes: 1 addition & 1 deletion OvmfPkg/OvmfPkgX64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,6 @@
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
Expand Down Expand Up @@ -964,6 +963,7 @@

!include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc
!include OvmfPkg/Include/Dsc/MorLock.dsc.inc
!include OvmfPkg/Include/Dsc/OvmfRngComponents.dsc.inc

!if $(SECURE_BOOT_ENABLE) == TRUE
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
Expand Down
2 changes: 1 addition & 1 deletion OvmfPkg/OvmfPkgX64.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
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
Expand Down Expand Up @@ -407,6 +406,7 @@ INF OvmfPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.inf

!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc
!include OvmfPkg/Include/Fdf/MorLock.fdf.inc
!include OvmfPkg/Include/Fdf/OvmfRngDxe.fdf.inc

################################################################################

Expand Down

0 comments on commit 712797c

Please sign in to comment.