From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Christoph Hellwig <hch@lst.de>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
Robin Murphy <robin.murphy@arm.com>,
linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
Michael Ellerman <mpe@ellerman.id.au>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct device
Date: Fri, 3 Apr 2020 19:38:11 +1100 [thread overview]
Message-ID: <213b0c7d-f908-b4f4-466d-6240c3622cd6@ozlabs.ru> (raw)
In-Reply-To: <a705afc5-779d-baf4-e5d2-e2da04c82743@ozlabs.ru>
On 26/03/2020 12:26, Alexey Kardashevskiy wrote:
>
>
> On 25/03/2020 19:37, Christoph Hellwig wrote:
>> On Wed, Mar 25, 2020 at 03:51:36PM +1100, Alexey Kardashevskiy wrote:
>>>>> This is for persistent memory which you can DMA to/from but yet it does
>>>>> not appear in the system as a normal memory and therefore requires
>>>>> special handling anyway (O_DIRECT or DAX, I do not know the exact
>>>>> mechanics). All other devices in the system should just run as usual,
>>>>> i.e. use 1:1 mapping if possible.
>>>>
>>>> On other systems (x86 and arm) pmem as long as it is page backed does
>>>> not require any special handling. This must be some weird way powerpc
>>>> fucked up again, and I suspect you'll have to suffer from it.
>>>
>>>
>>> It does not matter if it is backed by pages or not, the problem may also
>>> appear if we wanted for example p2p PCI via IOMMU (between PHBs) and
>>> MMIO might be mapped way too high in the system address space and make
>>> 1:1 impossible.
>>
>> How can it be mapped too high for a direct mapping with a 64-bit DMA
>> mask?
>
> The window size is limited and often it is not even sparse. It requires
> an 8 byte entry per an IOMMU page (which is most commonly is 64k max) so
> 1TB limit (a guest RAM size) is a quite real thing. MMIO is mapped to
> guest physical address space outside of this 1TB (on PPC).
>
>
I am trying now this approach on top of yours "dma-bypass.3" (it is
"wip", needs an upper boundary check):
https://github.com/aik/linux/commit/49d73c7771e3f6054804f6cfa80b4e320111662d
Do you see any serious problem with this approach? Thanks!
--
Alexey
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2020-04-03 8:38 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-20 14:16 generic DMA bypass flag v2 Christoph Hellwig
2020-03-20 14:16 ` [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct device Christoph Hellwig
2020-03-20 15:02 ` Greg Kroah-Hartman
2020-03-23 1:28 ` Alexey Kardashevskiy
2020-03-23 8:37 ` Christoph Hellwig
2020-03-23 8:50 ` Christoph Hellwig
2020-03-23 15:37 ` Aneesh Kumar K.V
2020-03-23 17:22 ` Christoph Hellwig
2020-03-24 3:05 ` Alexey Kardashevskiy
2020-03-24 6:30 ` Aneesh Kumar K.V
2020-03-24 7:55 ` Christoph Hellwig
2020-03-24 7:54 ` Christoph Hellwig
2020-03-25 4:51 ` Alexey Kardashevskiy
2020-03-25 8:37 ` Christoph Hellwig
2020-03-26 1:26 ` Alexey Kardashevskiy
2020-04-03 8:38 ` Alexey Kardashevskiy [this message]
2020-04-06 11:50 ` Christoph Hellwig
2020-04-06 13:25 ` Alexey Kardashevskiy
2020-04-06 17:17 ` Christoph Hellwig
2020-04-07 10:12 ` Alexey Kardashevskiy
2020-04-14 6:21 ` Alexey Kardashevskiy
2020-04-14 6:30 ` Christoph Hellwig
2020-03-23 8:58 ` Alexey Kardashevskiy
2020-03-23 17:20 ` Christoph Hellwig
2020-03-24 3:37 ` Alexey Kardashevskiy
2020-03-24 4:55 ` Alexey Kardashevskiy
2020-03-24 7:52 ` Christoph Hellwig
2020-03-23 12:14 ` Robin Murphy
2020-03-23 12:55 ` Christoph Hellwig
2020-03-20 14:16 ` [PATCH 2/2] powerpc: use the generic dma_ops_bypass mode Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2019-11-13 13:37 generic DMA bypass flag Christoph Hellwig
2019-11-13 13:37 ` [PATCH 1/2] dma-mapping: add a dma_ops_bypass flag to struct device Christoph Hellwig
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=213b0c7d-f908-b4f4-466d-6240c3622cd6@ozlabs.ru \
--to=aik@ozlabs.ru \
--cc=aneesh.kumar@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=robin.murphy@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).