how to trace guest OS when qemu is run with kvm enabled and cpu is host?

1.1k views Asked by At

Is it possible to trace guest OS execution (break/watchpoints, single-stepping) when kvm is used and cpu is set to host?

If I run qemu with

qemu-system-x86_64 -no-kvm -cpu core2duo -m 256 -cdrom kernel.iso -s -S

target remote :1234 //on gdb commande line

tracing goes fine but when I run using

qemu-system-x86_64 -enable-kvm -cpu host -m 256 -cdrom kernel.iso

no breakpoint works (guest never stops) so my question. If yes, can someone point me the right config?

I do need kvm to expose PMU features to the guest.

*PMU : Performance Monitoring Unit

2

There are 2 answers

0
Mahouk On BEST ANSWER

Ok, I figured out what i was missing. With kvm enabled and cpu set to host, use hardware breakpoint instead of software breakpoint. The only problem is that our budget in hardware breakpoint is limited

1
Yacine Hebbal On

What you want to do is called: Virtual Machine Introspection (VMI). Take a look at these two papers:

Virtual machine introspection: Techniques and applications

A Survey on Hypervisor Based Monitoring: Approaches, Applications, and Evolutions