Roland Tollenaar wrote:
> Hi Jan,
> 
>>>> But note that we are still sweeping out remaining bugs around this
>>>> kernel, see "Fix __ipipe_pin_range_globally" and "IO-APIC stall due to
>>>> broken fasteoi handling" on Xenomai-core / Adeos-main. Moreover,
>>>> today's
> 
>> Just checked again: The problem is still limited to kernels with
>> CONFIG_HIGH_RES_TIMERS or CONFIG_NO_HZ. So you can already do your tests
>> with those features disabled and the two mentioned patches applied.
> I presume the "Fix __ipipe_pin_range_globally" and "IO-APIC stall due to
>>>> broken fasteoi handling" are the patches you are refering to. I also
> assume these have been posted on xenomai-core and/or adeos-main mailing
> list. If that is correct I am having some trouble locating them in the
> ML archives with the labels above. Any other manner I can get hold of
> those patches?

This way e.g.:

http://search.gmane.org/?query=Fix+__ipipe_pin_range_globally&group=gmane.linux.real-time.xenomai.devel

Alternatively, I attached both for you, adding a third one which is
relevant if you use Xenomai with --enable-x86-sep.

Jan
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 2ae79e9..517937b 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -2022,6 +2022,8 @@ static void ack_ioapic_quirk_irq(unsigned int irq)
 		__unmask_and_level_IO_APIC_irq(irq);
 		spin_unlock(&ioapic_lock);
 	}
+
+	__mask_IO_APIC_irq(irq);
 }
 
 static int ioapic_retrigger_irq(unsigned int irq)
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index ba497a7..1560b4a 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -422,8 +422,13 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
 
 	spin_lock(&desc->lock);
 	desc->status &= ~IRQ_INPROGRESS;
+#ifdef CONFIG_IPIPE
+	desc->chip->unmask(irq);
+out:
+#else
 out:
 	desc->chip->eoi(irq);
+#endif
 
 	spin_unlock(&desc->lock);
 }
@@ -533,11 +538,12 @@ void fastcall __ipipe_end_level_irq(unsigned irq, struct irq_desc *desc)
 
 void fastcall __ipipe_ack_fasteoi_irq(unsigned irq, struct irq_desc *desc)
 {
+	desc->chip->eoi(irq);
 }
 
 void fastcall __ipipe_end_fasteoi_irq(unsigned irq, struct irq_desc *desc)
 {
-	desc->chip->eoi(irq);
+	desc->chip->unmask(irq);
 }
 
 void fastcall __ipipe_ack_edge_irq(unsigned irq, struct irq_desc *desc)
---
 arch/i386/mm/fault.c  |   16 +++++++++++-----
 include/linux/ipipe.h |    7 ++-----
 mm/memory.c           |   14 --------------
 3 files changed, 13 insertions(+), 24 deletions(-)

Index: linux-2.6.22.7/arch/i386/mm/fault.c
===================================================================
--- linux-2.6.22.7.orig/arch/i386/mm/fault.c
+++ linux-2.6.22.7/arch/i386/mm/fault.c
@@ -650,16 +650,22 @@ void vmalloc_sync_all(void)
 }
 
 #ifdef CONFIG_IPIPE
-int __ipipe_pin_range_mapping(struct mm_struct *mm,
-			      unsigned long start, unsigned long end)
+void __ipipe_pin_range_globally(unsigned long start, unsigned long end)
 {
 	unsigned long next, addr = start;
+	unsigned long flags;
+	struct page *page;
 
 	do {
 		next = pgd_addr_end(addr, end);
-		vmalloc_sync_one(mm->pgd, addr);
-	} while (addr = next, addr != end);
 
-	return 0;
+		spin_lock_irqsave(&pgd_lock, flags);
+		for (page = pgd_list; page; page = (struct page *)page->index)
+			if (!vmalloc_sync_one(page_address(page), addr)) {
+				BUG_ON(page != pgd_list);
+				break;
+			}
+		spin_unlock_irqrestore(&pgd_lock, flags);
+	} while (addr = next, addr != end);
 }
 #endif /* CONFIG_IPIPE */
Index: linux-2.6.22.7/include/linux/ipipe.h
===================================================================
--- linux-2.6.22.7.orig/include/linux/ipipe.h
+++ linux-2.6.22.7/include/linux/ipipe.h
@@ -223,11 +223,6 @@ static inline void ipipe_irq_unlock(unsi
 	__ipipe_unlock_irq(ipipe_current_domain, irq);
 }
 
-struct mm_struct;
-
-int __ipipe_pin_range_mapping(struct mm_struct *mm,
-			      unsigned long start, unsigned long end);
-
 #ifndef __ipipe_sync_pipeline
 #define __ipipe_sync_pipeline(syncmask) __ipipe_sync_stage(syncmask)
 #endif
@@ -298,6 +293,8 @@ static inline void ipipe_init_notify(str
 		__ipipe_dispatch_event(IPIPE_EVENT_INIT,p);
 }
 
+struct mm_struct;
+
 static inline void ipipe_cleanup_notify(struct mm_struct *mm)
 {
 	if (__ipipe_event_monitored_p(IPIPE_EVENT_CLEANUP))
Index: linux-2.6.22.7/mm/memory.c
===================================================================
--- linux-2.6.22.7.orig/mm/memory.c
+++ linux-2.6.22.7/mm/memory.c
@@ -2959,18 +2959,4 @@ int ipipe_disable_ondemand_mappings(stru
 }
 
 EXPORT_SYMBOL(ipipe_disable_ondemand_mappings);
-
-void __ipipe_pin_range_globally(unsigned long start, unsigned long end)
-{
-	struct task_struct *p;
-
-	read_lock(&tasklist_lock);
-
-	for_each_process(p)
-		if (p->mm)
-			__ipipe_pin_range_mapping(p->mm, start, end);
-
-	read_unlock(&tasklist_lock);
-}
-
 #endif
---
 arch/i386/kernel/vm86.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: linux-2.6.20.20/arch/i386/kernel/vm86.c
===================================================================
--- linux-2.6.20.20.orig/arch/i386/kernel/vm86.c
+++ linux-2.6.20.20/arch/i386/kernel/vm86.c
@@ -148,12 +148,14 @@ struct pt_regs * fastcall save_v86_state
 		do_exit(SIGSEGV);
 	}
 
+	local_irq_disable_hw_cond();
 	tss = &per_cpu(init_tss, get_cpu());
 	current->thread.esp0 = current->thread.saved_esp0;
 	current->thread.sysenter_cs = __KERNEL_CS;
 	load_esp0(tss, &current->thread);
 	current->thread.saved_esp0 = 0;
 	put_cpu();
+	local_irq_enable_hw_cond();
 
 	ret = KVM86->regs32;
 
@@ -324,12 +326,14 @@ static void do_sys_vm86(struct kernel_vm
 	savesegment(fs, tsk->thread.saved_fs);
 	tsk->thread.saved_gs = info->regs32->xgs;
 
+	local_irq_disable_hw_cond();
 	tss = &per_cpu(init_tss, get_cpu());
 	tsk->thread.esp0 = (unsigned long) &info->VM86_TSS_ESP0;
 	if (cpu_has_sep)
 		tsk->thread.sysenter_cs = 0;
 	load_esp0(tss, &tsk->thread);
 	put_cpu();
+	local_irq_enable_hw_cond();
 
 	tsk->thread.screen_bitmap = info->screen_bitmap;
 	if (info->flags & VM86_SCREEN_BITMAP)

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to