Closed kekeMemory closed 4 years ago
Hi,
I am not sure how to help with this - if you remove the blockdev ocssd, does that help?
Else you'll have to fire up gdb and see what fails when qemu crashes.
Regards, Matias
Hello. I have encountered a similar problem, when booting with the following command, there is no problem, the system boots on QEMU
./qemu-nvme/x86_64-softmmu/qemu-system-x86_64 -nographic -no-reboot -m 512M -smp cpus=2 --enable-kvm -kernel ./bzImage -drive file=./rootfs-target.img,if=ide -append "console=ttyS0 root=/dev/sda rw panic=1 earlyprintk=serial,ttyS0,115200"
However, when I run
./qemu-nvme/x86_64-softmmu/qemu-system-x86_64 -nographic -no-reboot -m 512M -smp cpus=2 --enable-kvm -kernel ./bzImage -drive file=./rootfs-target.img,if=ide -blockdev ocssd,node-name=nvme01,file.driver=file,file.filename=./blknvme -device nvme,drive=nvme01,serial=deadbeef,id=lnvm -append "console=ttyS0 root=/dev/sda rw panic=1 earlyprintk=serial,ttyS0,115200"
Note the extra arguments are :
-blockdev ocssd,node-name=nvme01,file.driver=file,file.filename=./blknvme
-device nvme,drive=nvme01,serial=deadbeef,id=lnvm
QEMU crashes here :
(gdb) where
#0 0x00007ffff638d9f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x555556665b68) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1 __pthread_cond_wait_common (abstime=0x0, mutex=0x5555564ce9e0 <qemu_global_mutex>, cond=0x555556665b40) at pthread_cond_wait.c:502
#2 __pthread_cond_wait (cond=cond@entry=0x555556665b40, mutex=mutex@entry=0x5555564ce9e0 <qemu_global_mutex>) at pthread_cond_wait.c:655
#3 0x0000555555c0c1cb in qemu_cond_wait_impl (cond=0x555556665b40, mutex=0x5555564ce9e0 <qemu_global_mutex>, file=0x555555ca0690 "/home/rick/qemu-nvme/qemu-nvme/cpus.c", line=1242) at util/qemu-thread-posix.c:161
#4 0x0000555555849f57 in qemu_wait_io_event (cpu=cpu@entry=0x5555566432c0) at /home/rick/qemu-nvme/qemu-nvme/cpus.c:1242
#5 0x000055555584b7e8 in qemu_kvm_cpu_thread_fn (arg=arg@entry=0x5555566432c0) at /home/rick/qemu-nvme/qemu-nvme/cpus.c:1286
#6 0x0000555555c0bb46 in qemu_thread_start (args=<optimized out>) at util/qemu-thread-posix.c:502
#7 0x00007ffff63876db in start_thread (arg=0x7ffff4c19700) at pthread_create.c:463
#8 0x00007ffff60b0a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:9
Before the crash I get this output :
SeaBIOS (version rel-1.12.0-0-ga698c8995f-prebuilt.qemu.orgSegmentation fault
So at least it tries to start, but probably has some trouble with the added NVMe block device.
I believe the offending function is qemu_wait_io_event(cpu)
. I don't know how to debug this further, any help would be appreciated.
Note : I am running qemu-nvme b6fb7eb1e9d708b920f24b559c503e68d0eb0329
on Ubuntu 18.04.5 LTS with 5.4.0-48 kernel (in VMWare with nested virtualization enabled).
I had problem with the ocssd.img file, once rebuilt with qemu-img create -f ocssd -o num_grp=2,num_pu=4,num_chk=60 ocssd.img
, The system would boot and the disk would show as /dev/nvme0
.
So if the input file (in my case ./blknvme) is bad or empty for some reason, the segfault would appear. Hope this can help someone else.
Note : a simple sanity check of the input file with relevant error message could help.
Thanks, Rick!
Good point. Note that the open-channel SSD interface is provided through the newly standardized NVMe Zoned Namespace (ZNS) SSD interface. You can read more about zoned storage at zonedstorage.io
We are working on upstreaming qemu support for ZNS. It'll soon be part of an official qemu release, but until then, it'll be available here: https://github.com/dmitry-fomichev/qemu
You may also simply use the null_blk device driver in Linux - it also supports exposing itself as a ZNS SSD / zoned block device.
Best, Matias
I have problems that I can start QEMU successfully by the command
./qemu-system-x86_64 -m 8192 -enable-kvm ubuntu.img -blockdev ocssd,node-name=nvme01,file.driver=file,file.filename=ocssd.img -device nvme,drive=nvme01,serial=deadbeef,id=lnvm -vnc :2 -net user,hostfwd=tcp::2222-:22 -net nic -kernel /home/kathy/linux/arch/x86_64/boot/bzImage -append root=/dev/sda1
The problem is that it always caused the QEMU virtual machine to crash Only the mouse can move, but it cannot work,the entire window screen crashed
I have always modify the linux config file in physical PC