Ticket #5412: D1789.diff
File D1789.diff, 2.9 KB (added by , 5 years ago) |
---|
-
source/lib/sysdep/arch/x86_x64/apic.h
1 /* Copyright (C) 201 1Wildfire Games.1 /* Copyright (C) 2019 Wildfire Games. 2 2 * 3 3 * Permission is hereby granted, free of charge, to any person obtaining 4 4 * a copy of this software and associated documentation files (the … … 40 40 // apicId<->contiguousId and apicId<->processor. 41 41 LIB_API bool AreApicIdsReliable(); 42 42 43 // we may get the apicId of a processor we don't have access to. 44 LIB_API bool IsProcessorKnown(ApicId apicId); 45 43 46 LIB_API size_t ProcessorFromApicId(ApicId apicId); 44 47 LIB_API size_t ContiguousIdFromApicId(ApicId apicId); 45 48 -
source/lib/sysdep/arch/x86_x64/apic.cpp
1 /* Copyright (C) 201 1Wildfire Games.1 /* Copyright (C) 2019 Wildfire Games. 2 2 * 3 3 * Permission is hereby granted, free of charge, to any person obtaining 4 4 * a copy of this software and associated documentation files (the … … 110 110 return true; 111 111 } 112 112 113 bool IsProcessorKnown(ApicId apicId) 114 { 115 ModuleInit(&apicInitState, InitApicIds); 116 117 const ApicId* pos = std::find(processorApicIds, processorApicIds+numIds, apicId); 118 return pos != processorApicIds+numIds; 119 } 113 120 114 121 static size_t IndexFromApicId(const ApicId* apicIds, ApicId apicId) 115 122 { -
source/lib/sysdep/os/win/wnuma.cpp
1 /* Copyright (C) 201 8Wildfire Games.1 /* Copyright (C) 2019 Wildfire Games. 2 2 * 3 3 * Permission is hereby granted, free of charge, to any person obtaining 4 4 * a copy of this software and associated documentation files (the … … 232 232 header = (const AffinityHeader*)(uintptr_t(header) + header->length)) 233 233 { 234 234 const AffinityAPIC* affinityAPIC = DynamicCastFromHeader<AffinityAPIC>(header); 235 if(affinityAPIC) 235 if(!affinityAPIC) 236 continue; 237 238 if(!IsProcessorKnown(affinityAPIC->apicId)) 236 239 { 237 const size_t processor = ProcessorFromApicId(affinityAPIC->apicId); 238 const u32 proximityDomainNumber = affinityAPIC->ProximityDomainNumber(); 239 ProximityDomain& proximityDomain = proximityDomains[proximityDomainNumber]; 240 proximityDomain.processorMask |= Bit<uintptr_t>(processor); 240 debug_printf("Processor with APIC ID %d found in SRAT but not known to CPUID.", affinityAPIC->apicId); 241 continue; 241 242 } 243 244 const size_t processor = ProcessorFromApicId(affinityAPIC->apicId); 245 const u32 proximityDomainNumber = affinityAPIC->ProximityDomainNumber(); 246 ProximityDomain& proximityDomain = proximityDomains[proximityDomainNumber]; 247 proximityDomain.processorMask |= Bit<uintptr_t>(processor); 242 248 } 243 249 244 250 return proximityDomains;