All of lore.kernel.org
 help / color / mirror / Atom feed
* Causing VMEXITs when kprobes are hit in the guest VM
@ 2022-05-01 15:30 Arnabjyoti Kalita
  2022-05-03 20:45 ` Sean Christopherson
  0 siblings, 1 reply; 12+ messages in thread
From: Arnabjyoti Kalita @ 2022-05-01 15:30 UTC (permalink / raw)
  To: kvm

Hello all,

I intend to run a kernel module inside my guest VM. The kernel module
sets kprobes on a couple of functions in the linux kernel. After
registering the kprobes successfully, I can see that the kprobes are
being hit repeatedly.

I would like to cause a VMEXIT when these kprobes are hit. I know that
kprobes use a breakpoint instruction (INT 3) to successfully execute
the pre and post handlers. This would mean that the execution of the
instruction INT 3 should technically cause a VMEXIT. However, I do not
get any software exception type VMEXITs when these kprobes are hit.

I have used the commands "perf kvm stat record" and "perf kvm stat
report --event=vmexit" to try and observe the VMEXIT reasons and I do
not see any VMEXIT of type "EXCEPTION_NMI" being returned in the
period that the kprobe was being hit.

My host uses a modified Linux kernel 5.8.0 while my guest runs a 4.4.0
Linux kernel. Both the guest and the host use the x86_64 architecture.
I am using QEMU version 5.0.1. What changes are needed in the Linux
kernel to make sure that I get an exception in the form of a VMEXIT
whenever the kprobes are hit?

Thank you very much.

Best Regards,
Arnabjyoti Kalita

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-05-23 19:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-01 15:30 Causing VMEXITs when kprobes are hit in the guest VM Arnabjyoti Kalita
2022-05-03 20:45 ` Sean Christopherson
2022-05-06  5:14   ` Arnabjyoti Kalita
2022-05-07  6:30     ` Arnabjyoti Kalita
2022-05-11  0:49       ` Jim Mattson
2022-05-11 13:59         ` Sean Christopherson
2022-05-11 14:08           ` Arnabjyoti Kalita
2022-05-11 14:16             ` Sean Christopherson
2022-05-11 14:38               ` Arnabjyoti Kalita
2022-05-11 15:04                 ` Sean Christopherson
2022-05-11 17:02                   ` Arnabjyoti Kalita
2022-05-23 19:44                     ` Arnabjyoti Kalita

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.