virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Martin Radev <martin.b.radev@gmail.com>,
	thomas.lendacky@amd.com, file@sect.tu-berlin.de,
	robert.buhren@sect.tu-berlin.de, kvm@vger.kernel.org,
	mathias.morbitzer@aisec.fraunhofer.de, joro@8bytes.org,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	iommu@lists.linux-foundation.org, robin.murphy@arm.com,
	kirill.shutemov@linux.intel.com, m.szyprowski@samsung.com
Subject: Re: [PATCH] swiotlb: Validate bounce size in the sync/unmap path
Date: Mon, 8 Feb 2021 12:14:49 -0500	[thread overview]
Message-ID: <YCFxiTB//Iz6aIhk@Konrads-MacBook-Pro.local> (raw)
In-Reply-To: <20210205175852.GA1021@lst.de>

On Fri, Feb 05, 2021 at 06:58:52PM +0100, Christoph Hellwig wrote:
> On Wed, Feb 03, 2021 at 02:36:38PM -0500, Konrad Rzeszutek Wilk wrote:
> > > So what?  If you guys want to provide a new capability you'll have to do
> > > work.  And designing a new protocol based around the fact that the
> > > hardware/hypervisor is not trusted and a copy is always required makes
> > > a lot of more sense than throwing in band aids all over the place.
> > 
> > If you don't trust the hypervisor, what would this capability be in?
> 
> Well, they don't trust the hypervisor to not attack the guest somehow,
> except through the data read.  I never really understood the concept,
> as it leaves too many holes.
> 
> But the point is that these schemes want to force bounce buffering
> because they think it is more secure.  And if that is what you want
> you better have protocol build around the fact that each I/O needs
> to use bounce buffers, so you make those buffers the actual shared
> memory use for communication, and build the protocol around it.

Right. That is what the SWIOTLB pool ends up being as it is allocated at
bootup where the guest tells the hypervisor - these are shared and
clear-text.

> E.g. you don't force the ridiculous NVMe PRP offset rules on the block
> layer, just to make a complicated swiotlb allocation that needs to
> preserve the alignment just do I/O.  But instead you have a trivial

I agree that NVMe is being silly. It could have allocated the coherent
pool and use that and do its own offset within that. That would in
essence carve out a static pool within the SWIOTLB static one..

TTM does that - it has its own DMA machinery on top of DMA API to deal
with its "passing" buffers from one application to another and the fun
of keeping track of that.

> ring buffer or whatever because you know I/O will be copied anyway
> and none of all the hard work higher layers do to make the I/O suitable
> for a normal device apply.

I lost you here. Sorry, are you saying have a simple ring protocol
(like NVME has), where the ring entries (SG or DMA phys) are statically
allocated and whenever NVME driver gets data from user-space it
would copy it in there?

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2021-02-08 17:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <X/27MSbfDGCY9WZu@martin>
2021-01-13 11:30 ` [PATCH] swiotlb: Validate bounce size in the sync/unmap path Christoph Hellwig
     [not found]   ` <YAV0uhfkimXn1izW@martin>
2021-01-18 15:14     ` Konrad Rzeszutek Wilk
     [not found]       ` <YA8O/2qBBzZo5hi7@martin>
2021-02-02 16:37         ` Konrad Rzeszutek Wilk
2021-02-02 22:34           ` Tom Lendacky
2021-02-02 23:13             ` Konrad Rzeszutek Wilk
2021-02-03 12:49     ` Christoph Hellwig
2021-02-03 19:36       ` Konrad Rzeszutek Wilk
2021-02-05 17:58         ` Christoph Hellwig
2021-02-08 17:14           ` Konrad Rzeszutek Wilk [this message]
2021-02-09  8:26             ` 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=YCFxiTB//Iz6aIhk@Konrads-MacBook-Pro.local \
    --to=konrad.wilk@oracle.com \
    --cc=file@sect.tu-berlin.de \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=martin.b.radev@gmail.com \
    --cc=mathias.morbitzer@aisec.fraunhofer.de \
    --cc=robert.buhren@sect.tu-berlin.de \
    --cc=robin.murphy@arm.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;
as well as URLs for NNTP newsgroup(s).