Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35DDCC433DB for ; Wed, 6 Jan 2021 01:51:55 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A312622D50 for ; Wed, 6 Jan 2021 01:51:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A312622D50 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 72655854A7; Wed, 6 Jan 2021 01:51:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ymLdqE0jjD-p; Wed, 6 Jan 2021 01:51:53 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1B50884C36; Wed, 6 Jan 2021 01:51:53 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id F2AB7C0891; Wed, 6 Jan 2021 01:51:52 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 089E7C013A for ; Wed, 6 Jan 2021 01:51:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E488785325 for ; Wed, 6 Jan 2021 01:51:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qLongFFp-bxN for ; Wed, 6 Jan 2021 01:51:51 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by hemlock.osuosl.org (Postfix) with ESMTPS id 4EE7F851E5 for ; Wed, 6 Jan 2021 01:51:51 +0000 (UTC) IronPort-SDR: o6HJ7X60kFWmUrwMwqfzN7hNzWm/iPcq9Bo2/J8lm16Qt9Hxe87RRr7tbn/YVeBnl4iGYjrY9o OnVrE6Nu6uhQ== X-IronPort-AV: E=McAfee;i="6000,8403,9855"; a="164912310" X-IronPort-AV: E=Sophos;i="5.78,478,1599548400"; d="scan'208";a="164912310" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2021 17:51:50 -0800 IronPort-SDR: QAz4tl1dFNjrArGzYCE5AHO5KTudeizzxbVy8iC428crbeCWwOJyZFIKy98Bp4egqnENnYdf5A B0rKwgZhMc3g== X-IronPort-AV: E=Sophos;i="5.78,478,1599548400"; d="scan'208";a="361387904" Received: from km-skylake-client-platform.sc.intel.com ([10.3.52.146]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2021 17:51:49 -0800 From: Kyung Min Park To: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org Subject: [PATCH v4 0/3] Audit Capability and Extended Capability among IOMMUs Date: Tue, 5 Jan 2021 17:30:32 -0800 Message-Id: <20210106013035.6476-1-kyung.min.park@intel.com> X-Mailer: git-send-email 2.17.1 Cc: ravi.v.shankar@intel.com, kevin.tian@intel.com, ashok.raj@intel.com, dwmw2@infradead.org, ricardo.neri@intel.com, kyung.min.park@intel.com, will@kernel.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" Modern platforms have more than one IOMMU. Each IOMMU has its own feature set. Some of these features must be consistent among IOMMUs. Otherwise, these differences can lead to improper behavior in the system. On the other hand, for some features, each IOMMU can have different capacity values. So, different actions are required to deal with the inconsistencies depending on the IOMMU features. Currently, some inconsistencies are ignored by the IOMMU driver. This patchset checks IOMMU capabilities and extended capabilities centralizedly during boot and take different actions according to the impacts caused by the mismatches. For example: 1. Disable Shared Virtual Memory. 2. Use common capacity values (normally the lowest capacity value) for all IOMMUs. 3. Report feature mismatches. Detailed information on the IOMMU Capability / Extended Capability can be found in Intel VT-d Specification. Link: https://software.intel.com/sites/default/files/managed/c5/15/vt-directed-io-spec.pdf ChangeLog: - Change from v3 to v4: 1. fix the build error for when only enabled irq remapping. - Change from v2 to v3: 1. fix the wrong macro names and rebase to v5.10. - Change from v1 to v2: 1. Add missing cap/ecaps for audit. 2. Refactor function/macros overal suggested by Lu, Baolu. 2. Skip audit for gfx dedicated IOMMU. 3. Change commit message. Kyung Min Park (3): iommu/vt-d: Audit IOMMU Capabilities and add helper functions iommu/vt-d: Move capability check code to cap_audit files iommu/vt-d: Disable SVM in the platform when IOMMUs have inconsistencies drivers/iommu/intel/Makefile | 4 +- drivers/iommu/intel/cap_audit.c | 219 ++++++++++++++++++++++++++++ drivers/iommu/intel/cap_audit.h | 132 +++++++++++++++++ drivers/iommu/intel/iommu.c | 85 ++--------- drivers/iommu/intel/irq_remapping.c | 8 + drivers/iommu/intel/svm.c | 3 +- include/linux/intel-iommu.h | 39 ++--- 7 files changed, 395 insertions(+), 95 deletions(-) create mode 100644 drivers/iommu/intel/cap_audit.c create mode 100644 drivers/iommu/intel/cap_audit.h -- 2.17.1 _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu