kvm icon indicating copy to clipboard operation
kvm copied to clipboard

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

Open wangbaba523 opened this issue 5 years ago • 2 comments

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.

wangbaba523 avatar Jun 27 '20 03:06 wangbaba523

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 ?

Wenzel avatar Jun 27 '20 05:06 Wenzel

@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.

adlazar avatar Jun 29 '20 12:06 adlazar