KVM-VMI / kvm

Fork of KVM with Virtual Machine Introspection patches
Other
33 stars 28 forks source link

some question about x86_emulate_instruction in arch/x86/kvm/x86.c #38

Open wangbaba523 opened 4 years ago

wangbaba523 commented 4 years ago

Hello, Is that x86_emulate_instruction can emulate all instructions? I want to emulate some call instruction,but I don't know how to do it,Do you have any information about this problem,Thanks.

Wenzel commented 4 years ago

Hi @wangbaba523,

I'm not knowledgable about the kvm part, but an emulator is complicated piece of software to implement and will always be incomplete. Althought, the call instruction is very common and should be implemented I believe.

Maybe @mdontu and @adlazar can provide more information ?

adlazar commented 4 years ago

@wangbaba523, the KVM emulator cannot emulate any instruction, but those instructions that cannot be emulated can be transparently single-stepped. Just track the execute access and allow the access to happen (when you handle the memory access event). If the instruction cannot be emulated, the vCPU will be single-stepped.