[llvmlinux] target x86_64_tiny: panic while booting compiled kernel

Shehbaz Jaffer shehbazjaffer007 at gmail.com
Tue Aug 9 03:38:25 UTC 2016


Hi,

I am trying to build x86_64_tiny. I resolved some patch related errors
that I was facing and was able to successfully run make kernel_build
test, until the qemu started loading and running the built kernel.

I am currently stuck with some Kernel panic and the only hint I am
receiving is this:

BUG: unable to handle kernel paging request at ffffffffffffffc0

Kernel panic - not syncing: Attempted to kill the idle task!

The full log is shown below:

Could you please tell me how to proceed debugging this issue? Is this
happening because I have not provided some known memory option in
qemu?

Thanks in advance,


~/llvmlinux/targets/x86_64_tiny$ qemu-system-x86_64 -kernel
./build/kernel-clang/arch/x86_64/boot/bzImage -initrd
initramfs.cpio.gz.clang -nographic -append "console=ttyS0" -enable-kvm
[    0.000000] Linux version
4.8.0-rc1-llvmlinux-Lr278081-Cr278052-00019-g81abf25-dirty
(shehbaz at donjaffer) (clang version 4.0.0
(http://llvm.org/git/clang.git
20ac821dee568d0293fc7efee414aa1b961b5142)
(http://llvm.org/git/llvm.git
e7c619024b4d6dd58ed64cbdd03f7557c8ef4d65)) #1 SMP Mon Aug 8 22:56:11
EDT 2016
[    0.000000] Command line: console=ttyS0
[    0.000000] x86/fpu: Legacy x87 FPU detected.
[    0.000000] x86/fpu: Using 'eager' FPU context switches.
[    0.000000] e820: BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[    0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x0000000007fdffff] usable
[    0.000000] BIOS-e820: [mem 0x0000000007fe0000-0x0000000007ffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] SMBIOS 2.8 present.
[    0.000000] e820: last_pfn = 0x7fe0 max_arch_pfn = 0x400000000
[    0.000000] x86/PAT: PAT not supported by CPU.
[    0.000000] x86/PAT: Configuration [0-7]: WB  WT  UC- UC  WB  WT  UC- UC
[    0.000000] found SMP MP-table at [mem 0x000f1090-0x000f109f]
mapped at [ffff8800000f1090]
[    0.000000] Scanning 1 areas for low memory corruption
[    0.000000] RAMDISK: [mem 0x07f40000-0x07fd7fff]
[    0.000000] ACPI: Early table checksum verification disabled
[    0.000000] ACPI: RSDP 0x00000000000F0EA0 000014 (v00 BOCHS )
[    0.000000] ACPI: RSDT 0x0000000007FE1853 000034 (v01 BOCHS
BXPCRSDT 00000001 BXPC 00000001)
[    0.000000] ACPI: FACP 0x0000000007FE0E48 000074 (v01 BOCHS
BXPCFACP 00000001 BXPC 00000001)
[    0.000000] ACPI: DSDT 0x0000000007FE0040 000E08 (v01 BOCHS
BXPCDSDT 00000001 BXPC 00000001)
[    0.000000] ACPI: FACS 0x0000000007FE0000 000040
[    0.000000] ACPI: SSDT 0x0000000007FE0EBC 0008E7 (v01 BOCHS
BXPCSSDT 00000001 BXPC 00000001)
[    0.000000] ACPI: APIC 0x0000000007FE17A3 000078 (v01 BOCHS
BXPCAPIC 00000001 BXPC 00000001)
[    0.000000] ACPI: HPET 0x0000000007FE181B 000038 (v01 BOCHS
BXPCHPET 00000001 BXPC 00000001)
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000001000-0x0000000000ffffff]
[    0.000000]   DMA32    [mem 0x0000000001000000-0x0000000007fdffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000001000-0x000000000009efff]
[    0.000000]   node   0: [mem 0x0000000000100000-0x0000000007fdffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000001000-0x0000000007fdffff]
[    0.000000] ACPI: PM-Timer IO Port: 0x608
[    0.000000] ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])
[    0.000000] IOAPIC[0]: apic_id 0, version 17, address 0xfec00000, GSI 0-23
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level)
[    0.000000] Using ACPI (MADT) for SMP configuration information
[    0.000000] ACPI: HPET id: 0x8086a201 base: 0xfed00000
[    0.000000] smpboot: Allowing 1 CPUs, 0 hotplug CPUs
[    0.000000] PM: Registered nosave memory: [mem 0x00000000-0x00000fff]
[    0.000000] PM: Registered nosave memory: [mem 0x0009f000-0x0009ffff]
[    0.000000] PM: Registered nosave memory: [mem 0x000a0000-0x000effff]
[    0.000000] PM: Registered nosave memory: [mem 0x000f0000-0x000fffff]
[    0.000000] e820: [mem 0x08000000-0xfeffbfff] available for PCI devices
[    0.000000] clocksource: refined-jiffies: mask: 0xffffffff
max_cycles: 0xffffffff, max_idle_ns: 1910969940391419 ns
[    0.000000] setup_percpu: NR_CPUS:64 nr_cpumask_bits:64
nr_cpu_ids:1 nr_node_ids:1
[    0.000000] percpu: Embedded 481 pages/cpu @ffff880007c00000
s1930784 r8192 d31200 u2097152
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.
Total pages: 32104
[    0.000000] Kernel command line: console=ttyS0
[    0.000000] PID hash table entries: 512 (order: 0, 4096 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 5, 131072 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 4, 65536 bytes)
[    0.000000] Memory: 96816K/130552K available (5679K kernel code,
452K rwdata, 2284K rodata, 2904K init, 15184K bss, 33736K reserved, 0K
cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Running RCU self tests
[    0.000000] Hierarchical RCU implementation.
[    0.000000] RCU lockdep checking is enabled.
[    0.000000] Build-time adjustment of leaf fanout to 64.
[    0.000000] RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=1.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=1
[    0.000000] NR_IRQS:4352 nr_irqs:256 16
[    0.000000] Console: colour VGA+ 80x25
[    0.000000] console [ttyS0] enabled
[    0.000000] Lock dependency validator: Copyright (c) 2006 Red Hat,
Inc., Ingo Molnar
[    0.000000] ... MAX_LOCKDEP_SUBCLASSES:  8
[    0.000000] ... MAX_LOCK_DEPTH:          48
[    0.000000] ... MAX_LOCKDEP_KEYS:        8191
[    0.000000] ... CLASSHASH_SIZE:          4096
[    0.000000] ... MAX_LOCKDEP_ENTRIES:     32768
[    0.000000] ... MAX_LOCKDEP_CHAINS:      65536
[    0.000000] ... CHAINHASH_SIZE:          32768
[    0.000000]  memory used by lock dependency info: 8671 kB
[    0.000000]  per task-struct memory footprint: 2688 bytes
[    0.000000] ------------------------
[    0.000000] | Locking API testsuite:
[    0.000000] ----------------------------------------------------------------------------
[    0.000000]                                  | spin |wlock |rlock
|mutex | wsem | rsem |
[    0.000000]
--------------------------------------------------------------------------
[    0.000000]                      A-A deadlock:  ok  |  ok  |  ok  |
 ok  |  ok  |  ok  |
[    0.000000]                  A-B-B-A deadlock:  ok  |  ok  |  ok  |
 ok  |  ok  |  ok  |
[    0.000000]              A-B-B-C-C-A deadlock:  ok  |  ok  |  ok  |
 ok  |  ok  |  ok  |
[    0.000000]              A-B-C-A-B-C deadlock:  ok  |  ok  |  ok  |
 ok  |  ok  |  ok  |
[    0.000000]          A-B-B-C-C-D-D-A deadlock:  ok  |  ok  |  ok  |
 ok  |  ok  |  ok  |
[    0.000000]          A-B-C-D-B-D-D-A deadlock:  ok  |  ok  |  ok  |
 ok  |  ok  |  ok  |
[    0.000000]          A-B-C-D-B-C-D-A deadlock:  ok  |  ok  |  ok  |
 ok  |  ok  |  ok  |
[    0.000000]                     double unlock:  ok  |  ok  |  ok  |
 ok  |  ok  |  ok  |
[    0.000000]                   initialize held:  ok  |  ok  |  ok  |
 ok  |  ok  |  ok  |
[    0.000000]                  bad unlock order:  ok  |  ok  |  ok  |
 ok  |  ok  |  ok  |
[    0.000000]
--------------------------------------------------------------------------
[    0.000000]               recursive read-lock:             |  ok  |
            |  ok  |
[    0.000000]            recursive read-lock #2:             |  ok  |
            |  ok  |
[    0.000000]             mixed read-write-lock:             |  ok  |
            |  ok  |
[    0.000000]             mixed write-read-lock:             |  ok  |
            |  ok  |
[    0.000000]
--------------------------------------------------------------------------
[    0.000000]      hard-irqs-on + irq-safe-A/12:  ok  |  ok  |  ok  |
[    0.000000]      soft-irqs-on + irq-safe-A/12:  ok  |  ok  |  ok  |
[    0.000000]      hard-irqs-on + irq-safe-A/21:  ok  |  ok  |  ok  |
[    0.000000]      soft-irqs-on + irq-safe-A/21:  ok  |  ok  |  ok  |
[    0.000000]        sirq-safe-A => hirqs-on/12:  ok  |  ok  |  ok  |
[    0.000000]        sirq-safe-A => hirqs-on/21:  ok  |  ok  |  ok  |
[    0.000000]          hard-safe-A + irqs-on/12:  ok  |  ok  |  ok  |
[    0.000000]          soft-safe-A + irqs-on/12:  ok  |  ok  |  ok  |
[    0.000000]          hard-safe-A + irqs-on/21:  ok  |  ok  |  ok  |
[    0.000000]          soft-safe-A + irqs-on/21:  ok  |  ok  |  ok  |
[    0.000000]     hard-safe-A + unsafe-B #1/123:  ok  |  ok  |  ok  |
[    0.000000]     soft-safe-A + unsafe-B #1/123:  ok  |  ok  |  ok  |
[    0.000000]     hard-safe-A + unsafe-B #1/132:  ok  |  ok  |  ok  |
[    0.000000]     soft-safe-A + unsafe-B #1/132:  ok  |  ok  |  ok  |
[    0.000000]     hard-safe-A + unsafe-B #1/213:  ok  |  ok  |  ok  |
[    0.000000]     soft-safe-A + unsafe-B #1/213:  ok  |  ok  |  ok  |
[    0.000000]     hard-safe-A + unsafe-B #1/231:  ok  |  ok  |  ok  |
[    0.000000]     soft-safe-A + unsafe-B #1/231:  ok  |  ok  |  ok  |
[    0.000000]     hard-safe-A + unsafe-B #1/312:  ok  |  ok  |  ok  |
[    0.000000]     soft-safe-A + unsafe-B #1/312:  ok  |  ok  |  ok  |
[    0.000000]     hard-safe-A + unsafe-B #1/321:  ok  |  ok  |  ok  |
[    0.000000]     soft-safe-A + unsafe-B #1/321:  ok  |  ok  |  ok  |
[    0.000000]     hard-safe-A + unsafe-B #2/123:  ok  |  ok  |  ok  |
[    0.000000]     soft-safe-A + unsafe-B #2/123:  ok  |  ok  |  ok  |
[    0.000000]     hard-safe-A + unsafe-B #2/132:  ok  |  ok  |  ok  |
[    0.000000]     soft-safe-A + unsafe-B #2/132:  ok  |  ok  |  ok  |
[    0.000000]     hard-safe-A + unsafe-B #2/213:  ok  |  ok  |  ok  |
[    0.000000]     soft-safe-A + unsafe-B #2/213:  ok  |  ok  |  ok  |
[    0.000000]     hard-safe-A + unsafe-B #2/231:  ok  |  ok  |  ok  |
[    0.000000]     soft-safe-A + unsafe-B #2/231:  ok  |  ok  |  ok  |
[    0.000000]     hard-safe-A + unsafe-B #2/312:  ok  |  ok  |  ok  |
[    0.000000]     soft-safe-A + unsafe-B #2/312:  ok  |  ok  |  ok  |
[    0.000000]     hard-safe-A + unsafe-B #2/321:  ok  |  ok  |  ok  |
[    0.000000]     soft-safe-A + unsafe-B #2/321:  ok  |  ok  |  ok  |
[    0.000000]       hard-irq lock-inversion/123:  ok  |  ok  |  ok  |
[    0.000000]       soft-irq lock-inversion/123:  ok  |  ok  |  ok  |
[    0.000000]       hard-irq lock-inversion/132:  ok  |  ok  |  ok  |
[    0.000000]       soft-irq lock-inversion/132:  ok  |  ok  |  ok  |
[    0.000000]       hard-irq lock-inversion/213:  ok  |  ok  |  ok  |
[    0.000000]       soft-irq lock-inversion/213:  ok  |  ok  |  ok  |
[    0.000000]       hard-irq lock-inversion/231:  ok  |  ok  |  ok  |
[    0.000000]       soft-irq lock-inversion/231:  ok  |  ok  |  ok  |
[    0.000000]       hard-irq lock-inversion/312:  ok  |  ok  |  ok  |
[    0.000000]       soft-irq lock-inversion/312:  ok  |  ok  |  ok  |
[    0.000000]       hard-irq lock-inversion/321:  ok  |  ok  |  ok  |
[    0.000000]       soft-irq lock-inversion/321:  ok  |  ok  |  ok  |
[    0.000000]       hard-irq read-recursion/123:  ok  |
[    0.000000]       soft-irq read-recursion/123:  ok  |
[    0.000000]       hard-irq read-recursion/132:  ok  |
[    0.000000]       soft-irq read-recursion/132:  ok  |
[    0.000000]       hard-irq read-recursion/213:  ok  |
[    0.000000]       soft-irq read-recursion/213:  ok  |
[    0.000000]       hard-irq read-recursion/231:  ok  |
[    0.000000]       soft-irq read-recursion/231:  ok  |
[    0.000000]       hard-irq read-recursion/312:  ok  |
[    0.000000]       soft-irq read-recursion/312:  ok  |
[    0.000000]       hard-irq read-recursion/321:  ok  |
[    0.000000]       soft-irq read-recursion/321:  ok  |
[    0.000000]
--------------------------------------------------------------------------
[    0.000000]   | Wound/wait tests |
[    0.000000]   ---------------------
[    0.000000]                   ww api failures:  ok  |  ok  |  ok  |
[    0.000000]                ww contexts mixing:  ok  |  ok  |
[    0.000000]              finishing ww context:  ok  |  ok  |  ok  |  ok  |
[    0.000000]                locking mismatches:  ok  |  ok  |  ok  |
[    0.000000]                  EDEADLK handling:  ok  |  ok  |  ok  |
 ok  |  ok  |  ok  |  ok  |  ok  |  ok  |  ok  |
[    0.000000]            spinlock nest unlocked:  ok  |
[    0.000000]   -----------------------------------------------------
[    0.000000]                                  |block | try  |context|
[    0.000000]   -----------------------------------------------------
[    0.000000]                           context:  ok  |  ok  |  ok  |
[    0.000000]                               try:  ok  |  ok  |  ok  |
[    0.000000]                             block:  ok  |  ok  |  ok  |
[    0.000000]                          spinlock:  ok  |  ok  |  ok  |
[    0.000000] -------------------------------------------------------
[    0.000000] Good, all 253 testcases passed! |
[    0.000000] ---------------------------------
[    0.000000] kmemleak: Kernel memory leak detector disabled
[    0.000000] ODEBUG: selftest passed
[    0.000000] kmemleak: Early log buffer exceeded (1253), please
increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE
[    0.000000] clocksource: hpet: mask: 0xffffffff max_cycles:
0xffffffff, max_idle_ns: 19112604467 ns
[    0.000000] tsc: Fast TSC calibration using PIT
[    0.000000] tsc: Detected 2196.867 MHz processor
[    0.002002] Calibrating delay loop (skipped), value calculated
using timer frequency.. 4393.73 BogoMIPS (lpj=2196867)
[    0.004003] pid_max: default: 32768 minimum: 301
[    0.004509] ACPI: Core revision 20160422
[    0.041284] ACPI: 2 ACPI AML tables successfully acquired and loaded
[    0.042003]
[    0.042326] Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
[    0.043012] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes)
[    0.045587] mce: CPU supports 10 MCE banks
[    0.046082] Last level iTLB entries: 4KB 0, 2MB 0, 4MB 0
[    0.047015] Last level dTLB entries: 4KB 0, 2MB 0, 4MB 0, 1GB 0
[    0.055630] BUG: unable to handle kernel paging request at ffffffffffffffc0
[    0.056000] IP: [<ffffffff81147008>] __purge_vmap_area_lazy+0x308/0x330
[    0.056000] PGD 1a07067 PUD 1a09067 PMD 0
[    0.056000] Oops: 0000 [#1] SMP
[    0.056000] Modules linked in:
[    0.056000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted
4.8.0-rc1-llvmlinux-Lr278081-Cr278052-00019-g81abf25-dirty #1
[    0.056000] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
BIOS 1.7.5-20150306_163512-brownie 04/01/2014
[    0.056000] task: ffffffff81a0b500 task.stack: ffffffff81a00000
[    0.056000] RIP: 0010:[<ffffffff81147008>]  [<ffffffff81147008>]
__purge_vmap_area_lazy+0x308/0x330
[    0.056000] RSP: 0000:ffffffff81a03d98  EFLAGS: 00010286
[    0.056000] RAX: ffffffffffffffc0 RBX: dead000000000200 RCX: 0000000000000001
[    0.056000] RDX: ffffffff81a03dc0 RSI: 0000000000000040 RDI: ffffffff81a6f8e8
[    0.056000] RBP: ffffffff81a03df8 R08: 0000000000000000 R09: 0000000000000001
[    0.056000] R10: 0000000000000000 R11: 00000000000074e0 R12: dead000000000200
[    0.056000] R13: dead000000000100 R14: ffffffff81a03e20 R15: ffffffff81a03e18
[    0.056000] FS:  0000000000000000(0000) GS:ffff880007c00000(0000)
knlGS:0000000000000000
[    0.056000] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    0.056000] CR2: ffffffffffffffc0 CR3: 0000000001a06000 CR4: 00000000000006f0
[    0.056000] Stack:
[    0.056000]  0000000000000246 0000000000000000 dead000000000100
0000000000000000
[    0.056000]  ffff880007dd2290 ffffffff81a03dc0 ffffffff81a03dc0
0000000000000040
[    0.056000]  0000000000000000 ffffffffffffffff ffff880007dd22d8
ffff880007dd22d8
[    0.056000] Call Trace:
[    0.056000]  [<ffffffff81146cf1>] vm_unmap_aliases+0x201/0x210
[    0.056000]  [<ffffffff8104ac6b>] change_page_attr_set_clr+0x14b/0x5d0
[    0.056000]  [<ffffffff8104b47c>] set_memory_nx+0x3c/0x50
[    0.056000]  [<ffffffff81047d4d>] free_init_pages+0x9d/0xf0
[    0.056000]  [<ffffffff81c57f63>] alternative_instructions+0xb3/0xd0
[    0.056000]  [<ffffffff81c5a73e>] check_bugs+0xe/0x30
[    0.056000]  [<ffffffff81c4c078>] start_kernel+0x448/0x4e0
[    0.056000]  [<ffffffff81c4b560>] x86_64_start_kernel+0x140/0x150
[    0.056000]  [<ffffffff81c4b420>] ? early_make_pgtable+0x2b0/0x2b0
[    0.056000] Code: 48 8d 55 c8 0f 8c 99 fd ff ff 31 c0 48 87 04 25
88 15 ac 82 eb 11 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 48 8b 40 40
48 83 c0 c0 <48> 8b 08 49 3b 0f 73 03 49 89 0f 48 8b 48 08 49 3b 0e 76
e4 49
[    0.056000] RIP  [<ffffffff81147008>] __purge_vmap_area_lazy+0x308/0x330
[    0.056000]  RSP <ffffffff81a03d98>
[    0.056000] CR2: ffffffffffffffc0
[    0.056000] ---[ end trace 0000000000000000 ]---
[    0.056000] Kernel panic - not syncing: Attempted to kill the idle task!
[    0.056000] ---[ end Kernel panic - not syncing: Attempted to kill
the idle task!

Any pointers in solving this issue or helping detect what the problem
is would be greatly appreciated.

Thanks!
-- 
Shehbaz Jaffer
First Year Graduate Student
Sir Edward S Rogers Sr Department of Electrical and Computer Engineering
University of Toronto


More information about the LLVMLinux mailing list