Skip to content

Commit

Permalink
Try matching on the last core
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 committed Jul 17, 2021
1 parent 814662f commit 37ff126
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CpuTscSync/VoodooTSCSync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ IOService* VoodooTSCSync::probe(IOService* provider, SInt32* score)
if (!cpuNumber) return NULL;

if (getKernelVersion() >= KernelVersion::Monterey) {
if (cpuNumber->unsigned16BitValue() != 0) return NULL;
SYSLOG("cputs", "discovered cpu with %llu threads, syncing", rdmsr64(MSR_CORE_THREAD_COUNT));
// only attach to last CPU
uint16_t threadCount = rdmsr64(MSR_CORE_THREAD_COUNT);
if (cpuNumber->unsigned16BitValue() != threadCount-1) return NULL;
SYSLOG("cputs", "discovered cpu with %u threads, matching last, syncing", threadCount);
mp_rendezvous_no_intrs(stamp_tsc_new, NULL);
SYSLOG("cputs", "done syncing");
tsc_synced = true;
Expand Down

0 comments on commit 37ff126

Please sign in to comment.