Si-Wei Liu
2023-Sep-09 13:31 UTC
[PATCH RFC v2 1/4] vdpa: introduce .reset_map operation callback
On-chip IOMMU parent driver could use it to restore memory mapping to the initial state. Signed-off-by: Si-Wei Liu <si-wei.liu at oracle.com> --- include/linux/vdpa.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index 17a4efa..daecf55 100644 --- a/include/linux/vdpa.h +++ b/include/linux/vdpa.h @@ -324,6 +324,12 @@ struct vdpa_map_file { * @iova: iova to be unmapped * @size: size of the area * Returns integer: success (0) or error (< 0) + * @reset_map: Reset device memory mapping (optional) + * Needed for device that using device + * specific DMA translation (on-chip IOMMU) + * @vdev: vdpa device + * @asid: address space identifier + * Returns integer: success (0) or error (< 0) * @get_vq_dma_dev: Get the dma device for a specific * virtqueue (optional) * @vdev: vdpa device @@ -401,6 +407,7 @@ struct vdpa_config_ops { u64 iova, u64 size, u64 pa, u32 perm, void *opaque); int (*dma_unmap)(struct vdpa_device *vdev, unsigned int asid, u64 iova, u64 size); + int (*reset_map)(struct vdpa_device *vdev, unsigned int asid); int (*set_group_asid)(struct vdpa_device *vdev, unsigned int group, unsigned int asid); struct device *(*get_vq_dma_dev)(struct vdpa_device *vdev, u16 idx); -- 1.8.3.1
Jason Wang
2023-Sep-11 03:42 UTC
[PATCH RFC v2 1/4] vdpa: introduce .reset_map operation callback
Hi Si-Wei: On Sat, Sep 9, 2023 at 9:34?PM Si-Wei Liu <si-wei.liu at oracle.com> wrote:> > On-chip IOMMU parent driver could use it to restore memory mapping > to the initial state.As discussed before. On-chip IOMMU is the hardware details that need to be hidden by the vDPA bus. Exposing this will complicate the implementation of bus drivers. Thanks> > Signed-off-by: Si-Wei Liu <si-wei.liu at oracle.com> > --- > include/linux/vdpa.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h > index 17a4efa..daecf55 100644 > --- a/include/linux/vdpa.h > +++ b/include/linux/vdpa.h > @@ -324,6 +324,12 @@ struct vdpa_map_file { > * @iova: iova to be unmapped > * @size: size of the area > * Returns integer: success (0) or error (< 0) > + * @reset_map: Reset device memory mapping (optional) > + * Needed for device that using device > + * specific DMA translation (on-chip IOMMU) > + * @vdev: vdpa device > + * @asid: address space identifier > + * Returns integer: success (0) or error (< 0) > * @get_vq_dma_dev: Get the dma device for a specific > * virtqueue (optional) > * @vdev: vdpa device > @@ -401,6 +407,7 @@ struct vdpa_config_ops { > u64 iova, u64 size, u64 pa, u32 perm, void *opaque); > int (*dma_unmap)(struct vdpa_device *vdev, unsigned int asid, > u64 iova, u64 size); > + int (*reset_map)(struct vdpa_device *vdev, unsigned int asid); > int (*set_group_asid)(struct vdpa_device *vdev, unsigned int group, > unsigned int asid); > struct device *(*get_vq_dma_dev)(struct vdpa_device *vdev, u16 idx); > -- > 1.8.3.1 >