oracle / qemu

QEMU git Oracle repository
Other
22 stars 20 forks source link

KVM error when QEMU adds duplicate region #9

Open tmakatos opened 3 years ago

tmakatos commented 3 years ago

@john-johnson-git QEMU seems to be adding duplicate regions and KVM doesn't like it:

qemu-system-x86_64: kvm_set_user_memory_region: KVM_SET_USER_MEMORY_REGION failed, slot=10, start=0xfebd1000, size=0x1000: File exists

VFIO trace:

vfio_listener_region_add_ram region_add [ram] 0xfebd1000 - 0xfebd1fff [0x7fa916d1c000]
vfio_listener_region_add_skip SKIPPING region_add 0xfebd0000 - 0xfebd0fff
vfio_listener_region_add_ram region_add [ram] 0xfebd1000 - 0xfebd1fff [0x7fa916d1c000]

See https://github.com/nutanix/libvfio-user/issues/439.

tmakatos commented 3 years ago

I can consistently reproduce this using the SPDK NVMe controller (https://review.spdk.io/gerrit/c/spdk/spdk/+/7617/14) as the vfio-user device and migrating a VM (-enable kvm -cpu host is required). This may be related to https://lists.gnu.org/archive/html/qemu-devel/2021-07/msg04194.html

tmakatos commented 3 years ago

Need to retest with branch https://github.com/oracle/qemu/tree/vfio-user-rfc1.1.

changpe1 commented 3 years ago

Need to retest with branch https://github.com/oracle/qemu/tree/vfio-user-rfc1.1.

I tested this branch and didn't reproduce this issue, before this commit it can happen very frequently by rebooting a VM.

tmakatos commented 3 years ago

Thanks @changpe1 , I should check to see whether it fixes the migration repro.