[Top] [All Lists]

custom kernel on lemote-3a-itx (Loongson-3A) crashes in userspace

Subject: custom kernel on lemote-3a-itx (Loongson-3A) crashes in userspace
From: Mike Frysinger <>
Date: Thu, 19 Feb 2015 14:46:17 -0500
List-archive: <>
List-help: <>
List-id: linux-mips <>
List-owner: <>
List-post: <>
List-software: Ecartis version 1.0.0
List-subscribe: <>
List-unsubscribe: <>
Original-recipient: rfc822;
i've got a lemote desktop with a quad core Loongson-3A in it:

i'm trying to build my own kernel for it, but userspace just crashes on me :(.

the current kernel is a precompiled one from lemote themselves, and things are 
compiling/running fine with it.  but it's a bit stale and missing features i 
want (like namespaces & seccomp).
$ uname -a
Linux lemote 3.5.0-9.lemote #1465 SMP PREEMPT Mon Aug 26 14:23:38 CST 2013 
mips64 ICT Loongson-3A V0.5 FPU V0.1 lemote-3a-itx-a1101 GNU/Linux

the userland is Gentoo.  it's an o32/n32/n64 multilib with n32 as the default.  
most (if not all) of userland has been built with gcc-4.8.2 using
"-O2 -march=mips64 -mplt -pipe".
$ file /bin/bash
/bin/bash: ELF 32-bit LSB executable, MIPS, N32 MIPS64 version 1 (SYSV), 
dynamically linked, interpreter /lib32/, for GNU/Linux 2.6.16, stripped
$ /lib/ 
GNU C Library (Gentoo 2.19-r1 p3) stable release version 2.19, by Roland 
McGrath et al.
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
Compiled by GNU CC version 4.8.2.
Compiled on a Linux 3.14.0 system on 2014-09-09.
Available extensions:
        C stubs add-on version 2.1.2
        crypt add-on version 2.1 by Michael Glad and others
        GNU Libidn by Simon Josefsson
        Native POSIX Threads Library by Ulrich Drepper et al
For bug reporting instructions, please see:

i first tried lemote's sources, which i grabbed their git tree from  i started at the same git tag (3.5.0-9.lemote) and used the 
same .config as their precompiled kernel.  once it booted, most userland progs 
would crash.  some would survive (like simple ones), but most would crash.

i moved up to vanilla linux-3.18, starting with the same config, but got the 
same behavior.

i tried booting with the nofpu command line, but that didn't help.  i also 
tried manually setting cpu_has_fpu to 0 in 
arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h, but that didn't 

i tried gcc-4.7.4, gcc-4.8.4, and gcc-4.9.2, but none of that helped.

i enabled the debugging in arch/mips/mm/fault.c, and you can see the attached 
dmesg with some of the example crashes.  when i looked at proc maps from other 
binaries, it looks like those crashing addresses are close to real ones, but 
slightly off (like a byte shift?).  i'm just guessing since i'm not actually 
looking at the crashing app itself ... just assuming the maps are largely 
(since they seem to be in other ones).

i tried to use strace/gdb to narrow things down, but those both crash early, so 
couldn't get anywhere :).

any pointers ?

Attachment: dmesg-crash
Description: Text document

Attachment: signature.asc
Description: Digital signature

<Prev in Thread] Current Thread [Next in Thread>