Skip to content

Commit

Permalink
CpuArchLib: Fixed CpuGetMemoryAttributes().
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Krichanov committed Dec 5, 2024
1 parent 79e0eca commit 5588895
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions UefiCpuPkg/Library/CpuArchLib/CpuPageTable.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,16 @@ CpuGetMemoryAttributes (
PAGE_ATTRIBUTE PageAttribute;
UINT64 *PageEntry;

ASSERT (Attributes != NULL);

GetCurrentPagingContext (&PagingContext);

if ((PagingContext.MachineType == IMAGE_FILE_MACHINE_I386) &&
((PagingContext.ContextData.Ia32.Attributes & PAGE_TABLE_LIB_PAGING_CONTEXT_IA32_X64_ATTRIBUTES_PAE) == 0)) {
*Attributes = 0;
return EFI_UNSUPPORTED;
}

PageEntry = GetPageTableEntry (&PagingContext, Address, &PageAttribute);
if (PageEntry == NULL) {
*Attributes = 0;
Expand Down

0 comments on commit 5588895

Please sign in to comment.