代码拉取完成,页面将自动刷新
From 1bb1257a63d8651d71223c766c9d09b8feebdd08 Mon Sep 17 00:00:00 2001
From: lilu <lilu@hygon.cn>
Date: Thu, 7 Sep 2023 14:44:59 +0800
Subject: [PATCH 11/11] OvmfPkg: Use classic mmio window for CSV guest
For CSV guest, firmware restricts gpa range. Dynamic mmio window
sets Mmio64Base exceeding firmware restriction. Use classic mmio
window for CSV guest. Classic mmio window is less than firmware
restriction under real circumstances.
Signed-off-by: Xin Jiang <jiangxin@hygon.cn>
---
OvmfPkg/Library/CsvLib/CsvLib.inf | 2 +-
OvmfPkg/Library/PlatformInitLib/MemDetect.c | 4 +++-
OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf | 1 +
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/OvmfPkg/Library/CsvLib/CsvLib.inf b/OvmfPkg/Library/CsvLib/CsvLib.inf
index 57efbe7..bcb6546 100644
--- a/OvmfPkg/Library/CsvLib/CsvLib.inf
+++ b/OvmfPkg/Library/CsvLib/CsvLib.inf
@@ -21,7 +21,7 @@
FILE_GUID = 9460ef3a-b9c3-11e9-8324-7371ac35e1e3
MODULE_TYPE = BASE
VERSION_STRING = 1.0
- LIBRARY_CLASS = CsvLib|PEIM DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_DRIVER
+ LIBRARY_CLASS = CsvLib|SEC PEIM DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_DRIVER
#
# The following information is for reference only and not required by the build
diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
index 3c9f01c..7eef68a 100644
--- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c
+++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
@@ -40,6 +40,7 @@ Module Name:
#include <Library/QemuFwCfgLib.h>
#include <Library/QemuFwCfgSimpleParserLib.h>
#include <Library/TdxLib.h>
+#include <Library/CsvLib.h>
#include <Library/PlatformInitLib.h>
@@ -687,7 +688,8 @@ PlatformDynamicMmioWindow (
AddrSpace = LShiftU64 (1, PlatformInfoHob->PhysMemAddressWidth);
MmioSpace = LShiftU64 (1, PlatformInfoHob->PhysMemAddressWidth - 3);
- if ((PlatformInfoHob->PcdPciMmio64Size < MmioSpace) &&
+ if (!CsvIsEnabled() &&
+ (PlatformInfoHob->PcdPciMmio64Size < MmioSpace) &&
(PlatformInfoHob->PcdPciMmio64Base + MmioSpace < AddrSpace))
{
DEBUG ((DEBUG_INFO, "%a: using dynamic mmio window\n", __func__));
diff --git a/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf b/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf
index 5a79d95..8fc80f4 100644
--- a/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf
+++ b/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf
@@ -52,6 +52,7 @@
PcdLib
PciLib
PeiHardwareInfoLib
+ CsvLib
[LibraryClasses.X64]
TdxLib
--
2.25.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。