From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com ([134.134.136.31]:22334 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728075AbeGPVLr (ORCPT ); Mon, 16 Jul 2018 17:11:47 -0400 From: Ashok Raj To: Alex Williamson , iommu@lists.linux-foundation.org Cc: Ashok Raj , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Joerg Roedel , Bjorn Helgaas , Gage Eads Subject: [PATCH] x86/pci: Some buggy virtual functions incorrectly report 1 for intx. Date: Mon, 16 Jul 2018 13:42:25 -0700 Message-Id: <1531773745-41876-1-git-send-email-ashok.raj@intel.com> Sender: stable-owner@vger.kernel.org List-ID: PCI_INTERRUPT_PIN should always read 0 for SRIOV Virtual Functions. Some SRIOV devices have some bugs in RTL and VF's end up reading 1 instead of 0 for the PIN. We could enforce it by default in vfio_pci_nointx. Reported-by: Gage Eads Tested-by: Gage Eads Signed-off-by: Ashok Raj Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Cc: iommu@lists.linux-foundation.org Cc: Joerg Roedel Cc: Bjorn Helgaas Cc: Gage Eads --- drivers/vfio/pci/vfio_pci.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index b423a30..bc3f4fa 100644 --- a/drivers/vfio/pci/vfio_pci.c +++ b/drivers/vfio/pci/vfio_pci.c @@ -192,6 +192,13 @@ static void vfio_pci_disable(struct vfio_pci_device *vdev); */ static bool vfio_pci_nointx(struct pci_dev *pdev) { + /* + * Per PCI, no VF's should have INTx + * Simply disable it here + */ + if (pdev->is_virtfn) + return true; + switch (pdev->vendor) { case PCI_VENDOR_ID_INTEL: switch (pdev->device) { -- 2.7.4