wbenny / hvpp

hvpp is a lightweight Intel x64/VT-x hypervisor written in C++ focused primarily on virtualization of already running operating system
MIT License
1.12k stars 221 forks source link

Cannot trap rdtsc #33

Closed chongg closed 5 years ago

chongg commented 5 years ago

Hello. I try to trap rdtsc

I add to vmexit_custom.h

void handle_execute_rdtsc(vcpu_t& vp) noexcept override;

and to vmexit_custom.cpp

void vmexit_custom_handler::handle_execute_rdtsc(vcpu_t& vp) noexcept
{
  DbgPrint("rdtsc");
  base_type::handle_execute_rdtsc(vp);
}

But am never catch the instruction. What am do wrong sir?

wbenny commented 5 years ago

Hi, you probably forgot to set rdtsc_exiting bit in vmx_procbased_ctls?

chongg commented 5 years ago

Yes I am forget! Thank you kind sir! Your project is very beautiful for my eyes :)