kvm_mem_ioeventfd_add: error adding ioeventfd: No space left on device

Bug #1813940 reported by Darek Stojaczyk on 2019-01-30
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Undecided
Unassigned

Bug Description

Latest QEMU master fails to run with too many MMIO devices specified.

After patch 3ac7d43a6fb [1] QEMU just prints an error message and exits.
> kvm_mem_ioeventfd_add: error adding ioeventfd: No space left on device

This is reproducible e.g. with the following setup:

qemu-3.1.50-dirty \
    -machine pc-i440fx-2.7,accel=kvm \
    -cpu host -m 4096 \
    -smp 2,sockets=2,cores=1,threads=1 \
    -drive file=freebsd_vm_1.qcow2,format=qcow2,if=none,id=bootdr \
    -device ide-hd,drive=bootdr,bootindex=0 \
    -device virtio-scsi-pci,id=vc0 \
    -device virtio-scsi-pci,id=vc1 \
    -device virtio-scsi-pci,id=vc2 \
    -device virtio-scsi-pci,id=vc3 \

Running with just 3 Virtio-SCSI controllers seems to work fine, adding more than that causes the error above. Note that this is not Virtio-SCSI specific. I've also reproduced this without any Virtio devices whatsoever.

strace shows the following ioctl chain over and over:

145787 ioctl(11, KVM_UNREGISTER_COALESCED_MMIO, 0x7f60a4985410) = 0
145787 ioctl(11, KVM_UNREGISTER_COALESCED_MMIO, 0x7f60a4985410) = 0
145787 ioctl(11, KVM_REGISTER_COALESCED_MMIO, 0x7f60a49853b0) = 0
145787 ioctl(11, KVM_REGISTER_COALESCED_MMIO, 0x7f60a49853b0) = -1 ENOSPC (No space left on device)
145787 ioctl(11, KVM_REGISTER_COALESCED_MMIO, 0x7f60a49853b0) = -1 ENOSPC (No space left on device)
145787 ioctl(11, KVM_REGISTER_COALESCED_MMIO, 0x7f60a49853b0) = -1 ENOSPC (No space left on device)
145787 ioctl(11, KVM_REGISTER_COALESCED_MMIO, 0x7f60a49853b0) = -1 ENOSPC (No space left on device)
145787 ioctl(11, KVM_REGISTER_COALESCED_MMIO, 0x7f60a49853b0) = -1 ENOSPC (No space left on device)
145787 ioctl(11, KVM_REGISTER_COALESCED_MMIO, 0x7f60a49853b0) = -1 ENOSPC (No space left on device)
145787 ioctl(11, KVM_REGISTER_COALESCED_MMIO, 0x7f60a49853b0) = -1 ENOSPC (No space left on device)
145787 ioctl(11, KVM_REGISTER_COALESCED_MMIO, 0x7f60a49853b0) = -1 ENOSPC (No space left on device)

Which suggests there's some kind of MMIO region leak.

[1]
commit 3ac7d43a6fbb5d4a3d01fc9a055c218030af3727
Author: Paolo Bonzini <email address hidden>
AuthorDate: Wed Nov 28 17:28:45 2018 +0100
Commit: Paolo Bonzini <email address hidden>
CommitDate: Fri Jan 11 13:57:24 2019 +0100

    memory: update coalesced_range on transaction_commit

elmarco (marcandre-lureau) wrote :

The bug is also reproducible with virtio-9p
-fsdev local,id=r,path=/,security_model=none -device virtio-9p-pci,fsdev=r,mount_tag=r

I bisected it to the same commit.

Paolo Bonzini (bonzini) wrote :

Hmm that's not surprising because coalesced ranges were completely broken before that commit. I'll take a look.

Does this patch from Jagannathan Raman fixes it?
https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg01397.html

Changed in qemu:
status: New → Confirmed
Darek Stojaczyk (darsto) wrote :

> Does this patch from Jagannathan Raman fixes it?
> https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg01397.html

It fixes my case. Thanks

That also fixes the case I'd hit

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers