Message ID | 20230209041642.9346-1-yi.l.liu@intel.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp119215wrn; Wed, 8 Feb 2023 20:25:19 -0800 (PST) X-Google-Smtp-Source: AK7set8pr/uBUUqk+eCcFjOVIyuqsqs9ep1dNSuGIYL6VF/c2wxWBsrUAh/TYLCO2Xdv4FowAAfW X-Received: by 2002:a17:906:1255:b0:878:81d9:63ea with SMTP id u21-20020a170906125500b0087881d963eamr10436511eja.52.1675916719609; Wed, 08 Feb 2023 20:25:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675916719; cv=none; d=google.com; s=arc-20160816; b=aZo7NCBy8iAENB/nhH/yn6yeaNiNzlPa3wPC2qpMMgSi6vTLxrelOOJV521kM3I69K vnILVtpnuEMaFUebr5GZTzCpAfx6levoy/NKhyUAuZo4ilkMPHZssmBvcn4anP+XKLbW xP66kYGF+VJfxwC0DIPyAJCDCaHyvL3yuW2AfWFNTiHEAMrATZ9YE3PuU6EqxUPF4lmT pCIpARMBaIXIGMSU6h2BtTJ/98e0dgT4WNhnpqBdFeNE2meW+Rpa/bgCa+A4hTNdU/6r vA9AeJiXe6BNX6i4Rh1RY143GfyOAk+Og33SyGALMDrgWMak3TOTocb8ixnJob1C4nJp 2Fxw== 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=sN5eColfIQfyvj37pyYs0J1dWuguR6Ys58PvX3BEl2M=; b=suRU5dA6F7jPTNomEX2swxiRC6/PyHZYPHkpzEuP87rvi4wSBaKjnmy+vAavw8uhwT wTyrplKVBGanAYLP8rp8D+E0seaW8T7BnGF0ACswW+KjMbge2D56V2iSwN1Erjm5+FJ0 Mo+kJ9mk7Q6ORk0ZOBAxWHm9O/np3uAHpWyqj74CefaPVRc2ef3O3sdXesUfUlzvUWrN gM53ahaMBfKsH2Gd19J2OGy+YpyI6bRN9EHECqy8V1me2ljuiIKWnx9EaWSc2C8jieWF XnAfg381TXMX9PqiysTDL8DeWGv3qMRs3spMmYbHaWqnecYV+F5EN7LZEkglMPK/41DC bU/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="P/Jq5Ddj"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c9-20020aa7df09000000b0049eed9e06eesi812030edy.316.2023.02.08.20.24.56; Wed, 08 Feb 2023 20:25:19 -0800 (PST) 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="P/Jq5Ddj"; 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 S229518AbjBIETX (ORCPT <rfc822;gnulinuxfreebsd@gmail.com> + 99 others); Wed, 8 Feb 2023 23:19:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbjBIETU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 8 Feb 2023 23:19:20 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 208427AA9; Wed, 8 Feb 2023 20:18:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675916305; x=1707452305; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=xI4jwcAkfh2lcTA8rQSFT0GKdDkIDlByxF+6Yr7jRrA=; b=P/Jq5DdjI1/PxcJXX6pQBN/kK5Zj4NZagXvpbai3rkOHxWY0ngAwcNIb +ZH4Xy7Muw7Vp+SouIDu1fd5c9ySBIUnPCqSQFE2eboETkfle129t3UZf r46055MP+NUhayCaVP9erG7eBJw+xNeu55KzYS3yJp2MbPnNP7bO2NFnY E3likTZXxeRKJYtXW54L/08NT4QFytGUYvR0ICmqQKLIjONVgsYVSvsy1 LjpvDxspNZP5Y59NaoA+OIAuDCJxfhN/yTxdDs4EqW+tz/+TSbZ8SUzFw FF9nChi+8OaB07QGzjO7GYGEZpKHvSzQLhXIZ2lrucLtCHvfMN0kBOUj+ g==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="394600685" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="394600685" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 20:16:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="912982071" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="912982071" Received: from 984fee00a4c6.jf.intel.com ([10.165.58.231]) by fmsmga006.fm.intel.com with ESMTP; 08 Feb 2023 20:16:44 -0800 From: Yi Liu <yi.l.liu@intel.com> To: joro@8bytes.org, alex.williamson@redhat.com, jgg@nvidia.com, kevin.tian@intel.com, robin.murphy@arm.com Cc: cohuck@redhat.com, eric.auger@redhat.com, nicolinc@nvidia.com, kvm@vger.kernel.org, mjrosato@linux.ibm.com, chao.p.peng@linux.intel.com, yi.l.liu@intel.com, yi.y.sun@linux.intel.com, peterx@redhat.com, jasowang@redhat.com, shameerali.kolothum.thodi@huawei.com, lulu@redhat.com, suravee.suthikulpanit@amd.com, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, baolu.lu@linux.intel.com Subject: [PATCH 0/6] iommufd: Add iommu capability reporting Date: Wed, 8 Feb 2023 20:16:36 -0800 Message-Id: <20230209041642.9346-1-yi.l.liu@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757326050098214303?= X-GMAIL-MSGID: =?utf-8?q?1757326050098214303?= |
Series |
iommufd: Add iommu capability reporting
|
|
Message
Yi Liu
Feb. 9, 2023, 4:16 a.m. UTC
iommufd gives userspace the capabilty to manipulating iommu subsytem. e.g. DMA map/unmap etc. In the near future, it will also support iommu nested translation. Different platform vendors have different implementation for the nested translation. So before set up nested translation, userspace needs to know the hardware iommu capabilities. For example, Intel platform supports guest I/O page table to be the first stage translation structure. This series reports the iommu capability for a given iommufd_device which has been bound to iommufd. It is a preparation work for nested translation support[1]. In this series, Intel VT-d capability reporting is added. Other vendors may add their own reporting based on this series. [1] https://github.com/yiliu1765/iommufd/tree/iommufd_nesting_vtd_v1 Regards, Yi Liu Lu Baolu (2): iommu: Add new iommu op to get iommu hardware information iommu/vt-d: Implement hw_info for iommu capability query Nicolin Chen (2): iommufd/selftest: Set iommu_device for mock_device iommufd/selftest: Add coverage for IOMMU_DEVICE_GET_INFO ioctl Yi Liu (2): iommufd: Add IOMMU_DEVICE_GET_INFO iommufd/device: Add mock_device support in iommufd_device_get_info() drivers/iommu/intel/iommu.c | 19 ++++ drivers/iommu/intel/iommu.h | 1 + drivers/iommu/iommufd/device.c | 91 +++++++++++++++++++ drivers/iommu/iommufd/iommufd_private.h | 2 + drivers/iommu/iommufd/iommufd_test.h | 15 +++ drivers/iommu/iommufd/main.c | 3 + drivers/iommu/iommufd/selftest.c | 26 ++++++ include/linux/iommu.h | 8 ++ include/uapi/linux/iommufd.h | 63 +++++++++++++ tools/testing/selftests/iommu/iommufd.c | 18 +++- tools/testing/selftests/iommu/iommufd_utils.h | 26 ++++++ 11 files changed, 271 insertions(+), 1 deletion(-)
Comments
On Wed, Feb 08, 2023 at 08:16:36PM -0800, Yi Liu wrote: > iommufd gives userspace the capabilty to manipulating iommu subsytem. > e.g. DMA map/unmap etc. In the near future, it will also support iommu > nested translation. Different platform vendors have different implementation > for the nested translation. So before set up nested translation, userspace > needs to know the hardware iommu capabilities. For example, Intel platform > supports guest I/O page table to be the first stage translation structure. > > This series reports the iommu capability for a given iommufd_device which > has been bound to iommufd. It is a preparation work for nested translation > support[1]. In this series, Intel VT-d capability reporting is added. Other > vendors may add their own reporting based on this series. > > [1] https://github.com/yiliu1765/iommufd/tree/iommufd_nesting_vtd_v1 Let's have the comments addressed and this rebased on top of https://github.com/jgunthorpe/linux/commits/iommufd_hwpt Which should address eg the selftest issue I want to start chipping away at bits of the nesting patch pile and this part looks close Thanks, Jason