Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp516784ybt; Wed, 1 Jul 2020 04:04:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdF0tvB/Hjzgrd3n0qSpifL2vbP+2J4LaB2Pzb9M01gUEBZNPV50d/aKhAdtU+RSTVDCoD X-Received: by 2002:a05:6402:2c2:: with SMTP id b2mr28068627edx.184.1593601472162; Wed, 01 Jul 2020 04:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593601472; cv=none; d=google.com; s=arc-20160816; b=HKXLbJvSv3o3I+k0c6e4uESFAp5iQZkoS+Svw0wWuluLlfzCenifuj4qgC4iZcK0vX Fjgoj9XPHJeTL/4xYH4VaAD4GL11i3NkXYvvAgRUGqElf5EF4XiIurfbjv2I0kDIltte 47oY4O+dCjnJvWrLNdlUdQe46zlAFwOi5uVGhgfu1hACQVZXMX6nphm7uEYnmQiWvHIF dU5vQyAtzzOMt3TKt9DUAir371Y2ex0yELfNGnLw80AhmyFwv56Q+oHxozPvvvE39edY MInOHurkDdtAY4YaF1yJCRfovCToi4do5EpTKrrnfIXF1Fn16aPMBeyZlQJvAWKeZsOb cP6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=Nx0KWnwxbEDKc+C1oKbVB5MThZXcTuO00y1bZuQY/ps=; b=JI3yY6jTWEX2PWfogjQ5YFst8goCiXQPme7WsxejSzgMaqbPhMWqSkTz8jdmBYr73e aE3cLh6spoGcejaS4+loMKud+e26BidreAM7G38GepOf3kVn9bv8uA+qeAvfc7GbvCxF LL8jcSlG9wqjKjRhebvnXrFIRiFqPITMtVkmaRT5Z1/ZXUMsrQt+eOj6SXIbu4hS/IiK cJiTn1cyahbHTDDhRQg3KOz1scoXqZ7sL+3ypIV4xIu9j9XlL45NJ6KZkMlbImpMJANp HUEFa/lL89iKjb64cW8QwryIP+2+ZtPjtLhx/MVNKwHJXHLZSDxJtRCnNviF59Z9Iyo8 1lCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j7si3566591edy.448.2020.07.01.04.04.08; Wed, 01 Jul 2020 04:04:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730218AbgGALDr (ORCPT + 99 others); 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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; } -- 2.26.2