iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Tom Murphy <murphyt7-/Zw1syy4LHg@public.gmane.org>
To: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] Changing the AMD IOMMU API path to work in an atomic context which is necessary for any custom drivers using the IOMMU API while holding a spinlock.
Date: Sat, 25 Aug 2018 00:06:23 +0100	[thread overview]
Message-ID: <CALQxJuscr_-KmECvx031GH9pR2cdCb46t-owmrkPRZaQXCfTGw@mail.gmail.com> (raw)
In-Reply-To: <24d3f04a-e6e2-ed8f-e2bd-b38144f33f26-5wv7dgnIgG8@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 1620 bytes --]

*resending this email without a link to the kernel source to avoid spam
detection*

The reason we want this change is so we can use iommu_group's to force our
pcie devices to have the same IOMMU mappings. For legacy reasons we require
a bunch of our pcie devices to have the same address translations.

We were going to do this by using the iommu-dma api and replacing all the
existing calls to the DMA API functions in the amd driver with their
iommu-dma equivalent like in the driver: /arch/arm64/mm/dma-mapping.c:810
in kernel v4.18.5

To do this we need the map/unmap callbacks to be spinlock-safe.

On 24 August 2018 at 16:24, Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org> wrote:

> On 24/08/18 15:53, Christoph Hellwig wrote:
>
>> On Fri, Aug 24, 2018 at 02:28:49PM +0000, murphyt7-/Zw1syy4LHg@public.gmane.org wrote:
>>
>>> From: Tom Murphy <murphyt7-/Zw1syy4LHg@public.gmane.org>
>>>
>>> ---
>>>
>>> This patch allows the IOMMU API path in the AMD driver to be called from
>>> an atomic context.
>>> This is useful for anyone building a driver which needs to call the
>>> IOMMU API while holding a spinlock.
>>>
>>
>> I don't think that is a good idea.  Please point to the code in the
>> driver and we can't probably find a better solution.
>>
>
> Although IIRC the AMD driver is in fact the only one whose map/unmap
> callbacks aren't already spinlock-safe (or at least it was last time I was
> looking). Stuff like iommu-dma is already relying on this in order to
> implement streaming DMA API calls (which may be in atomic context) on top
> of the corresponding IOMMU API operations.
>
> Robin.
>

[-- Attachment #1.2: Type: text/html, Size: 2492 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  parent reply	other threads:[~2018-08-24 23:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-24 14:28 [PATCH] Changing the AMD IOMMU API path to work in an atomic context which is necessary for any custom drivers using the IOMMU API while holding a spinlock murphyt7
2018-08-24 14:53 ` Christoph Hellwig
2018-08-24 15:24   ` Robin Murphy
     [not found]     ` <24d3f04a-e6e2-ed8f-e2bd-b38144f33f26-5wv7dgnIgG8@public.gmane.org>
2018-08-24 22:51       ` Tom Murphy
     [not found]         ` <CALQxJuuWqiygrGMVjZ0j-AxBZOskoNHfdYoHEwW4Zgigqjf7kg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-08-24 22:55           ` Tom Murphy
2018-08-27  7:07             ` Christoph Hellwig
2018-08-24 23:06       ` Tom Murphy [this message]
2018-08-27  6:58       ` Christoph Hellwig
2018-09-25  9:09 ` Joerg Roedel

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=CALQxJuscr_-KmECvx031GH9pR2cdCb46t-owmrkPRZaQXCfTGw@mail.gmail.com \
    --to=murphyt7-/zw1syy4lhg@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robin.murphy-5wv7dgnIgG8@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).