Skip to contentSkip to conversation

x86: Fix root state corruptions

PATCH New Jan Kiszka 1 participant 1 message Nov 15, 2008 x86

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 x86: Fix root state corruptions

Only fair: I touched this code a few times recently while re-enabling KGDB support, but I didn't noticed this lethal bug. Now I had to hunt it for half a day.

What was wrong should be obvious. Its effect was a spuriously unstalled root domain once in a while after we handled a fault over a non-root domain. Fortunately this is a corner case - unless you use the FPU in userspace (initial usage fault...).

Patch is (still) against 2.6.26, but it is required for all recent i386/x86_64/x86 ipipe versions, from 2.6.23 to 2.6.27.

---
 arch/x86/kernel/ipipe.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/ipipe.c +2 -2
Index: b/arch/x86/kernel/ipipe.c
===================================================================
@@ -751,7 +751,7 @@ int __ipipe_handle_exception(struct pt_r
 	if (!ipipe_root_domain_p &&
 	    __ipipe_xlate_signo[vector] >= 0 &&
 	    !kgdb_handle_exception(vector, __ipipe_xlate_signo[vector], error_code, regs)) {
-		if (!flags)
+		if (flags & X86_EFLAGS_IF)
 			__clear_bit(IPIPE_STALL_FLAG,
 				    &ipipe_root_cpudom_var(status));
 		return 1;
@@ -759,7 +759,7 @@ int __ipipe_handle_exception(struct pt_r
 #endif /* CONFIG_KGDB */
 
 	if (unlikely(ipipe_trap_notify(vector, regs))) {
-		if (!flags)
+		if (flags & X86_EFLAGS_IF)
 			__clear_bit(IPIPE_STALL_FLAG,
 				    &ipipe_root_cpudom_var(status));
 		return 1;