1 Star 0 Fork 61

ConfidentialComputingPersonal/edk2

forked from ConfidentialComputing/edk2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0067-OvmfPkg-Use-classic-mmio-window-for-CSV-guest.patch 2.67 KB
一键复制 编辑 原始数据 按行查看 历史
hanliyang 提交于 2024-11-12 14:59 +08:00 . Add support for Hygon CSV3 guest
From 26d16863ccb72fd9ac3cbec8d732e0574610893b 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 57efbe70..bcb6546f 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 3c9f01cf..7eef68a0 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 5a79d95b..8fc80f48 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.43.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/confidential-computing-personal/edk2.git
git@gitee.com:confidential-computing-personal/edk2.git
confidential-computing-personal
edk2
edk2
openEuler-24.03-LTS-SP1

搜索帮助