|
@@ -27,6 +27,8 @@
|
|
|
#include "VirtualMemory.h"
|
|
|
#include <IndustryStandard/Tdx.h>
|
|
|
#include <Library/TdxLib.h>
|
|
|
+#include <Library/UefiBootServicesTableLib.h>
|
|
|
+#include <Protocol/MemoryAccept.h>
|
|
|
#include <ConfidentialComputingGuestAttr.h>
|
|
|
|
|
|
typedef enum {
|
|
@@ -517,8 +519,9 @@ SetOrClearSharedBit (
|
|
|
IN UINT64 Length
|
|
|
)
|
|
|
{
|
|
|
- UINT64 AddressEncMask;
|
|
|
- UINT64 Status;
|
|
|
+ UINT64 AddressEncMask;
|
|
|
+ UINT64 Status;
|
|
|
+ EDKII_MEMORY_ACCEPT_PROTOCOL *MemoryAcceptProtocol;
|
|
|
|
|
|
AddressEncMask = GetMemEncryptionAddressMask ();
|
|
|
|
|
@@ -539,7 +542,10 @@ SetOrClearSharedBit (
|
|
|
// If changing shared to private, must accept-page again
|
|
|
//
|
|
|
if (Mode == ClearSharedBit) {
|
|
|
- TdAcceptPages (PhysicalAddress, Length / EFI_PAGE_SIZE, EFI_PAGE_SIZE);
|
|
|
+ Status = gBS->LocateProtocol (&gEdkiiMemoryAcceptProtocolGuid, NULL, (VOID **)&MemoryAcceptProtocol);
|
|
|
+ ASSERT (!EFI_ERROR (Status));
|
|
|
+ Status = MemoryAcceptProtocol->AcceptMemory (MemoryAcceptProtocol, PhysicalAddress, Length);
|
|
|
+ ASSERT (!EFI_ERROR (Status));
|
|
|
}
|
|
|
|
|
|
DEBUG ((
|