On Mon, Feb 07, 2022 at 11:22:17PM -0800, Elena Ufimtseva wrote: > @@ -2434,6 +2569,42 @@ void memory_region_clear_flush_coalesced(MemoryRegion > *mr) > > static bool userspace_eventfd_warning; > > +void memory_region_add_ioregionfd(MemoryRegion *mr, > + hwaddr addr, > + unsigned size, > + uint64_t data,
uint64_t data is vague and can be confused with ioeventfd's match data
field. QEMU tends to use void *opaque, but following the ioregionfd
kernel API's naming would be fine too: uint64_t user_data.
> + int fd,
> + bool pio)
> +{
> + MemoryRegionIoregionfd mriofd = {
> + .addr.start = int128_make64(addr),
> + .addr.size = int128_make64(size),
> + .data = data,
> + .fd = fd,
> + };
> + unsigned i;
> +
> + if (kvm_enabled() && !kvm_ioregionfds_enabled()) {
> + error_report("KVM does not support KVM_CAP_IOREGIONFD");
> + }
Is this a fatal error?
QEMU should have a userspace ioregionfd implementation for
compatibility. That allows ioregionfd to be tested without running in
KVM mode. (This is how ioeventfd support works in QEMU.)
signature.asc
Description: PGP signature
