On 04/04/2013 04:38:44 PM, Yoder Stuart-B08248 wrote:
> > /*
> > * VFIO_PAMU_MAP_MSI_BANK
> > *
> > * Maps the MSI bank at the specified index and iova. User space
must
> > * call this ioctl once for each MSI bank (count of banks is
returned by
> > * VFIO_IOMMU_GET_MSI_BANK_COUNT).
> > * Caller provides struct vfio_pamu_msi_bank_map with all fields
set.
> > * Operates on VFIO file descriptor (/dev/vfio/vfio).
> > * Return: 0 on success, -errno on failure
> > */
> >
> > struct vfio_pamu_msi_bank_map {
> > __u32 argsz;
> > __u32 msi_bank_index; /* the index of the MSI bank */
> > __u64 iova; /* the iova the bank is to be mapped
to */
> > };
>
> Again, flags. If we dynamically add or remove devices from a
container
> the bank count can change, right? If bank count goes from 2 to 3,
does
> userspace know assume the new bank is [2]? If bank count goes from
3 to
> 2, which index was that? If removing a device removes an MSI bank
then
> vfio-pamu will automatically do the unmap, right?
My assumption is that the bank count returned by
VFIO_IOMMU_GET_MSI_BANK_COUNT
is the max bank count for a platform. (number will mostly likely
always be
3 or 4). So it won't change as devices are added or removed.
It should be the actual number of banks used. This is required if
we're going to have userspace do the iteration and specify the exact
iovas to use -- and even if we aren't going to do that, it would be
more restrictive on available iova-space than is necessary. Usually
there will be only one bank in the group.
Actually mapping all of the MSI banks, all the time, would completely
negate the point of using the separate alias pages.
-Scott
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html