qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC 3/8] ioregionfd: introduce memory API functions


From: Stefan Hajnoczi
Subject: Re: [RFC 3/8] ioregionfd: introduce memory API functions
Date: Mon, 14 Feb 2022 14:32:21 +0000

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.)

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]