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