File ovmf.SetOrClearSharedBit.patch of Package xen
From: Olaf Hering <olaf@aepfle.de>
Date: Tue, 20 Jun 2023 18:02:23 +0000
Subject: SetOrClearSharedBit
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
/home/abuild/rpmbuild/BUILD/xen-4.18.20230619T122059.42473bae/non-dbg/tools/firmware/ovmf-dir-remote/OvmfPkg/Library/BaseMemEncryptTdxLib/MemoryEncryption.c: In function ‘SetOrClearSharedBit’:
/home/abuild/rpmbuild/BUILD/xen-4.18.20230619T122059.42473bae/non-dbg/tools/firmware/ovmf-dir-remote/MdePkg/Include/Library/DebugLib.h:375:9: error: ‘Status’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
DebugPrint (PrintLevel, ##__VA_ARGS__); \
^~~~~~~~~~
/home/abuild/rpmbuild/BUILD/xen-4.18.20230619T122059.42473bae/non-dbg/tools/firmware/ovmf-dir-remote/OvmfPkg/Library/BaseMemEncryptTdxLib/MemoryEncryption.c:527:33: note: ‘Status’ was declared here
EFI_STATUS Status;
^~~~~~
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
OvmfPkg/Library/BaseMemEncryptTdxLib/MemoryEncryption.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/OvmfPkg/Library/BaseMemEncryptTdxLib/MemoryEncryption.c
+++ b/OvmfPkg/Library/BaseMemEncryptTdxLib/MemoryEncryption.c
@@ -515,25 +515,25 @@ Split1GPageTo2M (
**/
STATIC
EFI_STATUS
SetOrClearSharedBit (
IN OUT UINT64 *PageTablePointer,
IN TDX_PAGETABLE_MODE Mode,
IN PHYSICAL_ADDRESS PhysicalAddress,
IN UINT64 Length
)
{
UINT64 AddressEncMask;
UINT64 TdStatus;
- EFI_STATUS Status;
+ EFI_STATUS Status = 0;
EDKII_MEMORY_ACCEPT_PROTOCOL *MemoryAcceptProtocol;
AddressEncMask = GetMemEncryptionAddressMask ();
//
// Set or clear page table entry. Also, set shared bit in physical address, before calling MapGPA
//
if (Mode == SetSharedBit) {
*PageTablePointer |= AddressEncMask;
PhysicalAddress |= AddressEncMask;
} else {
*PageTablePointer &= ~AddressEncMask;