[+iommu_list]

Application isn't aware of hugepage but a userspace (lower) level stack is aware of the type of memory being allocated on behalf of application, which in turn communicates w/ driver via ioctl. I'm trying to make it more agnostic by using dma_map_sg() when multiple GBs are required by application. Otherwise, I'm using dmap_map_page(). Admittedly, I'm learning these concepts/APIs for Linux along the way.

Thanks,
-am


On Sun, Dec 1, 2019 at 7:12 PM Lu Baolu <baolu.lu@linux.intel.com> wrote:
Hi,

On 12/2/19 11:00 AM, Anand Misra wrote:
> Thanks, Lu Baolu. This is the dev version we've in our company. I can
> try on a Ubuntu with a recent kernel version. Although, do you think I'm  > going in the right direction? Is it possible to have multiple hugepages
> mapped via iommu to get contiguous mapping for DMA?
>

You mentioned:

"
I'm trying to use iommu for multiple hugepages (mmap'ed by process and
pushed to driver via ioctl). The expectation is to have multiple
hugepages mapped via iommu with each huge page having an entry in iommu
(i.e. minimize table walk for DMA). Is this possible?
"

Currently huge page mapping is hidden in iommu driver according to the
iommu capability and size of map range. Why do you want to be aware of
it in driver or even application level?

Best regards,
baolu

> -am
>
>
> On Sun, Dec 1, 2019 at 6:24 PM Lu Baolu <baolu.lu@linux.intel.com
> <mailto:baolu.lu@linux.intel.com>> wrote:
>
>     Hi,
>
>     On 12/2/19 9:46 AM, Anand Misra wrote:
>      > Hello:
>      >
>      > I'm in process of adding iommu support in my driver for a PCIe
>     device.
>      > The device doesn't publish ACS/ATS via its config space. I've
>     following
>      > config:
>      >
>      > Linux cmdline: "intel-iommu=on iommu=pt
>      > vfio_iommu_type1.allow_unsafe_interrupts=1
>     pcie_acs_override=downstream"
>      > Centos kernel: 3.10.0-1062.1.2.el7.x86_64
>      >
>
>     Can you please use the latest kernel for test? 3.10 seems to be pretty
>     old and there are a lot of changes after it.
>
>     Best regards,
>     baolu
>