From: Avi Kivity <avi@redhat.com>
To: Kurt Kiefer <kekiefer@gmail.com>
Cc: kvm@vger.kernel.org
Subject: Re: Recording interrupted instruction on ioapic_set_irq
Date: Sun, 08 Nov 2009 14:50:33 +0200 [thread overview]
Message-ID: <4AF6BE99.5050107@redhat.com> (raw)
In-Reply-To: <467FDE56-7E94-4144-85C8-B8082C009A4C@gmail.com>
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
prev parent reply other threads:[~2009-11-08 12:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-07 20:13 Recording interrupted instruction on ioapic_set_irq Kurt Kiefer
2009-11-08 12:50 ` Avi Kivity [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AF6BE99.5050107@redhat.com \
--to=avi@redhat.com \
--cc=kekiefer@gmail.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.