From mboxrd@z Thu Jan 1 00:00:00 1970 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 92FE4C64E7A for ; Tue, 24 Nov 2020 13:13:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5D0392073C for ; Tue, 24 Nov 2020 13:13:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387945AbgKXNNn (ORCPT ); Tue, 24 Nov 2020 08:13:43 -0500 Received: from mga03.intel.com ([134.134.136.65]:18489 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387927AbgKXNNm (ORCPT ); Tue, 24 Nov 2020 08:13:42 -0500 IronPort-SDR: I0z1AQeMqlgU1CA9DzOq6U9t34+aHpJ+433Kyl18EVE+nM04mgjBztc9EPnpgmsv9VSh+avcs8 8k/NeplfiSUw== X-IronPort-AV: E=McAfee;i="6000,8403,9814"; a="172037966" X-IronPort-AV: E=Sophos;i="5.78,366,1599548400"; d="scan'208";a="172037966" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2020 05:13:41 -0800 IronPort-SDR: p352IUKdUSa4CW99elVa4dDgS5dHCMYct8EWcV321HWlofmsqJw0BU6R32hdp7a8zcqZWwGdtL 8ZPgAfmBn0Kw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,366,1599548400"; d="scan'208";a="432602256" Received: from allen-box.sh.intel.com ([10.239.159.28]) by fmsmga001.fm.intel.com with ESMTP; 24 Nov 2020 05:13:39 -0800 From: Lu Baolu To: Will Deacon , Joerg Roedel Cc: Ashok Raj , Christoph Hellwig , Sohil Mehta , Robin Murphy , Jacob Pan , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Sai Praneeth Prakhya , Will Deacon , Lu Baolu Subject: [PATCH v10 4/4] iommu: Document usage of "/sys/kernel/iommu_groups//type" file Date: Tue, 24 Nov 2020 21:06:04 +0800 Message-Id: <20201124130604.2912899-5-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201124130604.2912899-1-baolu.lu@linux.intel.com> References: <20201124130604.2912899-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sai Praneeth Prakhya The default domain type of an iommu group can be changed by writing to "/sys/kernel/iommu_groups//type" file. Hence, document it's usage and more importantly spell out its limitations. Cc: Christoph Hellwig Cc: Joerg Roedel Cc: Ashok Raj Cc: Will Deacon Cc: Sohil Mehta Cc: Robin Murphy Cc: Jacob Pan Signed-off-by: Sai Praneeth Prakhya Signed-off-by: Lu Baolu --- .../ABI/testing/sysfs-kernel-iommu_groups | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-kernel-iommu_groups b/Documentation/ABI/testing/sysfs-kernel-iommu_groups index 017f5bc3920c..407b1628d7fd 100644 --- a/Documentation/ABI/testing/sysfs-kernel-iommu_groups +++ b/Documentation/ABI/testing/sysfs-kernel-iommu_groups @@ -33,3 +33,32 @@ Description: In case an RMRR is used only by graphics or USB devices it is now exposed as "direct-relaxable" instead of "direct". In device assignment use case, for instance, those RMRR are considered to be relaxable and safe. + +What: /sys/kernel/iommu_groups//type +Date: November 2020 +KernelVersion: v5.11 +Contact: Sai Praneeth Prakhya +Description: /sys/kernel/iommu_groups//type shows the type of default + domain in use by iommu for this group. See include/linux/iommu.h + for possible values. A privileged user could request kernel to + change the group type by writing to this file. Presently, only + three types of request are supported: + 1. DMA: All the DMA transactions from the device in this group + are translated by the iommu. + 2. identity: All the DMA transactions from the device in this + group are *not* translated by the iommu. + 3. auto: Change to the type the device was booted with. + Note: + ----- + The default domain type of a group may be modified only when + 1. The group has *only* one device + 2. The device in the group is not bound to any device driver. + So, the users must unbind the appropriate driver before + changing the default domain type. + Caution: + -------- + Unbinding a device driver will take away the driver's control + over the device and if done on devices that host root file + system could lead to catastrophic effects (the users might + need to reboot the machine to get it to normal state). So, it's + expected that the users understand what they're doing. -- 2.25.1