32696fd8dd
- edk2-ArmVirt-add-VirtioSerialDxe-to-ArmVirtQemu-builds.patch [RHEL-643] - edk2-ArmVirt-PlatformBootManagerLib-factor-out-IsVirtio.patch [RHEL-643] - edk2-ArmVirt-PlatformBootManagerLib-factor-out-IsVirtioPc.patch [RHEL-643] - edk2-ArmVirt-PlatformBootManagerLib-set-up-virtio-serial-.patch [RHEL-643] - edk2-OvmfPkg-VirtioSerialDxe-use-TPL_NOTIFY.patch [RHEL-643] - edk2-OvmfPkg-VirtioSerialDxe-Remove-noisy-debug-print-on-.patch [RHEL-643] - edk2-OvmfPkg-PlatformInitLib-limit-phys-bits-to-46.patch [bz#2174749] - edk2-Revert-OvmfPkg-disable-dynamic-mmio-window-rhel-only.patch [bz#2174749] - edk2-UefiCpuPkg-MpInitLib-fix-apic-mode-for-cpu-hotplug.patch [bz#2124143] - edk2-OvmfPkg-PlatformInitLib-check-PcdUse1GPageTable.patch [RHEL-644] - edk2-OvmfPkg-OvmfPkgIa32X64-enable-1G-pages.patch [RHEL-644] - edk2-OvmfPkg-MicrovmX64-enable-1G-pages.patch [RHEL-644] - Resolves: RHEL-643 (add virtio serial support to armvirt) - Resolves: bz#2174749 ([edk2] re-enable dynamic mmio window) - Resolves: bz#2124143 (ovmf must consider max cpu count not boot cpu count for apic mode [rhel-9]) - Resolves: RHEL-644 (enable gigabyte pages)
97 lines
3.1 KiB
Diff
97 lines
3.1 KiB
Diff
From 8545529f2b6d967946f111d79455ec8896d53311 Mon Sep 17 00:00:00 2001
|
|
From: Gerd Hoffmann <kraxel@redhat.com>
|
|
Date: Thu, 1 Jun 2023 13:57:12 +0200
|
|
Subject: [PATCH 03/12] ArmVirt/PlatformBootManagerLib: factor out
|
|
IsVirtioPci()
|
|
|
|
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
|
|
RH-MergeRequest: 39: ArmVirt: add VirtioSerialDxe to ArmVirtQemu builds
|
|
RH-Jira: RHEL-643
|
|
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
RH-Commit: [3/6] d0000df1169e1f7b8ce3ad4942460cdc661a0ed9 (kraxel/centos-edk2)
|
|
|
|
IsVirtioPciRng() becomes just a thin wrapper for IsVirtioPci().
|
|
This allows to add similar thin wrappers for other virtio
|
|
devices in the future.
|
|
|
|
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
|
|
(cherry picked from commit aaf546879ab71722c36738ccc6f0f0ab4ecf5076)
|
|
---
|
|
.../PlatformBootManagerLib/PlatformBm.c | 30 ++++++++++++++-----
|
|
1 file changed, 23 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
|
|
index 5eb6f0f9c1..ed38c42a43 100644
|
|
--- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
|
|
+++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
|
|
@@ -313,15 +313,16 @@ IsVirtioRng (
|
|
}
|
|
|
|
/**
|
|
- This FILTER_FUNCTION checks if a handle corresponds to a Virtio RNG device at
|
|
- the EFI_PCI_IO_PROTOCOL level.
|
|
+ This function checks if a handle corresponds to the Virtio Device ID given
|
|
+ at the EFI_PCI_IO_PROTOCOL level.
|
|
**/
|
|
STATIC
|
|
BOOLEAN
|
|
EFIAPI
|
|
-IsVirtioPciRng (
|
|
+IsVirtioPci (
|
|
IN EFI_HANDLE Handle,
|
|
- IN CONST CHAR16 *ReportText
|
|
+ IN CONST CHAR16 *ReportText,
|
|
+ IN UINT16 VirtIoDeviceId
|
|
)
|
|
{
|
|
EFI_STATUS Status;
|
|
@@ -387,11 +388,11 @@ IsVirtioPciRng (
|
|
//
|
|
// From DeviceId and RevisionId, determine whether the device is a
|
|
// modern-only Virtio 1.0 device. In case of Virtio 1.0, DeviceId can
|
|
- // immediately be restricted to VIRTIO_SUBSYSTEM_ENTROPY_SOURCE, and
|
|
+ // immediately be restricted to VirtIoDeviceId, and
|
|
// SubsystemId will only play a sanity-check role. Otherwise, DeviceId can
|
|
// only be sanity-checked, and SubsystemId will decide.
|
|
//
|
|
- if ((DeviceId == 0x1040 + VIRTIO_SUBSYSTEM_ENTROPY_SOURCE) &&
|
|
+ if ((DeviceId == 0x1040 + VirtIoDeviceId) &&
|
|
(RevisionId >= 0x01))
|
|
{
|
|
Virtio10 = TRUE;
|
|
@@ -419,7 +420,7 @@ IsVirtioPciRng (
|
|
return TRUE;
|
|
}
|
|
|
|
- if (!Virtio10 && (SubsystemId == VIRTIO_SUBSYSTEM_ENTROPY_SOURCE)) {
|
|
+ if (!Virtio10 && (SubsystemId == VirtIoDeviceId)) {
|
|
return TRUE;
|
|
}
|
|
|
|
@@ -430,6 +431,21 @@ PciError:
|
|
return FALSE;
|
|
}
|
|
|
|
+/**
|
|
+ This FILTER_FUNCTION checks if a handle corresponds to a Virtio RNG device at
|
|
+ the EFI_PCI_IO_PROTOCOL level.
|
|
+**/
|
|
+STATIC
|
|
+BOOLEAN
|
|
+EFIAPI
|
|
+IsVirtioPciRng (
|
|
+ IN EFI_HANDLE Handle,
|
|
+ IN CONST CHAR16 *ReportText
|
|
+ )
|
|
+{
|
|
+ return IsVirtioPci (Handle, ReportText, VIRTIO_SUBSYSTEM_ENTROPY_SOURCE);
|
|
+}
|
|
+
|
|
/**
|
|
This CALLBACK_FUNCTION attempts to connect a handle non-recursively, asking
|
|
the matching driver to produce all first-level child handles.
|
|
--
|
|
2.39.3
|
|
|