From: Avinash S. <avi...@gm...> - 2012-05-27 03:57:03
|
Hi, I have a gentoo installation running the following kernel: uname -a Linux avi-server 3.1.0-gentoo #6 SMP Sat Mar 24 12:48:22 PDT 2012 x86_64 Intel(R) Core(TM) i5-2300 CPU @ 2.80GHz GenuineIntel GNU/Linux I wanted to run linux kernel 2.6.38 uner UML on this system. I checked out the git repository for linux kernel (from kernel.org), and compiled a 2.6.38 kernel image for UML, with the default config. However, on running the UML 2.6.38 kernel with a gentoo rootfs, the UML aborts with a kernel panic. However, when I compiled linux kernel 3.1.0 for the UML architecture things worked perfectly. I was able to boot linux kernel 3.1.0 under UML (with a gentoo rootfs). Is there a kernel dependency for UML, that I can't run a 2.6 kernel under 3.1? The website doesn't seem to mention any such dependency. Here is the error that I am observing on starting UML with linux kernel 2.6.38 on a 3.1.0 system: ./linux ubda=~/dev/kernel/UML/Gentoo-10.0-AMD64-root_fs mem=512M stderr=1 Core dump limits : soft - 0 hard - NONE Checking that ptrace can change system call numbers...OK Checking syscall emulation patch for ptrace...OK Checking advanced syscall emulation patch for ptrace...OK Checking for tmpfs mount on /dev/shm...OK Checking PROT_EXEC mmap in /dev/shm/...OK Checking for the skas3 patch in the host: - /proc/mm...not found: No such file or directory - PTRACE_FAULTINFO...not found - PTRACE_LDT...not found UML running in SKAS0 mode Linux version 2.6.38 (asridharan@avi-server) (gcc version 4.5.3 (Gentoo 4.5.3-r1 p1.0, pie-0.4.5) ) #1 Sat May 26 20:53:32 PDT 2012 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129280 Kernel command line: ubda=/home/asridharan/dev/kernel/UML/Gentoo-10.0-AMD64-root_fs mem=512M stderr=1 root=98:0 PID hash table entries: 2048 (order: 2, 16384 bytes) Dentry cache hash table entries: 65536 (order: 7, 524288 bytes) Inode-cache hash table entries: 32768 (order: 6, 262144 bytes) Memory: 506088k available NR_IRQS:15 console [stderr0] enabled Calibrating delay loop... 367.00 BogoMIPS (lpj=1835008) pid_max: default: 32768 minimum: 301 kmem_cache_create: Early error in slab pid Kernel panic - not syncing: Kernel mode signal 4 Call Trace: 602417d8: [<60199354>] panic+0xea/0x1dc 602417f8: [<60037e44>] update_process_times+0x4a/0x52 60241838: [<6004b0c4>] tick_handle_periodic+0xf/0x56 60241858: [<60013ae3>] um_timer+0xf/0x16 60241868: [<60054485>] handle_IRQ_event+0x9d/0xac 602418a8: [<60055f4f>] handle_edge_irq+0xfd/0x123 602418d8: [<60014bbf>] relay_signal+0x38/0x79 60241908: [<60021f21>] sig_handler_common+0x84/0x98 60241928: [<60021f71>] real_alarm_handler+0x3c/0x3e 602419b0: [<60024de8>] __delay+0xa/0x16 60241a38: [<60022016>] sig_handler+0x30/0x3e 60241a58: [<60021c41>] handle_signal+0x6f/0xa5 60241aa8: [<60023968>] hard_handler+0x10/0x14 60241b68: [<600789e2>] kmem_cache_create+0x63/0x426 Modules linked in: Pid: 0, comm: swapper Not tainted 2.6.38 RIP: 0000:[<0000000000000000>] RSP: 0000000000000000 EFLAGS: 00000000 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Call Trace: 60241768: [<60014db5>] panic_exit+0x2f/0x45 60241788: [<600467fc>] notifier_call_chain+0x32/0x5e 602417c8: [<60046842>] atomic_notifier_call_chain+0xf/0x11 602417d8: [<6019936f>] panic+0x105/0x1dc 602417f8: [<60037e44>] update_process_times+0x4a/0x52 60241838: [<6004b0c4>] tick_handle_periodic+0xf/0x56 60241858: [<60013ae3>] um_timer+0xf/0x16 60241868: [<60054485>] handle_IRQ_event+0x9d/0xac 602418a8: [<60055f4f>] handle_edge_irq+0xfd/0x123 602418d8: [<60014bbf>] relay_signal+0x38/0x79 60241908: [<60021f21>] sig_handler_common+0x84/0x98 60241928: [<60021f71>] real_alarm_handler+0x3c/0x3e 602419b0: [<60024de8>] __delay+0xa/0x16 60241a38: [<60022016>] sig_handler+0x30/0x3e 60241a58: [<60021c41>] handle_signal+0x6f/0xa5 60241aa8: [<60023968>] hard_handler+0x10/0x14 60241b68: [<600789e2>] kmem_cache_create+0x63/0x426 Aborted |
From: richard -r. w. <ric...@gm...> - 2012-05-27 10:00:18
|
Hi! Running 3.1 x86_64 on top of 3.1 x86_64 works, but 2.6.38 x86_64 on top of 3.1 x86_64 not? Please confirm, so that I can try to produce the issue. However I suspect we have to back port f1c2bb8 (um: implement a x86_64 vDSO). Thanks, //richard |
From: Avinash S. <avi...@gm...> - 2012-05-27 16:49:53
|
Hi Richard, You got it right. Running 2.6.38_x86_64 on top of 3.1 x86_64 does not work. As you mentioned, I think its more of an issue with the version of gcc that I am using. On gentoo the latest release comes with gcc 4.5 (I have gcc (Gentoo 4.5.3-r1 p1.0, pie-0.4.5) 4.5.3). Thanks for pointing this out, Avinash On Sun, May 27, 2012 at 3:00 AM, richard -rw- weinberger < ric...@gm...> wrote: > Hi! > > Running 3.1 x86_64 on top of 3.1 x86_64 works, but 2.6.38 x86_64 on > top of 3.1 x86_64 not? > Please confirm, so that I can try to produce the issue. > > However I suspect we have to back port f1c2bb8 (um: implement a x86_64 > vDSO). > > Thanks, > //richard > |
From: richard -r. w. <ric...@gm...> - 2012-05-27 10:34:01
|
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 <ri...@no...> 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 <ri...@no...> Acked-by: Kirill A. Shutemov <ki...@sh...> Signed-off-by: Andrew Morton <ak...@li...> Signed-off-by: Linus Torvalds <tor...@li...> 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 |
From: Avinash S. <avi...@gm...> - 2012-05-27 16:55:07
|
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 < ric...@gm...> 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 <ri...@no...> > 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 <ri...@no...> > Acked-by: Kirill A. Shutemov <ki...@sh...> > Signed-off-by: Andrew Morton <ak...@li...> > Signed-off-by: Linus Torvalds <tor...@li...> > > 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 > |
From: richard -r. w. <ric...@gm...> - 2012-05-27 17:09:42
|
On Sun, May 27, 2012 at 6:54 PM, Avinash Sridharan <avi...@gm...> wrote: > I guess will have to work on porting these modules to 3.1 as well. Why 3.1? Use a recent kernel! > A suggestion, is it possible to mention the version dependancy for UML (for > a given kernel) on the website? There is no version dependency. 2.6.38.x is EOL and broken when compiled with gcc 4.5.x -- Thanks, //richard |