Message ID | 20160509171525.GA9224@potion (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
2016-05-09 19:15+0200, Radim Kr?má?: > From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= <rkrcmar@redhat.com> > Date: Mon, 9 May 2016 19:04:56 +0200 > Subject: [PATCH] intel_iommu: support all masks in interrupt entry cache > invalidation > > 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?má? <rkrcmar@redhat.com> > --- > diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c > @@ -2359,7 +2359,7 @@ static void vtd_init(IntelIOMMUState *s) > s->ecap = VTD_ECAP_QI | VTD_ECAP_IRO; > > if (ms->iommu_intr) { > - s->ecap |= VTD_ECAP_IR | VTD_ECAP_EIM; > + s->ecap |= VTD_ECAP_IR | VTD_ECAP_EIM | VTD_ECAP_MHVM; Eh, I really cannot spell ... this one should read VTD_ECAP_MHMV. (... or compile after a last-second renaming.) > diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h > @@ -186,6 +186,7 @@ > +#define VTD_ECAP_MHMV (15ULL << 20)
On Mon, May 09, 2016 at 10:37:24PM +0200, Radim Kr?má? wrote: > 2016-05-09 19:15+0200, Radim Kr?má?: > > From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= <rkrcmar@redhat.com> > > Date: Mon, 9 May 2016 19:04:56 +0200 > > Subject: [PATCH] intel_iommu: support all masks in interrupt entry cache > > invalidation > > > > 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?má? <rkrcmar@redhat.com> > > --- > > diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c > > @@ -2359,7 +2359,7 @@ static void vtd_init(IntelIOMMUState *s) > > s->ecap = VTD_ECAP_QI | VTD_ECAP_IRO; > > > > if (ms->iommu_intr) { > > - s->ecap |= VTD_ECAP_IR | VTD_ECAP_EIM; > > + s->ecap |= VTD_ECAP_IR | VTD_ECAP_EIM | VTD_ECAP_MHVM; > > Eh, I really cannot spell ... this one should read VTD_ECAP_MHMV. > (... or compile after a last-second renaming.) Thanks, Radim. If you would not mind, I'll pick this one up and put it in v7. :) -- peterx
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index d10064289551..be3647f6b006 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -2359,7 +2359,7 @@ static void vtd_init(IntelIOMMUState *s) s->ecap = VTD_ECAP_QI | VTD_ECAP_IRO; if (ms->iommu_intr) { - s->ecap |= VTD_ECAP_IR | VTD_ECAP_EIM; + s->ecap |= VTD_ECAP_IR | VTD_ECAP_EIM | VTD_ECAP_MHVM; } vtd_reset_context_cache(s); diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index 72b011492755..0829a5064f2c 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) /* CAP_REG */ /* (offset >> 4) << 24 */