From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751499AbdCBKW3 (ORCPT ); Thu, 2 Mar 2017 05:22:29 -0500 Received: from foss.arm.com ([217.140.101.70]:57204 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750768AbdCBKW2 (ORCPT ); Thu, 2 Mar 2017 05:22:28 -0500 Subject: Re: [PATCH 2/2] vfio: type1: conditionally check MSI remapping at irq domain level To: Mian Yousaf Kaukab , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, alex.williamson@redhat.com References: <20170302100132.20502-1-yousaf.kaukab@suse.com> <20170302100132.20502-2-yousaf.kaukab@suse.com> Cc: eric.auger@redhat.com, will.deacon@arm.com From: Marc Zyngier Organization: ARM Ltd Message-ID: <7b46ae99-8800-2c90-fd72-054aef877106@arm.com> Date: Thu, 2 Mar 2017 10:19:54 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170302100132.20502-2-yousaf.kaukab@suse.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/03/17 10:01, Mian Yousaf Kaukab wrote: > Check only if irq domains are available. > > Signed-off-by: Mian Yousaf Kaukab > --- > drivers/vfio/vfio_iommu_type1.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c > index bd6f293c4ebd..e3ed50e40ead 100644 > --- a/drivers/vfio/vfio_iommu_type1.c > +++ b/drivers/vfio/vfio_iommu_type1.c > @@ -1287,8 +1287,9 @@ static int vfio_iommu_type1_attach_group(void *iommu_data, > INIT_LIST_HEAD(&domain->group_list); > list_add(&group->next, &domain->group_list); > > - msi_remap = resv_msi ? irq_domain_check_msi_remap() : > - iommu_capable(bus, IOMMU_CAP_INTR_REMAP); > + msi_remap = resv_msi && IS_ENABLED(CONFIG_IRQ_DOMAIN) ? Now, that seems completely overkill in the light of your previous patch. Why do we need this at all? > + irq_domain_check_msi_remap() : > + iommu_capable(bus, IOMMU_CAP_INTR_REMAP); > > if (!allow_unsafe_interrupts && !msi_remap) { > pr_warn("%s: No interrupt remapping support. Use the module param \"allow_unsafe_interrupts\" to enable VFIO IOMMU support on this platform\n", > Thanks, M. -- Jazz is not dead. It just smells funny...