Skip to contentSkip to conversation

Make VTIdomain boot again

PATCH Xu, Anthony 2 participants 2 messages Feb 9, 2006

lore
Share & tools
lore
#0 lore raw

Hi all,

Do_softirq is invoked at the path of ia64_leave_kernel instead of being invoking in function irq_exit, which is aligned with XEN/X86 and avoids __enter_schedule being reentered. VTIdomain can boot again after applying this patch.

BTW, a small bug is fixed.
- (p6) br.call.sptk.many b0=deliver_pending_interrupt
+(pUStk) br.call.sptk.many b0=deliver_pending_interrupt
Since P6 is scratch register, after returning from deliver_pending_interrupt, p6 may be changed. But p6 is also used by subsequent code and should not be changed.

Signed-off-by Anthony Xu <[email protected]>

Thanks,
-Anthony

Quoted 44 lines

-----Original Message-----
From: Alex Williamson [mailto:[email protected]]
Sent: 2006年2月9日 11:32
To: Xu, Anthony
Cc: [email protected]; [email protected]
Subject: Re: [Xen-ia64-devel] [Xen-devel] [PATCH]Make VTIdomain boot again

Quoted 6 lines · Anthony

Keir,

This patch is intended to make VTIdomain boot again, and will not impact domU. Actually VTIdomain and domU can boot simultaneously after applying this patch, Could you please check this patch into xen-unstable.hg? This is a must in 3.0.1.

Hi Anthony,

Xen 3.0.1 went out on Feb. 1st. A couple comments

xen/arch/ia64/linux-xen/irq_ia64.c Wed Feb 8 16:28:11 2006 renamed from xen/arch/ia64/linux-xen/irq_ia64.c Thu Jan 26 10:31:28 2006 +0 -0
@@ -169,7 +169,7 @@
        * handler needs to be able to wait for further keyboard

interrupts, which can't
* come through until ia64_eoi() has been done. */

xen/arch/ia64/linux-xen/irq_ia64.c Wed Feb 8 16:28:11 2006 renamed from xen/arch/ia64/linux-xen/irq_ia64.c Thu Jan 26 10:31:28 2006 +1 -1
-       irq_exit();
+       xen_irq_exit(regs);

}

Quoted 1 line
Quoted 1 line
Quoted 1 line

This needs to be in an #ifdef XEN.

xen/arch/ia64/linux-xen/irq_ia64.c Wed Feb 8 16:28:11 2006 renamed from xen/arch/ia64/linux-xen/irq_ia64.c Thu Jan 26 10:31:28 2006 +1 -1
-void irq_exit(void)
+void xen_irq_exit(struct pt_regs *regs)
{
       //account_system_vtime(current);
       sub_preempt_count(IRQ_EXIT_OFFSET);
xen/arch/ia64/linux-xen/irq_ia64.c Wed Feb 8 16:28:11 2006 renamed from xen/arch/ia64/linux-xen/irq_ia64.c Thu Jan 26 10:31:28 2006 +1 -1
-       if (!in_interrupt() && local_softirq_pending()) {
+    if((((char *)regs) -(char *) current) !=

(IA64_STK_OFFSET-IA64_PT_REGS_SIZE))

xen/arch/ia64/linux-xen/irq_ia64.c Wed Feb 8 16:28:11 2006 renamed from xen/arch/ia64/linux-xen/irq_ia64.c Thu Jan 26 10:31:28 2006 +3 -0
+        return;
+
+       if (!in_interrupt()&&local_softirq_pending()) {
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

Formatting here is inconsistent with the rest of the file and

itself. Could we be setting some flag and adding the test to the existing in_interrupt/local_softirq_pending check? This looks rather precarious. Thanks,

Alex

# HG changeset patch
# User [email protected]
# Node ID 89cb1daa3f31e2984e3f734a701108bdba13fa8b
# Parent 2710f2fe624a5103d198e6685e250c6678f34ec1
soft_IRQ is done at the path of ia64_leave_kernel instead of being invoking in function irq_exit, which is aligned with XEN/X86 and make VTIdomain boot again.

Signed-off-by Anthony Xu <[email protected]>

xen/arch/ia64/linux-xen/entry.S +5 -1
diff -r 2710f2fe624a -r 89cb1daa3f31 xen/arch/ia64/linux-xen/entry.S
@@ -895,6 +895,10 @@
 #endif
 .work_processed_kernel:
 #ifdef XEN
+(pUStk) ssm psr.i
+(pUStk)    br.call.sptk.many b0=process_soft_irq
+(pUStk) rsm psr.i
+    ;;
 	alloc loc0=ar.pfs,0,1,1,0
 	adds out0=16,r12
     adds r7 = PT(EML_UNAT)+16,r12
@@ -907,7 +911,7 @@
 (p8) br.sptk.few leave_kernel_self
 	;; 
 #endif
-(p6)	br.call.sptk.many b0=deliver_pending_interrupt
+(pUStk)	br.call.sptk.many b0=deliver_pending_interrupt
     ;;
 	mov ar.pfs=loc0
 	mov ar.unat=r7  /* load eml_unat  */
xen/arch/ia64/xen/xenirq.c +13 -1
diff -r 2710f2fe624a -r 89cb1daa3f31 xen/arch/ia64/xen/xenirq.c
@@ -64,11 +64,23 @@
 {
 	//account_system_vtime(current);
 	sub_preempt_count(IRQ_EXIT_OFFSET);
+//	if (!in_interrupt() && local_softirq_pending()) {
+//		add_preempt_count(SOFTIRQ_OFFSET);
+//		do_softirq();
+//		sub_preempt_count(SOFTIRQ_OFFSET);
+//	}
+	//preempt_enable_no_resched();
+}
+
+// ONLY gets called from ia64_leave_kernel
+// ONLY call with interrupts enable
+void process_soft_irq()
+{
 	if (!in_interrupt() && local_softirq_pending()) {
 		add_preempt_count(SOFTIRQ_OFFSET);
 		do_softirq();
 		sub_preempt_count(SOFTIRQ_OFFSET);
 	}
-	//preempt_enable_no_resched();
 }
+
 /* end from linux/kernel/softirq.c */

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 8 lines · Anthony

Do_softirq is invoked at the path of ia64_leave_kernel instead of being invoking in function irq_exit, which is aligned with XEN/X86 and avoids __enter_schedule being reentered. VTIdomain can boot again after applying this patch.

BTW, a small bug is fixed.
- (p6) br.call.sptk.many b0=deliver_pending_interrupt
+(pUStk) br.call.sptk.many b0=deliver_pending_interrupt
Since P6 is scratch register, after returning from deliver_pending_interrupt, p6 may be changed. But p6 is also used by subsequent code and should not be changed.

Signed-off-by Anthony Xu <[email protected]>

Should I check in this patch instead of your earlier one (which used xen_irq_exit instead or irq_exit?).

-- Keir