From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33C03C433E1 for ; Thu, 11 Jun 2020 04:05:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C9E82075F for ; Thu, 11 Jun 2020 04:05:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726502AbgFKEFz (ORCPT ); Thu, 11 Jun 2020 00:05:55 -0400 Received: from mga01.intel.com ([192.55.52.88]:2717 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726290AbgFKEFw (ORCPT ); Thu, 11 Jun 2020 00:05:52 -0400 IronPort-SDR: LW0Mk8ExYtJ/LEHqabOxIu04OkZxpaOw0FgiDAarAyLH4gLdWHmxa7KbbRBw2r5ibsegxr7pgz dJqRFSbj7XaA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2020 21:05:51 -0700 IronPort-SDR: vr+aPOHu6s4WY55r7400BgZlEx1FRXctwY56AsQDpDfJWmeiCSW4sLR8SOOcYmd6W2Rcm6RJNK HVan2TwW087w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,498,1583222400"; d="scan'208";a="306804388" Received: from jacob-builder.jf.intel.com ([10.7.199.155]) by orsmga008.jf.intel.com with ESMTP; 10 Jun 2020 21:05:51 -0700 From: Jacob Pan To: iommu@lists.linux-foundation.org, LKML , "Lu Baolu" , Joerg Roedel , David Woodhouse Cc: Yi Liu , "Tian, Kevin" , Raj Ashok , Alex Williamson , "Christoph Hellwig" , Jean-Philippe Brucker , Eric Auger , Jonathan Corbet , Jacob Pan Subject: [PATCH v2 0/3] IOMMU user API enhancement Date: Wed, 10 Jun 2020 21:12:12 -0700 Message-Id: <1591848735-12447-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 IOMMU user API header was introduced to support nested DMA translation and related fault handling. The current UAPI data structures consist of three areas that cover the interactions between host kernel and guest: - fault handling - cache invalidation - bind guest page tables, i.e. guest PASID Future extensions are likely to support more architectures and vIOMMU features. In the previous discussion, using user-filled data size and feature flags is made a preferred approach over a unified version number. https://lkml.org/lkml/2020/1/29/45 In addition to introduce argsz field to data structures, this patchset is also trying to document the UAPI design, usage, and extension rules. VT-d driver changes to utilize the new argsz field is included, VFIO usage is to follow. Thanks, Jacob Changeog: v2: - Removed unified API version and helper - Introduced argsz for each UAPI data - Introduced UAPI doc Jacob Pan (3): docs: IOMMU user API iommu/uapi: Add argsz for user filled data iommu/vt-d: Sanity check uapi argsz filled by users Documentation/userspace-api/iommu.rst | 210 ++++++++++++++++++++++++++++++++++ drivers/iommu/intel-iommu.c | 16 +++ drivers/iommu/intel-svm.c | 12 ++ include/uapi/linux/iommu.h | 6 + 4 files changed, 244 insertions(+) create mode 100644 Documentation/userspace-api/iommu.rst -- 2.7.4