public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Questions about TSC virtualization in KVM
@ 2023-10-24 17:15 Yifei Ma
  2023-10-24 17:33 ` Sean Christopherson
  0 siblings, 1 reply; 4+ messages in thread
From: Yifei Ma @ 2023-10-24 17:15 UTC (permalink / raw)
  To: kvm

Hi KVM community,

   I am trying to figure out how TSC is virtualized in KVM-VMX world.
   According to the kernel documentation, reading TSC register through MSR can be trapped into KVM and VMX. I am trying to figure out the KVM code handing this trap.
   In order to understand it, I have run a kernel traced by GDB, and added break points to the code I thought they may handle the MSR trap, e.g., kvm_get_msr, vmx_exec_control, etc. Then ran rdtsc from guest application, however, it  didn’t trigger these breakpoints. I am a little lost in how TSC is virtualized.
   Two questions:
   - does the TSC MRS instructions are emulated and trapped into KVM?
   - if TSC is trapped, which code handles it?

Any background about TSC virtualization and suggestions on tracing its virtualization are appreciated.

Thank you,

Yifei

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-26 13:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-24 17:15 Questions about TSC virtualization in KVM Yifei Ma
2023-10-24 17:33 ` Sean Christopherson
2023-10-25 23:11   ` Yifei Ma
2023-10-26 13:35     ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox