[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] A Question about Interrupt Handling


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: Jiaqing Du <jiaqing@xxxxxxxxx>
  • Date: Tue, 12 Jan 2010 18:51:49 +0100
  • Delivery-date: Wed, 13 Jan 2010 08:59:50 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=UErCdVFwgBgZxqYSX8krl2zy4JriWCej1OX1obNEvRnHuqrmoash8T3uMD6ynUw/ZQ 6eSGmmMa8suTt4Ou0o7QM3TbfEi2H4LiT7jFXLI3rQ7FRkcpGAqYNZEsHUzx/rfGlu1/ 9Ho69dj5V8zpH0Tnp6i8/VpmIAyobxYU42Jfk=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.