Received: by 10.192.165.156 with SMTP id m28csp1132720imm; Mon, 16 Apr 2018 14:49:14 -0700 (PDT) X-Google-Smtp-Source: AIpwx49EQLf3bMcbSo+Jw/UMHAOLIwUFE8/Tee5F7D9GNRUE/KSkktbkmdGsLGdqJ+9ciruTRviZ X-Received: by 2002:a17:902:bc3:: with SMTP id 61-v6mr16889223plr.117.1523915354926; Mon, 16 Apr 2018 14:49:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523915354; cv=none; d=google.com; s=arc-20160816; b=S206SOwo+yg/Y75gZs+pK9at6+ubC+g4uDGQptV1LbCNUvR78GL+DMRHvefvpmEJ9A bVedNiLrWEHhtNkWn939eT+jD02bWLBkLayoBl/ZtcvVJBZMJTM2GiNLil9zZEycoeBL 2Goqd7KGcMYivRZ6enCukebk42JCQFRo9yNnVc8uqqWYBSDAJ9qii6AA42lz+mAdAfug L671a5rnbWpeDxUkiwbq2WwG9VctEj975UwGKJvl3VxcGor92wHHBGK0UZg2q0ZDtbJG qFMcB8qJHgFzgdEeWLupzkqqe46SVLCTveHnuyl4QgthSi2UgE3Mnr0sLLdBbJWESAv9 AZyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=AWyUTf89RtmcPXz7J2ozMdOV1ro7FaVNGacLH2xpQ+Q=; b=L7/KMuOdgpR3+aODSnvPg1gcfmNE//9z4ucVpNItAYs44OgLb78eCXVWkrUvG0cuaa 3HMrktY6thDEHa3YfMlVe2e/7z1VIvZtpekfHs9WIJ/a4Sj1FyEYCdK0Bxg7QrwatggA lSWk2dYOxdGo7HWNPX9OB9aXOQm7cVt/Ge669zl3qR+KBvhO85Lbh2IdwBUOpnHHgUAw LguiQgg3p9cDoVaL9UnmTkLIKQ4NpEzRnIo0g7JQXsxQ5JSKE+gkn3IsFz3X2rAGJJxC 9cPvN8XFhTbGOAo7uHxmR+qTEYDDrckqZs5qNuVK5e0dl7h7NSjoLY/utPYtcBwzP7wp BY9Q== 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 f123si3868258pfg.317.2018.04.16.14.49.00; Mon, 16 Apr 2018 14:49:14 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753166AbeDPVr1 (ORCPT + 99 others); Mon, 16 Apr 2018 17:47:27 -0400 Received: from mga09.intel.com ([134.134.136.24]:12291 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753048AbeDPVqv (ORCPT ); Mon, 16 Apr 2018 17:46:51 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Apr 2018 14:46:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,460,1517904000"; d="scan'208";a="34740203" Received: from jacob-builder.jf.intel.com ([10.7.199.155]) by orsmga006.jf.intel.com with ESMTP; 16 Apr 2018 14:46:43 -0700 From: Jacob Pan To: iommu@lists.linux-foundation.org, LKML , Joerg Roedel , David Woodhouse , Greg Kroah-Hartman , Alex Williamson , Jean-Philippe Brucker Cc: Rafael Wysocki , "Liu, Yi L" , "Tian, Kevin" , Raj Ashok , Jean Delvare , "Christoph Hellwig" , "Lu Baolu" , Jacob Pan Subject: [PATCH v4 22/22] iommu: use sva invalidate and device fault trace event Date: Mon, 16 Apr 2018 14:49:11 -0700 Message-Id: <1523915351-54415-23-git-send-email-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523915351-54415-1-git-send-email-jacob.jun.pan@linux.intel.com> References: <1523915351-54415-1-git-send-email-jacob.jun.pan@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For performance and debugging purposes, these trace events help analyzing device faults and passdown invalidations that interact with IOMMU subsystem. E.g. IOMMU:0000:00:0a.0 type=2 reason=0 addr=0x00000000007ff000 pasid=1 group=1 last=0 prot=1 Signed-off-by: Jacob Pan --- drivers/iommu/iommu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index f6512692..e2090d2 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -979,6 +979,7 @@ int iommu_report_device_fault(struct device *dev, struct iommu_fault_event *evt) mutex_unlock(&fparam->lock); } ret = fparam->handler(evt, fparam->data); + trace_dev_fault(dev, evt); done_unlock: mutex_unlock(&dev->iommu_param->lock); return ret; @@ -1547,6 +1548,7 @@ int iommu_sva_invalidate(struct iommu_domain *domain, return -ENODEV; ret = domain->ops->sva_invalidate(domain, dev, inv_info); + trace_sva_invalidate(dev, inv_info); return ret; } @@ -1584,6 +1586,7 @@ int iommu_page_response(struct device *dev, if (evt->pasid == msg->pasid && msg->page_req_group_id == evt->page_req_group_id) { msg->private_data = evt->iommu_private; + trace_dev_page_response(dev, msg); ret = domain->ops->page_response(dev, msg); list_del(&evt->list); kfree(evt); -- 2.7.4