Provide deterministic (and somewhat useful) value for RDPID result,
and for %ecx after RDTSCP. Initialize TSC_AUX MSR with CPUID. It allows for userspace to cheaply identify CPU it was executed on some time ago, which is sometimes useful. Note: The values returned might be changed in future. Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
7e0a345bc5
commit
39d70f6b80
@ -265,6 +265,10 @@ initializecpu(void)
|
||||
init_via();
|
||||
break;
|
||||
}
|
||||
|
||||
if ((amd_feature & AMDID_RDTSCP) != 0 ||
|
||||
(cpu_stdext_feature2 & CPUID_STDEXT2_RDPID) != 0)
|
||||
wrmsr(MSR_TSC_AUX, PCPU_GET(cpuid));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -749,6 +749,9 @@ initializecpu(void)
|
||||
msr = rdmsr(MSR_EFER) | EFER_NXE;
|
||||
wrmsr(MSR_EFER, msr);
|
||||
}
|
||||
if ((amd_feature & AMDID_RDTSCP) != 0 ||
|
||||
(cpu_stdext_feature2 & CPUID_STDEXT2_RDPID) != 0)
|
||||
wrmsr(MSR_TSC_AUX, PCPU_GET(cpuid));
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user