[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y66gTtjZf5ZT0lP0@gondor.apana.org.au>
Date: Fri, 30 Dec 2022 16:24:46 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Rijo Thomas <Rijo-john.Thomas@....com>
Cc: Jeremi Piotrowski <jpiotrowski@...ux.microsoft.com>,
Tom Lendacky <thomas.lendacky@....com>,
John Allen <john.allen@....com>,
"David S . Miller" <davem@...emloft.net>,
Sumit Semwal <sumit.semwal@...aro.org>,
Christian König <christian.koenig@....com>,
linux-kernel@...r.kernel.org, linux-crypto@...r.kernel.org,
linux-media@...r.kernel.org, dri-devel@...ts.freedesktop.org,
linaro-mm-sig@...ts.linaro.org,
Mythri PK <Mythri.Pandeshwarakrishna@....com>,
Jeshwanth <JESHWANTHKUMAR.NK@....com>,
Devaraj Rangasamy <Devaraj.Rangasamy@....com>,
stable@...r.kernel.org, Jens Wiklander <jens.wiklander@...aro.org>
Subject: Re: [PATCH v2] crypto: ccp - Allocate TEE ring and cmd buffer using
DMA APIs
On Fri, Dec 23, 2022 at 05:45:24PM +0530, Rijo Thomas wrote:
>
> > dma_alloc_coherent memory is just as contiguous as __get_free_pages, and
> > calling dma_alloc_coherent from a guest does not guarantee that the memory is
> > contiguous in host memory either. The memory would look contiguous from the
> > device point of view thanks to the IOMMU though (in both cases). So this is not
> > about being contiguous but other properties that you might rely on (dma mask
> > most likely, or coherent if you're not running this on x86?).
> >
> > Can you confirm why this fixes things and update the comment to reflect that.
>
> I see what you are saying.
>
> We verified this in Xen Dom0 PV guest, where dma_alloc_coherent() returned a memory
> that is contiguous in machine address space, and the machine address was returned
> in the dma handle (buf->dma).
So is this even relevant to the mainstream kernel or is this patch
only needed for Xen Dom0?
Thanks,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists