* A Question about Interrupt Handling
@ 2010-01-12 17:51 Jiaqing Du
0 siblings, 0 replies; only message in thread
From: Jiaqing Du @ 2010-01-12 17:51 UTC (permalink / raw)
To: xen-devel
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-01-12 17:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-12 17:51 A Question about Interrupt Handling Jiaqing Du
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).