iTSC multicore value

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
mrjbom
Member
Member
Posts: 322
Joined: Sun Jul 21, 2019 7:34 am

iTSC multicore value

Post by mrjbom »

I'm trying to understand if running invariant TSC is simultaneous for all cores of a single CPU.
Intel documentation says: "Following a RESET, the counter increments..."
After powering up the CPU, all cores are in a RESET state at the same time, right?(or with an extremely small margin of error can be neglected).
Then, since INIT does not change the counter value, in the case of an invariant TSC, we can assume that the counter value will be the same for all cores (or with a very small error to be neglected), right?

I also don't fully understand if all cores have the iTSC frequency("Core Crystal Clock"), I assume so, but can I be sure?
Octocontrabass
Member
Member
Posts: 5623
Joined: Mon Mar 25, 2013 7:01 pm

Re: iTSC multicore value

Post by Octocontrabass »

mrjbom wrote: Tue Dec 31, 2024 6:47 amAfter powering up the CPU, all cores are in a RESET state at the same time, right?(or with an extremely small margin of error can be neglected).
Yes.
mrjbom wrote: Tue Dec 31, 2024 6:47 amThen, since INIT does not change the counter value, in the case of an invariant TSC, we can assume that the counter value will be the same for all cores (or with a very small error to be neglected), right?
Yes, as long as you haven't written to the TSC MSR.
mrjbom wrote: Tue Dec 31, 2024 6:47 amI also don't fully understand if all cores have the iTSC frequency("Core Crystal Clock"), I assume so, but can I be sure?
Yes. See SDM volume 3B section 21.7:
Core Crystal Clock — This is a clock that runs at fixed frequency; it coordinates the clocks on all packages across the system.
User avatar
mrjbom
Member
Member
Posts: 322
Joined: Sun Jul 21, 2019 7:34 am

Re: iTSC multicore value

Post by mrjbom »

Octocontrabass wrote: Tue Dec 31, 2024 4:33 pm
mrjbom wrote: Tue Dec 31, 2024 6:47 amAfter powering up the CPU, all cores are in a RESET state at the same time, right?(or with an extremely small margin of error can be neglected).
Yes.
mrjbom wrote: Tue Dec 31, 2024 6:47 amThen, since INIT does not change the counter value, in the case of an invariant TSC, we can assume that the counter value will be the same for all cores (or with a very small error to be neglected), right?
Yes, as long as you haven't written to the TSC MSR.
mrjbom wrote: Tue Dec 31, 2024 6:47 amI also don't fully understand if all cores have the iTSC frequency("Core Crystal Clock"), I assume so, but can I be sure?
Yes. See SDM volume 3B section 21.7:
Core Crystal Clock — This is a clock that runs at fixed frequency; it coordinates the clocks on all packages across the system.
Great, so I can safely use the iTSC as a system-wide timer.
Thank you for your reply.
Post Reply