All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Peter Xu <peterx@redhat.com>, Cornelia Huck <cohuck@redhat.com>,
	<kvm@vger.kernel.org>,
	Alex Williamson <alex.williamson@redhat.com>
Subject: Re: [PATCH] vfio-pci: Use io_remap_pfn_range() for PCI IO memory
Date: Mon, 16 Nov 2020 19:20:33 -0400	[thread overview]
Message-ID: <20201116232033.GR917484@nvidia.com> (raw)
In-Reply-To: <02bd74bb-b672-da91-aae7-6364c4bf555f@amd.com>

On Mon, Nov 16, 2020 at 03:43:53PM -0600, Tom Lendacky wrote:
> On 11/16/20 9:53 AM, Jason Gunthorpe wrote:
> > On Thu, Nov 05, 2020 at 06:39:49PM -0500, Peter Xu wrote:
> >> On Thu, Nov 05, 2020 at 12:34:58PM -0400, Jason Gunthorpe wrote:
> >>> Tom says VFIO device assignment works OK with KVM, so I expect only things
> >>> like DPDK to be broken.
> >>
> >> Is there more information on why the difference?  Thanks,
> > 
> > I have nothing, maybe Tom can explain how it works?
> 
> IIUC, the main differences would be along the lines of what is performing
> the mappings or who is performing the MMIO.
> 
> For device passthrough using VFIO, the guest kernel is the one that ends
> up performing the MMIO in kernel space with the proper encryption mask
> (unencrypted).

The question here is why does VF assignment work if the MMIO mapping
in the hypervisor is being marked encrypted.

It sounds like this means the page table in the hypervisor is ignored,
and it works because the VM's kernel marks the guest's page table as
non-encrypted?

> I'm not familiar with how DPDK really works other than it is userspace
> based and uses polling drivers, etc. So it all depends on how everything
> gets mapped and by whom. For example, using mmap() to get a mapping to
> something that should be mapped unencrypted will be an issue since the
> userspace mappings are created encrypted. 

It is the same as the rdma stuff, DPDK calls mmap against VFIO which
calls remap_pfn and creates encrypted mappings

> Extending mmap() to be able to specify a new flag, maybe
> MAP_UNENCRYPTED, might be something to consider.
 
Not sure how this makes sense here, the kernel knows the should not be
encrypted..

Jason

  reply	other threads:[~2020-11-16 23:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 16:34 [PATCH] vfio-pci: Use io_remap_pfn_range() for PCI IO memory Jason Gunthorpe
2020-11-05 23:39 ` Peter Xu
2020-11-16 15:53   ` Jason Gunthorpe
2020-11-16 21:43     ` Tom Lendacky
2020-11-16 23:20       ` Jason Gunthorpe [this message]
2020-11-17 15:33         ` Tom Lendacky
2020-11-17 15:54           ` Alex Williamson
2020-11-17 16:37             ` Tom Lendacky
2020-11-17 17:07               ` Jason Gunthorpe
2020-11-17 17:10                 ` Tom Lendacky
2020-11-17 15:57           ` Peter Xu
2020-11-17 16:34             ` Tom Lendacky
2020-11-17 18:17               ` Peter Xu
2020-11-26 20:13                 ` Jason Gunthorpe
2020-11-30 14:34                   ` Tom Lendacky
2020-11-30 15:34                     ` Alex Williamson

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=20201116232033.GR917484@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=peterx@redhat.com \
    --cc=thomas.lendacky@amd.com \
    /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.