[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201027115810.GH1523783@nvidia.com>
Date: Tue, 27 Oct 2020 08:58:10 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Christoph Hellwig <hch@...radead.org>
CC: Tom Lendacky <thomas.lendacky@....com>, <x86@...nel.org>,
<linux-kernel@...r.kernel.org>, <linux-arch@...r.kernel.org>,
<linux-mm@...ck.org>, <kvm@...r.kernel.org>,
Radim Kr??m???? <rkrcmar@...hat.com>,
Arnd Bergmann <arnd@...db.de>,
Matt Fleming <matt@...eblueprint.co.uk>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Andy Lutomirski <luto@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
Paolo Bonzini <pbonzini@...hat.com>,
"Alexander Potapenko" <glider@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>,
"Dmitry Vyukov" <dvyukov@...gle.com>,
Rik van Riel <riel@...hat.com>,
Larry Woodman <lwoodman@...hat.com>,
Dave Young <dyoung@...hat.com>,
Toshimitsu Kani <toshi.kani@....com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Brijesh Singh <brijesh.singh@....com>
Subject: Re: AMD SME encrpytion and PCI BAR pages to user space
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
Powered by blists - more mailing lists