[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v9 4/9] virtio-iommu: set supported page size mask
From: |
Auger Eric |
Subject: |
Re: [PATCH v9 4/9] virtio-iommu: set supported page size mask |
Date: |
Thu, 26 Mar 2020 16:51:44 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
Hi Bharat,
On 3/23/20 9:46 AM, Bharat Bhushan wrote:
> Add optional interface to set page size mask.
> Currently this is set global configuration and not
> per endpoint.
This allows to override the page size mask per end-point?
>
> Signed-off-by: Bharat Bhushan <address@hidden>
> ---
> include/hw/virtio/virtio-iommu.h | 1 +
> hw/virtio/virtio-iommu.c | 9 +++++++++
> 2 files changed, 10 insertions(+)
>
> diff --git a/include/hw/virtio/virtio-iommu.h
> b/include/hw/virtio/virtio-iommu.h
> index 6f67f1020a..4efa09610a 100644
> --- a/include/hw/virtio/virtio-iommu.h
> +++ b/include/hw/virtio/virtio-iommu.h
> @@ -35,6 +35,7 @@ typedef struct IOMMUDevice {
> void *viommu;
> PCIBus *bus;
> int devfn;
> + uint64_t page_size_mask;
> IOMMUMemoryRegion iommu_mr;
> AddressSpace as;
> } IOMMUDevice;
> diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c
> index 4cee8083bc..a28818202c 100644
> --- a/hw/virtio/virtio-iommu.c
> +++ b/hw/virtio/virtio-iommu.c
> @@ -650,6 +650,14 @@ static gint int_cmp(gconstpointer a, gconstpointer b,
> gpointer user_data)
> return (ua > ub) - (ua < ub);
> }
>
> +static void virtio_iommu_set_page_size_mask(IOMMUMemoryRegion *mr,
> + uint64_t page_size_mask)
> +{
> + IOMMUDevice *sdev = container_of(mr, IOMMUDevice, iommu_mr);
> +
> + sdev->page_size_mask = page_size_mask;
> +}
> +
> static void virtio_iommu_device_realize(DeviceState *dev, Error **errp)
> {
> VirtIODevice *vdev = VIRTIO_DEVICE(dev);
> @@ -865,6 +873,7 @@ static void
> virtio_iommu_memory_region_class_init(ObjectClass *klass,
> IOMMUMemoryRegionClass *imrc = IOMMU_MEMORY_REGION_CLASS(klass);
>
> imrc->translate = virtio_iommu_translate;
> + imrc->iommu_set_page_size_mask = virtio_iommu_set_page_size_mask;
> }
>
> static const TypeInfo virtio_iommu_info = {
>
Thanks
Eric
- Re: [PATCH v9 1/9] hw/vfio/common: Remove error print on mmio region translation by viommu, (continued)
[PATCH v9 2/9] memory: Add interface to set iommu page size mask, Bharat Bhushan, 2020/03/23
[PATCH v9 3/9] vfio: set iommu page size as per host supported page size, Bharat Bhushan, 2020/03/23
[PATCH v9 4/9] virtio-iommu: set supported page size mask, Bharat Bhushan, 2020/03/23
- Re: [PATCH v9 4/9] virtio-iommu: set supported page size mask,
Auger Eric <=
[PATCH v9 5/9] virtio-iommu: Add iommu notifier for map/unmap, Bharat Bhushan, 2020/03/23
[PATCH v9 6/9] virtio-iommu: Call iommu notifier for attach/detach, Bharat Bhushan, 2020/03/23
[PATCH v9 7/9] virtio-iommu: add iommu replay, Bharat Bhushan, 2020/03/23
[PATCH v9 8/9] virtio-iommu: Implement probe request, Bharat Bhushan, 2020/03/23
[PATCH v9 9/9] virtio-iommu: add iommu notifier memory-region, Bharat Bhushan, 2020/03/23