From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:55700 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751203AbcKIPyJ (ORCPT ); Wed, 9 Nov 2016 10:54:09 -0500 Date: Wed, 9 Nov 2016 08:53:26 -0700 From: Alex Williamson To: Ilya Lesokhin Cc: "linux-pci@vger.kernel.org" , "kvm@vger.kernel.org" , "bhelgaas@google.com" , Adi Menachem Subject: Re: Shouldn't VFIO virtualize the ATS capability? Message-ID: <20161109085326.62b47d2f@t450s.home> In-Reply-To: References: <20161106100832.41e173d5@t450s.home> <20161109080746.24dd79dd@t450s.home> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-pci-owner@vger.kernel.org List-ID: On Wed, 9 Nov 2016 15:25:16 +0000 Ilya Lesokhin wrote: > > -----Original Message----- > > From: Alex Williamson [mailto:alex.williamson@redhat.com] > > Sent: Wednesday, November 09, 2016 5:08 PM > > To: Ilya Lesokhin > > Cc: linux-pci@vger.kernel.org; kvm@vger.kernel.org; bhelgaas@google.com; > > Adi Menachem > > Subject: Re: Shouldn't VFIO virtualize the ATS capability? > > > > On Wed, 9 Nov 2016 14:49:02 +0000 > > Ilya Lesokhin wrote: > > > > > I would virtualize the "ATS Control Register". > > > > And do what? > I think it should be read only. That would violate the spec, in which case it shouldn't be virtualized, the capability should be hidden. > > > Regarding poor behavior, I couldn't really find what happens when ATS is > > misconfigured, but I would assume it can cause problems. > > > The scenarios I'm concerned about are: > > > 1. The guest enables translation caching, while the hypervisor thinks > > there are disabled -> Hypervisor won't issue invalidations. > > > > Aren't invalidations issued by the iommu, why does the hypervisor need to > > participate? How would a software entity induce an invalidation? > That's what one might expect from a sane design, but > http://lxr.free-electrons.com/source/drivers/iommu/intel-iommu.c?v=4.8#L1549 > seems to imply otherwise :( > > > > > 2. Smallest Translation Unit misconfiguration. Not sure if it will cause > > invalid access or only poor caching behavior. > > > > > > Thanks, > > > Ilya > > > > > > > -----Original Message----- > > > > From: Alex Williamson [mailto:alex.williamson@redhat.com] > > > > Sent: Sunday, November 06, 2016 7:09 PM > > > > To: Ilya Lesokhin > > > > Cc: linux-pci@vger.kernel.org; kvm@vger.kernel.org; > > > > bhelgaas@google.com > > > > Subject: Re: Shouldn't VFIO virtualize the ATS capability? > > > > > > > > On Sun, 6 Nov 2016 11:13:09 +0000 > > > > Ilya Lesokhin wrote: > > > > > > > > > Hi > > > > > I've noticed that VFIO doesn't virtualize the ATS capability. > > > > > It seems to me that translation caching and Smallest Translation > > > > > Unit is > > > > something you would want to control on the host. Am I wrong? > > > > > > > > What about those fields would we virtualize? Why does the host need > > > > to be an intermediary? Can the user induce poor behavior with > > > > direct access to them? Thanks, > > > > > > > > Alex >