dhruvvyas90 / qemu-rpi-kernel

Qemu kernel for emulating Rpi on QEMU
2.05k stars 362 forks source link

Kernel Panics with qemu 2.50 #74

Closed pragun closed 5 years ago

pragun commented 5 years ago

I get a Kernel panic at init, running this with qemu-2.50 and 2018-11-13-raspbian-stretch-lite.img

`Uncompressing Linux... done, booting the kernel.

vpb_sic_write: Bad register offset 0x2c
Booting Linux on physical CPU 0x0

Linux version 4.14.79 (ubuntu@ip-172-31-22-27) (gcc version 7.3.0 (Ubuntu/Linaro 7.3.0-27ubuntu1~18.04)) #1 Sun Jan 27 22:47:58 UTC 2019

CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d

CPU: VIPT aliasing data cache, unknown instruction cache

OF: fdt: Machine model: ARM Versatile PB

Memory policy: Data cache writeback

Built 1 zonelists, mobility grouping on.  Total pages: 64960

Kernel command line: root=/dev/sda2 panic=1

PID hash table entries: 1024 (order: 0, 4096 bytes)

Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)

Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)

Memory: 253036K/262144K available (4670K kernel code, 217K rwdata, 1080K rodata, 188K init, 146K bss, 9108K reserved, 0K cma-reserved)

Virtual kernel memory layout:

    vector  : 0xffff0000 - 0xffff1000   (   4 kB)

    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)

    vmalloc : 0xd0800000 - 0xff800000   ( 752 MB)

    lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)

    modules : 0xbf000000 - 0xc0000000   (  16 MB)

      .text : 0xc0008000 - 0xc0497d08   (4672 kB)

      .init : 0xc05c9000 - 0xc05f8000   ( 188 kB)

      .data : 0xc05f8000 - 0xc062e420   ( 218 kB)

       .bss : 0xc0633cf4 - 0xc06585c4   ( 147 kB)

NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16

VIC @d0800000: id 0x00041190, vendor 0x41

FPGA IRQ chip 0 "intc" @ d0802000, 20 irqs, parent IRQ: 47

clocksource: arm,sp804: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275 ns

sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 2147483647500ns

Failed to initialize '/amba/timer@101e3000': -22

sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns

Console: colour dummy device 80x30

console [tty0] enabled

Calibrating delay loop... 528.79 BogoMIPS (lpj=2643968)

pid_max: default: 32768 minimum: 301

Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)

Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)

Disabling memory control group subsystem

CPU: Testing write buffer coherency: ok

Setting up static identity map for 0x8220 - 0x827c

devtmpfs: initialized

random: get_random_u32 called from bucket_table_alloc+0x80/0x1a4 with crng_init=0

VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5

clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns

futex hash table entries: 256 (order: -1, 3072 bytes)

NET: Registered protocol family 16

DMA: preallocated 256 KiB pool for atomic coherent allocations

OF: amba_device_add() failed (-19) for /amba/smc@10100000

OF: amba_device_add() failed (-19) for /amba/mpmc@10110000

OF: amba_device_add() failed (-19) for /amba/sctl@101e0000

OF: amba_device_add() failed (-19) for /amba/watchdog@101e1000

OF: amba_device_add() failed (-19) for /amba/sci@101f0000

OF: amba_device_add() failed (-19) for /amba/ssp@101f4000

OF: amba_device_add() failed (-19) for /amba/fpga/sci@a000

Serial: AMBA PL011 UART driver

101f1000.uart: ttyAMA0 at MMIO 0x101f1000 (irq = 28, base_baud = 0) is a PL011 rev1

console [ttyAMA0] enabled

101f2000.uart: ttyAMA1 at MMIO 0x101f2000 (irq = 29, base_baud = 0) is a PL011 rev1

101f3000.uart: ttyAMA2 at MMIO 0x101f3000 (irq = 30, base_baud = 0) is a PL011 rev1

10009000.uart: ttyAMA3 at MMIO 0x10009000 (irq = 54, base_baud = 0) is a PL011 rev1

vgaarb: loaded

SCSI subsystem initialized

clocksource: Switched to clocksource arm,sp804

NET: Registered protocol family 2

TCP established hash table entries: 2048 (order: 1, 8192 bytes)

TCP bind hash table entries: 2048 (order: 1, 8192 bytes)

TCP: Hash tables configured (established 2048 bind 2048)

UDP hash table entries: 256 (order: 0, 4096 bytes)

UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)

NET: Registered protocol family 1

RPC: Registered named UNIX socket transport module.

RPC: Registered udp transport module.

RPC: Registered tcp transport module.

RPC: Registered tcp NFSv4.1 backchannel transport module.

NetWinder Floating Point Emulator V0.97 (double precision)

workingset: timestamp_bits=14 max_order=16 bucket_order=2

Installing knfsd (copyright (C) 1996 okir@monad.swb.de).

jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.

romfs: ROMFS MTD (C) 2007 Red Hat, Inc.

9p: Installing v9fs 9p2000 file system support

Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)

io scheduler noop registered

io scheduler deadline registered

io scheduler cfq registered (default)

io scheduler mq-deadline registered

io scheduler kyber registered

pl061_gpio 101e4000.gpio: PL061 GPIO chip @0x101e4000 registered

pl061_gpio 101e5000.gpio: PL061 GPIO chip @0x101e5000 registered

pl061_gpio 101e6000.gpio: PL061 GPIO chip @0x101e6000 registered

pl061_gpio 101e7000.gpio: PL061 GPIO chip @0x101e7000 registered

OF: PCI: host bridge /amba/pci@10001000 ranges:

OF: PCI:    IO 0x43000000..0x4300ffff -> 0x00000000

OF: PCI:   MEM 0x50000000..0x5fffffff -> 0x50000000

OF: PCI:   MEM 0x60000000..0x6fffffff -> 0x60000000

versatile-pci 10001000.pci: PCI core found (slot 11)

versatile-pci 10001000.pci: PCI host bridge to bus 0000:00

pci_bus 0000:00: root bus resource [bus 00-ff]

pci_bus 0000:00: root bus resource [io  0x0000-0xffff]

pci_bus 0000:00: root bus resource [mem 0x50000000-0x5fffffff]

pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff pref]

PCI: bus0: Fast back to back transfers disabled

pci 0000:00:0c.0: BAR 2: assigned [mem 0x50000000-0x50001fff]

pci 0000:00:0c.0: BAR 1: assigned [mem 0x50002000-0x500023ff]

pci 0000:00:0c.0: BAR 0: assigned [io  0x1000-0x10ff]

clcd-pl11x dev:20: PL110 designer 41 rev0 at 0x10120000

clcd-pl11x dev:20: Versatile hardware, VGA display

Console: switching to colour frame buffer device 80x30

brd: module loaded

sym53c8xx 0000:00:0c.0: enabling device (0100 -> 0103)

sym0: <895a> rev 0x0 at pci 0000:00:0c.0 irq 66

sym0: No NVRAM, ID 7, Fast-40, LVD, parity checking

sym0: SCSI BUS has been reset.

scsi host0: sym-2.2.3

sym0: unknown interrupt(s) ignored, ISTAT=0x5 DSTAT=0x80 SIST=0x0

scsi 0:0:0:0: Direct-Access     QEMU     QEMU HARDDISK    2.5+ PQ: 0 ANSI: 5

scsi target0:0:0: tagged command queuing enabled, command queue depth 16.

scsi target0:0:0: Beginning Domain Validation

scsi target0:0:0: Domain Validation skipping write tests

scsi target0:0:0: Ending Domain Validation

scsi 0:0:2:0: CD-ROM            QEMU     QEMU CD-ROM      2.5+ PQ: 0 ANSI: 5

scsi target0:0:2: tagged command queuing enabled, command queue depth 16.

scsi target0:0:2: Beginning Domain Validation

scsi target0:0:2: Domain Validation skipping write tests

scsi target0:0:2: Ending Domain Validation

sr 0:0:2:0: [sr0] scsi3-mmc drive: 16x/50x cd/rw xa/form2 cdda tray

cdrom: Uniform CD-ROM driver Revision: 3.20

random: fast init done

sd 0:0:0:0: [sda] 3645440 512-byte logical blocks: (1.87 GB/1.74 GiB)

sd 0:0:0:0: [sda] Write Protect is off

sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

 sda: sda1 sda2

smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico@fluxnic.net>

smc91x 10010000.net eth0: SMC91C11xFD (rev 1) at d0b89000 IRQ 41

smc91x 10010000.net eth0: Ethernet addr: 52:54:00:12:34:56

sd 0:0:0:0: [sda] Attached SCSI disk

rtc-ds1307 0-0068: registered as rtc0

IR NEC protocol handler initialized

IR RC5(x/sz) protocol handler initialized

IR RC6 protocol handler initialized

IR JVC protocol handler initialized

IR Sony protocol handler initialized

IR SANYO protocol handler initialized

IR Sharp protocol handler initialized

IR MCE Keyboard/mouse protocol handler initialized

IR XMP protocol handler initialized

versatile reboot driver registered

mmci-pl18x fpga:05: /aliases ID not available

mmci-pl18x fpga:05: mmc0: PL181 manf 41 rev0 at 0x10005000 irq 59,60 (pio)

mmci-pl18x fpga:05: DMA channels RX none, TX none

mmci-pl18x fpga:0b: /aliases ID not available

mmci-pl18x fpga:0b: mmc1: PL181 manf 41 rev0 at 0x1000b000 irq 49,50 (pio)

mmci-pl18x fpga:0b: DMA channels RX none, TX none

input: AT Raw Set 2 keyboard as /devices/platform/amba/amba:fpga/10006000.kmi/serio0/input/input0

leds-syscon 10000000.core-module:led@08.0: registered LED versatile:0

leds-syscon 10000000.core-module:led@08.1: registered LED versatile:1

leds-syscon 10000000.core-module:led@08.2: registered LED versatile:2

leds-syscon 10000000.core-module:led@08.3: registered LED versatile:3

leds-syscon 10000000.core-module:led@08.4: registered LED versatile:4

leds-syscon 10000000.core-module:led@08.5: registered LED versatile:5

leds-syscon 10000000.core-module:led@08.6: registered LED versatile:6

leds-syscon 10000000.core-module:led@08.7: registered LED versatile:7

ledtrig-cpu: registered to indicate activity on CPUs

Netfilter messages via NETLINK v0.30.

nf_conntrack version 0.5.0 (4096 buckets, 16384 max)

ip_tables: (C) 2000-2006 Netfilter Core Team

NET: Registered protocol family 17

Bridge firewalling registered

9pnet: Installing 9P2000 support

rtc-ds1307 0-0068: setting system clock to 2019-03-27 03:07:46 UTC (1553656066)

uart-pl011 101f1000.uart: no DMA platform data

input: ImExPS/2 Generic Explorer Mouse as /devices/platform/amba/amba:fpga/10007000.kmi/serio1/input/input2

EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)

VFS: Mounted root (ext4 filesystem) readonly on device 8:2.

devtmpfs: mounted

Freeing unused kernel memory: 188K

This architecture does not have kernel memory protection.

Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004

CPU: 0 PID: 1 Comm: init Not tainted 4.14.79 #1

Hardware name: ARM-Versatile (Device Tree Support)

[<c001c52c>] (unwind_backtrace) from [<c0018a6c>] (show_stack+0x10/0x14)

[<c0018a6c>] (show_stack) from [<c0024c00>] (panic+0xb8/0x22c)

[<c0024c00>] (panic) from [<c0026fd0>] (do_exit+0x964/0x99c)

[<c0026fd0>] (do_exit) from [<c0027070>] (do_group_exit+0x3c/0xa4)

[<c0027070>] (do_group_exit) from [<c002fe98>] (get_signal+0x134/0x528)

[<c002fe98>] (get_signal) from [<c0017f94>] (do_signal+0xc4/0x42c)

[<c0017f94>] (do_signal) from [<c00184c0>] (do_work_pending+0xb4/0xd0)

[<c00184c0>] (do_work_pending) from [<c0014f2c>] (slow_work_pending+0xc/0x20)

Rebooting in 1 seconds..

`

pragun commented 5 years ago

Was able to boot by following the recipie given here:

$ sudo mkdir /mnt/raspbian
$ sudo mount -v -o offset=50331648 -t ext4 <raspbian-image> /mnt/raspbian
$ sudo nano /mnt/raspbian/etc/ld.so.preload
Comment out every entry in that file with ‘#’, save and exit with Ctrl-x » Y.

Tried with both 2018-11-13-raspbian regular and 2018-11-13-raspbian-lite images, both work good