Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36127542rwd; Mon, 10 Jul 2023 18:40:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlHzTgWVKBNAKLV9dlUWJmm1fNBtxDDyGM8V8RB9/m5QT0y88FO2ikZElTMZ81Gm0Bq4dJXJ X-Received: by 2002:a05:6a00:2302:b0:668:7209:1856 with SMTP id h2-20020a056a00230200b0066872091856mr13887796pfh.14.1689039628038; Mon, 10 Jul 2023 18:40:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689039628; cv=none; d=google.com; s=arc-20160816; b=0xmYeVuByaKtuXHqtHZyxlMjt2yhhnplhYN/mANDwx4u1+f0dmDvUpxMx7AItR34Xt 5KiLPwF2qZVgua+1osROdJIntFx9aD/XbJU1uX+DGO1DuoRX7TAJSVM5vygXVUKuGQ47 7KbhCrjjI05zmOQ7w9aIz5owi9YK1CwpAO8WIpVCq8GewnH2F/umP12SxQdTSHD9dxAZ 7KPNfNu2ESj5V3ttXPA93qEnLBzN/LrvHz0grv092BZCQL2X4wLkvio42L7E59ZD1YNo u3uaBMA8VTcsigyvCsDWhMk6oTY5Q1AhRULYEFocMeeBV/UcLEColYs2w8hT6penvNRB Zx2w== 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:dkim-signature; bh=hdk35lbOddMqGi7i3a5OQIfpqEKsvd5wz7trwbBABOU=; fh=5v0QJkujOnxKSzhmeWiMX/0q9X35NwMz+SRMkKa4moc=; b=b0Z4TZTu39939b0qjv98fOExCswNV1zd6cUts7V8ELTyxDDNqjZvxLo3YuohbcdSp1 9tzKhtDycs92Pfjz9N2qP2fNtDhiFu9YBUA8VeN/8sSDq5yp9AQY5BNPtYTR1gjvuA89 KetISHrd6uk983U8lztVI9ASF6MbKmjB/CW1opGpUY6uRw9cMST1TMref+0KXMOhzGJe w/uM152js77JIfiQ7t8gzcp2reR6ophIY4A4CpjGYVnYP9rkWr1rLrKxT3AZP+ISmFFk DKXNllFvwO52FghoRLPU3q0FZBJ6zQKlOv/lYPU9SCP1i1KEqNNy7OK8bhNDrGi/6oiP urbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="B/oUzrvk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j2-20020a63e742000000b0055af51c2ea9si522616pgk.719.2023.07.10.18.40.15; Mon, 10 Jul 2023 18:40:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="B/oUzrvk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230474AbjGKBIi (ORCPT + 99 others); Mon, 10 Jul 2023 21:08:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230040AbjGKBIh (ORCPT ); Mon, 10 Jul 2023 21:08:37 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EC6A194; Mon, 10 Jul 2023 18:08:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689037716; x=1720573716; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=X6HARK8d7O3/CsqjXmQ+dxc6FJwEi+B6duwTtCj4/ZQ=; b=B/oUzrvksvmPaANnyqdUm2329rW6ukl7R/AnkPGVyZhs9ksuYlAhjOn5 RQY9cbOe8fNM4yFGp2qc1zh63H5QOwHbGjdkryBMRM5LXPTnBB2jiw9k4 r0Puv/H3/iIp4HWNrRRbiGO5xeRXTbMqe9XrgtSlaKaOQ91XxUNTxudYw BBYtJjt7AB+0uH4uKfp7ma67KtpIXhyPro85P5xZuPKVlabXUWHHZ5yPj 6iyYiwpuEOEwFlMPK4I2ovZ62bwCVNMnQhol/BuzBunPkdFUhkqnx9F4q dA0BhF7PcqKjObe3ZihFQM5Y6MfLRSorwgm0lYcK4adW7sZ7+9l2csePB g==; X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="344816038" X-IronPort-AV: E=Sophos;i="6.01,195,1684825200"; d="scan'208";a="344816038" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2023 18:08:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="810999790" X-IronPort-AV: E=Sophos;i="6.01,195,1684825200"; d="scan'208";a="810999790" Received: from allen-box.sh.intel.com ([10.239.159.127]) by FMSMGA003.fm.intel.com with ESMTP; 10 Jul 2023 18:08:32 -0700 From: Lu Baolu To: Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe , Kevin Tian , Jean-Philippe Brucker , Nicolin Chen Cc: Yi Liu , Jacob Pan , iommu@lists.linux.dev, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH 0/9] iommu: Prepare to deliver page faults to user space Date: Tue, 11 Jul 2023 09:06:33 +0800 Message-Id: <20230711010642.19707-1-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When a user-managed page table is attached to an IOMMU, it is necessary to deliver IO page faults to user space so that they can be handled appropriately. One use case for this is nested translation, which is currently being discussed in the mailing list. I have posted a RFC series [1] that describes the implementation of delivering page faults to user space through IOMMUFD. This series has received several comments on the IOMMU refactoring, which I have addressed in this series. The major refactoring includes: - Removing include/uapi/linux/iommu.h. - Removing iommu_[un]register_device_fault_handler(). - Making fault_param always available between iommu device probe and release. - Using fault cookie to store temporary data used for processing faults. This is also available at github [2]. I would appreciate your feedback on this series. [1] https://lore.kernel.org/linux-iommu/20230530053724.232765-1-baolu.lu@linux.intel.com/ [2] https://github.com/LuBaolu/intel-iommu/commits/preparatory-io-pgfault-delivery-v1 Best regards, baolu Lu Baolu (9): iommu: Move iommu fault data to linux/iommu.h iommu: Add device parameter to iopf handler iommu: Add common code to handle IO page faults iommu: Change the return value of dev_iommu_get() iommu: Make fault_param generic iommu: Remove iommu_[un]register_device_fault_handler() iommu: Add helper to set iopf handler for domain iommu: Add iommu page fault cookie helpers iommu: Use fault cookie to store iopf_param include/linux/iommu.h | 206 +++++++++++++++--- drivers/iommu/iommu-sva.h | 8 +- include/uapi/linux/iommu.h | 161 -------------- .../iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c | 13 +- drivers/iommu/intel/iommu.c | 18 +- drivers/iommu/io-pgfault.c | 55 +++-- drivers/iommu/iommu-sva.c | 2 +- drivers/iommu/iommu.c | 199 ++++++++--------- MAINTAINERS | 1 - 9 files changed, 320 insertions(+), 343 deletions(-) delete mode 100644 include/uapi/linux/iommu.h -- 2.34.1