Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2000039pxj; Wed, 19 May 2021 20:18:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcAqTQk3sEXnCRN4MGXbDrbX2dGmwXwkJU9adIienjPd9+u//y3InuNDt6iPWiONycFtMa X-Received: by 2002:a05:6402:50d2:: with SMTP id h18mr2677187edb.10.1621480689745; Wed, 19 May 2021 20:18:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621480689; cv=none; d=google.com; s=arc-20160816; b=PTgaSKfqPAPll63L6DGS2hkjWPR9Bvxr1v05qKnaLGUfArurpAizoy085DjmZZDVGX OvwYH6nmZHcaHvIFsGCb9MBOEZKZxhuWg2wxl6Iio813fnjdMtiB0EHX7QwfMNMHzgv3 5F428IDXIXviB5eRU2LxeJ7316gemxLA1L0MmOBVJsstU5jrsftYeWngV0cG0aVH8cqw 65Eva+fqPogAc+HR6n7epdTquDOnLgHMd/nC63NDpUG8xZzkW52iJ3Ud4RXMB1zlL6KJ yO6yVl1qP9DPHArm3pjLZ5bk3fLhGhDoKDKHTxLesKG0zN7ESdv/14NK57AhdXf33DAf NO+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=w/gQgF9ux99/GkJmwAJHeLVfWjCMCdBCYhi+7K+9AXI=; b=NUuQd9S/kQ8fqsFMJjQAXxSvn6AAgGTicnVSOFSON7SnIfkOII6AnOcAoD9n3njknj 1e2oqFkPnaGYB27Pv0KrBgehKp2UfAHbtPRUlc1D4O0wGtZsirT0Bx+EHaUNzyGGrwxg k0TPlyXYIhn+GQ4UOJYaeHDcTf2WTD84Zk5AJERJBzE2dAEzQ25R1ubuGsbWwDK2lefF HOhUyb6hwH1FmcbyFUeBnrjlBNvhp70SmxbTvIFFpe7M7No9k8M9qx+vvgP9vlkFMkMk YUbA02uauN0D64zNMQGV2dYQDp6vl8KTsItLcbAvLZdV022E3gUCZYZ2nQ5bzXgol8Q4 rLLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id qh24si1586305ejb.194.2021.05.19.20.17.44; Wed, 19 May 2021 20:18:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S230102AbhETDSG (ORCPT + 99 others); Wed, 19 May 2021 23:18:06 -0400 Received: from mga05.intel.com ([192.55.52.43]:58818 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbhETDSG (ORCPT ); Wed, 19 May 2021 23:18:06 -0400 IronPort-SDR: gVuubufW9z4jvx3Umqw7n0rXiR0viC8MBmd38SAOKYmW9Z5cyeBqavfCF4YpOEoye1nAxzzgYU r4jvtuUmzMhQ== X-IronPort-AV: E=McAfee;i="6200,9189,9989"; a="286659600" X-IronPort-AV: E=Sophos;i="5.82,313,1613462400"; d="scan'208";a="286659600" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2021 20:16:45 -0700 IronPort-SDR: 9k6sy+XDAQQIIPMCc053Z4fRy85gaC85Ws3ZQ027xLft/tNZj7auaK2Zfi/N5POPshW4WbBzp0 cJ24R31Gf5rg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,313,1613462400"; d="scan'208";a="395527153" Received: from allen-box.sh.intel.com ([10.239.159.128]) by orsmga006.jf.intel.com with ESMTP; 19 May 2021 20:16:41 -0700 From: Lu Baolu To: Joerg Roedel Cc: ashok.raj@intel.com, kevin.tian@intel.com, jacob.jun.pan@intel.com, Jean-Philippe Brucker , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH 00/11] Convert Intel IOMMU to use sva-lib helpers Date: Thu, 20 May 2021 11:15:20 +0800 Message-Id: <20210520031531.712333-1-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series converts the Intel IOMMU to use the generic sva helpers defined in iommu-sva-lib.c and io-pgfault.c. It includes the SVA pasid management and IO page fault handling. This series could be divided into below parts: PATCH[1~3]: Use iommu_sva_alloc/free_pasid() to manage the SVA pasid. PATCH[4-6]: Use the generic sva io page fault handler iommu_queue_iopf. PATCH[7-11]: Add ftrace and debugfs support for io page fault handling. Please help to review. Best regards, baolu Lu Baolu (11): iommu/vt-d: Add pasid private data helpers iommu/vt-d: Use iommu_sva_alloc(free)_pasid() helpers iommu/vt-d: Use common helper to lookup svm devices iommu/vt-d: Refactor prq_event_thread() iommu/vt-d: Allocate/register iopf queue for sva devices iommu/vt-d: Report prq to io-pgfault framework iommu/vt-d: Add prq_report trace event iommu/vt-d: Add common code for dmar latency performance monitors iommu/vt-d: Expose latency monitor data through debugfs iommu/vt-d: Add cache invalidation latency sampling iommu/vt-d: Add PRQ handling latency sampling include/linux/intel-iommu.h | 33 +- drivers/iommu/intel/perf.h | 73 ++++ include/trace/events/intel_iommu.h | 37 ++ drivers/iommu/intel/debugfs.c | 111 +++++ drivers/iommu/intel/dmar.c | 31 ++ drivers/iommu/intel/iommu.c | 73 +++- drivers/iommu/intel/perf.c | 166 ++++++++ drivers/iommu/intel/svm.c | 627 ++++++++++++++--------------- drivers/iommu/intel/Kconfig | 5 + drivers/iommu/intel/Makefile | 1 + 10 files changed, 819 insertions(+), 338 deletions(-) create mode 100644 drivers/iommu/intel/perf.h create mode 100644 drivers/iommu/intel/perf.c -- 2.25.1