Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp388578ybn; Tue, 1 Oct 2019 23:08:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyeab/0p/vxoOgLEyXmPRWJxCkIgifKAj8Vkn++rzVbIusrA5FE0SpS0bMr3QsZVexq/C+H X-Received: by 2002:a17:906:6a45:: with SMTP id n5mr1646439ejs.20.1569996536537; Tue, 01 Oct 2019 23:08:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569996536; cv=none; d=google.com; s=arc-20160816; b=UwPJ4B3xCGPBoJ6iNyqjMc7nIGiuWfk9IQpFjgMfOBzmlqIAqVb6FzS0atTP2bg5P6 mdaMVf1IYyD+sQMizL92eqz8DJ9gts9jwq2ZWjuvIIbkc96zSoDuAGc3gFKH6/BUZd/B Aew326EVswn6/aO1u8Nt5gDeRI/3E3vw4mfj+8k/pf0joRpmMgHZ1ExSl19u0I5N5IZt tJLH4N/8zKGGVl+MOYXBvtaLhXRXEoe/xigu6ucVG5yBnzaTOibCbGgdLQd4mRcNgr5g cItCj/6/jqKVVwIOQ/j5PbIPEwkSRBMq5xL53zMECOAAH95bZPu5q4yF1yFmQAbDnt6n yTCA== 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=Z7gHWqpY/1ztenXWdEHgu8WL7G0x72RLOc8l4iI7ggc=; b=KvHCGSPPqMwDH6W/KpK3igLVDMvzSf8TNxKPWKzfmpHPhem8mtRN4j1Uh5SSAya2ga Clb92Ys1aI+YKnv5j7OoA97lsZ6zZ/WPH5NyGHjUEddD4MruwAmpcT+sRB8tHSm+fmQN JeRG+w35HsnjRVaHMAK+GEmIhqkNoOKE7+s/x6FCGs8pw7kk6PlBjTTMmEIBL2IWKzUO Z6xLamDcIt6hpPCalxpUz0TFUe+Cz0slQtHib428u3OZAr6agNAnUvigRhcWnCkFER6r +6tq3R3R31frXOqXCU/9jBBD1bll5jh8821mwz8c9ZaiooAdbNFxykdPl9BKoudHMw2j tshw== 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 w6si10827727eda.336.2019.10.01.23.08.32; Tue, 01 Oct 2019 23:08:56 -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 S1729004AbfJAX3S (ORCPT + 99 others); Tue, 1 Oct 2019 19:29:18 -0400 Received: from mga17.intel.com ([192.55.52.151]:26348 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728997AbfJAX3R (ORCPT ); Tue, 1 Oct 2019 19:29:17 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Oct 2019 16:29:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,572,1559545200"; d="scan'208";a="203402501" Received: from jacob-builder.jf.intel.com ([10.7.199.155]) by orsmga002.jf.intel.com with ESMTP; 01 Oct 2019 16:29:17 -0700 From: Jacob Pan To: iommu@lists.linux-foundation.org, LKML , Joerg Roedel , David Woodhouse , Alex Williamson , Jean-Philippe Brucker Cc: "Yi Liu" , "Tian, Kevin" , Raj Ashok , "Christoph Hellwig" , "Lu Baolu" , Jonathan Cameron , Eric Auger , Jerry Snitselaar , Jacob Pan Subject: [PATCH v3 0/4] User API for nested shared virtual address (SVA) Date: Tue, 1 Oct 2019 16:33:21 -0700 Message-Id: <1569972805-27664-1-git-send-email-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This set consists of IOMMU APIs to support SVA in the guest, a.k.a nested SVA. As the complete SVA support is complex, we break down the enabling effort into three stages: 1. PCI device direct assignment 2. Fault handling, especially page request service support 3. Mediated device assignment Each stage includes common API and vendor specific IOMMU driver changes. This series is the common uAPI for stage #1. It is intended to build consensus on the interface which all vendors reply on. This series is extracted from the complete stage1 set which includes VT-d code. https://lkml.org/lkml/2019/8/15/951 Changes: - Use spinlock instead of mutex to protect ioasid custom allocators. This is to support callers in atomic context - Added more padding to guest PASID bind data for future extensions, suggested by Joerg. After much thinking, I did not do name change from PASID to IOASID in the uAPI, considering we have been using PASID in the rest of uAPIs. IOASID will remain used within the kernel. For more discussions lead to this series, checkout LPC 2019 VFIO/IOMMU/PCI microconference materials. https://linuxplumbersconf.org/event/4/sessions/66/#20190909 Change log: v3: - include errno.h in ioasid.h to fix compile error - rebased to v5.4-rc1, no change v2: - Addressed review comments by Jean on IOASID custom allocators, locking fix, misc control flow fix. - Fixed a compile error with missing header errno.h - Updated Jean-Philiippe's new email and updateded reviewed-by tag Jacob Pan (2): iommu/ioasid: Add custom allocators iommu: Introduce guest PASID bind function Jean-Philippe Brucker (1): iommu: Add I/O ASID allocator Yi L Liu (1): iommu: Introduce cache_invalidate API drivers/iommu/Kconfig | 4 + drivers/iommu/Makefile | 1 + drivers/iommu/ioasid.c | 432 +++++++++++++++++++++++++++++++++++++++++++++ drivers/iommu/iommu.c | 30 ++++ include/linux/ioasid.h | 76 ++++++++ include/linux/iommu.h | 36 ++++ include/uapi/linux/iommu.h | 169 ++++++++++++++++++ 7 files changed, 748 insertions(+) create mode 100644 drivers/iommu/ioasid.c create mode 100644 include/linux/ioasid.h -- 2.7.4