Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752380AbcDRLbZ (ORCPT ); Mon, 18 Apr 2016 07:31:25 -0400 Received: from smtp-out4.electric.net ([192.162.216.187]:53797 "EHLO smtp-out4.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751552AbcDRLbY (ORCPT ); Mon, 18 Apr 2016 07:31:24 -0400 From: David Laight To: "'Yongji Xie'" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-pci@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "iommu@lists.linux-foundation.org" , "linux-doc@vger.kernel.org" CC: "alistair@popple.id.au" , "nikunj@linux.vnet.ibm.com" , "zhong@linux.vnet.ibm.com" , "eric.auger@linaro.org" , "aik@ozlabs.ru" , "joro@8bytes.org" , "will.deacon@arm.com" , "gwshan@linux.vnet.ibm.com" , "warrier@linux.vnet.ibm.com" , "alex.williamson@redhat.com" , "paulus@samba.org" , "bhelgaas@google.com" Subject: RE: [RFC v6 06/10] PCI: Add a new PCI_BUS_FLAGS_MSI_REMAP flag Thread-Topic: [RFC v6 06/10] PCI: Add a new PCI_BUS_FLAGS_MSI_REMAP flag Thread-Index: AQHRmWH9gp+qYPLOEEqQKgRiMdJvzJ+PltVw Date: Mon, 18 Apr 2016 11:30:07 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6D5F4A45A8@AcuExch.aculab.com> References: <1460977120-29367-1-git-send-email-xyjxie@linux.vnet.ibm.com> In-Reply-To: <1460977120-29367-1-git-send-email-xyjxie@linux.vnet.ibm.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-Outbound-IP: 213.249.233.130 X-Env-From: David.Laight@ACULAB.COM X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u3IBVTVo019650 Content-Length: 1120 Lines: 28 From: Yongji Xie > Sent: 18 April 2016 11:59 > We introduce a new pci_bus_flags, PCI_BUS_FLAGS_MSI_REMAP > which indicates all devices on the bus are protected by the > hardware which supports IRQ remapping(intel naming). > > This flag will be used to know whether it's safe to expose > MSI-X tables of PCI BARs to userspace. Because the capability > of IRQ remapping can guarantee the PCI device cannot trigger > MSIs that correspond to interrupt IDs of other devices. I'm worried that this entire series is going to break drivers for existing hardware. I understand some of the reasoning for 'vm pass through' configurations, but there will be PCIe devices out there that have the MSI-X tables in the same BAR as other device registers. If you are lucky nothing else is in the same 4k area, but I wouldn't assume it. In any case, if the hardware can't police the card's master transfers there is nothing to stop a different bus master block on the card from raising MSI-X interrupts - they are just a PCIe write. So all you are doing is raising the bar slightly and giving a very false sense of security. David