代码拉取完成,页面将自动刷新
同步操作将从 src-anolis-os/edk2 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 16936ea22fc052576844dfdad6987531aa27a8ec Mon Sep 17 00:00:00 2001
From: Liu Zixing <liuzixing@hygon.cn>
Date: Sat, 26 Feb 2022 14:39:06 +0800
Subject: [PATCH 35/46] anolis: OvmfPkg/BaseMemcryptSevLib: update page status
to Secure Processor for CSV
For CSV VM, when encrypting/decrypting a shared/private memory region,
guest needs to
- set/clear the c-bit in guest page table
- the Secure Processor should be updated accordingly
The BaseMemcryptSevLib has done the first step.
Calling the secure call library for second step.
Signed-off-by: Xin Jiang <jiangxin@hygon.cn>
Change-Id: Icab502ee201d887d6056bcb0116b2e5a1b9eb6b9
---
.../BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf | 1 +
.../BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c | 14 ++++++++++++++
2 files changed, 15 insertions(+)
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf b/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf
index f2e162d..dc32929 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf
@@ -49,6 +49,7 @@
DebugLib
MemoryAllocationLib
PcdLib
+ CsvLib
[FeaturePcd]
gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c
index c696745..6726010 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c
@@ -18,6 +18,8 @@
#include "VirtualMemory.h"
+#include <Library/CsvLib.h>
+
STATIC BOOLEAN mAddressEncMaskChecked = FALSE;
STATIC UINT64 mAddressEncMask;
STATIC PAGE_TABLE_POOL *mPageTablePool = NULL;
@@ -585,6 +587,11 @@ SetMemoryEncDec (
UINT64 AddressEncMask;
BOOLEAN IsWpEnabled;
RETURN_STATUS Status;
+ PHYSICAL_ADDRESS PageAddress;
+ UINTN PageNum;
+
+ PageAddress = PhysicalAddress;
+ PageNum = EFI_SIZE_TO_PAGES (Length);
//
// Set PageMapLevel4Entry to suppress incorrect compiler/analyzer warnings.
@@ -816,6 +823,13 @@ Done:
EnableReadOnlyPageWriteProtect ();
}
+ if (CsvIsEnabled () && Status == EFI_SUCCESS) {
+ if (Mode == ClearCBit)
+ CsvUpdateMemory (PageAddress, PageNum, TRUE);
+ else
+ CsvUpdateMemory (PageAddress, PageNum, FALSE);
+ }
+
return Status;
}
--
2.17.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。