Thanks Richard,
 Will try out the patch. 

I was trying to downgrade to 2.6 simply because there are some kernel modules (not in the linux kernel tree) that are very dependant on the 2.6 code base. One example being the "click-modular-router" http://www.read.cs.ucla.edu/click/click

I guess will have to work on porting these modules to 3.1 as well.

A suggestion, is it possible to mention the version dependancy for UML (for a given kernel) on the website?

-Avinash
On Sun, May 27, 2012 at 3:33 AM, richard -rw- weinberger <richard.weinberger@gmail.com> wrote:
So, you're using gcc 4.5. You have to apply the patch below to your UML kernel.
Anyway, consider using a recent UML kernel. Or at least one which an
active stable tree.

commit 534e3adbd22efa327e6ff27cf2d8ebaad8382ecd
Author: Richard Weinberger <richard@nod.at>
Date:   Wed Apr 27 15:26:54 2011 -0700

   um: adjust current_thread_info() for newer gcc versions

   In some cases gcc >= 4.5.2 will optimize away current_thread_info().  To
   prevent gcc from doing so the stack address has to be obtained via inline
   asm.

   Signed-off-by: Richard Weinberger <richard@nod.at>
   Acked-by: Kirill A. Shutemov <kirill@shutemov.name>
   Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
   Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

diff --git a/arch/um/include/asm/thread_info.h
b/arch/um/include/asm/thread_info.h
index e2cf786..5bd1bad 100644
--- a/arch/um/include/asm/thread_info.h
+++ b/arch/um/include/asm/thread_info.h
@@ -49,7 +49,10 @@ static inline struct thread_info *current_thread_info(void)
 {
       struct thread_info *ti;
       unsigned long mask = THREAD_SIZE - 1;
-       ti = (struct thread_info *) (((unsigned long) &ti) & ~mask);
+       void *p;
+
+       asm volatile ("" : "=r" (p) : "0" (&ti));
+       ti = (struct thread_info *) (((unsigned long)p) & ~mask);
       return ti;
 }

--
Thanks,
//richard