[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210604155016.GR1002214@nvidia.com>
Date: Fri, 4 Jun 2021 12:50:16 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: Alex Williamson <alex.williamson@...hat.com>,
"Tian, Kevin" <kevin.tian@...el.com>,
Jean-Philippe Brucker <jean-philippe@...aro.org>,
"Jiang, Dave" <dave.jiang@...el.com>,
"Raj, Ashok" <ashok.raj@...el.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
Jonathan Corbet <corbet@....net>,
Robin Murphy <robin.murphy@....com>,
LKML <linux-kernel@...r.kernel.org>,
"iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
David Gibson <david@...son.dropbear.id.au>,
Kirti Wankhede <kwankhede@...dia.com>,
David Woodhouse <dwmw2@...radead.org>,
Jason Wang <jasowang@...hat.com>
Subject: Re: [RFC] /dev/ioasid uAPI proposal
On Fri, Jun 04, 2021 at 05:40:34PM +0200, Paolo Bonzini wrote:
> On 04/06/21 17:26, Alex Williamson wrote:
> > Let's make sure the KVM folks are part of this decision; a re-cap for
> > them, KVM currently automatically enables wbinvd emulation when
> > potentially non-coherent devices are present which is determined solely
> > based on the IOMMU's (or platform's, as exposed via the IOMMU) ability
> > to essentially force no-snoop transactions from a device to be cache
> > coherent. This synchronization is triggered via the kvm-vfio device,
> > where QEMU creates the device and adds/removes vfio group fd
> > descriptors as an additionally layer to prevent the user from enabling
> > wbinvd emulation on a whim.
> >
> > IIRC, this latter association was considered a security/DoS issue to
> > prevent a malicious guest/userspace from creating a disproportionate
> > system load.
> >
> > Where would KVM stand on allowing more direct userspace control of
> > wbinvd behavior? Would arbitrary control be acceptable or should we
> > continue to require it only in association to a device requiring it for
> > correct operation.
>
> Extending the scenarios where WBINVD is not a nop is not a problem for me.
> If possible I wouldn't mind keeping the existing kvm-vfio connection via the
> device, if only because then the decision remains in the VFIO camp (whose
> judgment I trust more than mine on this kind of issue).
Really the question to answer is what "security proof" do you want
before the wbinvd can be enabled
1) User has access to a device that can issue no-snoop TLPS
2) User has access to an IOMMU that can not block no-snoop (today)
3) Require CAP_SYS_RAW_IO
4) Anyone
#1 is an improvement because it allows userspace to enable wbinvd and
no-snoop optimizations based on user choice
#2 is where we are today and wbinvd effectively becomes a fixed
platform choice. Userspace has no say
#3 is "there is a problem, but not so serious, root is powerful
enough to override"
#4 is "there is no problem here"
Jason
Powered by blists - more mailing lists