* [Adeos-main] [git pull] Updates for ipipe-2.6.35-x86
@ 2010-11-25 16:41 Jan Kiszka
2010-11-25 16:46 ` [Adeos-main] [PATCH 1/3] ipipe: x86-32: Drop IRQ flag virtualization from syscall/interrupt entry/exit Jan Kiszka
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jan Kiszka @ 2010-11-25 16:41 UTC (permalink / raw)
To: Philippe Gerum; +Cc: adeos-main
The following changes since commit 00b6a9994fe4d8c978a9a56d20d01c49fde0a2c3:
Merge branch 'ipipe-2.6.35-noarch' into ipipe-2.6.35-x86 (2010-11-05 13:59:15 +0100)
are available in the git repository at:
git://git.kiszka.org/ipipe-2.6 queues/2.6.35-x86
[edited changelog]
Jan Kiszka (8):
ipipe: Provide wrapper for IRQ mask/unmask at chip level
ipipe: Drop spurious irq_enter/exit from __ipipe_sync_stage
ipipe: Provide __ipipe_spin_trylock_irq for !CONFIG_IPIPE
Merge commit 'v2.6.35.9' into queues/2.6.35-noarch
Merge branch 'queues/2.6.35-noarch' into queues/2.6.35-x86
ipipe: x86-32: Drop IRQ flag virtualization from syscall/interrupt entry/exit
ipipe: x86: Push IF as set to stack of root IRQ handlers
ipipe: x86: Fix up root state after __do_root_[vx]irq under CONFIG_TRACE_IRQFLAGS
Will follow up with the x86-specific ipipe patches for review.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Adeos-main] [PATCH 1/3] ipipe: x86-32: Drop IRQ flag virtualization from syscall/interrupt entry/exit
2010-11-25 16:41 [Adeos-main] [git pull] Updates for ipipe-2.6.35-x86 Jan Kiszka
@ 2010-11-25 16:46 ` Jan Kiszka
2010-11-25 16:47 ` [Adeos-main] [PATCH 2/3] ipipe: x86: Push IF as set to stack of root IRQ handlers Jan Kiszka
2010-11-25 16:47 ` [Adeos-main] [PATCH 3/3] ipipe: x86: Fix up root state after __do_root_[vx]irq under CONFIG_TRACE_IRQFLAGS Jan Kiszka
2 siblings, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2010-11-25 16:46 UTC (permalink / raw)
To: Philippe Gerum; +Cc: adeos-main
The virtualization of the IRQ flag in entry_32.S turned out to be buggy
[1]. Instead of trying to fix it again, this patch removes the
virtualization, conceptually aligning x86-32 with x86-64. This
simplifies quite some code and should help keeping both in sync /wrt
this critical code paths.
[1] http://thread.gmane.org/gmane.linux.kernel.adeos.general/1706
Signed-off-by: Jan Kiszka <jan.kiszka@domain.hid>
---
Patch is moderately tested (both w/ and w/o IPIPE) and behaved properly
so far. Still, careful review would be welcome.
arch/x86/include/asm/irqflags.h | 42 ++++++++++--------
arch/x86/kernel/entry_32.S | 52 +++++++++--------------
arch/x86/kernel/ipipe.c | 88 +-------------------------------------
3 files changed, 47 insertions(+), 135 deletions(-)
diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
index 59c8be8..5c18214 100644
--- a/arch/x86/include/asm/irqflags.h
+++ b/arch/x86/include/asm/irqflags.h
@@ -213,26 +213,15 @@ static inline unsigned long __raw_local_irq_save(void)
}
#else
+#define ENABLE_INTERRUPTS(x) sti
+#define DISABLE_INTERRUPTS(x) cli
+
#ifdef CONFIG_IPIPE
-#ifdef CONFIG_X86_32
-#define DISABLE_INTERRUPTS(clobbers) PER_CPU(ipipe_percpu_darray, %eax); btsl $0,(%eax); sti
-#define ENABLE_INTERRUPTS(clobbers) call __ipipe_unstall_root
-#else /* CONFIG_X86_64 */
-/* Not worth virtualizing in x86_64 mode. */
-#define DISABLE_INTERRUPTS(clobbers) cli
-#define ENABLE_INTERRUPTS(clobbers) sti
-#endif /* CONFIG_X86_64 */
#define ENABLE_INTERRUPTS_HW_COND sti
#define DISABLE_INTERRUPTS_HW_COND cli
-#define DISABLE_INTERRUPTS_HW(clobbers) cli
-#define ENABLE_INTERRUPTS_HW(clobbers) sti
#else /* !CONFIG_IPIPE */
-#define ENABLE_INTERRUPTS(x) sti
-#define DISABLE_INTERRUPTS(x) cli
#define ENABLE_INTERRUPTS_HW_COND
#define DISABLE_INTERRUPTS_HW_COND
-#define DISABLE_INTERRUPTS_HW(clobbers) DISABLE_INTERRUPTS(clobbers)
-#define ENABLE_INTERRUPTS_HW(clobbers) ENABLE_INTERRUPTS(clobbers)
#endif /* !CONFIG_IPIPE */
#ifdef CONFIG_X86_64
@@ -323,23 +312,38 @@ static inline int raw_irqs_disabled(void)
#endif
#ifdef CONFIG_TRACE_IRQFLAGS
-# if defined(CONFIG_IPIPE) && defined(CONFIG_X86_64)
-# define TRACE_IRQS_ON \
+# ifdef CONFIG_IPIPE
+# ifdef CONFIG_X86_64
+# define TRACE_IRQS_ON \
call trace_hardirqs_on_thunk; \
pushq %rax; \
PER_CPU(ipipe_percpu_darray, %rax); \
btrl $0,(%rax); \
popq %rax
-# define TRACE_IRQS_OFF \
+# define TRACE_IRQS_OFF \
pushq %rax; \
PER_CPU(ipipe_percpu_darray, %rax); \
btsl $0,(%rax); \
popq %rax; \
call trace_hardirqs_off_thunk
-# else /* !(CONFIG_IPIPE && CONFIG_X86_64) */
+# else /* CONFIG_X86_32 */
+# define TRACE_IRQS_ON \
+ call trace_hardirqs_on_thunk; \
+ pushl %eax; \
+ PER_CPU(ipipe_percpu_darray, %eax); \
+ btrl $0,(%eax); \
+ popl %eax
+# define TRACE_IRQS_OFF \
+ pushl %eax; \
+ PER_CPU(ipipe_percpu_darray, %eax); \
+ btsl $0,(%eax); \
+ popl %eax; \
+ call trace_hardirqs_off_thunk
+# endif /* CONFIG_X86_32 */
+# else /* !CONFIG_IPIPE */
# define TRACE_IRQS_ON call trace_hardirqs_on_thunk;
# define TRACE_IRQS_OFF call trace_hardirqs_off_thunk;
-# endif /* !(CONFIG_IPIPE && CONFIG_X86_64) */
+# endif /* !CONFIG_IPIPE */
#else
# define TRACE_IRQS_ON
# define TRACE_IRQS_OFF
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index 4fc229b..cc382bc 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -82,25 +82,20 @@
#define nr_syscalls ((syscall_table_size)/4)
#ifdef CONFIG_IPIPE
-#define EMULATE_ROOT_IRET(bypass) \
- call __ipipe_unstall_iret_root ; \
- TRACE_IRQS_ON ; \
- bypass: \
- movl PT_EAX(%esp),%eax
-#define TEST_PREEMPTIBLE(regs) call __ipipe_kpreempt_root ; testl %eax,%eax
-#define CATCH_ROOT_SYSCALL(bypass1,bypass2) \
+#define CATCH_ROOT_SYSCALL(bypass_check,bypass_nocheck) \
movl %esp,%eax ; \
call __ipipe_syscall_root ; \
testl %eax,%eax ; \
- js bypass1 ; \
- jne bypass2 ; \
+ movl PT_EAX(%esp),%eax ; \
+ js bypass_check ; \
+ jne bypass_nocheck ; \
movl PT_ORIG_EAX(%esp),%eax
#define PUSH_XCODE(v) pushl $ ex_ ## v
#define PUSH_XVEC(v) pushl $ ex_ ## v
#define HANDLE_EXCEPTION(code) movl %code,%ecx ; \
call __ipipe_handle_exception ; \
testl %eax,%eax ; \
- jnz restore_ret
+ jnz restore_nocheck
#define DIVERT_EXCEPTION(code) movl $(__USER_DS), %ecx ; \
movl %ecx, %ds ; \
movl %ecx, %es ; \
@@ -108,7 +103,8 @@
movl $ex_ ## code,%edx ; \
call __ipipe_divert_exception ; \
testl %eax,%eax ; \
- jnz restore_ret
+ jnz restore_nocheck
+#define PREEMPT_SCHEDULE_IRQ call __ipipe_preempt_schedule_irq
#ifdef CONFIG_IPIPE_TRACE_IRQSOFF
# define IPIPE_TRACE_IRQ_ENTER \
@@ -125,17 +121,16 @@
#define IPIPE_TRACE_IRQ_EXIT
#endif /* CONFIG_IPIPE_TRACE_IRQSOFF */
#else /* !CONFIG_IPIPE */
-#define EMULATE_ROOT_IRET(bypass)
-#define TEST_PREEMPTIBLE(regs) testl $X86_EFLAGS_IF,PT_EFLAGS(regs)
-#define CATCH_ROOT_SYSCALL(bypass1,bypass2)
+#define CATCH_ROOT_SYSCALL(bypass_check,bypass_nocheck)
#define PUSH_XCODE(v) pushl $v
#define PUSH_XVEC(v) pushl v
#define HANDLE_EXCEPTION(code) call *%code
#define DIVERT_EXCEPTION(code)
+#define PREEMPT_SCHEDULE_IRQ call preempt_schedule_irq
#endif /* CONFIG_IPIPE */
#ifdef CONFIG_PREEMPT
-#define preempt_stop(clobbers) DISABLE_INTERRUPTS_HW(clobbers); TRACE_IRQS_OFF
+#define preempt_stop(clobbers) DISABLE_INTERRUPTS(clobbers); TRACE_IRQS_OFF
#else
#define preempt_stop(clobbers)
#define resume_kernel restore_all
@@ -429,15 +424,16 @@ END(ret_from_exception)
#ifdef CONFIG_PREEMPT
ENTRY(resume_kernel)
+ DISABLE_INTERRUPTS(CLBR_ANY)
cmpl $0,TI_preempt_count(%ebp) # non-zero preempt_count ?
jnz restore_all
need_resched:
movl TI_flags(%ebp), %ecx # need_resched set ?
testb $_TIF_NEED_RESCHED, %cl
jz restore_all
- TEST_PREEMPTIBLE(%esp) # interrupts off (exception path) ?
+ testl $X86_EFLAGS_IF,PT_EFLAGS(%esp) # interrupts off (exception path) ?
jz restore_all
- call preempt_schedule_irq
+ PREEMPT_SCHEDULE_IRQ
jmp need_resched
END(resume_kernel)
#endif
@@ -487,7 +483,7 @@ sysenter_past_esp:
pushl %eax
CFI_ADJUST_CFA_OFFSET 4
SAVE_ALL
- ENABLE_INTERRUPTS_HW(CLBR_NONE)
+ ENABLE_INTERRUPTS(CLBR_NONE)
/*
* Load the potential sixth argument from user stack.
@@ -503,7 +499,7 @@ sysenter_past_esp:
.previous
GET_THREAD_INFO(%ebp)
- CATCH_ROOT_SYSCALL(sysenter_tail,sysenter_out)
+ CATCH_ROOT_SYSCALL(sysenter_tail,sysenter_exit)
testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%ebp)
jnz sysenter_audit
@@ -521,13 +517,10 @@ sysenter_tail:
jne sysexit_audit
sysenter_exit:
/* if something modifies registers it must also disable sysexit */
- EMULATE_ROOT_IRET(sysenter_out)
movl PT_EIP(%esp), %edx
movl PT_OLDESP(%esp), %ecx
xorl %ebp,%ebp
-#ifndef CONFIG_IPIPE
- TRACE_IRQS_ON
-#endif
+ TRACE_IRQS_ON
1: mov PT_FS(%esp), %fs
PTGS_TO_GS
ENABLE_INTERRUPTS_SYSEXIT
@@ -592,7 +585,7 @@ ENTRY(system_call)
CFI_ADJUST_CFA_OFFSET 4
SAVE_ALL
GET_THREAD_INFO(%ebp)
- CATCH_ROOT_SYSCALL(syscall_exit,restore_ret)
+ CATCH_ROOT_SYSCALL(syscall_exit,restore_nocheck)
# system call tracing in operation / emulation
testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%ebp)
jnz syscall_trace_entry
@@ -625,10 +618,6 @@ restore_all_notrace:
CFI_REMEMBER_STATE
je ldt_ss # returning to user-space with LDT SS
restore_nocheck:
-#ifdef CONFIG_IPIPE
- call __ipipe_unstall_iret_root
-#endif /* CONFIG_IPIPE */
-restore_ret:
RESTORE_REGS 4 # skip orig_eax/error_code
CFI_ADJUST_CFA_OFFSET -4
irq_return:
@@ -690,7 +679,7 @@ ldt_ss:
/* Disable interrupts, but do not irqtrace this section: we
* will soon execute iret and the tracer was already set to
* the irqstate after the iret */
- DISABLE_INTERRUPTS_HW(CLBR_EAX)
+ DISABLE_INTERRUPTS(CLBR_EAX)
lss (%esp), %esp /* switch to espfix segment */
CFI_ADJUST_CFA_OFFSET -8
jmp restore_nocheck
@@ -720,6 +709,7 @@ work_resched:
work_notifysig: # deal with pending signals and
# notify-resume requests
+ ENABLE_INTERRUPTS_HW_COND
#ifdef CONFIG_VM86
testl $X86_EFLAGS_VM, PT_EFLAGS(%esp)
movl %esp, %eax
@@ -931,7 +921,7 @@ common_interrupt:
IPIPE_TRACE_IRQ_EXIT
testl %eax,%eax
jnz ret_from_intr
- jmp restore_ret
+ jmp restore_nocheck
CFI_ENDPROC
.pushsection .kprobes.text, "ax"
@@ -947,7 +937,7 @@ ENTRY(name) \
IPIPE_TRACE_IRQ_EXIT; \
testl %eax,%eax; \
jnz ret_from_intr; \
- jmp restore_ret; \
+ jmp restore_nocheck; \
CFI_ENDPROC
#define BUILD_INTERRUPT(name, nr) BUILD_INTERRUPT3(name, nr, smp_##name)
diff --git a/arch/x86/kernel/ipipe.c b/arch/x86/kernel/ipipe.c
index 6720ba8..c943fca 100644
--- a/arch/x86/kernel/ipipe.c
+++ b/arch/x86/kernel/ipipe.c
@@ -393,72 +393,7 @@ static inline void __fixup_if(int s, struct pt_regs *regs)
regs->flags |= X86_EFLAGS_IF;
}
-#ifdef CONFIG_X86_32
-
-/*
- * Check the stall bit of the root domain to make sure the existing
- * preemption opportunity upon in-kernel resumption could be
- * exploited. In case a rescheduling could take place, the root stage
- * is stalled before the hw interrupts are re-enabled. This routine
- * must be called with hw interrupts off.
- */
-
-asmlinkage int __ipipe_kpreempt_root(struct pt_regs regs)
-{
- if (test_bit(IPIPE_STALL_FLAG, &ipipe_root_cpudom_var(status)))
- /* Root stage is stalled: rescheduling denied. */
- return 0;
-
- __ipipe_stall_root();
- trace_hardirqs_off();
- local_irq_enable_hw_notrace();
-
- return 1; /* Ok, may reschedule now. */
-}
-
-asmlinkage void __ipipe_unstall_iret_root(struct pt_regs regs)
-{
- struct ipipe_percpu_domain_data *p;
-
- /* Emulate IRET's handling of the interrupt flag. */
-
- local_irq_disable_hw();
-
- p = ipipe_root_cpudom_ptr();
-
- /*
- * Restore the software state as it used to be on kernel
- * entry. CAUTION: NMIs must *not* return through this
- * emulation.
- */
- if (raw_irqs_disabled_flags(regs.flags)) {
- if (!__test_and_set_bit(IPIPE_STALL_FLAG, &p->status))
- trace_hardirqs_off();
- if (!__ipipe_pipeline_head_p(ipipe_root_domain))
- regs.flags |= X86_EFLAGS_IF;
- } else {
- if (test_bit(IPIPE_STALL_FLAG, &p->status)) {
- trace_hardirqs_on();
- __clear_bit(IPIPE_STALL_FLAG, &p->status);
- }
- /*
- * We could have received and logged interrupts while
- * stalled in the syscall path: play the log now to
- * release any pending event. The SYNC_BIT prevents
- * infinite recursion in case of flooding.
- */
- if (unlikely(__ipipe_ipending_p(p)))
- __ipipe_sync_pipeline();
- }
-#ifdef CONFIG_IPIPE_TRACE_IRQSOFF
- ipipe_trace_end(0x8000000D);
-#endif /* CONFIG_IPIPE_TRACE_IRQSOFF */
-}
-
-#else /* !CONFIG_X86_32 */
-
#ifdef CONFIG_PREEMPT
-
asmlinkage void preempt_schedule_irq(void);
void __ipipe_preempt_schedule_irq(void)
@@ -492,11 +427,8 @@ void __ipipe_preempt_schedule_irq(void)
__local_irq_restore_nosync(flags);
}
-
#endif /* CONFIG_PREEMPT */
-#endif /* !CONFIG_X86_32 */
-
void __ipipe_halt_root(void)
{
struct ipipe_percpu_domain_data *p;
@@ -739,7 +671,6 @@ int __ipipe_divert_exception(struct pt_regs *regs, int vector)
int __ipipe_syscall_root(struct pt_regs *regs)
{
- struct ipipe_percpu_domain_data *p;
unsigned long flags;
int ret;
@@ -765,30 +696,17 @@ int __ipipe_syscall_root(struct pt_regs *regs)
__ipipe_dispatch_event(IPIPE_EVENT_RETURN, regs);
}
- if (!ipipe_root_domain_p) {
-#ifdef CONFIG_X86_32
- local_irq_restore_hw(flags);
-#endif
+ if (!ipipe_root_domain_p)
return 1;
- }
- p = ipipe_root_cpudom_ptr();
-#ifdef CONFIG_X86_32
- /*
- * Fix-up only required on 32-bit as only here the IRET return code
- * will evaluate the flags.
- */
- __fixup_if(test_bit(IPIPE_STALL_FLAG, &p->status), regs);
-#endif
/*
* If allowed, sync pending VIRQs before _TIF_NEED_RESCHED is
* tested.
*/
- if (__ipipe_ipending_p(p))
+ if (__ipipe_ipending_p(ipipe_root_cpudom_ptr()))
__ipipe_sync_pipeline();
-#ifdef CONFIG_X86_64
+
if (!ret)
-#endif
local_irq_restore_hw(flags);
return -ret;
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Adeos-main] [PATCH 2/3] ipipe: x86: Push IF as set to stack of root IRQ handlers
2010-11-25 16:41 [Adeos-main] [git pull] Updates for ipipe-2.6.35-x86 Jan Kiszka
2010-11-25 16:46 ` [Adeos-main] [PATCH 1/3] ipipe: x86-32: Drop IRQ flag virtualization from syscall/interrupt entry/exit Jan Kiszka
@ 2010-11-25 16:47 ` Jan Kiszka
2010-11-25 16:47 ` [Adeos-main] [PATCH 3/3] ipipe: x86: Fix up root state after __do_root_[vx]irq under CONFIG_TRACE_IRQFLAGS Jan Kiszka
2 siblings, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2010-11-25 16:47 UTC (permalink / raw)
To: Philippe Gerum; +Cc: adeos-main
Preemption check of the Linux interrupt tail verifies, among other
things, that IF set for the preempted context. If it's not, no Linux
task switch is initiated. As we fake the context on root IRQ replay, we
must ensure that IF is faked properly as well, otherwise long Linux
rescheduling latencies up to deadlocks can occur.
Based on suggestion by Philippe.
Signed-off-by: Jan Kiszka <jan.kiszka@domain.hid>
---
arch/x86/include/asm/ipipe_32.h | 8 ++++++--
arch/x86/include/asm/ipipe_64.h | 8 ++++++--
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/ipipe_32.h b/arch/x86/include/asm/ipipe_32.h
index 4263a7f..61d7913 100644
--- a/arch/x86/include/asm/ipipe_32.h
+++ b/arch/x86/include/asm/ipipe_32.h
@@ -70,6 +70,7 @@ static inline void __do_root_xirq(ipipe_irq_handler_t handler,
regs->orig_ax = ~__ipipe_get_irq_vector(irq);
__asm__ __volatile__("pushfl\n\t"
+ "orl %[x86if],(%%esp)\n\t"
"pushl %%cs\n\t"
"pushl $__xirq_end\n\t"
"pushl %%eax\n\t"
@@ -89,7 +90,8 @@ static inline void __do_root_xirq(ipipe_irq_handler_t handler,
"jmp ret_from_intr\n\t"
"__xirq_end: cli\n"
: /* no output */
- : "a" (~irq), "r" (handler), "rm" (regs));
+ : "a" (~irq), "r" (handler), "rm" (regs),
+ [x86if] "i" (X86_EFLAGS_IF));
}
#define __ipipe_do_root_xirq(ipd, irq) \
@@ -103,6 +105,7 @@ static inline void __do_root_virq(ipipe_irq_handler_t handler,
irq_enter();
__asm__ __volatile__("pushfl\n\t"
+ "orl %[x86if],(%%esp)\n\t"
"pushl %%cs\n\t"
"pushl $__virq_end\n\t"
"pushl $-1\n\t"
@@ -122,7 +125,8 @@ static inline void __do_root_virq(ipipe_irq_handler_t handler,
"call *%1\n\t"
"addl $8,%%esp\n"
: /* no output */
- : "a" (irq), "r" (handler), "d" (cookie));
+ : "a" (irq), "r" (handler), "d" (cookie),
+ [x86if] "i" (X86_EFLAGS_IF));
irq_exit();
__asm__ __volatile__("jmp ret_from_intr\n\t"
"__virq_end: cli\n"
diff --git a/arch/x86/include/asm/ipipe_64.h b/arch/x86/include/asm/ipipe_64.h
index b9367f6..c8f2c54 100644
--- a/arch/x86/include/asm/ipipe_64.h
+++ b/arch/x86/include/asm/ipipe_64.h
@@ -71,6 +71,7 @@ static inline void __do_root_xirq(ipipe_irq_handler_t handler,
"pushq $0\n\t"
"pushq %%rax\n\t"
"pushfq\n\t"
+ "orq %[x86if],(%%rsp)\n\t"
"pushq %[kernel_cs]\n\t"
"pushq $__xirq_end\n\t"
"pushq %[vector]\n\t"
@@ -91,7 +92,8 @@ static inline void __do_root_xirq(ipipe_irq_handler_t handler,
: /* no output */
: [kernel_cs] "i" (__KERNEL_CS),
[vector] "rm" (regs->orig_ax),
- [handler] "r" (handler), "D" (regs)
+ [handler] "r" (handler), "D" (regs),
+ [x86if] "i" (X86_EFLAGS_IF)
: "rax");
}
@@ -109,6 +111,7 @@ static inline void __do_root_virq(ipipe_irq_handler_t handler,
"pushq $0\n\t"
"pushq %%rax\n\t"
"pushfq\n\t"
+ "orq %[x86if],(%%rsp)\n\t"
"pushq %[kernel_cs]\n\t"
"pushq $__virq_end\n\t"
"pushq $-1\n\t"
@@ -125,7 +128,8 @@ static inline void __do_root_virq(ipipe_irq_handler_t handler,
"call *%[handler]\n\t"
: /* no output */
: [kernel_cs] "i" (__KERNEL_CS),
- [handler] "r" (handler), "D" (irq), "S" (cookie)
+ [handler] "r" (handler), "D" (irq),
+ "S" (cookie), [x86if] "i" (X86_EFLAGS_IF)
: "rax");
irq_exit();
__asm__ __volatile__("cli\n\t"
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Adeos-main] [PATCH 3/3] ipipe: x86: Fix up root state after __do_root_[vx]irq under CONFIG_TRACE_IRQFLAGS
2010-11-25 16:41 [Adeos-main] [git pull] Updates for ipipe-2.6.35-x86 Jan Kiszka
2010-11-25 16:46 ` [Adeos-main] [PATCH 1/3] ipipe: x86-32: Drop IRQ flag virtualization from syscall/interrupt entry/exit Jan Kiszka
2010-11-25 16:47 ` [Adeos-main] [PATCH 2/3] ipipe: x86: Push IF as set to stack of root IRQ handlers Jan Kiszka
@ 2010-11-25 16:47 ` Jan Kiszka
2 siblings, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2010-11-25 16:47 UTC (permalink / raw)
To: Philippe Gerum; +Cc: adeos-main
As TRACE_IRQS_ON, thus also TRACE_IRQS_IRET, synchronizes the root
pipeline state with the pseudo state that __do_root_[vx]irq creates on
entry. We need to fix that up, disabling root IRQs again as
__ipipe_sync_stage may inject more IRQs.
Signed-off-by: Jan Kiszka <jan.kiszka@domain.hid>
---
arch/x86/include/asm/ipipe_32.h | 9 +++++++++
arch/x86/include/asm/ipipe_64.h | 9 +++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/ipipe_32.h b/arch/x86/include/asm/ipipe_32.h
index 61d7913..38d7870 100644
--- a/arch/x86/include/asm/ipipe_32.h
+++ b/arch/x86/include/asm/ipipe_32.h
@@ -92,6 +92,11 @@ static inline void __do_root_xirq(ipipe_irq_handler_t handler,
: /* no output */
: "a" (~irq), "r" (handler), "rm" (regs),
[x86if] "i" (X86_EFLAGS_IF));
+#ifdef CONFIG_TRACE_IRQFLAGS
+ /* TRACE_IRQS_IRET fully enables root IRQs - disable them again in
+ * case __ipipe_sync_stage injects another one. */
+ local_irq_disable();
+#endif
}
#define __ipipe_do_root_xirq(ipd, irq) \
@@ -132,6 +137,10 @@ static inline void __do_root_virq(ipipe_irq_handler_t handler,
"__virq_end: cli\n"
: /* no output */
: /* no input */);
+#ifdef CONFIG_TRACE_IRQFLAGS
+ /* see __do_root_xirq */
+ local_irq_disable();
+#endif
}
#define __ipipe_do_root_virq(ipd, irq) \
diff --git a/arch/x86/include/asm/ipipe_64.h b/arch/x86/include/asm/ipipe_64.h
index c8f2c54..91d7397 100644
--- a/arch/x86/include/asm/ipipe_64.h
+++ b/arch/x86/include/asm/ipipe_64.h
@@ -95,6 +95,11 @@ static inline void __do_root_xirq(ipipe_irq_handler_t handler,
[handler] "r" (handler), "D" (regs),
[x86if] "i" (X86_EFLAGS_IF)
: "rax");
+#ifdef CONFIG_TRACE_IRQFLAGS
+ /* TRACE_IRQS_IRETQ fully enables root IRQs - disable them again in
+ * case __ipipe_sync_stage injects another one. */
+ local_irq_disable();
+#endif
}
#define __ipipe_do_root_xirq(ipd, irq) \
@@ -137,6 +142,10 @@ static inline void __do_root_virq(ipipe_irq_handler_t handler,
"__virq_end: cli\n"
: /* no output */
: /* no input */);
+#ifdef CONFIG_TRACE_IRQFLAGS
+ /* see __do_root_xirq */
+ local_irq_disable();
+#endif
}
#define __ipipe_do_root_virq(ipd, irq) \
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-11-25 16:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-25 16:41 [Adeos-main] [git pull] Updates for ipipe-2.6.35-x86 Jan Kiszka
2010-11-25 16:46 ` [Adeos-main] [PATCH 1/3] ipipe: x86-32: Drop IRQ flag virtualization from syscall/interrupt entry/exit Jan Kiszka
2010-11-25 16:47 ` [Adeos-main] [PATCH 2/3] ipipe: x86: Push IF as set to stack of root IRQ handlers Jan Kiszka
2010-11-25 16:47 ` [Adeos-main] [PATCH 3/3] ipipe: x86: Fix up root state after __do_root_[vx]irq under CONFIG_TRACE_IRQFLAGS Jan Kiszka
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.