All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: Steve Sistare <steven.sistare@oracle.com>,
	"Tian, Kevin" <kevin.tian@intel.com>,
	kvm@vger.kernel.org, Cornelia Huck <cohuck@redhat.com>
Subject: Re: [PATCH V4 0/5] fixes for virtual address update
Date: Thu, 15 Dec 2022 10:25:11 -0400	[thread overview]
Message-ID: <Y5suR/nBlxnfJY0n@nvidia.com> (raw)
In-Reply-To: <20221214144229.43c8348d.alex.williamson@redhat.com>

On Wed, Dec 14, 2022 at 02:42:29PM -0700, Alex Williamson wrote:
> On Wed, 14 Dec 2022 13:24:52 -0800
> Steve Sistare <steven.sistare@oracle.com> wrote:
> 
> > Fix bugs in the interfaces that allow the underlying memory object of an
> > iova range to be mapped in a new address space.  They allow userland to
> > indefinitely block vfio mediated device kernel threads, and do not
> > propagate the locked_vm count to a new mm.
> > 
> > The fixes impose restrictions that eliminate waiting conditions, so
> > revert the dead code:
> >   commit 898b9eaeb3fe ("vfio/type1: block on invalid vaddr")
> >   commit 487ace134053 ("vfio/type1: implement notify callback")
> >   commit ec5e32940cc9 ("vfio: iommu driver notify callback")
> > 
> > Changes in V2 (thanks Alex):
> >   * do not allow group attach while vaddrs are invalid
> >   * add patches to delete dead code
> >   * add WARN_ON for never-should-happen conditions
> >   * check for changed mm in unmap.
> >   * check for vfio_lock_acct failure in remap
> > 
> > Changes in V3 (ditto!):
> >   * return errno at WARN_ON sites, and make it unique
> >   * correctly check for dma task mm change
> >   * change dma owner to current when vaddr is updated
> >   * add Fixes to commit messages
> >   * refactored new code in vfio_dma_do_map
> > 
> > Changes in V4:
> >   * misc cosmetic changes
> > 
> > Steve Sistare (5):
> >   vfio/type1: exclude mdevs from VFIO_UPDATE_VADDR
> >   vfio/type1: prevent locked_vm underflow
> >   vfio/type1: revert "block on invalid vaddr"
> >   vfio/type1: revert "implement notify callback"
> >   vfio: revert "iommu driver notify callback"
> > 
> >  drivers/vfio/container.c        |   5 -
> >  drivers/vfio/vfio.h             |   7 --
> >  drivers/vfio/vfio_iommu_type1.c | 199 +++++++++++++++++++---------------------
> >  include/uapi/linux/vfio.h       |  15 +--
> >  4 files changed, 103 insertions(+), 123 deletions(-)
> > 
> 
> Looks ok to me.  Jason, Kevin, I'd appreciate your reviews regarding
> whether this sufficiently addresses the outstanding issues to keep this
> interface around until we have a re-implementation in iommufd.  Thanks,

Well, patch 3 undeniably solves the deadlock problem.

I still don't like that we are keeping this, an interface that doesn't
support mdevs has no future and can't really be used in any general
purpose way.

Can we at least protect it with a kconfig && CONFIG_EXPERIMENTAL so it
is disabled in most builds?

Jason

  reply	other threads:[~2022-12-15 14:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-14 21:24 [PATCH V4 0/5] fixes for virtual address update Steve Sistare
2022-12-14 21:24 ` [PATCH V4 1/5] vfio/type1: exclude mdevs from VFIO_UPDATE_VADDR Steve Sistare
2022-12-15  4:34   ` Tian, Kevin
2022-12-15 14:32     ` Steven Sistare
2022-12-14 21:24 ` [PATCH V4 2/5] vfio/type1: prevent locked_vm underflow Steve Sistare
2022-12-15  4:52   ` Tian, Kevin
2022-12-15 14:33     ` Steven Sistare
2022-12-15 14:20   ` Jason Gunthorpe
2022-12-15 14:38     ` Steven Sistare
2022-12-15 15:03       ` Jason Gunthorpe
2022-12-14 21:24 ` [PATCH V4 3/5] vfio/type1: revert "block on invalid vaddr" Steve Sistare
2022-12-14 21:24 ` [PATCH V4 4/5] vfio/type1: revert "implement notify callback" Steve Sistare
2022-12-14 21:24 ` [PATCH V4 5/5] vfio: revert "iommu driver " Steve Sistare
2022-12-14 21:42 ` [PATCH V4 0/5] fixes for virtual address update Alex Williamson
2022-12-15 14:25   ` Jason Gunthorpe [this message]
2022-12-15 18:37     ` Alex Williamson
  -- strict thread matches above, loose matches on Subject: below --
2022-12-15 21:53 Steve Sistare
2022-12-15 21:56 ` Steven Sistare

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=Y5suR/nBlxnfJY0n@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=steven.sistare@oracle.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.