[llvmlinux] Problems running LLVMLinux with kvmconfig on QEMU

Vinicius Tinti viniciustinti at gmail.com
Wed Jun 24 12:54:13 UTC 2015

On Thu, Jun 11, 2015 at 10:00 AM, Alexander Potapenko <glider at google.com> wrote:
> Hello LLVMLinux devs,

Hi Alexander,

> I'm having troubles with running a kernel built from LLVMLinux git
> tree with kvmconfig.
> The problem is reproducible with many different Clang version starting
> at 232688 and including the current tip of trunk.
> In order to reproduce it you need to check out the LLVMLinux tree:
>   $ git clone git://git.linuxfoundation.org/llvmlinux/kernel.git
> , configure it:
>   $ make defconfig && make kvmconfig
> , then build:
>   $ make HOSTCC=clang CC=clang -j64
> and run on QEMU:
>   $ qemu-system-x86_64 -hda wheezy.img -m 500M -smp 4   \
>   -net user,hostfwd=tcp::10022-:22 -net nic \
>   -kernel $KASAN_SRC_DIR/arch/x86/boot/bzImage \
>   -append "console=ttyS0 root=/dev/sda debug earlyprintk=serial
> slub_debug=QUZ" \
>   -nographic    -pidfile vm_pid  -enable-kvm
> The kernel would crash with a NULL pointer dereference in
> __free_pages_bootmem (see qemu_log.txt attached)
> This problem can be fixed by reimplementing list_add() as a noinline
> function and making free_hot_cold_page() in mm/page_alloc.c call the
> noinline version (see my_list_add.patch attached).
> But now the kernel falls into a reboot loop in startup (see qemu_log_inf.txt).
> I've spent some time debugging this issue, and it appears to have
> something to do with SMP alternatives being incorrectly applied at
> startup.
> Yet I haven't managed to find the culprit yet and am seeking your advice.
> Have you ran into this problem? Any ideas how to debug it efficiently?

Sorry for the late reply. Could you try to build with gcc and check if
the problem persists?
Sometimes our patches break something in kernel. It is probably not
that but is worth a try.

Next we normaly try to compare some key assemble files produced by gcc
and clang related to the problem.

Please let me know if you succeed.


> --
> Alexander Potapenko
> Software Engineer
> Google Germany GmbH
> Dienerstraße 12
> 80331 München
> _______________________________________________
> LLVMLinux mailing list
> LLVMLinux at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/llvmlinux

Simplicity is the ultimate sophistication

More information about the LLVMLinux mailing list