All of lore.kernel.org
 help / color / mirror / Atom feed
* [Adeos-main] [PATCH] x86: Fix root state corruptions
@ 2008-11-15 21:46 Jan Kiszka
  0 siblings, 0 replies; only message in thread
From: Jan Kiszka @ 2008-11-15 21:46 UTC (permalink / raw)
  To: adeos-main; +Cc: Philippe Gerum

[-- Attachment #1: Type: text/plain, Size: 1502 bytes --]

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.

Signed-off-by: Jan Kiszka <jan.kiszka@domain.hid>
---
 arch/x86/kernel/ipipe.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: b/arch/x86/kernel/ipipe.c
===================================================================
--- a/arch/x86/kernel/ipipe.c
+++ 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;


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-15 21:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-15 21:46 [Adeos-main] [PATCH] x86: Fix root state corruptions 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.