代码拉取完成,页面将自动刷新
From 1f244d5fec68cbd76fd902819d906c5222577a69 Mon Sep 17 00:00:00 2001
From: hanliyang <hanliyang@hygon.cn>
Date: Mon, 17 Jan 2022 01:19:21 -0500
Subject: [PATCH 45/46] anolis: OvmfPkg/BaseMemcryptSevLib: Correct the
calculation of page range that notified to hypervisor
Correct the calculation of page range that notified to hypervisor.
Change-Id: Ie2ac4a4e894095ea9ae3b1d44afed04681b9d491
---
.../Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c
index 0b67577..4dbf829 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c
@@ -828,9 +828,13 @@ SetMemoryEncDec (
// Notify Hypervisor on C-bit status
//
if (CBitChanged) {
+ UINTN StartPfn = OrigPhysicalAddress >> EFI_PAGE_SHIFT;
+ UINTN EndPfn = (OrigPhysicalAddress + OrigLength +
+ ((1 << EFI_PAGE_SHIFT) - 1)) >> EFI_PAGE_SHIFT;
+
Status = SetMemoryEncDecHypercall3 (
OrigPhysicalAddress,
- EFI_SIZE_TO_PAGES (OrigLength),
+ (EndPfn - StartPfn),
(Mode == SetCBit) ? TRUE : FALSE
);
}
--
2.17.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。