Received: from eggs.gnu.org ([2001:4830:134:3::10]:49105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byV43-0008EH-3q for qemu-devel@nongnu.org; Sun, 23 Oct 2016 22:32:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byV3z-0006mz-U7 for qemu-devel@nongnu.org; Sun, 23 Oct 2016 22:32:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33164) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1byV3z-0006mU-OL for qemu-devel@nongnu.org; Sun, 23 Oct 2016 22:32:35 -0400 References: <1476719064-9242-1-git-send-email-bd.aviv@gmail.com> <1476719064-9242-2-git-send-email-bd.aviv@gmail.com> <20161021194729.ext66dum4l2ao3si@redhat.com> From: Jason Wang Message-ID: <3e6278c7-6832-3275-c300-be8de2bafe55@redhat.com> Date: Mon, 24 Oct 2016 10:32:27 +0800 MIME-Version: 1.0 In-Reply-To: <20161021194729.ext66dum4l2ao3si@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 RESEND 1/3] IOMMU: add option to enable VTD_CAP_CM to vIOMMU capility exposoed to guest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Jan Kiszka , "Aviv B.D" , Alex Williamson , qemu-devel@nongnu.org, Peter Xu On 2016=E5=B9=B410=E6=9C=8822=E6=97=A5 03:47, Michael S. Tsirkin wrote: > On Fri, Oct 21, 2016 at 03:14:00PM +0800, Jason Wang wrote: >> > >> > >> >On 2016=E5=B9=B410=E6=9C=8817=E6=97=A5 23:44, Aviv B.D wrote: >>> > >From: "Aviv Ben-David" >>> > > >>> > >This capability asks the guest to invalidate cache before each map= operation. >>> > >We can use this invalidation to trap map operations in the hypervi= sor. >>> > > >>> > >Signed-off-by: Aviv Ben-David >>> > >--- >>> > > hw/i386/intel_iommu.c | 5 +++++ >>> > > hw/i386/intel_iommu_internal.h | 1 + >>> > > include/hw/i386/intel_iommu.h | 2 ++ >>> > > 3 files changed, 8 insertions(+) >> > >> >As I asked in previous version, this may not be sufficient. >> > >> >CM requires to cache fault translations which is not implemented in t= his >> >patch. > I'm not sure why would there be a requirement to cache > fault information. Cache can always be invalidated for > any reason, in particular an empty cache is always OK. s/requires/may/. But what did here is "don't". Isn't this an obvious=20 violation? Empty cache only work if we don't implement an real IOTLB but traverse=20 the IO page tables each time. > >> >Guest can easily notice this kind of spec violation. > How? > I guess this may do the detection: 1) map iova A to be non-present. 2) invalidate iova A 3) access iova A 4) map iova A to addr B 5) access iova A A correct implemented CM may meet fault in step 5, but with this patch,=20 we don't.