Skip to contentSkip to conversation

CPU hot-plugs cause the qemu process to coredump

BUG lixianglai 1 participant 1 message Jul 21, 2023

lore
Share & tools
lore

lixianglai

author
#0 lore raw

Hello,Recently, when I was developing CPU hot-plugs under the loongarch architecture,

I found that there was a problem with qemu cpu hot-plugs under x86 architecture,

which caused the qemu process coredump when repeatedly inserting and unplugging

the CPU when the TCG was accelerated.

The specific operation process is as follows:

1.Use the following command to start the virtual machine

qemu-system-x86_64 \
-machine q35  \
-cpu Broadwell-IBRS \
-smp 1,maxcpus=4,sockets=4,cores=1,threads=1 \
-m 4G \
-drive file=~/anolis-8.8.qcow2  \
-serial stdio   \
-monitor telnet:localhost:4498,server,nowait

2.Enter QEMU Monitor via telnet for repeated CPU insertion and unplugging

telnet 127.0.0.1 4498

(qemu) device_add Broadwell-IBRS-x86_64-cpu,socket-id=1,core-id=0,thread-id=0,id=cpu1

(qemu) device_del cpu1
(qemu) device_add Broadwell-IBRS-x86_64-cpu,socket-id=1,core-id=0,thread-id=0,id=cpu1

3.You will notice that the QEMU process has a coredump

# malloc(): unsorted double linked list corrupted
Aborted (core dumped)