[Top][All Lists]

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

Understanding VMEXITS caused by the rdtsc instruction

From: Arnabjyoti Kalita
Subject: Understanding VMEXITS caused by the rdtsc instruction
Date: Sat, 24 Apr 2021 18:31:23 +0530

Hello all,

I'm having a requirement to record values obtained by reading tsc clock.

The command line I use to start QEMU in KVM mode is as below -

sudo ./qemu-system-x86_64 -m 1024 --machine pc-i440fx-2.5 -cpu
qemu64,-vme,-x2apic,-kvmclock,+lahf_lm,+3dnowprefetch,+vmx -enable-kvm
-netdev tap,id=tap1,ifname=tap0,script=no,downscript=no -device
virtio-net-pci,netdev=tap1,mac=00:00:00:00:00:00 -drive
-device virtio-blk-pci,drive=img-direct

I have already made changes to KVM so that when an rdtsc instruction
runs, a VMEXIT happens. I have achieved this by adding a
"CPU_BASED_RDTSC_EXITING" flag to the vmcs config structure and having
a "rdtsc handler" function that will lead to a VMEXIT in userspace.

Now, I want to track whether VMEXITs are actually happening in QEMU
because of rdtsc. This requires me to know which functions get called
when the rdtsc emulation happens within QEMU.

How do I go about determining whether a VMEXIT happened because of the
rdtsc instruction? Which function does QEMU execute to emulate rdtsc?

Thank you very much.

Best Regards,
Arnabjyoti Kalita

reply via email to

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