Re: [llvmlinux] percpu | bitmap issue? (Cannot boot on bare metal due to a kernel NULL pointer dereference)

From: Sedat Dilek
Date: Mon Sep 07 2015 - 01:59:06 EST


On Sun, Sep 6, 2015 at 7:45 PM, Sedat Dilek <sedat.dilek@xxxxxxxxx> wrote:
> [ TO percpu folks and CCed some linux/bitmap people listed in [2] ]
>
> Hi,
>
> this week I built a LLVM/Clang v3.7.0 toolchain and wanted to play
> with LLVMLinux again.
>
> The kernel (v4.1.6 and v4.2) were compiled successfully.
>
> But I cannot boot on bare metal, so I played a bit with QEMU (KVM) to
> see what's going.
>
> The good or bad news:
> Both kernel-versions show the same issue (for v4.1.6 I posted to
> llvmlinux ML, see [1]).
> I am not sure if it is a percpu or bitmap issue.
>
> My QEMU line looks like this...
>
> root# qemu-system-x86_64 -enable-kvm -M pc -kernel $KPATH/bzImage
> -initrd $KPATH/initrd.img -m 512 -net none -serial stdio -append
> "root=/dev/ram0 console=ttyS0 hung_task_panic=1
> earlyprintk=ttyS0,115200"
>
[...]
>
> For me this looks like a PERCPU issue, but I might be wrong.
> I also added folks listed in [2].
>
> I will play a bit more with some "for-4.3" percpu and linux/bitmap
> fixes [2] and [3] which are not in Linux v4.2 (which is now my base
> for further tests).
>
> Attached are my kernel-config and something like a dmesg-log (QEMU snippet).
>
> I can send my important files if someone wants to play with QEMU.
>
> $ LC_ALL=C ll important-files/
> total 40896
> drwxr-xr-x 2 wearefam wearefam 4096 Sep 6 18:56 ./
> drwxr-xr-x 3 wearefam wearefam 4096 Sep 6 18:55 ../
> -rw-r--r-- 1 wearefam wearefam 3512984 Sep 6 18:51 System.map
> -rw-r--r-- 1 wearefam wearefam 4631200 Sep 6 18:51 bzImage
> -rw-r--r-- 1 wearefam wearefam 12062720 Sep 6 18:54 initrd.img
> -rwxr-xr-x 1 wearefam wearefam 27501165 Sep 6 18:51 vmlinux*
>
> If you need more informations, please let me know.
> Any help appreciated.
>
> Thanks.
>
> Regards,
> - Sedat -
>
> [1] http://lists.linuxfoundation.org/pipermail/llvmlinux/2015-September/001337.html
> [2] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=1a1d48a4a8fde49aedc045d894efe67173d59fe0
> [3] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=292c24a073ee34c629966eec8b48d54b0a206667

Hi,

I collected new material with a new 4.2.0-2-llvmlinux-small kernel.

The attached tarball has the following content:

$ LC_ALL=C ls -lR
.:
total 16
drwxr-xr-x 2 wearefam wearefam 4096 Sep 7 07:37 configs
drwxr-xr-x 2 wearefam wearefam 4096 Sep 7 07:36 logs
drwxr-xr-x 2 wearefam wearefam 4096 Sep 7 07:37 objdumps
drwxr-xr-x 2 wearefam wearefam 4096 Sep 7 07:40 patches

./configs:
total 128
-rw-r--r-- 1 wearefam wearefam 128613 Sep 6 23:17
config-4.2.0-2-llvmlinux-small

./logs:
total 12
-rw-r--r-- 1 wearefam wearefam 11875 Sep 7 07:34
qemu-log_call-trace_percpu-bitmap-issue_4.2.0-2-llvmlinux-small.txt

./objdumps:
total 656
-rw-r--r-- 1 wearefam wearefam 308876 Sep 7 07:12
mm-percpu_o-objdump-D-Mintel.txt
-rw-r--r-- 1 wearefam wearefam 288099 Sep 7 07:12 mm-percpu_o-objdump-drw.txt
-rw-r--r-- 1 wearefam wearefam 67520 Sep 6 22:51 percpu.o

./patches:
total 36
-rw-r--r-- 1 wearefam wearefam 34830 Sep 6 22:49 4.2.0-2-llvmlinux-small.patch

[ patches ]

Please have a look into the single llvmlinux patch on top of Linux v4.2.
The patches were taken from llvmlinux project (see [1] and [2]).
"[PATCH] kbuild, LLVMLinux: Fix asm-offset generation to work with
clang" from [3] changes ASM defines (read the changelog).

[ objdumps ]

The objdumps were created like this...

user$ objdump -drw mm/percpu.o > mm-percpu_o-objdump-drw.txt

user$ objdump -D -Mintel > mm-percpu_o-objdump-D-Mintel.txt

Hope this helps a bit more.

Regards,
- Sedat -

[1] http://git.linuxfoundation.org/?p=llvmlinux.git;a=tree;f=arch/all/patches
[2] http://git.linuxfoundation.org/?p=llvmlinux.git;a=tree;f=arch/x86_64/patches
[3] http://git.linuxfoundation.org/?p=llvmlinux.git;a=blob_plain;f=arch/all/patches/kbuild-asm-defines.patch

Attachment: for-tj.tar.gz
Description: GNU Zip compressed data

Attachment: for-tj.tar.gz.md5sum
Description: Binary data