/* This is done by changing the page table attribute to be PRSENT. */
VOID EFIAPI UnsetGuardPage(IN EFI_PHYSICAL_ADDRESS BaseAddress)
/* This is done by changing the page table attribute to be PRSENT. */
VOID EFIAPI UnsetGuardPage(IN EFI_PHYSICAL_ADDRESS BaseAddress)
{
  UINT64      Attributes;
  EFI_STATUS  Status;
  if (gCpu == NULL) {
    return;
  }
  Attributes = 0;
  if ((PcdGet64 (PcdDxeNxMemoryProtectionPolicy) & (1 << EfiConventionalMemory)) != 0) {
    Attributes |= EFI_MEMORY_XP;
  }
  mOnGuarding = TRUE;
  Status = gCpu->SetMemoryAttributes (gCpu, BaseAddress, EFI_PAGE_SIZE, Attributes);
  ASSERT_EFI_ERROR (Status);
  mOnGuarding = FALSE;
}