/** @file\r
CPU DXE Module to produce CPU ARCH Protocol.\r
\r
- Copyright (c) 2008 - 2022, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2008 - 2023, Intel Corporation. All rights reserved.<BR>\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
VOID\r
)\r
{\r
- UINT32 RegEax;\r
- UINT8 PhysicalAddressBits;\r
+ UINT32 MaxExtendedFunction;\r
+ CPUID_VIR_PHY_ADDRESS_SIZE_EAX VirPhyAddressSize;\r
\r
- AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL);\r
+ AsmCpuid (CPUID_EXTENDED_FUNCTION, &MaxExtendedFunction, NULL, NULL, NULL);\r
\r
- if (RegEax >= 0x80000008) {\r
- AsmCpuid (0x80000008, &RegEax, NULL, NULL, NULL);\r
-\r
- PhysicalAddressBits = (UINT8)RegEax;\r
+ if (MaxExtendedFunction >= CPUID_VIR_PHY_ADDRESS_SIZE) {\r
+ AsmCpuid (CPUID_VIR_PHY_ADDRESS_SIZE, &VirPhyAddressSize.Uint32, NULL, NULL, NULL);\r
} else {\r
- PhysicalAddressBits = 36;\r
+ VirPhyAddressSize.Bits.PhysicalAddressBits = 36;\r
}\r
\r
- mValidMtrrBitsMask = LShiftU64 (1, PhysicalAddressBits) - 1;\r
+ mValidMtrrBitsMask = LShiftU64 (1, VirPhyAddressSize.Bits.PhysicalAddressBits) - 1;\r
mValidMtrrAddressMask = mValidMtrrBitsMask & 0xfffffffffffff000ULL;\r
}\r
\r
/** @file\r
CPU DXE Module to produce CPU ARCH Protocol and CPU MP Protocol.\r
\r
- Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2008 - 2023, Intel Corporation. All rights reserved.<BR>\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
#include <Protocol/Cpu.h>\r
#include <Protocol/MpService.h>\r
+#include <Register/Intel/Cpuid.h>\r
#include <Register/Intel/Msr.h>\r
\r
#include <Ppi/SecPlatformInformation.h>\r