[kata-dev] Question about TSC

Sunwoo Jang swjang702 at gmail.com
Sun Feb 7 13:48:24 UTC 2021


Hello all,

I'm trying to get TSC via rdtscp() instruction in kata containers.
But, the value of TSC is different from that of host TSC. In runc
container, I have the same TSC. My cpus are intel core and the codes are
following:

unsigned long long hi, lo;
 __asm__ __volatile__ ("rdtscp" : "=a"(lo), "=d"(hi));
 unsigned long long tsc = lo | hi<<32;


As far as I know, the reason why is due to TSC virtualization, such as TSC
offsetting, in VMM. Is this right? and the same method is applied in kata
containers?

If so, is there a way to get the same host TSC from the kata containers? or
disable TSC offset?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.katacontainers.io/pipermail/kata-dev/attachments/20210207/1ae0851b/attachment.html>


More information about the kata-dev mailing list