Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#74716 - [qemu-system-x86] SIGABRT with KVM - kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' fa

Attached to Project: Arch Linux
Opened by Frantisek Sumsal (mrc0mmand) - Thursday, 12 May 2022, 09:55 GMT
Task Type Bug Report
Category Packages: Extra
Status Unconfirmed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


Latest qemu-system-x86 crashes with SIGABRT on startup with KVM enabled:

# qemu-system-x86_64 -machine accel=kvm -enable-kvm -cpu host /boot/initramfs-linux.img
WARNING: Image format was not specified for '/boot/initramfs-linux.img' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
qemu-system-x86_64: error: failed to set MSR 0xc0000104 to 0x100000000
qemu-system-x86_64: ../qemu-7.0.0/target/i386/kvm/kvm.c:2996: kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.
Aborted (core dumped)


Additional info:
* package version(s)
qemu-system-x86 7.0.0-9

Steps to reproduce:
# qemu-system-x86_64 -machine accel=kvm -enable-kvm -cpu host /boot/initramfs-linux.img

Coredump info:
PID: 843 (qemu-system-x86)
UID: 0 (root)
GID: 0 (root)
Signal: 6 (ABRT)
Timestamp: Thu 2022-05-12 09:53:13 UTC (14s ago)
Command Line: qemu-system-x86_64 -machine accel=kvm -enable-kvm -cpu host /boot/initramfs-linux.img
Executable: /usr/bin/qemu-system-x86_64
Control Group: /user.slice/user-1000.slice/session-4.scope
Unit: session-4.scope
Slice: user-1000.slice
Session: 4
Owner UID: 1000 (vagrant)
Boot ID: 720d165b59734239a839778c4f0b6ec5
Machine ID: 10f52eb518164e1691a8b304a5bf3a43
Hostname: arch.localdomain
Storage: /var/lib/systemd/coredump/core.qemu-system-x86.0.720d165b59734239a839778c4f0b6ec5.843.1652349193000000.zst (present)
Disk Size: 1.1M
Message: Process 843 (qemu-system-x86) of user 0 dumped core.

Module with build-id ae8518a0710c2679844504efb751b01abf13cef5
Module with build-id 09690c43af29ef92bbec2e53e29101b2b8e9c48c
Module with build-id 140694a62d8d4d07c6c320a501f948dd1b389d73
Module with build-id f94a24f9ce8f3f394c3df23f7d436796797d4459
Module with build-id 28b40c7af8098a66af6ee093b6986b91cad7694d
Module with build-id a4ba3f4b4571c8272343b621da812a6e24a202a7
Module with build-id 7fa8b52fae071a370ba4ca32bf9490a30aff31c4
Module with build-id 27ca9470fd239e2f61c83e293f24f266789485b6
Module with build-id 4cf96cb4785e1ca233693ae17fa0d62971ee09c2
Module with build-id 845483dd0acba86de9f0313102bebbaf3ce52767
Module with build-id f0a9586cf0f42d2b9971bd1065ca3a6b19f4a2c2
Module with build-id 4436aeea0cd8c01b5a77969e0531184f8b3513ce
Module with build-id 447e6072ef09d5e282332034705f86420c34e54e
Module with build-id 032a21acd159ee3902605e9911be5f86a7df7df9
Module with build-id bb9bd2657bfba9f60bd34d2050cc63a7eb024bc4
Module with build-id e58d34ab389d1b649c24195c2d145e3ff2e58290
Module with build-id 2d70cff7b1841b4d9ca4e8e7726cd4b944c07fdc
Module with build-id 9a878e513c02007598fcf1e2e286c2203f13536e
Module with build-id ee3429ca5e94718aea4fe5249fc859e0cd88e4e9
Module with build-id 015ac6d6bcb60b7d8bea31a80d1941b06e8636ab
Module with build-id 1ce2b50ad9f9821c2c629b521cf5a3c99593d332
Module with build-id 45defc036e918e0140a72f1fbce6e7692d38241d
Module with build-id 81a4bdfe7d85b8daa2297869b1e9b35c28fe189e
Module with build-id cc372ea3c28c4d3dfc633b4d2e933c8584d2af16
Module with build-id 88ad4eff81a00c684abfe0f863e87434123d8943
Module with build-id c09c6f50f6bcec73c64a0b4be77eadb8f7202410
Module with build-id 85766e9d8458b16e9c7ce6e07c712c02b8471dbc
Module with build-id 5d817452a709ca3a213341555ddcf446ecee37fa
Module with build-id 596b63a006a4386dcab30912d2b54a7a61827b07
Module with build-id f41b69db8468baa07d466cc240c0794b5ff52b92
Module with build-id e859cc0cfbe1388b71174fba0701ac7bef5ed62c
Module with build-id bb11b2685fe89555938ffd330ea44d82b0f8701c
Module with build-id 5d0db204364cefb16d6d80f9e40df7c3d86023b3
Module with build-id c7f5471ffaddf14493c661e39976cf4f43aa43a1
Module with build-id 2cd05f37adf35ebab500ff2fa6f5eda457d608b2
Module with build-id 7dc938362569112855b6086de066cd6a18d1b978
Module with build-id f5692d20d0c82bba981746e991ea525fdea7b9b2
Module with build-id a7ecc447cfee5680a9308021e994ade25c3c9da3
Module with build-id 3bccb8fe08e48d5ea135b1d0f99de0d771dd752f
Module with build-id d6c7c03d71a1b71f59e10016323136de55f43266
Module with build-id f5126c30685462884948f1048f2039305c67f5c5
Module with build-id 3f16bee59e25c8bfbb70c4e78a3c90ee79ba4469
Module with build-id ecf6af9807840e498f8027d31fe97fff1aa5afaf
Module with build-id 7089f0e5cd72e16ad74053fe689ef4b0e87e95b7
Module with build-id 54179323d84e1b713b7547ba0b3f8310e65eec93
Module with build-id 203da370da341b7890e2cafaa2b0f416def38974
Module with build-id 626ba9e8e877a809393c4d5a48ef6bdd8d30f817
Module with build-id 5b2955e99a56f895cb70144748d096b5c4f7bf83
Module with build-id 324d9d66f01707241e31af5cc104db3c9122f4c4
Module with build-id 2dc0bce07f199bf983c07a05fb95a6f4af83a9b3
Module with build-id 1fb800ce60ddb605ebe23f9702adcd341c7c8970
Module with build-id ed8e33ba505954ca344aea58d10c7b8a37fd2f39
Module with build-id 36e3fb247a476fe2f755162644ebcd8ebd5d92cb
Module with build-id 341f793dcada3a48a306a793d265a517e3f2e7d6
Module qemu-system-x86_64 with build-id 5638dd4a047239c9384135ce89a908a844b30dd5
Stack trace of thread 848:
#0 0x00007f46e7ad034c __pthread_kill_implementation ( + 0x8f34c)
#1 0x00007f46e7a834b8 raise ( + 0x424b8)
#2 0x00007f46e7a6d534 abort ( + 0x2c534)
#3 0x00007f46e7a6d45c __assert_fail_base.cold ( + 0x2c45c)
#4 0x00007f46e7a7c116 __assert_fail ( + 0x3b116)
#5 0x000055f8676358d5 kvm_buf_set_msrs (qemu-system-x86_64 + 0x6ac8d5)
#6 0x000055f86763a81a kvm_arch_put_registers (qemu-system-x86_64 + 0x6b181a)
#7 0x000055f8677d5902 do_kvm_cpu_synchronize_post_init (qemu-system-x86_64 + 0x84c902)
#8 0x000055f8673d9091 process_queued_cpu_work (qemu-system-x86_64 + 0x450091)
#9 0x000055f8677d73d8 kvm_vcpu_thread_fn (qemu-system-x86_64 + 0x84e3d8)
#10 0x000055f8679f00c7 qemu_thread_start (qemu-system-x86_64 + 0xa670c7)
#11 0x00007f46e7ace5c2 start_thread ( + 0x8d5c2)
#12 0x00007f46e7b53584 __clone ( + 0x112584)

