|
From: Nicholas N. <nj...@cs...> - 2005-02-02 22:49:02
|
Hi,
Valgrind currently only supports the 'int' instruction when it is "int
0x80", which is used for a system call on x86/Linux. Some Java
implementations use the x86 'int' ("interrupt") instruction when certain
exceptions are thrown. Steve Blackburn of ANU was having problems with
using Cachegrind on some Java programs because of this. I made a quick
attempt at adding support for these instructions, but failed, so I'm
asking here about it. I tried adding a new kind of basic-block-ending
Jmp, and then tried adding a new UCode instruction, INT. I made some
progress but didn't really get anywhere.
AIUI, an interrupt basically causes a jump to a particular interrupt
handler within the kernel. This is tricky for Valgrind, because we can't
let jumps go just anywhere, otherwise we'll lose control and the client
will undoubtedly crash very quickly. So the pertinent question is this:
how does control return to the client in user-space? With system calls
(int 0x80), control returns -- once the kernel has done its thing -- to
the subsequent instruction. Is the same true of all interrupts?
Another question: how do we know what the kernel does while servicing the
interrupt? Would it require, as with syscalls, that Valgrind tells the
tool about certain events such as memory reads and writes? I guess it may
well depend on what the kernel does with each interrupt, and so support
would have to be added one interrupt at a time?
Basically, if anyone knows how these interrupts work, and have ideas about
how to support them, I'd appreciate knowing about it. Thanks.
Thanks.
N
|