I recently became aware of the RDTSCP instruction. There is an Intel whitepaper
here that discusses its use in cycle-counting code. My Core i3, with two physical cores and no HTT, supports RDTSCP. Assuming that RDTSCP returns a processor or core ID, or similar, in ECX, I thought it would be interesting to use it to monitor the processor core that my process is running on, to see if the system does move processes between cores, as I have seen some people claim it does.
I started out to do this as a 64-bit app coded in JWASM, but in the time I had to spend on it I could not find a good set of 64-bit header files, so I switched to Pelles C and POASM.
First surprise, RDTSCP seems to always return zero in ECX, independent of the process/thread affinity. Intel refers to the value in ECX as IA32_TSC_AUX, and per
this page, "the Linux kernel initializes this to the core's number, starting from zero." Also, on that same page, the "invariant TSC" stuff is interesting.