Received: by 10.223.185.116 with SMTP id b49csp4150833wrg; Tue, 13 Feb 2018 13:41:27 -0800 (PST) X-Google-Smtp-Source: AH8x226Ki/f5hgcMcGYrtWkGSaqM0cTdPCHssb87SiyhKAwcbWkjqKyom/2CRYOjKUbJMQi98d0G X-Received: by 10.98.200.22 with SMTP id z22mr2523762pff.228.1518558087336; Tue, 13 Feb 2018 13:41:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518558087; cv=none; d=google.com; s=arc-20160816; b=QQb2u1wMid+NHCIcs4V6W11UVQOUNTQ45SjJcL2zBb+oJvs1CbdOrTkRxwcanvafek 54jmLHfhsQXFd+bNCLt8Yi8Rwhol9Rk/nUlaztS1D17CkTJs4V6p1Uk0YCgy0fQXz2mz kuA3M9ibKvX4icqYCXiSMeIiFPMHmpd9YueIcRhw2aT2KfsfVvMdTR3Eerj0s8meBtOF AMNWb3LUEDjRTz1dukV3PGevoi8Z/3Rf74vlxF6LscpFdfnafKkwFEs78wUDZHTrli5l 0A9Z1GJSIElSTe8dY+CAs1XsR5x5YKG0yU1+vXxglFknyanMQkWETYwuLJ2Z3YxzoTle U8Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=HfgqDHDVODIfzj+5w1JoixTOZmSS9xs399EBqOJBMmM=; b=zy1y9u4ko5rn8x0i85MKkh34qC/4zbcpUt7ZZP/Zqoy+oJ+NmaprwkIKeZHnhjkBLf 3gYFSrPdt8m5yXSp20siO9XvL/q+eHj+6e2rmb/CnIPY5BEXQ4yxUf2yG0A8BklK74Pl LyCyMA++JobSdKNhmFKzJD9wxn/Lhv7Tn7xQBohuJkm/ta6zqVFpy1G9wxK7S8BXjd5y 6dPQc0sWfy9p4OmeoEX0uiFy1DEwGIHYTCel23Xopc6qPHntdACZGZ9RyDKnvTTCAKJO ktIbJrCMANknvF7vZs3EJo5I37Jtgt1dAo54T0mM2OCCvs7AbwRZisCBOW3OWl9hk+GG P7Jg== 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 z24si1805331pfg.344.2018.02.13.13.40.58; Tue, 13 Feb 2018 13:41:27 -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 S965885AbeBMVkF (ORCPT + 99 others); Tue, 13 Feb 2018 16:40:05 -0500 Received: from mga06.intel.com ([134.134.136.31]:4361 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965749AbeBMVkD (ORCPT ); Tue, 13 Feb 2018 16:40:03 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Feb 2018 13:40:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,509,1511856000"; d="scan'208";a="17884192" Received: from otc-nc-03.jf.intel.com (HELO otc-nc-03) ([10.54.39.38]) by orsmga008.jf.intel.com with ESMTP; 13 Feb 2018 13:40:03 -0800 Date: Tue, 13 Feb 2018 13:40:02 -0800 From: "Raj, Ashok" To: Joerg Roedel Cc: Sohil Mehta , Alex Williamson , David Woodhouse , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Jacob Pan , Gayatri Kammela , Ravi V Shankar , Andy Shevchenko , Lu Baolu , Fenghua Yu , Ashok Raj Subject: Re: [PATCH v7 0/5] Add Intel IOMMU debugfs support Message-ID: <20180213214002.GA27066@otc-nc-03> References: <1517619001-148586-1-git-send-email-sohil.mehta@intel.com> <20180213140303.42mbzfxpypljy37l@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180213140303.42mbzfxpypljy37l@8bytes.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Joerg, On Tue, Feb 13, 2018 at 03:03:03PM +0100, Joerg Roedel wrote: > On Fri, Feb 02, 2018 at 04:49:56PM -0800, Sohil Mehta wrote: > > 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/'. > > This looks like it only presents data from the iommu-hardware (register > state) or from in-memory data structures used by the hardware. Can't all > this be read out from user-space with libpci and /dev/mem access? True, we can do the tools and keep it strictly user space, but find it very convenient to keep the kernel code and debugfs together. When there are bug-reports its rather easy for the user to collect some data and report it, and all the data-structures we need are readily available instead of finding a round-about way to capture the same data from user-space. This version has only hw dumps for now, but we plan to add some other things like walking 2nd level page-tables, or get some SVM specific data from the driver in the future. > > Things are different for kernel-defined data structures, as they might > change between releases and can be presented to user-space via debugfs > is needed, but the data structures used by the hardware should be pretty > stable. Cheers, Ashok