Received: by 10.223.176.5 with SMTP id f5csp90824wra; Fri, 2 Feb 2018 17:29:39 -0800 (PST) X-Google-Smtp-Source: AH8x227CynTWIPVJxR8opoa8FeqnHNlFivZwA698ajJO1R8iOCHbyuFAJ03X8+c0RXxFUGhKodq3 X-Received: by 10.98.224.136 with SMTP id d8mr3732570pfm.56.1517621379758; Fri, 02 Feb 2018 17:29:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517621379; cv=none; d=google.com; s=arc-20160816; b=GT5ORShB++vkO2pnq/ieoPz1X1Km/X9PNLf8wo7mD9RjpeOPahtxSKMtZY37ZiTPFf e7W+m/PcZDSWHshVfHMFVie3huIGzcOGi9MYRiAEXMBWaYZRqRVloFwmHnL+gG+dUXWb OY/H69YHR+ns84uruLcMj9r0y4FsyPodj37HuEclmWJmi6RODVGoQbohMhVvK+3fxYKG nUwyUSq3+TmMA8jPG8+OrGizQWFja7bFw2Cb/Sav7Ld4JaUxx+cojUzaiY5Bx+VIWmYF 0RqHOPsZ9B4T7hgrGiJlBqoiqjGn+gTOG/qUJXJI61wkNtPjuTLa7jkt1jyTyOWgFO0y gQFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=v/Aw1oOeokovt8MMuIi9q8xkKlTah2M88cK7DIyWPoY=; b=nUfrAuZrQcXFbhAZx/0W5/hoPVKcIi/pi1k6UcAMVohqQ2NqPn4ulVvOJCGTPzACUh mjauPPcXk65sQwF78nLG1EbSGmUAZJ5JwGNKdY908zbLn22zJCwbp2mvpWT3M81kwt34 TbTl6b4As2PMrSwqXl+pkMgZeLyK+EZibuM/x+gL2OTX9CT3ED+GiFXvs3qEuLd45B+2 2052ckdL7eMDb+uastR5Mtk/mgkBQlRtI9l443QCPNosynKo1bGsbPJPZR3jgKFx3ALA AOXLsqsKDAocE62gJNCsi22Q4EdA8Ps9yaRqipkkTYN+CPRYm8gJ+oKp9wA/ddRO4oil ChRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m12-v6si306577pln.737.2018.02.02.17.29.25; Fri, 02 Feb 2018 17:29:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753159AbeBCAt2 (ORCPT + 99 others); Fri, 2 Feb 2018 19:49:28 -0500 Received: from mga18.intel.com ([134.134.136.126]:17233 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752146AbeBCAtW (ORCPT ); Fri, 2 Feb 2018 19:49:22 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Feb 2018 16:49:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,452,1511856000"; d="scan'208";a="15086243" Received: from sohilbuildbox.sc.intel.com (HELO localhost.localdomain) ([172.25.110.4]) by fmsmga008.fm.intel.com with ESMTP; 02 Feb 2018 16:49:21 -0800 From: Sohil Mehta To: Joerg Roedel Cc: Alex Williamson , Ashok Raj , David Woodhouse , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Jacob Pan , Gayatri Kammela , Sohil Mehta , Ravi V Shankar , Andy Shevchenko , Lu Baolu , Fenghua Yu Subject: [PATCH v7 0/5] Add Intel IOMMU debugfs support Date: Fri, 2 Feb 2018 16:49:56 -0800 Message-Id: <1517619001-148586-1-git-send-email-sohil.mehta@intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi All, This series aims to add debugfs support for Intel IOMMU. It exposes IOMMU registers, internal context and dumps individual table entries to help debug Intel IOMMUs. The first patch does the ground work for the following patches by reorganizing some Intel IOMMU data structures. The following patches create a new Kconfig option - INTEL_IOMMU_DEBUG and add debugfs support for IOMMU context internals, register contents, PASID internals, and Interrupt remapping in that order. The information can be accessed in sysfs at '/sys/kernel/debug/intel_iommu/'. Regards, Sohil Changes since v6: - Split patch 1/5 and 2/5 differently - Simplify and improve code formatting - Use macro for register set definitions - Fix compiler warning for readq - Add Co-Developed-by tag to commit messages Changes since v5: - Change the order of includes to an alphabetical order - Change seq_printf and seq_puts formatting Changes since v4: - Change to a SPDX license tag - Fix seq_printf formatting and remove leading '\n's Changes since v3: - Remove an unused function parameter from some of the functions - Fix checkpatch.pl warnings - Remove error reporting for debugfs_create_file functions - Fix unnecessary reprogramming of the context entries - Simplify and merge the show context and extended context patch into one - Remove redundant IOMMU null check under for_each_active_iommu - Update the commit title to be consistent Changes since v2: - Added a macro for seq file operations based on recommendation by Andy Shevchenko. The marco can be moved to seq_file.h at a future point - Changed the debugfs file names to more relevant ones - Added information for MTRR registers in the regset file Changes since v1: - Fixed seq_printf formatting - Handled the case when Interrupt remapping is not enabled Gayatri Kammela (4): iommu/vt-d: Relocate struct/function declarations to its header files iommu/vt-d: Enable debugfs support to show context internals iommu/vt-d: Add debugfs support to show register contents iommu/vt-d: Add debugfs support to show Pasid table contents Sohil Mehta (1): iommu/vt-d: Add debugfs support for Interrupt remapping drivers/iommu/Kconfig | 8 + drivers/iommu/Makefile | 1 + drivers/iommu/intel-iommu-debug.c | 338 ++++++++++++++++++++++++++++++++++++++ drivers/iommu/intel-iommu.c | 34 +--- drivers/iommu/intel-svm.c | 8 - include/linux/intel-iommu.h | 39 +++++ include/linux/intel-svm.h | 10 +- 7 files changed, 400 insertions(+), 38 deletions(-) create mode 100644 drivers/iommu/intel-iommu-debug.c -- 2.7.4