qemu: virtio: bogus descriptor or out of resources

Bug #2055296 reported by Heinrich Schuchardt
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qemu (Ubuntu)
Triaged
Undecided
Unassigned

Bug Description

Running the UEFI SCT on EDK II using qemu-system-riscv64 QEMU failed with an error

qemu: virtio: bogus descriptor or out of resources

This problem is described in https://gitlab.com/qemu-project/qemu/-/issues/2014.

I suggest to use the appended patch to work around the issue.

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: qemu-system-misc 1:8.2.1+ds-1ubuntu1
ProcVersionSignature: Ubuntu 6.6.0-14.14-generic 6.6.3
Uname: Linux 6.6.0-14-generic x86_64
NonfreeKernelModules: zfs nvidia_modeset nvidia
ApportVersion: 2.28.0-0ubuntu1
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: KDE
Date: Wed Feb 28 13:50:05 2024
InstallationDate: Installed on 2021-05-26 (1008 days ago)
InstallationMedia: Kubuntu 21.04 "Hirsute Hippo" - Release amd64 (20210420)
KvmCmdLine:
 COMMAND STAT EUID RUID PID PPID %CPU COMMAND
 qemu-system-ris Sl+ 1000 1000 48352 8338 101 qemu-system-riscv64 -M virt,acpi=off -accel tcg -m 4096 -serial mon:stdio -device virtio-gpu-pci -device qemu-xhci -device usb-kbd -drive if=pflash,format=raw,unit=0,file=RISCV_VIRT_CODE.fd,readonly=on -drive if=pflash,format=raw,unit=1,file=RISCV_VIRT_VARS.fd -drive file=sct.img,format=raw,if=virtio -device virtio-net-device,netdev=net0 -netdev user,id=net0
MachineType: System manufacturer System Product Name
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-6.6.0-14-generic root=/dev/mapper/vgkubuntu-root ro default_hugepagesz=1G hugepagesz=1G hugepages=4
SourcePackage: qemu
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 10/07/2023
dmi.bios.release: 5.17
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 5003
dmi.board.asset.tag: Default string
dmi.board.name: PRIME X570-PRO
dmi.board.vendor: ASUSTeK COMPUTER INC.
dmi.board.version: Rev X.0x
dmi.chassis.asset.tag: Default string
dmi.chassis.type: 3
dmi.chassis.vendor: Default string
dmi.chassis.version: Default string
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr5003:bd10/07/2023:br5.17:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKCOMPUTERINC.:rnPRIMEX570-PRO:rvrRevX.0x:cvnDefaultstring:ct3:cvrDefaultstring:skuSKU:
dmi.product.family: To be filled by O.E.M.
dmi.product.name: System Product Name
dmi.product.sku: SKU
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer

Revision history for this message
Heinrich Schuchardt (xypron) wrote :
Revision history for this message
Heinrich Schuchardt (xypron) wrote (last edit ):

The patch is also available as
https://lore.<email address hidden>/T/#u

Revision history for this message
Heinrich Schuchardt (xypron) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "0001-physmem-avoid-bounce-buffer-too-small.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Paride Legovini (paride) wrote :

Hi Heinrich,

While the patch itself is small, it's not straightforward to tell what the implications of

- l = MIN(l, TARGET_PAGE_SIZE);
+ l = MIN(l, 0x10000);

are. Also: looks like the patch has not been applied upstream yet, and there's some active discussion about it in the qemu-devel mailing list.

Given that AIUI a very specific configuration is required to trigger this bug, I think we should delay adding it as an Ubuntu delta at least until accepted upstream. Would you find this a sensible approach? Thanks!

Revision history for this message
Heinrich Schuchardt (xypron) wrote (last edit ):

Hello Paride,

the implication is only possibly increased memory usage. But the patch may not cover all cases where this error might arise.

I agree that we should watch the upstream discussion in https://lore.<email address hidden>/T/#u and see how this settles.

Best regards

Heinrich

Revision history for this message
Mitchell Dzurick (mitchdz) wrote :
Revision history for this message
Heinrich Schuchardt (xypron) wrote (last edit ):

The problem reappeared in QEMU emulator version 10.1.0 (Debian 1:10.1.0+ds-1ubuntu1)

When running the UEFI SCT I again get
qemu: virtio: bogus descriptor or out of resources
when file system tests are executed.

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

The issue seemed to be fixed after
637b0aa13956 ("softmmu: Support concurrent bounce buffers")
I need to bisect since when the issue reoccurs.

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

To make bisecting easier, this is the failing SCT test:
MediaAccessTest\BlockIOProtocolTest0\ReadBlocks_Conf

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

The problem is reproducible with upstream QEMU 9.2.4.

Changed in qemu (Ubuntu):
status: New → Triaged
To post a comment you must log in.