megasas: Buffer I/O error on dev sda / critical target error, dev sda, sector 0 op 0x0:(READ)
Host environment
- Operating system: ALT Linux
- OS/kernel version: 6.4.4
- Architecture: x86-64
- QEMU flavor: qemu-system-x86_64
- QEMU version: 7.2.0 - 8.0.0
- QEMU command line:
qemu-system-x86_64 -M accel=kvm:tcg -m 56527 -smp cores=20 -serial mon:stdio -nodefaults -nographic -no-reboot -fsdev local,id=root,path=/,security_model=none,multidevs=remap -device virtio-9p-pci,fsdev=root,mount_tag=virtio-9p:/ -device virtio-rng-pci -kernel /boot/vmlinuz-6.4.16-un-def-alt1 -initrd /usr/src/tmp/initramfs-6.4.16-un-def-alt1.img -sandbox on,spawn=deny -device megasas -blockdev driver=null-co,read-zeroes=on,node-name=null -device scsi-hd,drive=null -bios bios.bin -append 'console=ttyS0 mitigations=off nokaslr quiet panic=-1 SCRIPT=/usr/src/tmp/vm.L10nv7pngN no_timer_check'
Emulated/Virtualized environment
- Operating system: ALT Linux
- OS/kernel version: 6.0.15 - 6.4.16
- Architecture: x86_64
Description of problem
Since QEMU 7.2.0 when using megasas device the guest kernel is unable to I/O with the device (Input/output error) also producing errors messages in dmesg like these:
[ 18.739344] critical target error, dev sda, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
[ 18.739925] Buffer I/O error on dev sda, logical block 0, async page read
[ 18.740374] Dev sda: unable to read RDB block 0
Relevant options are: -device megasas -blockdev driver=null-co,read-zeroes=on,node-name=null -device scsi-hd,drive=null then in guest modprobe megaraid-sas. With qcow2 images - errors are the same.
I also tested that the same commands produce no errors on QEMU 6.0.0 - 7.1.0.