Re: [RFC PATCH 0/9] vfio: Introduce mmap maple tree

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

 



The last email was a draft sent by mistake. This is the full version.

Alex Williamson <alex.williamson@xxxxxxxxxx> writes:

> Currently we have a struct vfio_pci_region stored in an array that we
> dynamically resize for device specific regions and the offset is
> determined statically from the array index.  We could easily specify an
> offset and alias field on that object if we wanted to make the address
> space more compact (without a maple tree) and facilitate multiple
> regions referencing the same device resource.  This is all just
> implementation decisions.  We also don't need to support read/write on
> new regions, we could have them exist advertising only mmap support via
> REGION_INFO, which simplifies and is consistent with the existing API.
>

What I understand is that you’re proposing an API to create a new
region.  The user would then fetch a new index and use it with
REGION_INFO to obtain the pgoff.  This feels like adding another layer
on top of the pgoff, while the end goal remains the same.

I'm not sure an alias region offers more value than simply creating an
alias pgoff.  It may even be more confusing, since—AFAIU—users expect
indexes to align with PCI BAR indexes in the PCI case.  We would also
need either a new API or an additional REGION_INFO member to tell the
user which index the alias refers to and what extra attributes it has.

Ultimately, both approaches are very similar: one creates a full alias
region, the other just a pgoff alias, but both would require nearly the
same internal implementation for pgoff handling.

The key question is: does a full region alias provide any tangible
benefits over a pgoff alias?

In my opinion, it’s clearer to simply have the user call e.g
REQUEST_REGION_MMAP (which returns a pgoff for mmap) rather than request
full region creation.

- MNAdam



Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux