- 论坛徽章:
- 0
|
guest的中断是通过事件通道模拟的, xen的arch/x86/x86-32/entry.S有如下代码
test_all_events:
xorl %ecx,%ecx
notl %ecx
cli # tests must not race interrupts
/*test_softirqs:*/
movl VCPU_processor(%ebx),%eax
shl $IRQSTAT_shift,%eax
test %ecx,irq_stat(%eax,1)
jnz process_softirqs
testb $1,VCPU_nmi_pending(%ebx)
jnz process_nmi
test_guest_events:
movl VCPU_vcpu_info(%ebx),%eax
testb $0xFF,VCPUINFO_upcall_mask(%eax)
jnz restore_all_guest
testb $0xFF,VCPUINFO_upcall_pending(%eax)
jz restore_all_guest
/*process_guest_events:*/
sti
leal VCPU_trap_bounce(%ebx),%edx
movl VCPU_event_addr(%ebx),%eax
movl %eax,TRAPBOUNCE_eip(%edx)
movl VCPU_event_sel(%ebx),%eax
movw %ax,TRAPBOUNCE_cs(%edx)
movb $TBF_INTERRUPT,TRAPBOUNCE_flags(%edx)
call create_bounce_frame
jmp test_all_events
我的疑惑是 call create_bounce_frame 和jmp test_all_events 似乎有矛盾?
call create_bounce_frame 如果仅仅是创建guest interrupt stack frame的话, 然后 jmp test_all_events 是为了批处理吗? 但是xen guest能处理nested frame吗?
call create_bounce_frame 如果切换到guest 执行处理guest的中断处理看不出来如何回到test_all_events? |
|