All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Tom Lendacky <thomas.lendacky@amd.com>, <x86@kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-arch@vger.kernel.org>,
	<linux-mm@kvack.org>, <kvm@vger.kernel.org>,
	Radim Kr??m???? <rkrcmar@redhat.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Matt Fleming <matt@codeblueprint.co.uk>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Andy Lutomirski <luto@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"Alexander Potapenko" <glider@google.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Dmitry Vyukov" <dvyukov@google.com>,
	Rik van Riel <riel@redhat.com>,
	Larry Woodman <lwoodman@redhat.com>,
	Dave Young <dyoung@redhat.com>,
	Toshimitsu Kani <toshi.kani@hpe.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Brijesh Singh <brijesh.singh@amd.com>
Subject: Re: AMD SME encrpytion and PCI BAR pages to user space
Date: Tue, 27 Oct 2020 08:58:10 -0300	[thread overview]
Message-ID: <20201027115810.GH1523783@nvidia.com> (raw)
In-Reply-To: <20201027084357.GA10053@infradead.org>

On Tue, Oct 27, 2020 at 08:43:57AM +0000, Christoph Hellwig wrote:
> On Wed, Oct 21, 2020 at 01:03:22PM -0300, Jason Gunthorpe wrote:
> > Oh, interesting.. Yes the issue is no userspace DMA stuff uses the DMA
> > API correctly (because it is in userspace)
> > 
> > So SWIOTLB tricks don't work, I wish the dma_map could fail for these
> > situations
> 
> Userspace DMA by definition also does not use dma_map..

? Sure it does, ib_dma_map_sg_attrs() is what RDMA uses

What all the userspace users skip is the dma_sync*() - that would
require a kernel call which defeats the point.

So, my desire is some flag to dma_map_sg() that says
  'user space mapping no dma_sync_*'

ie dma_sync_* is a NOP

Then things like SWIOTLB on the SEV system can fail with an error code
instead of malfunctioning

If FOLL_LONGERM is some estimate of this pattern then we have these users:
 - drivers/infiniband
 - v4l
 - vdpa
 - xdp
 - rds
 - habana labs

Jason

      reply	other threads:[~2020-10-27 11:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 15:25 AMD SME encrpytion and PCI BAR pages to user space Jason Gunthorpe
2020-10-19 16:36 ` Tom Lendacky
2020-10-19 17:00   ` Jason Gunthorpe
2020-10-19 17:11     ` Tom Lendacky
2020-10-19 17:25       ` Jason Gunthorpe
2020-10-21 11:59   ` Jason Gunthorpe
2020-10-21 15:30     ` Tom Lendacky
2020-10-21 16:03       ` Jason Gunthorpe
2020-10-27  8:43         ` Christoph Hellwig
2020-10-27 11:58           ` Jason Gunthorpe [this message]

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=20201027115810.GH1523783@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=arnd@arndb.de \
    --cc=aryabinin@virtuozzo.com \
    --cc=bp@alien8.de \
    --cc=brijesh.singh@amd.com \
    --cc=dvyukov@google.com \
    --cc=dyoung@redhat.com \
    --cc=glider@google.com \
    --cc=hch@infradead.org \
    --cc=hpa@zytor.com \
    --cc=konrad.wilk@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@kernel.org \
    --cc=lwoodman@redhat.com \
    --cc=matt@codeblueprint.co.uk \
    --cc=mingo@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=riel@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=toshi.kani@hpe.com \
    --cc=x86@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.