X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=UefiCpuPkg%2FLibrary%2FBaseXApicLib%2FBaseXApicLib.c;fp=UefiCpuPkg%2FLibrary%2FBaseXApicLib%2FBaseXApicLib.c;h=f81bbb2252d9e82df9eab00d56b65f8bf9b7e4bb;hp=4064049807b72fcc334520339695fdcffd74fe93;hb=4af3ae1463796ef7b2ecf2bfe8b390e72817212c;hpb=7b9b576c71c71ed134f50497fd58f862109dd80b diff --git a/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c b/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c index 4064049807..f81bbb2252 100644 --- a/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c +++ b/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c @@ -314,12 +314,15 @@ GetInitialApicId ( // // If CPUID Leaf B is supported, + // And CPUID.0BH:EBX[15:0] reports a non-zero value, // Then the initial 32-bit APIC ID = CPUID.0BH:EDX // Else the initial 8-bit APIC ID = CPUID.1:EBX[31:24] // if (MaxCpuIdIndex >= CPUID_EXTENDED_TOPOLOGY) { - AsmCpuidEx (CPUID_EXTENDED_TOPOLOGY, 0, NULL, NULL, NULL, &ApicId); - return ApicId; + AsmCpuidEx (CPUID_EXTENDED_TOPOLOGY, 0, NULL, &RegEbx, NULL, &ApicId); + if ((RegEbx & (BIT16 - 1)) != 0) { + return ApicId; + } } AsmCpuid (CPUID_VERSION_INFO, NULL, &RegEbx, NULL, NULL);