Fail to boot VM with console=hvc0 in VM kernel cmdline and qemu cmd -serial stdio
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
intel |
New
|
Medium
|
Unassigned | ||
Ubuntu |
Confirmed
|
Undecided
|
Thibf |
Bug Description
[summary]
Fail to boot VM with console=hvc0 in VM kernel cmdline and qemu cmd -serial stdio
[Reproduce steps]
1. Boot host with Ubuntu23.10 default kernel
root@emr-111:~# uname -a
Linux emr-111 6.5.0-13-generic #13-Ubuntu SMP PREEMPT_DYNAMIC Fri Nov 3 12:16:05 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
2. Install qemu
apt install qemu-system-
apt install qemu-system-
3. Boot VM with Ubuntu23.10 default kernel, change guest kernel cmdline in it.
img=/home/
qemu-system-x86_64 \
-accel kvm -smp 2 -m 4G -cpu host \
-drive file=${
-device virtio-
-bios /usr/share/
-device virtio-
-serial stdio
Login into guest, modify /boot/grub/
linux /vmlinuz-
Remove "console=tty1 console=ttyS0", add "console=hvc0 earlyprintk=
linux /vmlinuz-
Poweroff VM
4. Boot VM again with virtio-serial qemu cmd
img=/home/
qemu-system-x86_64 \
-accel kvm -smp 2 -m 4G -cpu host \
-drive file=${
-device virtio-
-bios /usr/share/
-device virtio-
-chardev stdio,id=
-serial chardev:mux \
VM boot up successfully
Poweroff VM
5. Boot VM again with -serial stdio qemu cmd
img=/home/
qemu-system-x86_64 \
-accel kvm -smp 2 -m 4G -cpu host \
-drive file=${
-device virtio-
-bios /usr/share/
-device virtio-
-serial stdio
Fail to boot VM, guest crash with kernel panic
......
[ 2.305104] Btrfs loaded, zoned=yes, fsverity=yes
[ 32.446015] EXT4-fs (vda1): mounted filesystem fc270810-
[ 32.484041] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
[ 32.484571] CPU: 0 PID: 1 Comm: init Not tainted 6.5.0-9-generic #9-Ubuntu
[ 32.485060] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 2023.05-2+tdx1.0 11/05/2023
[ 32.485749] Call Trace:
[ 32.485948] <TASK>
[ 32.486114] dump_stack_
[ 32.486406] dump_stack+
[ 32.486664] panic+0x1bb/0x3a0
[ 32.486905] do_exit+0x6a1/0x6f0
[ 32.487160] ? __count_
[ 32.487506] do_group_
[ 32.487786] __x64_sys_
[ 32.488119] do_syscall_
[ 32.488393] ? do_user_
[ 32.488732] ? exit_to_
[ 32.489105] ? irqentry_
[ 32.489488] ? irqentry_
[ 32.489776] ? exc_page_
[ 32.490081] entry_SYSCALL_
[ 32.490472] RIP: 0033:0x7f583c09b2ed
[ 32.490747] Code: 02 ba ff ff ff ff 89 d0 c3 0f 1f 40 00 f3 0f 1e fa 48 8b 35 1d 3b 11 00 ba e7 00 00 00 eb 07 66 0f 1f 44 00 00 f4 89 d0 0f 05 <48> 3d 00 f0 ff ff 76 f3 f7 d8 64 89 06 eb ec 0f 1f 40 00 f3 0f 1e
[ 32.492180] RSP: 002b:00007ffe86
[ 32.492761] RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f583c09b2ed
[ 32.493306] RDX: 00000000000000e7 RSI: ffffffffffffff88 RDI: 0000000000000001
[ 32.493849] RBP: 00007ffe86621f01 R08: 000056221af7e010 R09: 0000000000000007
[ 32.494397] R10: 000056221af7ffd0 R11: 0000000000000202 R12: 0000000000000000
[ 32.494940] R13: 00007ffe86621f40 R14: 0000562219b31598 R15: 00007f583c1f8000
[ 32.495479] </TASK>
[ 32.496940] Kernel Offset: 0x30200000 from 0xffffffff81000000 (relocation range: 0xffffffff80000
[ 32.497737] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100 ]---
[Expected Result]
VM boot up successfully with qemu cmd -serial stdio, no output from stdio after earlyprint
[Actual Result]
guest crash with kernel panic
<Build: version, kernel>
Host/Guest OS: Ubuntu 23.10
Host kernel: 6.5.0-13-generic
Qemu:1:
Guest kernel:
<Environment: HW version, SKU#>
CPU: EMR
CPU(s): 224
Vendor ID: GenuineIntel
CPU family: 6
Model: 207
Stepping: 1
Changed in intel: | |
importance: | Undecided → Medium |
information type: | Private → Public |
Changed in ubuntu: | |
assignee: | nobody → The Kobuk team (kobuk-team) |
Changed in ubuntu: | |
assignee: | The Kobuk team (kobuk-team) → Philip Cox (philcox) |
Changed in ubuntu: | |
assignee: | Philip Cox (philcox) → Thibf (thibf) |
With the same host kernel and qemu, this issue cannot be reproduced with Centos guest image, it can get expected result: VM boot up successfully
I built the latest linux.git kernel and 6.5.0 release kernel myself on guest, and boot VM with the same config, the issue can be reproduced.
When reproduce, make sure no other "console=" para in guest kernel cmdline, in case "console=hvc0" be overwritten.