From patchwork Wed Jul 1 11:03:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Giovanni Cabiddu X-Patchwork-Id: 1320416 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49xddb5hktz9sTT for ; Wed, 1 Jul 2020 21:04:03 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730216AbgGALDr (ORCPT ); Wed, 1 Jul 2020 07:03:47 -0400 Received: from mga17.intel.com ([192.55.52.151]:29868 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730215AbgGALDl (ORCPT ); Wed, 1 Jul 2020 07:03:41 -0400 IronPort-SDR: KYCAIgvw5+tG1jPf5Cj0LL44uB78p31MguX1btgiBcvv2Q5GIfjlNfpFCxggndMFtWQRVDQAab fEzxDoK3wsdA== X-IronPort-AV: E=McAfee;i="6000,8403,9668"; a="126632438" X-IronPort-AV: E=Sophos;i="5.75,300,1589266800"; d="scan'208";a="126632438" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2020 04:03:40 -0700 IronPort-SDR: n53Dxo/n7ZbHxazLLXAU9U0C133Q4yNgj/pLuNxlGK4YudcammWs6c6Jmf16OAnpvHm9vfhn3g 4IDa4wiMF+xQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,300,1589266800"; d="scan'208";a="425557275" Received: from silpixa00400314.ir.intel.com (HELO silpixa00400314.ger.corp.intel.com) ([10.237.222.51]) by orsmga004.jf.intel.com with ESMTP; 01 Jul 2020 04:03:37 -0700 From: Giovanni Cabiddu To: alex.williamson@redhat.com, herbert@gondor.apana.org.au Cc: cohuck@redhat.com, nhorman@redhat.com, vdronov@redhat.com, bhelgaas@google.com, mark.a.chambers@intel.com, gordon.mcfadden@intel.com, ahsan.atta@intel.com, qat-linux@intel.com, kvm@vger.kernel.org, linux-crypto@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Giovanni Cabiddu Subject: [PATCH 3/5] vfio/pci: add qat devices to blocklist Date: Wed, 1 Jul 2020 12:03:00 +0100 Message-Id: <20200701110302.75199-4-giovanni.cabiddu@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200701110302.75199-1-giovanni.cabiddu@intel.com> References: <20200701110302.75199-1-giovanni.cabiddu@intel.com> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The current generation of Intel® QuickAssist Technology devices are not designed to run in an untrusted environment because of the following issues reported in the release notes in https://01.org/intel-quickassist-technology: QATE-39220 - GEN - Intel® QAT API submissions with bad addresses that trigger DMA to invalid or unmapped addresses can cause a platform hang QATE-7495 - GEN - An incorrectly formatted request to Intel® QAT can hang the entire Intel® QAT Endpoint This patch adds the following QAT devices to the blocklist: DH895XCC, C3XXX and C62X. Signed-off-by: Giovanni Cabiddu --- drivers/vfio/pci/vfio_pci.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index ea5904ca6cbf..dcac5408c764 100644 --- a/drivers/vfio/pci/vfio_pci.c +++ b/drivers/vfio/pci/vfio_pci.c @@ -75,6 +75,21 @@ static inline bool vfio_vga_disabled(void) static bool vfio_pci_dev_in_blocklist(struct pci_dev *pdev) { + switch (pdev->vendor) { + case PCI_VENDOR_ID_INTEL: + switch (pdev->device) { + case PCI_DEVICE_ID_INTEL_QAT_C3XXX: + case PCI_DEVICE_ID_INTEL_QAT_C3XXX_VF: + case PCI_DEVICE_ID_INTEL_QAT_C62X: + case PCI_DEVICE_ID_INTEL_QAT_C62X_VF: + case PCI_DEVICE_ID_INTEL_QAT_DH895XCC: + case PCI_DEVICE_ID_INTEL_QAT_DH895XCC_VF: + return true; + default: + return false; + } + } + return false; }