All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jordan Crouse <jcrouse@codeaurora.org>
To: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Cc: iommu@lists.linux-foundation.org, joro@8bytes.org,
	linux-pci@vger.kernel.org, alex.williamson@redhat.com,
	Jonathan.Cameron@huawei.com, jacob.jun.pan@linux.intel.com,
	christian.koenig@amd.com, eric.auger@redhat.com,
	kevin.tian@intel.com, yi.l.liu@intel.com, andrew.murray@arm.com,
	will.deacon@arm.com, robin.murphy@arm.com, ashok.raj@intel.com,
	baolu.lu@linux.intel.com, xuzaibo@huawei.com,
	liguozhu@hisilicon.com, okaya@codeaurora.org,
	bharatku@xilinx.com, ilias.apalodimas@linaro.org,
	shunyong.yang@hxt-semitech.com
Subject: Re: [RFC PATCH v3 10/10] iommu/sva: Add support for private PASIDs
Date: Wed, 17 Oct 2018 09:07:52 -0600	[thread overview]
Message-ID: <20181017150751.GF4751@jcrouse-lnx.qualcomm.com> (raw)
In-Reply-To: <3e1b58bb-eb16-5855-2922-2b15b37ba971@arm.com>

On Wed, Oct 17, 2018 at 03:21:43PM +0100, Jean-Philippe Brucker wrote:
> Hi Jordan,
> 
> On 12/10/2018 15:32, Jordan Crouse wrote:
> > On Thu, Sep 20, 2018 at 06:00:46PM +0100, Jean-Philippe Brucker wrote:
> >> Provide an API for allocating PASIDs and populating them manually. To ease
> >> cleanup and factor allocation code, reuse the io_mm structure for private
> >> PASID. Private io_mm has a NULL mm_struct pointer, and cannot be bound to
> >> multiple devices. The mm_alloc() IOMMU op must now check if the mm
> >> argument is NULL, in which case it should allocate io_pgtables instead of
> >> binding to an mm.
> >>
> >> Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
> >> Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
> >> ---
> >> Sadly this probably won't be the final thing. The API in this patch is
> >> used like this:
> >>
> >>         iommu_sva_alloc_pasid(dev, &io_mm) -> PASID
> >>         iommu_sva_map(io_mm, ...)
> >>         iommu_sva_unmap(io_mm, ...)
> >>         iommu_sva_free_pasid(dev, io_mm)
> >>
> >> The proposed API for auxiliary domains is in an early stage but might
> >> replace this patch and could be used like this:
> >>
> >>         iommu_enable_aux_domain(dev)
> >>         d = iommu_domain_alloc()
> >>         iommu_attach_aux(dev, d)
> >>         iommu_aux_id(d) -> PASID
> >>         iommu_map(d, ...)
> >>         iommu_unmap(d, ...)
> >>         iommu_detach_aux(dev, d)
> >>         iommu_domain_free(d)
> >>
> >> The advantage being that the driver doesn't have to use a special
> >> version of map/unmap/etc.
> >
> > Hi Jean-Phillippe -
> >
> > Have you thought about this any more? I want to send out a
> > refresh for the per-context pagetables for arm-smmu so if we want to change
> > the underlying assumptions this would be a great time.
> >
> > For my part I'm okay with either model. In fact the second one is closer
> > to the original implementation that I sent out so I have a clear development
> > path in mind for either option depending on what the community decides.
> 
> We'll probably go with the second model. I'm trying to make the latest
> version work with SMMUv3
> (https://lwn.net/ml/linux-kernel/20181012051632.26064-1-baolu.lu@linux.intel.com/)
> and I'd like to send an RFC soon

Okay. When you do, I'll try to add the v2 code and make it work with the Adreno
GPU.

Jordan

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

WARNING: multiple messages have this Message-ID (diff)
From: Jordan Crouse <jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: Jean-Philippe Brucker
	<jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
Cc: kevin.tian-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	ashok.raj-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	ilias.apalodimas-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	will.deacon-5wv7dgnIgG8@public.gmane.org,
	alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	liguozhu-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org,
	robin.murphy-5wv7dgnIgG8@public.gmane.org,
	christian.koenig-5C7GfCeVMHo@public.gmane.org
Subject: Re: [RFC PATCH v3 10/10] iommu/sva: Add support for private PASIDs
Date: Wed, 17 Oct 2018 09:07:52 -0600	[thread overview]
Message-ID: <20181017150751.GF4751@jcrouse-lnx.qualcomm.com> (raw)
In-Reply-To: <3e1b58bb-eb16-5855-2922-2b15b37ba971-5wv7dgnIgG8@public.gmane.org>

On Wed, Oct 17, 2018 at 03:21:43PM +0100, Jean-Philippe Brucker wrote:
> Hi Jordan,
> 
> On 12/10/2018 15:32, Jordan Crouse wrote:
> > On Thu, Sep 20, 2018 at 06:00:46PM +0100, Jean-Philippe Brucker wrote:
> >> Provide an API for allocating PASIDs and populating them manually. To ease
> >> cleanup and factor allocation code, reuse the io_mm structure for private
> >> PASID. Private io_mm has a NULL mm_struct pointer, and cannot be bound to
> >> multiple devices. The mm_alloc() IOMMU op must now check if the mm
> >> argument is NULL, in which case it should allocate io_pgtables instead of
> >> binding to an mm.
> >>
> >> Signed-off-by: Jordan Crouse <jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> >> Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
> >> ---
> >> Sadly this probably won't be the final thing. The API in this patch is
> >> used like this:
> >>
> >>         iommu_sva_alloc_pasid(dev, &io_mm) -> PASID
> >>         iommu_sva_map(io_mm, ...)
> >>         iommu_sva_unmap(io_mm, ...)
> >>         iommu_sva_free_pasid(dev, io_mm)
> >>
> >> The proposed API for auxiliary domains is in an early stage but might
> >> replace this patch and could be used like this:
> >>
> >>         iommu_enable_aux_domain(dev)
> >>         d = iommu_domain_alloc()
> >>         iommu_attach_aux(dev, d)
> >>         iommu_aux_id(d) -> PASID
> >>         iommu_map(d, ...)
> >>         iommu_unmap(d, ...)
> >>         iommu_detach_aux(dev, d)
> >>         iommu_domain_free(d)
> >>
> >> The advantage being that the driver doesn't have to use a special
> >> version of map/unmap/etc.
> >
> > Hi Jean-Phillippe -
> >
> > Have you thought about this any more? I want to send out a
> > refresh for the per-context pagetables for arm-smmu so if we want to change
> > the underlying assumptions this would be a great time.
> >
> > For my part I'm okay with either model. In fact the second one is closer
> > to the original implementation that I sent out so I have a clear development
> > path in mind for either option depending on what the community decides.
> 
> We'll probably go with the second model. I'm trying to make the latest
> version work with SMMUv3
> (https://lwn.net/ml/linux-kernel/20181012051632.26064-1-baolu.lu-VuQAYsv1563Yd54FQh9/CA@public.gmane.org/)
> and I'd like to send an RFC soon

Okay. When you do, I'll try to add the v2 code and make it work with the Adreno
GPU.

Jordan

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  parent reply	other threads:[~2018-10-17 15:08 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20 17:00 [PATCH v3 00/10] Shared Virtual Addressing for the IOMMU Jean-Philippe Brucker
2018-09-20 17:00 ` Jean-Philippe Brucker
2018-09-20 17:00 ` [PATCH v3 01/10] iommu: Introduce Shared Virtual Addressing API Jean-Philippe Brucker
2018-09-20 17:00   ` Jean-Philippe Brucker
     [not found]   ` <20180920170046.20154-2-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2018-09-23  2:39     ` Lu Baolu
2018-09-24 12:07       ` Jean-Philippe Brucker
2018-09-24 12:07         ` Jean-Philippe Brucker
2018-09-25 13:16       ` Joerg Roedel
2018-09-25 13:16         ` Joerg Roedel
2018-09-25 22:46         ` Jacob Pan
2018-09-25 22:46           ` Jacob Pan
2018-09-26 10:14           ` Jean-Philippe Brucker
2018-09-26 10:14             ` Jean-Philippe Brucker
2018-09-26 12:48           ` Joerg Roedel
2018-09-26 12:48             ` Joerg Roedel
2018-09-20 17:00 ` [PATCH v3 02/10] iommu/sva: Bind process address spaces to devices Jean-Philippe Brucker
2018-09-20 17:00   ` Jean-Philippe Brucker
2018-09-23  3:05   ` Lu Baolu
2018-09-23  3:05     ` Lu Baolu
2018-09-24 12:07     ` Jean-Philippe Brucker
2018-09-24 12:07       ` Jean-Philippe Brucker
2018-09-26 18:01       ` Jacob Pan
2018-09-26 18:01         ` Jacob Pan
2018-09-27 15:06         ` Jean-Philippe Brucker
2018-09-27 15:06           ` Jean-Philippe Brucker
2018-09-28  1:14           ` Tian, Kevin
2018-09-28  1:14             ` Tian, Kevin
2018-09-20 17:00 ` [PATCH v3 03/10] iommu/sva: Manage process address spaces Jean-Philippe Brucker
2018-09-20 17:00   ` Jean-Philippe Brucker
2018-09-25  3:15   ` Lu Baolu
2018-09-25  3:15     ` Lu Baolu
2018-09-25 10:32     ` Jean-Philippe Brucker
2018-09-25 10:32       ` Jean-Philippe Brucker
2018-09-26  3:12       ` Lu Baolu
2018-09-26  3:12         ` Lu Baolu
2018-09-25 13:26     ` Joerg Roedel
2018-09-25 13:26       ` Joerg Roedel
2018-09-25 23:33       ` Lu Baolu
2018-09-25 23:33         ` Lu Baolu
2018-09-26 10:20         ` Jean-Philippe Brucker
2018-09-26 10:20           ` Jean-Philippe Brucker
2018-09-26 12:45           ` Joerg Roedel
2018-09-26 12:45             ` Joerg Roedel
2018-09-26 13:50             ` Jean-Philippe Brucker
2018-09-26 13:50               ` Jean-Philippe Brucker
2018-09-27  3:22               ` Liu, Yi L
2018-09-27  3:22                 ` Liu, Yi L
2018-09-27 13:37                 ` Jean-Philippe Brucker
2018-09-27 13:37                   ` Jean-Philippe Brucker
2018-10-08  8:29                   ` Liu, Yi L
2018-10-08  8:29                     ` Liu, Yi L
2018-09-26 22:58             ` Jacob Pan
2018-09-26 22:58               ` Jacob Pan
2018-09-26 22:35   ` Jacob Pan
2018-09-26 22:35     ` Jacob Pan
2018-10-03 17:52     ` Jean-Philippe Brucker
2018-10-03 17:52       ` Jean-Philippe Brucker
2018-10-15 20:53       ` Jacob Pan
2018-10-15 20:53         ` Jacob Pan
2018-09-20 17:00 ` [PATCH v3 04/10] iommu/sva: Add a mm_exit callback for device drivers Jean-Philippe Brucker
2018-09-20 17:00   ` Jean-Philippe Brucker
2018-09-20 17:00 ` [PATCH v3 05/10] iommu/sva: Track mm changes with an MMU notifier Jean-Philippe Brucker
2018-09-20 17:00   ` Jean-Philippe Brucker
2018-09-20 17:00 ` [PATCH v3 06/10] iommu/sva: Search mm by PASID Jean-Philippe Brucker
2018-09-20 17:00   ` Jean-Philippe Brucker
2018-09-25  4:59   ` Lu Baolu
2018-09-25  4:59     ` Lu Baolu
2018-09-20 17:00 ` [PATCH v3 07/10] iommu: Add a page fault handler Jean-Philippe Brucker
2018-09-20 17:00   ` Jean-Philippe Brucker
2018-09-27 20:37   ` Jacob Pan
2018-09-27 20:37     ` Jacob Pan
2018-10-03 17:46     ` Jean-Philippe Brucker
2018-10-03 17:46       ` Jean-Philippe Brucker
2018-09-20 17:00 ` [PATCH v3 08/10] iommu/iopf: Handle mm faults Jean-Philippe Brucker
2018-09-20 17:00   ` Jean-Philippe Brucker
2018-09-20 17:00 ` [PATCH v3 09/10] iommu/sva: Register page fault handler Jean-Philippe Brucker
2018-09-20 17:00   ` Jean-Philippe Brucker
2018-09-20 17:00 ` [RFC PATCH v3 10/10] iommu/sva: Add support for private PASIDs Jean-Philippe Brucker
2018-09-20 17:00   ` Jean-Philippe Brucker
2018-10-12 14:32   ` Jordan Crouse
2018-10-12 14:32     ` Jordan Crouse
2018-10-17 14:21     ` Jean-Philippe Brucker
2018-10-17 14:21       ` Jean-Philippe Brucker
2018-10-17 14:24       ` Jean-Philippe Brucker
2018-10-17 14:24         ` Jean-Philippe Brucker
2018-10-17 15:07       ` Jordan Crouse [this message]
2018-10-17 15:07         ` Jordan Crouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181017150751.GF4751@jcrouse-lnx.qualcomm.com \
    --to=jcrouse@codeaurora.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=alex.williamson@redhat.com \
    --cc=andrew.murray@arm.com \
    --cc=ashok.raj@intel.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=bharatku@xilinx.com \
    --cc=christian.koenig@amd.com \
    --cc=eric.auger@redhat.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jacob.jun.pan@linux.intel.com \
    --cc=jean-philippe.brucker@arm.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=liguozhu@hisilicon.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=okaya@codeaurora.org \
    --cc=robin.murphy@arm.com \
    --cc=shunyong.yang@hxt-semitech.com \
    --cc=will.deacon@arm.com \
    --cc=xuzaibo@huawei.com \
    --cc=yi.l.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.