Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4732495imm; Tue, 11 Sep 2018 17:11:36 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaslrCh/rohRdezSv6WXw/on3narplgsqxWeUs5T5fxkISsHdBem3bOOD/wVe5TmmADojEa X-Received: by 2002:a17:902:8d95:: with SMTP id v21-v6mr28774127plo.213.1536711096696; Tue, 11 Sep 2018 17:11:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536711096; cv=none; d=google.com; s=arc-20160816; b=mHy4G9cRfTNrM0LAzhNtY3mvei+TXuZs9anAjkR56LGgcg3qujpsZQka1Fspgwe8q7 +oacN3hcRR4By8TlQNE6tyTmT/COk2zgh4mTpMsfURUkJc2Y/Ue1ZXtWhh/krjuP39WJ Gqzl3196qUj8uDhCx0LZEp8/ha64A0KfPAoaligayQ2nn7z7LCeEsCSlxCfZ0GpfSMRb aWfLl1L7N8s7Mhz1wXNgo2dkmlY0kLdIj2TopaBJ5i+TVeL/EVsh9gzZNJoCMByqdoDb 5LdEpSo7JLSACFFnrMzqbz3kxxAN0heeLi/t6iwQcKjG2NlVQEjUbKJfGxQ93DkdqC87 T5WA== 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; bh=RqqcUA/EEcDYIt5sUzR5aj8cK0nAGV9Nxm+DXwGS8G4=; b=ZLxXrzf1ZsGQN/pwJwQrUJqcifx58Lp9qiVWHaEeCwxwqxcG0zUee1X9YzI2v8Wo4j 3obO3mWETuE68HmqPZ+b7sUY0FlzmYAOHp2NGG8LY4n9iRqpqffiZYlrE+P0e2lSybB6 LxDaimW4Ycz1zKKgSPlLTE3QqQsd0y+CXM1rpdfpXeQvm7mUiTIZIQGKUc/Q//0eUmzi Z0/7xcVyooa3/1TVGm6vfD4FquqFUW+AEUIRMAqQDrJhOfsFyHKwvmVAEJzWTZk4I3ot rJ7Rm7PHWnp1i2W/LCf/UkuIrtgvTpI681fIaCdXgGJIs1w6SdoxDsdr+mvl6tfNkY7v Qp7w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d34-v6si21781734pla.195.2018.09.11.17.11.22; Tue, 11 Sep 2018 17:11:36 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727834AbeILFLm (ORCPT + 99 others); Wed, 12 Sep 2018 01:11:42 -0400 Received: from mga01.intel.com ([192.55.52.88]:30629 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727652AbeILFLl (ORCPT ); Wed, 12 Sep 2018 01:11:41 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Sep 2018 17:09:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,362,1531810800"; d="scan'208";a="72213067" Received: from sohilbuildbox.sc.intel.com (HELO localhost.localdomain) ([172.25.110.4]) by orsmga007.jf.intel.com with ESMTP; 11 Sep 2018 17:09:58 -0700 From: Sohil Mehta To: Joerg Roedel Cc: 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 v8 0/6] Add Intel IOMMU debugfs support Date: Tue, 11 Sep 2018 17:11:35 -0700 Message-Id: <20180912001141.64025-1-sohil.mehta@intel.com> X-Mailer: git-send-email 2.18.0 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. Patches 1-3 do the ground work for the following patches by reorganizing some Intel IOMMU data structures, creating a new config option - INTEL_IOMMU_DEBUGFS and adding an Intel IOMMU debugfs directory. The following patches add debugfs support for IOMMU resigter contents, Interrupt remapping and context internals in that order. The information can be accessed in sysfs at '/sys/kernel/debug/iommu/intel/'. This series is based on the new VT-d 3.0 specification [1]. The scalable mode and PASID table debugfs patches are not part of this series. They would be submitted later once the IOMMU driver patches for the same are accepted and merged upstream. Regards, Sohil [1] https://software.intel.com/sites/default/files/managed/c5/15/vt-directed-io-spec.pdf Changes since v7: - Move to the common iommu directory approach suggested by Joerg - Remove ECS debugfs support that has been deprecated with the new VT-d spec - Change filename to intel-iommu-debugfs.c - Remove the pasid table debugfs patch - Add MTRR and Virtual command register support - Use locks to protect register and table access - Improve seq_printf formatting - Simplify and split the patches differently 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 (1): iommu/vt-d: Add debugfs support to show register contents Sohil Mehta (5): iommu/vt-d: Relocate struct/function declarations to its header files iommu/vt-d: Update register definitions to VT-d 3.0 specification iommu/vt-d: Enable base Intel IOMMU debugfs support iommu/vt-d: Add debugfs support for Interrupt remapping iommu/vt-d: Add debugfs support to show context internals arch/x86/include/asm/irq_remapping.h | 2 + drivers/iommu/Kconfig | 13 ++ drivers/iommu/Makefile | 1 + drivers/iommu/intel-iommu-debugfs.c | 314 +++++++++++++++++++++++++++ drivers/iommu/intel-iommu.c | 32 +-- drivers/iommu/intel_irq_remapping.c | 2 +- include/linux/intel-iommu.h | 72 ++++++ 7 files changed, 407 insertions(+), 29 deletions(-) create mode 100644 drivers/iommu/intel-iommu-debugfs.c -- 2.18.0