On 11/07/2009 10:13 PM, Kurt Kiefer wrote:
Hi guys,
I'm trying to record the instruction pointer at the exact time a guest
was delivered an IOAPIC interrupt. Take for example a PS2 keyboard
press. Clearly, when I read IP during the subsequent exit for
IO_INSTRUCTION I'm just recording the IP of io_read in the handler,
and not the IP at actual interrupt delivery.
Maybe I'm missing something fundamental. It doesn't look like exits
for EXTERNAL_INTERRUPT (shouldn't it?) or INTERRUPT_WINDOW correspond
one-to-one with delivery of these PS2 interrupts.
Just setting request_interrupt_window for these IRQs didn't give me an
INTERRUPT_WINDOW for each key. I guess since the guest doesn't usually
have interrupts masked when I press a key means delivery won't wait
for the window.
Could I record during delivery? I figure I could look at the stack
during the IO_INSTRUCTION exit and figure out what instruction was
actually interrupted, but this would be a Linux-specific solution. Any
other ideas? I think even a simple description of how these interrupts
are being delivered to the guest would help me out a lot.
This is all available now in 2.6.32 or later with the new trace
infrastructure. If you enable ftrace and echo kvm >
/sys/kernel/tracing/set_event, you should get a trace of all interrupt
injections. Of course, you need to figure out which vector is
associated with your irq; you can even have the trace infrastructure
filter this for you.
Note you can only get the ip at the time the interrupt is delivered,
rather than the time the irq is asserted on the ioapic pin.
--
error compiling committee.c: too many arguments to function
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html