From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org ([63.228.1.57]:48470 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751423AbdGZLfH (ORCPT ); Wed, 26 Jul 2017 07:35:07 -0400 Message-ID: <1501068839.2792.27.camel@kernel.crashing.org> Subject: Re: [PATCH kernel v4 4/6] iommu: Set PCI_BUS_FLAGS_MSI_REMAP on iommu driver initialization From: Benjamin Herrenschmidt To: Joerg Roedel , Alexey Kardashevskiy Cc: Bjorn Helgaas , Robin Murphy , "kvm@vger.kernel.org" , David Gibson , Alex Williamson , Yongji Xie , Eric Auger , Yongji Xie , "open list:INTEL IOMMU (VT-d)" , Jike Song , Paul Mackerras , linux-pci Date: Wed, 26 Jul 2017 21:33:59 +1000 In-Reply-To: <20170726095053.GG15833@8bytes.org> References: <20170630052436.15212-1-aik@ozlabs.ru> <20170630052436.15212-5-aik@ozlabs.ru> <20170726095053.GG15833@8bytes.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org List-ID: On Wed, 2017-07-26 at 11:50 +0200, Joerg Roedel wrote: > > 3. Create IOMMU_DOMAIN_UNMANAGED IOMMU domains for PPC64/powernv IOMMU > > groups and only define capable() hook to report IOMMU_CAP_INTR_REMAP; > > others already use these IOMMU domains. VFIO-PCI's mmap() hook could then > > check the capability via iommu_capable(bus). The problems is as Robin said: > > "iommu_capable() is a fundamentally broken and unworkable interface > > anyway"; however it is still not clear to me why it is unworkable in this > > particular case of isolation checking. > > That one is wrong, IRQ remapping is not a property of a domain. A domain > is an abstraction for a device address space. Attaching IRQ information > there is just wrong. Except it somewhat is ... an MSI is a store in the device address space, the way MSIs are handled and/or filtered can be considered a property of the domain. In our case, it's the exact same piece of HW that defines domains and which MSIs they are allowed to generate. Cheers, Ben.