public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Ashish Kalra <ashish.kalra@amd.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Tom Lendacky <thomas.lendacky@amd.com>,
	Halil Pasic <pasic@linux.ibm.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, Cornelia Huck <cohuck@redhat.com>,
	linux-s390@vger.kernel.org, Michael Mueller <mimu@linux.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Janosch Frank <frankja@linux.ibm.com>,
	Ram Pai <linuxram@us.ibm.com>,
	Thiago Jung Bauermann <bauerman@linux.ibm.com>,
	Andy Lutomirski <luto@kernel.org>,
	Brijesh Singh <brijesh.singh@amd.com>
Subject: Re: [PATCH 1/1] virtio_ring: fix return code on DMA mapping fails
Date: Fri, 29 Nov 2019 01:57:55 +0000	[thread overview]
Message-ID: <20191129015730.GA13084@ashkalra_ubuntu_server> (raw)
In-Reply-To: <20191128070538.GB20274@lst.de>

On Thu, Nov 28, 2019 at 08:05:38AM +0100, Christoph Hellwig wrote:
> On Thu, Nov 28, 2019 at 12:42:25AM +0000, Ashish Kalra wrote:
> > Why can't we leverage CMA instead of SWIOTLB for DMA when SEV is
> > enabled, CMA is well integerated with the DMA subsystem and handles
> > encrypted pages when force_dma_unencrypted() returns TRUE. 
> > 
> > Though, CMA might face the same issues as SWIOTLB bounce buffers, it's
> > size is similarly setup statically as SWIOTLB does or can be set as a 
> > percentage of the available system memory.
> 
> How is CMA integrated with SEV?  CMA just gives a contiguous chunk
> of memory, which still needs to be remapped as unencrypted before
> returning it to the user.

Looking at the implementation, i see that CMA is accessible using
dma_alloc_coherent() and the buffer allocated by dma_alloc_coherent()
either using the CMA or the page allocator, will be marked/tagged as
unencrypted and returned to the user.

But for dma_map_xx() interfaces, the memory will need be remapped as
unencrypted memory (as you mentioned).

Thanks,
Ashish

  reply	other threads:[~2019-11-29  1:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-14 12:46 [PATCH 1/1] virtio_ring: fix return code on DMA mapping fails Halil Pasic
2019-11-19 11:10 ` Halil Pasic
2019-11-19 13:04   ` Michael S. Tsirkin
2019-11-22 13:08     ` Halil Pasic
2019-11-23 15:39       ` Tom Lendacky
2019-11-26 18:45         ` Christoph Hellwig
2019-11-28  0:42           ` Ashish Kalra
2019-11-28  7:05             ` Christoph Hellwig
2019-11-29  1:57               ` Ashish Kalra [this message]
2019-11-29 14:09           ` Halil Pasic

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=20191129015730.GA13084@ashkalra_ubuntu_server \
    --to=ashish.kalra@amd.com \
    --cc=bauerman@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=brijesh.singh@amd.com \
    --cc=cohuck@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=hch@lst.de \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linuxram@us.ibm.com \
    --cc=luto@kernel.org \
    --cc=mimu@linux.ibm.com \
    --cc=mst@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=thomas.lendacky@amd.com \
    --cc=virtualization@lists.linux-foundation.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