xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jiaqing Du <jiaqing@gmail.com>
To: xen-devel@lists.xensource.com
Subject: A Question about Interrupt Handling
Date: Tue, 12 Jan 2010 18:51:49 +0100	[thread overview]
Message-ID: <6d8082041001120951p2430ecf5q3832e5651ca36407@mail.gmail.com> (raw)

Hi list,

I am trying to figure out when & how a interrupt handler of the guest
is called after Xen sets evtchn_upcall_pending to non-zero. Below is
my understanding. Please let me know if something is wrong.

When Xen wants to inject an interrupt to the guest, the following
functions are called sequentially.

send_guest_vcpu_virq()-->evtchn_set_pending()-->vcpu_mark_events_pending()-->vcpu_kick()-->cpu_raise_softirq()-->smp_send_event_check_cpu()-->send_IPI_mask(mask,
EVENT_CHECK_VECTOR). Then an interrupt handler will handle this IPI
with vector EVENT_CHECK_VECTOR. I think within this interrupt handler,
Xen calls the registered virtual interrupt handler of the guest. Right
or not?

The IPI handler is defined as

BUILD_SMP_INTERRUPT(event_check_interrupt,EVENT_CHECK_VECTOR),

then the definition of this macro goes here,

#define BUILD_SMP_INTERRUPT(x,v) XBUILD_SMP_INTERRUPT(x,v)
#define XBUILD_SMP_INTERRUPT(x,v)               \
asmlinkage void x(void);                        \
__asm__(                                        \
    "\n"__ALIGN_STR"\n"                         \
    ".globl " STR(x) "\n\t"                     \
    STR(x) ":\n\t"                              \
    "pushl $"#v"<<16\n\t"                       \
    STR(FIXUP_RING0_GUEST_STACK)                \
    STR(SAVE_ALL(1f,1f)) "\n\t"                 \
    "1:movl %esp,%eax\n\t"                      \
    "pushl %eax\n\t"                            \
    "call "STR(smp_##x)"\n\t"                   \
    "addl $4,%esp\n\t"                          \
    "jmp ret_from_intr\n");

Inside this assembly code block, smp_event_check_interrupt() is
called.  Then I could not find where this function is defined..

Any comments?


Thanks,
Jiaqing

                 reply	other threads:[~2010-01-12 17:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=6d8082041001120951p2430ecf5q3832e5651ca36407@mail.gmail.com \
    --to=jiaqing@gmail.com \
    --cc=xen-devel@lists.xensource.com \
    /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 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).