From: Julien Grall <julien.grall@arm.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Arnd Bergmann <arnd@arndb.de>,
Robin Murphy <robin.murphy@arm.com>,
Juergen Gross <jgross@suse.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Mike Rapoport <rppt@linux.ibm.com>,
"open list:IOMMU DRIVERS" <iommu@lists.linux-foundation.org>,
Joerg Roedel <jroedel@suse.de>,
xen-devel <xen-devel@lists.xenproject.org>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Marek Szyprowski <m.szyprowski@samsung.com>
Subject: Re: [Xen-devel] [PATCH] Revert "swiotlb: remove SWIOTLB_MAP_ERROR"
Date: Fri, 8 Mar 2019 17:25:57 +0000 [thread overview]
Message-ID: <124f4e49-9eb1-99d9-35f4-c2ef3dff8415@arm.com> (raw)
In-Reply-To: <20190308152355.GA20230@lst.de>
Hi Christoph,
On 08/03/2019 15:23, Christoph Hellwig wrote:
> On Tue, Mar 05, 2019 at 09:41:46AM +0000, Julien Grall wrote:
>> On Xen, dma_addr_t will always be 64-bit while the phys_addr_t will depend
>> on the MMU type. So we may have phys_addr_t smaller than dma_addr_t from
>> the kernel point of view.
>
> How can dma_addr_t on arm have value > 32-bit when physical
> addresses are 32-bit only?
The number of platform with IOMMU protected all DMA-capable device is not yet
there. So we decided to not require IOMMU for Dom0. Instead, its memory is be
directly mapped (i.e guest physical address == host physical address) and will
always be below 4GB to cater the short page table case.
In the common case, Dom0 also contains the PV backend drivers. Those drivers may
directly use the guest buffer in the DMA request (so a copy is avoided). To
avoid using a bounce buffer too much, xen-swiotlb will find the host physical
address associated to the guest buffer and will use it to compute the DMA address.
While Dom0 kernel may only deal with 32-bit physical address, the hypervisor can
still deal with up to 40-bit physical address. This means the guest memory can
be allocated above the 4GB threshold. Hence why the dma_addr_t is always 64-bit
with CONFIG_XEN=y.
Cheers,
--
Julien Grall
next prev parent reply other threads:[~2019-03-08 17:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-04 19:59 Arnd Bergmann
2019-03-04 22:00 ` Konrad Rzeszutek Wilk
2019-03-04 23:56 ` Robin Murphy
2019-03-05 8:16 ` Arnd Bergmann
2019-03-05 9:41 ` [Xen-devel] " Julien Grall
2019-03-08 15:23 ` Christoph Hellwig
2019-03-08 17:25 ` Julien Grall [this message]
2019-03-13 18:32 ` Christoph Hellwig
2019-03-13 19:44 ` Arnd Bergmann
2019-03-05 9:36 ` Julien Grall
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=124f4e49-9eb1-99d9-35f4-c2ef3dff8415@arm.com \
--to=julien.grall@arm.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=boris.ostrovsky@oracle.com \
--cc=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=jgross@suse.com \
--cc=jroedel@suse.de \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=robin.murphy@arm.com \
--cc=rppt@linux.ibm.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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
Powered by JetHome