From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37060) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b57Tk-0001TK-AD for qemu-devel@nongnu.org; Tue, 24 May 2016 04:14:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b57Tg-0007Rl-4D for qemu-devel@nongnu.org; Tue, 24 May 2016 04:14:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b57Tf-0007Rb-V0 for qemu-devel@nongnu.org; Tue, 24 May 2016 04:14:12 -0400 References: <1463847590-22782-1-git-send-email-bd.aviv@gmail.com> <1463847590-22782-2-git-send-email-bd.aviv@gmail.com> From: Jason Wang Message-ID: <57440D4C.2070303@redhat.com> Date: Tue, 24 May 2016 16:14:04 +0800 MIME-Version: 1.0 In-Reply-To: <1463847590-22782-2-git-send-email-bd.aviv@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 1/3] IOMMU: add VTD_CAP_CM to vIOMMU capability exposed to guest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Aviv B.D" , qemu-devel@nongnu.org Cc: Jan Kiszka , Alex Williamson , Peter Xu , "Michael S. Tsirkin" On 2016=E5=B9=B405=E6=9C=8822=E6=97=A5 00:19, Aviv B.D wrote: > From: "Aviv Ben-David" > > This flag tells the guest to invalidate tlb cache also after unmap oper= ations. > > Signed-off-by: Aviv Ben-David > --- Is this a guest visible behavior? If yes, shouldn't we cache=20 translation fault conditions in IOTLB? > hw/i386/intel_iommu.c | 3 ++- > hw/i386/intel_iommu_internal.h | 1 + > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c > index 347718f..1af8da8 100644 > --- a/hw/i386/intel_iommu.c > +++ b/hw/i386/intel_iommu.c > @@ -1949,7 +1949,8 @@ static void vtd_init(IntelIOMMUState *s) > s->iq_last_desc_type =3D VTD_INV_DESC_NONE; > s->next_frcd_reg =3D 0; > s->cap =3D VTD_CAP_FRO | VTD_CAP_NFR | VTD_CAP_ND | VTD_CAP_MGAW = | > - VTD_CAP_SAGAW | VTD_CAP_MAMV | VTD_CAP_PSI | VTD_CAP_SLLP= S; > + VTD_CAP_SAGAW | VTD_CAP_MAMV | VTD_CAP_PSI | VTD_CAP_SLLP= S | > + VTD_CAP_CM; > s->ecap =3D VTD_ECAP_QI | VTD_ECAP_IRO; > =20 > vtd_reset_context_cache(s); > diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_inter= nal.h > index e5f514c..ae40f73 100644 > --- a/hw/i386/intel_iommu_internal.h > +++ b/hw/i386/intel_iommu_internal.h > @@ -190,6 +190,7 @@ > #define VTD_CAP_MAMV (VTD_MAMV << 48) > #define VTD_CAP_PSI (1ULL << 39) > #define VTD_CAP_SLLPS ((1ULL << 34) | (1ULL << 35)) > +#define VTD_CAP_CM (1ULL << 7) > =20 > /* Supported Adjusted Guest Address Widths */ > #define VTD_CAP_SAGAW_SHIFT 8