From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNZfJ-0003le-F5 for qemu-devel@nongnu.org; Thu, 14 Jul 2016 01:58:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNZfF-0003Bm-Bv for qemu-devel@nongnu.org; Thu, 14 Jul 2016 01:58:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNZfF-0003Bh-6c for qemu-devel@nongnu.org; Thu, 14 Jul 2016 01:58:25 -0400 From: Peter Xu Date: Thu, 14 Jul 2016 13:56:34 +0800 Message-Id: <1468475796-7397-26-git-send-email-peterx@redhat.com> In-Reply-To: <1468475796-7397-1-git-send-email-peterx@redhat.com> References: <1468475796-7397-1-git-send-email-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v12 25/27] intel_iommu: support all masks in interrupt entry cache invalidation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: imammedo@redhat.com, rth@twiddle.net, ehabkost@redhat.com, jasowang@redhat.com, marcel@redhat.com, mst@redhat.com, pbonzini@redhat.com, jan.kiszka@web.de, rkrcmar@redhat.com, alex.williamson@redhat.com, wexu@redhat.com, davidkiarie4@gmail.com, peterx@redhat.com From: Radim Kr=C4=8Dm=C3=A1=C5=99 Linux guests do not gracefully handle cases when the invalidation mask they wanted is not supported, probably because real hardware always allowed all. We can just say that all 16 masks are supported, because both ioapic_iec_notifier and kvm_update_msi_routes_all invalidate all caches. Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 --- hw/i386/intel_iommu.c | 2 +- hw/i386/intel_iommu_internal.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index d7d30a7..00e6682 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -2364,7 +2364,7 @@ static void vtd_init(IntelIOMMUState *s) s->ecap =3D VTD_ECAP_QI | VTD_ECAP_IRO; =20 if (x86_iommu->intr_supported) { - s->ecap |=3D VTD_ECAP_IR | VTD_ECAP_EIM; + s->ecap |=3D VTD_ECAP_IR | VTD_ECAP_EIM | VTD_ECAP_MHMV; } =20 vtd_reset_context_cache(s); diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_interna= l.h index 72b0114..0829a50 100644 --- a/hw/i386/intel_iommu_internal.h +++ b/hw/i386/intel_iommu_internal.h @@ -186,6 +186,7 @@ /* Interrupt Remapping support */ #define VTD_ECAP_IR (1ULL << 3) #define VTD_ECAP_EIM (1ULL << 4) +#define VTD_ECAP_MHMV (15ULL << 20) =20 /* CAP_REG */ /* (offset >> 4) << 24 */ --=20 2.4.11