Stack trace of thread 844:
#0 0x00007f46e7b19a55 clock_nanosleep@GLIBC_2.2.5 ( + 0xd8a55)
#1 0x00007f46e7b1e717 __nanosleep ( + 0xdd717)
#2 0x00007f46e7f93289 g_usleep ( + 0x80289)
#3 0x000055f8679ff653 call_rcu_thread (qemu-system-x86_64 + 0xa76653)
#4 0x000055f8679f00c7 qemu_thread_start (qemu-system-x86_64 + 0xa670c7)
#5 0x00007f46e7ace5c2 start_thread ( + 0x8d5c2)
#6 0x00007f46e7b53584 __clone ( + 0x112584)

Stack trace of thread 843:
#0 0x00007f46e7acb15a __futex_abstimed_wait_common ( + 0x8a15a)
#1 0x00007f46e7acd960 pthread_cond_wait@@GLIBC_2.3.2 ( + 0x8c960)
#2 0x000055f8679f4760 qemu_cond_wait_impl (qemu-system-x86_64 + 0xa6b760)
#3 0x000055f8673d8df8 do_run_on_cpu (qemu-system-x86_64 + 0x44fdf8)
#4 0x000055f86740eb60 cpu_synchronize_all_post_init (qemu-system-x86_64 + 0x485b60)
#5 0x000055f8674ec39f qdev_machine_creation_done (qemu-system-x86_64 + 0x56339f)
#6 0x000055f86742768e qmp_x_exit_preconfig.part.0 (qemu-system-x86_64 + 0x49e68e)
#7 0x000055f867428efc qemu_init (qemu-system-x86_64 + 0x49fefc)
#8 0x000055f8673cda8d main (qemu-system-x86_64 + 0x444a8d)
#9 0x00007f46e7a6e310 __libc_start_call_main ( + 0x2d310)
#10 0x00007f46e7a6e3c1 __libc_start_main@@GLIBC_2.34 ( + 0x2d3c1)
#11 0x000055f8673d02e5 _start (qemu-system-x86_64 + 0x4472e5)

Stack trace of thread 845:
#0 0x00007f46e7acb15a __futex_abstimed_wait_common ( + 0x8a15a)
#1 0x00007f46e7ad62f3 __new_sem_wait_slow64.constprop.0 ( + 0x952f3)
#2 0x000055f8679efb31 qemu_sem_timedwait (qemu-system-x86_64 + 0xa66b31)
#3 0x000055f867a1bc44 worker_thread (qemu-system-x86_64 + 0xa92c44)
#4 0x000055f8679f00c7 qemu_thread_start (qemu-system-x86_64 + 0xa670c7)
#5 0x00007f46e7ace5c2 start_thread ( + 0x8d5c2)
#6 0x00007f46e7b53584 __clone ( + 0x112584)
ELF object binary architecture: AMD x86-64
This task depends upon

Comment by Frantisek Sumsal (mrc0mmand) - Thursday, 12 May 2022, 12:40 GMT
I forgot to mention that I've reproduced this with _nested_ KVM (I don't have any machine at hand right now to test it with plain KVM).
Comment by loqs (loqs) - Thursday, 12 May 2022, 13:35 GMT