qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/2] vfio: hugepage support for vfio_iommu_type1


From: Konrad Rzeszutek Wilk
Subject: Re: [Qemu-devel] [PATCH 2/2] vfio: hugepage support for vfio_iommu_type1
Date: Sat, 25 May 2013 07:20:10 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

> + * Turns out AMD IOMMU has a page table bug where it won't map large pages
> + * to a region that previously mapped smaller pages.  This should be fixed
> + * soon, so this is just a temporary workaround to break mappings down into
> + * PAGE_SIZE.  Better to map smaller pages than nothing.
> + */
> +static int map_try_harder(struct vfio_iommu *iommu, dma_addr_t iova,
> +                       unsigned long pfn, long npage, int prot)
> +{
> +     long i;
> +     int ret;
> +
> +     for (i = 0; i < npage; i++, pfn++, iova += PAGE_SIZE) {
> +             ret = iommu_map(iommu->domain, iova,
> +                             (phys_addr_t)pfn << PAGE_SHIFT,
> +                             PAGE_SIZE, prot);
> +             if (ret)
> +                     break;
> +     }
> +
> +     for (; i < npage && i > 0; i--, iova -= PAGE_SIZE)
> +             iommu_unmap(iommu->domain, iova, PAGE_SIZE);
> +
>       return ret;
>  }

This looks to belong to a vfio-quirk file (a something else) that deals with
various IOMMU's quirks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]