qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Get physical machine TSC inside VM by rdtsc


From: Tao Lyu
Subject: Get physical machine TSC inside VM by rdtsc
Date: Mon, 1 Jan 2024 21:41:52 +0000

Hello all,


Can anybody help me with this question?


I want to read the timestamp counter using rdtsc inside the KVM virtual machine.

From some blogs, I know I need to disable the following options when starting qemu:

vmx-rdtsc-exit

vmx-rdtscp-exit

tsc-scale

tsc-adjust

vmx-tsc-offset


And enable the following options:

rdtscp

tsc


However, after specifying these options, the rdtsc inside the VM still returns an adjusted counter instead of host counter.


This is the result shown by the vmxcap script:


  Use TSC offsetting                       no
  RDTSC exiting                            no
  Enable RDTSCP                            no
  TSC scaling                              yes


I really appreciate it if anyone could help me. Thank you so much!


Best,

Tao



reply via email to

[Prev in Thread] Current Thread [Next in Thread]