Re: [RFC PATCH 0/7] vfio: Add alias region uapi for device feature
From: Mahmoud Nagy Adam
Date: Mon Oct 27 2025 - 14:20:25 EST
David Matlack <dmatlack@xxxxxxxxxx> writes:
> On Wed, Sep 24, 2025 at 7:11 AM Mahmoud Adam <mngyadam@xxxxxxxxx> wrote:
>>
>> This RFC proposes a new uapi VFIO DEVICE_FEATURE to create per-region
>> aliases with selectable attributes, initially enabling write-combine
>> (WC) where supported by the underlying region. The goal is to expose a
>> UAPI for userspace to request an alias of an existing VFIO region with
>> extra flags, then interact with it via a stable alias index through
>> existing ioctls and mmap where applicable.
>
> Would it make sense to build this on top of Leon's dma-buf series [1]?
> My understanding is that dma-buf can support mmap, so WC could just be
> a property attached to a dma-buf fd and passed by userspace via
> VFIO_DEVICE_FEATURE_DMA_BUF. Then VFIO wouldn't have to create or
> manage region aliases.
>
The motivation for this proposal is that it would integrate seamlessly
with DPDK. I haven’t yet investigated the new dma-buf series as a
solution, but my initial impression is that it doesn’t fit well with
DPDK’s existing model.
Enabling write-combine with dma-buf was also proposed here[1] and I
agree that’s a generally good idea and fits naturally with dma-buf. I
think it would be valuable to support WC with both region aliasing and
dma-buf, But maybe Alex have a different opinion on that.
[1]: https://lore.kernel.org/kvm/20250918214425.2677057-1-amastro@xxxxxx/
> Apologies if this has already been discussed, I did not go through all
> the past discussion.
>
> [1] https://lore.kernel.org/kvm/72ecaa13864ca346797e342d23a7929562788148.1760368250.git.leon@xxxxxxxxxx/
Thanks,
MNAdam
Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christian Schlaeger
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597