kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Alex Williamson <alex.williamson@redhat.com>,
	Cornelia Huck <cohuck@redhat.com>,
	iommu@lists.linux.dev, Kevin Tian <kevin.tian@intel.com>,
	kvm@vger.kernel.org, Yi Liu <yi.l.liu@intel.com>
Subject: Re: [PATCH v3] vfio: Support VFIO_NOIOMMU with iommufd
Date: Mon, 30 Jan 2023 14:28:54 -0400	[thread overview]
Message-ID: <Y9gMZmvFDOW5LaWv@nvidia.com> (raw)
In-Reply-To: <0-v3-480cd64a16f7+1ad0-iommufd_noiommu_jgg@nvidia.com>

On Wed, Jan 18, 2023 at 01:50:28PM -0400, Jason Gunthorpe wrote:
> Add a small amount of emulation to vfio_compat to accept the SET_IOMMU to
> VFIO_NOIOMMU_IOMMU and have vfio just ignore iommufd if it is working on a
> no-iommu enabled device.
> 
> Move the enable_unsafe_noiommu_mode module out of container.c into
> vfio_main.c so that it is always available even if VFIO_CONTAINER=n.
> 
> This passes Alex's mini-test:
> 
> https://github.com/awilliam/tests/blob/master/vfio-noiommu-pci-device-open.c
> 
> Reviewed-by: Kevin Tian <kevin.tian@intel.com>
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> ---
>  drivers/iommu/iommufd/Kconfig           |   2 +-
>  drivers/iommu/iommufd/iommufd_private.h |   2 +
>  drivers/iommu/iommufd/vfio_compat.c     | 105 +++++++++++++++++++-----
>  drivers/vfio/Kconfig                    |   2 +-
>  drivers/vfio/container.c                |   7 --
>  drivers/vfio/group.c                    |   7 +-
>  drivers/vfio/iommufd.c                  |  19 ++++-
>  drivers/vfio/vfio.h                     |   8 +-
>  drivers/vfio/vfio_main.c                |   7 ++
>  include/linux/iommufd.h                 |  12 ++-
>  10 files changed, 136 insertions(+), 35 deletions(-)
> 
> v3:
>  - Missed kdoc
>  - Incorrect indent
>  - Consolidate duplicate code into vfio_device_is_noiommu()
> v2: https://lore.kernel.org/r/0-v2-568c93fef076+5a-iommufd_noiommu_jgg@nvidia.com
>  - Passes Alex's test
>  - Fix a spelling error for s/CONFIG_VFIO_NO_IOMMU/CONFIG_VFIO_NOIOMMU/
>  - Prevent type1 mode from being requested and prevent a compat IOAS from being
>    auto created with an additional context global trap door flag
>  - Make it so VFIO_CONTAINER=n still creates the module option and related machinery
>  - Comment updates
> v1: https://lore.kernel.org/all/0-v1-5cde901db21d+661fe-iommufd_noiommu_jgg@nvidia.com
> 
> Alex, if you are good with this can you ack it and I'll send you a PR. Yi will
> need to rebase his series on top of it.

Alex are we OK?

Jason

  parent reply	other threads:[~2023-01-30 18:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18 17:50 [PATCH v3] vfio: Support VFIO_NOIOMMU with iommufd Jason Gunthorpe
2023-01-18 18:58 ` Alex Williamson
2023-01-19 14:10   ` Jason Gunthorpe
2023-01-30 18:28 ` Jason Gunthorpe [this message]
2023-01-30 19:29   ` Alex Williamson
2023-02-03 19:58     ` Jason Gunthorpe

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=Y9gMZmvFDOW5LaWv@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=iommu@lists.linux.dev \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=yi.l.liu@intel.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 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).