qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Capture SIGSEGV to track pc.ram page access
@ 2013-09-01  9:38 Thomas Knauth
  2013-09-02  9:16 ` Stefan Hajnoczi
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Knauth @ 2013-09-01  9:38 UTC (permalink / raw)
  To: qemu-devel

Dear all,

I'm trying to use a signal handler to catch SIGSEGV's in qemu. I
want(ed) to use them to track which memory pages are accessed by the
guest (only accesses to the pc.ram). After some hours of fruitless mucking
around, I've come to the conclusion that it is not as straightforward
as with "normal" programs to do that.

I've swapped out the memory allocation part for the pc.ram part. I'm
using mmap() to allocate the memory with read/write/exec permissions,
and mprotect() with PROT_NONE to revoke all access permissions. I'm
also installing a SIGSEGV handler with sigaction(). But this is never
called for accesses to the mmap()ed region. This leads me to believe
that qemu is doing something behind my back to divert the SIGSEGV
signals from my handler.

My question is where do I have to touch qemu to call my code for
handling SIGSEGVs? Is this possible at all? Can anyone suggest
alternative ways of tracking which pages of pc.ram are accessed?

Thanks for your help,
Thomas.

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

end of thread, other threads:[~2013-10-08 16:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-01  9:38 [Qemu-devel] Capture SIGSEGV to track pc.ram page access Thomas Knauth
2013-09-02  9:16 ` Stefan Hajnoczi
2013-09-26 12:53   ` Thomas Knauth
2013-09-27 10:50     ` Stefan Hajnoczi
2013-10-08 16:22       ` Thomas Knauth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).