Hi, > + if (sizeof (UINTN) == sizeof (UINT64)) { > + // > + // Check Page5Level Support or not. > + // > + Cr4.UintN = AsmReadCr4 (); > + Page5LevelSupport = (Cr4.Bits.LA57 ? TRUE : FALSE); > + > + // > + // Check Page1G Support or not. > + // > + Page1GSupport = FALSE; > + AsmCpuid (CPUID_EXTENDED_FUNCTION, &RegEax, NULL, NULL, NULL); > + if (RegEax >= CPUID_EXTENDED_CPU_SIG) { > + AsmCpuid (CPUID_EXTENDED_CPU_SIG, NULL, NULL, NULL, &RegEdx.Uint32); > + if (RegEdx.Bits.Page1GB != 0) { > + Page1GSupport = TRUE; > + } > + } > + > + // > + // Decide Paging Mode according Page5LevelSupport & Page1GSupport. > + // > + if (Page5LevelSupport) { > + PagingMode = Page1GSupport ? Paging5Level1GB : Paging5Level; > + } else { > + PagingMode = Page1GSupport ? Paging4Level1GB : Paging4Level; > + } > + } else { > + PagingMode = PagingPae; > + }
I'm wondering whenever CpuPageTableLib should get a function for this? I suspect there a multiple places in edk2 which will need this functionality ... take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118862): https://edk2.groups.io/g/devel/message/118862 Mute This Topic: https://groups.io/mt/106018135/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-