linux-um archives
 help / color / mirror / Atom feed
* [uml-devel] Testing requested - [PATCH] Fixing SKAS0 compilation problem / TT mode bug report
@ 2005-11-27 20:59 Blaisorblade
  2005-11-28  0:47 ` [uml-devel] Blaisorblade's UML binaries - MORE MORE... please give us an x86_64 UML UML
  2005-11-28  4:23 ` [uml-devel] Testing requested - [PATCH] Fixing SKAS0 compilation problem / TT mode bug report Jeff Dike
  0 siblings, 2 replies; 11+ messages in thread
From: Blaisorblade @ 2005-11-27 20:59 UTC (permalink / raw)
  To: user-mode-linux-devel, Jeff Dike

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

The attached patch is a (hacky) proposal, alternative to Jeff's 
fix-stub-syscall6, to fix the SKAS0 compilation problem.

In fact, Jeff's patch makes the problem appear on my system (where I never 
reproduced it).

I'm going to stick this in -bs2, as it makes kernels compiled for me work 
better. So please test compiling -bs2.

As an aside, I saw this code crashing at shutdown in TT mode, from 
fs/proc/array.c:do_task_stat() :

        if (mm) {
                vsize = task_vsize(mm);
                eip = KSTK_EIP(task);
                esp = KSTK_ESP(task);
        }

Went looking and guess what? There is full crap (starting from 2.6.14, due to 
the fixes for sysrq-t IIRC):

include/asm-um/processor-i386.h

#define KSTK_EIP(tsk) KSTK_REG(tsk, EIP)
#define KSTK_ESP(tsk) KSTK_REG(tsk, UESP)
#define KSTK_EBP(tsk) KSTK_REG(tsk, EBP)

include/asm-um/processor-generic.h

#ifdef CONFIG_MODE_SKAS
#define KSTK_REG(tsk, reg) \
        ({ union uml_pt_regs regs; \
           get_thread_regs(&regs, tsk->thread.mode.skas.switch_buf); \
           UPT_REG(&regs, reg); })
#else
#define KSTK_REG(tsk, reg) (0xbadbabe)
#endif

I didn't fully realize the amount of crap in the patch when I reviewed it at 
that time (but I do remember complaining about 0xbadbabe rather than 
0xdeadbeef, so I'm guilty too).

I'll restore for TT mode the 2.6.13 content (which is wrong and kills sysrq-t, 
but is better than crap).

And there's no reason for letting TT mode bitrot so much, sorry. Making UML 
work for everybody, plus having a SMP testing mode, still means keeping it 
working.
-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

[-- Attachment #2: uml-use-asm-preventing-ebp.diff --]
[-- Type: text/x-diff, Size: 738 bytes --]

Index: linux-2.6.14/arch/um/kernel/skas/clone.c
===================================================================
--- linux-2.6.14.orig/arch/um/kernel/skas/clone.c
+++ linux-2.6.14/arch/um/kernel/skas/clone.c
@@ -1,5 +1,6 @@
 #include <sched.h>
 #include <signal.h>
+#include <stddef.h>
 #include <sys/mman.h>
 #include <sys/time.h>
 #include <asm/unistd.h>
@@ -39,6 +40,10 @@ stub_clone_handler(void)
 			    from->fd, from->offset);
  out:
 	/* save current result. Parent: pid; child: retcode of mmap */
+#if defined(UML_CONFIG_UML_X86) && !defined(UML_CONFIG_64BIT)
+	__asm__("movl %0, %1": : "r" (err), "g" (*(long*) (UML_CONFIG_STUB_DATA + offsetof(struct stub_data, err))));
+#else
 	from->err = err;
+#endif
 	trap_myself();
 }

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-12-03  5:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-27 20:59 [uml-devel] Testing requested - [PATCH] Fixing SKAS0 compilation problem / TT mode bug report Blaisorblade
2005-11-28  0:47 ` [uml-devel] Blaisorblade's UML binaries - MORE MORE... please give us an x86_64 UML UML
2005-11-29 12:22   ` Phill Wombat
2005-11-29 16:52     ` Blaisorblade
2005-11-30 20:32       ` Phill Wombat
2005-12-01 12:34         ` Blaisorblade
2005-11-28  4:23 ` [uml-devel] Testing requested - [PATCH] Fixing SKAS0 compilation problem / TT mode bug report Jeff Dike
2005-11-29 16:28   ` Blaisorblade
2005-11-29 17:55     ` Jeff Dike
2005-12-02  0:18       ` Blaisorblade
2005-12-03  5:54         ` Jeff Dike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox