linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Tomasz Figa <tfiga@chromium.org>
Cc: Christoph Hellwig <hch@lst.de>,
	Robin Murphy <robin.murphy@arm.com>,
	"open list:IOMMU DRIVERS" <iommu@lists.linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Joerg Roedel <joro@8bytes.org>, Will Deacon <will.deacon@arm.com>,
	Vineet Gupta <vgupta@synopsys.com>,
	Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>,
	Mitchel Humpherys <mitchelh@codeaurora.org>,
	Krzysztof Kozlowski <krzk@kernel.org>
Subject: Re: [RFC PATCH 4/5] iommu/dma: Export non-static functions to use in modules
Date: Thu, 6 Jul 2017 16:35:28 +0200	[thread overview]
Message-ID: <CAK8P3a0oDPL8s7XMHZw9u_PpqGLELGHSx4GaG3qbcxtjGOG3SQ@mail.gmail.com> (raw)
In-Reply-To: <CAAFQd5Dd81w3AEyWq1L5uYN2Aw1a8UW7T7gkdtD3stMV58EjfQ@mail.gmail.com>

On Thu, Jul 6, 2017 at 4:24 PM, Tomasz Figa <tfiga@chromium.org> wrote:
> On Thu, Jul 6, 2017 at 11:17 PM, Tomasz Figa <tfiga@chromium.org> wrote:
>> On Thu, Jul 6, 2017 at 11:10 PM, Christoph Hellwig <hch@lst.de> wrote:
>>> On Thu, Jul 06, 2017 at 12:09:45PM +0100, Robin Murphy wrote:
>>>> I suppose another option is to just make the IOMMU and DMA ops a
>>>> self-contained non-modular driver mirroring the VT-d/AMD-Vi IOMMUs -
>>>> AFAICS it shouldn't have to be all that tightly coupled to the IPU bus
>>>> code, the latter more or less just needs to create the appropriate IOMMU
>>>> device for the driver to find.
>>>
>>> I still haven't seen the driver code, but this seems to be best
>>> solution so far.  Given that it's not a plug in device but part of
>>> an SOC that seems perfectly acceptable to me.
>>
>> I guess that's something that could work. With its caveats of not
>> being able to avoid including the very platform specific code in a
>> generic kernel image or do any quick testing of code changes without a
>> restart, but I guess that's something one could quickly hack in their
>> own downstream (i.e. export the symbols and turn the Kconfig entry
>> into tristate).
>>
>> On the other hand, I'm yet to see any real reasons why not to export
>> those symbols. Personally I don't see anything that one wouldn't be
>> able to do in their downstream without the symbols exported in
>> mainline (one can add the exports any time or if the kernel source
>> can't be modified can just load a wrapper module that exports its own
>> symbols...)
>
> Sorry, I just realized that last sentence might sound nonsense. By
> wrapper I meant reimplementing the missing functions using some
> already exported functions I mentioned in my post to another patch
> from this series, such as __get_vm_area() and map_vm_area().

We should look at the two aspects separately: one is how to drive
the IOMMU as part of a loadable driver, the other is how to handle
DMA to uncached memory on x86. You are in an unfortunate
position of needing both, but aside from that they seem unrelated.

      Arnd

  reply	other threads:[~2017-07-06 14:35 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-05  7:12 [RFC PATCH 0/5] Fixes for loadable modules implementing DMA/IOMMU APIs Tomasz Figa
2017-07-05  7:12 ` [RFC PATCH 1/5] base: dma-mapping: Export commonly used symbols Tomasz Figa
2017-07-05 15:17   ` Christoph Hellwig
2017-07-05 15:22     ` Tomasz Figa
2017-07-05 17:20       ` Christoph Hellwig
2017-07-06  1:44         ` Tomasz Figa
2017-07-06  8:26           ` Arnd Bergmann
2017-07-06  8:34             ` Tomasz Figa
2017-07-06  8:36               ` Tomasz Figa
2017-07-06 12:23                 ` Arnd Bergmann
2017-07-06 13:31                   ` Tomasz Figa
2017-07-06 13:49                     ` Tomasz Figa
2017-07-06 14:02                       ` Arnd Bergmann
2017-07-06 14:06                         ` Tomasz Figa
2017-07-06 14:27                           ` Arnd Bergmann
2017-07-06 14:35                             ` Tomasz Figa
2017-07-06 13:56                     ` Arnd Bergmann
2017-07-05  7:12 ` [RFC PATCH 2/5] base: dma-mapping: Provide a function to look up remapped pages Tomasz Figa
2017-07-05  7:12 ` [RFC PATCH 3/5] iommu: Export non-static functions to use in modules Tomasz Figa
2017-07-05  7:12 ` [RFC PATCH 4/5] iommu/dma: " Tomasz Figa
2017-07-05 16:22   ` Robin Murphy
2017-07-06  2:25     ` Tomasz Figa
2017-07-06 11:09       ` Robin Murphy
2017-07-06 14:10         ` Christoph Hellwig
2017-07-06 14:17           ` Tomasz Figa
2017-07-06 14:24             ` Tomasz Figa
2017-07-06 14:35               ` Arnd Bergmann [this message]
2017-07-06 14:41                 ` Tomasz Figa
2017-07-05  7:12 ` [RFC PATCH 5/5] iommu/dma: Add iommu_dma_cleanup() Tomasz Figa

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=CAK8P3a0oDPL8s7XMHZw9u_PpqGLELGHSx4GaG3qbcxtjGOG3SQ@mail.gmail.com \
    --to=arnd@arndb.de \
    --cc=egtvedt@samfundet.no \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mitchelh@codeaurora.org \
    --cc=robin.murphy@arm.com \
    --cc=tfiga@chromium.org \
    --cc=vgupta@synopsys.com \
    --cc=will.deacon@arm.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 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).