qemu-system-arm: crashes raspian kernels with divide-by-zero
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
While trying to boot a arm kernel for a raspi2 machine (kernel7-
[ 10.022377] [<8011d344>] (__warn) from [<8011d42c>] (warn_slowpath_
[ 10.024726] [<8011d42c>] (warn_slowpath_
...
[ 10.094933] Hardware name: BCM2835
[ 10.101507] [<8010fb3c>] (unwind_backtrace) from [<8010c058>] (show_stack+
[ 10.105413] [<8010c058>] (show_stack) from [<80455f84>] (dump_stack+
[ 10.140268] [<80455f84>] (dump_stack) from [<8010bed4>] (__div0+0x24/0x28)
[ 10.143065] [<8010bed4>] (__div0) from [<8045498c>] (Ldiv0+0x8/0x14)
[ 10.145553] [<8045498c>] (Ldiv0) from [<804e5538>] (pl011_
[ 10.148017] [<804e5538>] (pl011_set_termios) from [<804da954>] (uart_change_
[ 10.185887] [<804da954>] (uart_change_speed) from [<804ddedc>] (uart_startup.
[ 10.222187] [<804ddedc>] (uart_startup.
[ 10.226014] [<804ddfcc>] (uart_port_
[ 10.228398] [<804c93b8>] (tty_port_open) from [<804dce64>] (uart_open+
[ 10.264254] [<804dce64>] (uart_open) from [<804c1d70>] (tty_open+
[ 10.266697] [<804c1d70>] (tty_open) from [<802753f0>] (chrdev_
[ 10.269049] [<802753f0>] (chrdev_open) from [<8026d964>] (do_dentry_
[ 10.271620] [<8026d964>] (do_dentry_open) from [<8026ec00>] (vfs_open+
[ 10.275245] [<8026ec00>] (vfs_open) from [<8027f39c>] (path_openat+
[ 10.312827] [<8027f39c>] (path_openat) from [<80281040>] (do_filp_
[ 10.317860] [<80281040>] (do_filp_open) from [<8026efd8>] (do_sys_
[ 10.320370] [<8026efd8>] (do_sys_open) from [<8026f0b4>] (SyS_open+
[ 10.357033] [<8026f0b4>] (SyS_open) from [<801080c0>] (ret_fast_
Tracking that down in the linux kernel source, it looks like somehow uart_get_
The same kernel could be booted without problem with qemu version 2.11.
Trying to bisecting the issue revealed commit @d9f8bbd8eb4e95
Commandline to run was:
qemu-system-arm -M raspi2 \
-kernel "$KERNEL" \
-m 1024 \
-d guest_errors,unimp \
-dtb bcm2709-rpi-2-b.dtb \
-drive file="$
Distribution is SuSE tumbleweed (x86_64, kernel 4.17.2), but same problem also happens with a freshly compiled qemu from git repository.
This isn't a kernel crash, it's just a warning (which I think is safely ignorable). The problem is that QEMU doesn't implement the 'cprman' clock control hardware, which means Linux thinks the UART is running at a zero baud rate. Unfortunately the cprman hardware is as far as I can determine undocumented, so it's not really possible to write an emulation of it.
I'm not sure your bisection has landed on the right thing, as d9f8bbd8eb4e95 should be a no-behaviour-change commit.