/* Return whether memory used by SMM page table need to be set as Read Only. */
BOOLEAN IfReadOnlyPageTableNeeded(VOID)
/* Return whether memory used by SMM page table need to be set as Read Only. */
BOOLEAN IfReadOnlyPageTableNeeded(VOID)
{
  if (!IsRestrictedMemoryAccess () ||
      ((PcdGet8 (PcdHeapGuardPropertyMask) & (BIT3 | BIT2)) != 0) ||
      FeaturePcdGet (PcdCpuSmmProfileEnable))
  {
    if (sizeof (UINTN) == sizeof (UINT64)) {
      ASSERT (
        !(IsRestrictedMemoryAccess () &&
          (PcdGet8 (PcdHeapGuardPropertyMask) & (BIT3 | BIT2)) != 0)
        );
      ASSERT (!(IsRestrictedMemoryAccess () && FeaturePcdGet (PcdCpuSmmProfileEnable)));
    }
    return FALSE;
  }
  return TRUE;
}