Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1010962pxb; Sun, 11 Apr 2021 04:48:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyskgdXMi9WPK3u3DkC9Va5BU3bTBfr2ROj4zvELHp9iS89AXka15jbBTqp9GPbXUlAb0El X-Received: by 2002:a63:b00b:: with SMTP id h11mr21304671pgf.204.1618141701661; Sun, 11 Apr 2021 04:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618141701; cv=none; d=google.com; s=arc-20160816; b=kgDOoMiNYBFfPVg0gCSlmYHsYbdU/awzjo97s5uS3EYABBKwwGMmkec/gn6wsDDQMH dAANWNkkAupkqprtDzgTbYXVyAXHkIu7u9ZBi/+C26MCOOvy0rVn87f8EV4oov6evkGE 1uoyT7G49HjrE+sqIEFT1x+wiLH9NfZgbSdfR/9qRbrni8qxI96QBqGLZxOHrH+iCNTF U+4FxN8Hiph+xtkqch9mEXIyK9SFwiP1gKo5fcsjBi5bATTvTNH6UDyM+r0z7DENZrHX is43B13Jh+73oiAlADI7WTaqz2tUGJS762d2HopmInnZxQ3r+2Gj6uv0LwLFGAEK3QdV kTRw== 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=i/Qya5gYlpQU+h8vw6iTmP2eW8gYE13bTztPj4lYMq4=; b=DXkLOF6/VLWg4Kkm5u83zCmgEvToLG0hBDBsIJ3ClPT8SkmwhUtpae+sXx+ST5c5ny bRbXmnbsxFIplS9SVHaY51Fw43+F0GJX9vkiKzWGNH0xGd4Y2QZ1b+2O61TlqjyjLs0X c5lTFpE9OvbxctNiKGBzvF2oR3sw6YjvxiOz6R/Kedp18VShX0rw9/x9UJVoD7dI70/h 5kh/gq7r5GaK7HVsKNch5kvjQ6z3AFZB0rEax0TKJCClC3lFYW30ddLEZFRZ/lIIec9/ hHpt0JNyqiZTE9w2UgI4cU7hH72Bp9k91LttEbPiscvToquOSsETmkCxwJOII5s6Q7YR Zhcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EnsudmBe; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g12si9415603pjl.159.2021.04.11.04.48.08; Sun, 11 Apr 2021 04:48:21 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EnsudmBe; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235418AbhDKLrq (ORCPT + 99 others); Sun, 11 Apr 2021 07:47:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:51323 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235216AbhDKLrp (ORCPT ); Sun, 11 Apr 2021 07:47:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618141647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=i/Qya5gYlpQU+h8vw6iTmP2eW8gYE13bTztPj4lYMq4=; b=EnsudmBe4W6V79c3+XuqGJ/6M8dlAOuQwYfvFAVsJPaiONhzAZlwhhSuVltVBAj5Z8ehLE qsBi/e2LZSQZRSAa25xAhnEz8FClc4rBm8iDpkvvhPGb+1G5wlgbHE8QJSBQ98faQvWwCd 1fauKKHAQIfrWhtvzqs1Ita4Ond7Hf0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-592-26xNIX_tNuykPaTM3aRqmQ-1; Sun, 11 Apr 2021 07:47:23 -0400 X-MC-Unique: 26xNIX_tNuykPaTM3aRqmQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 721E71006701; Sun, 11 Apr 2021 11:47:20 +0000 (UTC) Received: from laptop.redhat.com (ovpn-112-22.ams2.redhat.com [10.36.112.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A66B5C22A; Sun, 11 Apr 2021 11:47:02 +0000 (UTC) From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, will@kernel.org, maz@kernel.org, robin.murphy@arm.com, joro@8bytes.org, alex.williamson@redhat.com, tn@semihalf.com, zhukeqian1@huawei.com Cc: jacob.jun.pan@linux.intel.com, yi.l.liu@intel.com, wangxingang5@huawei.com, jean-philippe@linaro.org, zhangfei.gao@linaro.org, zhangfei.gao@gmail.com, vivek.gautam@arm.com, shameerali.kolothum.thodi@huawei.com, yuzenghui@huawei.com, nicoleotsuka@gmail.com, lushenming@huawei.com, vsethi@nvidia.com, chenxiang66@hisilicon.com, vdumpa@nvidia.com, jiangkunkun@huawei.com Subject: [PATCH v13 00/13] SMMUv3 Nested Stage Setup (VFIO part) Date: Sun, 11 Apr 2021 13:46:46 +0200 Message-Id: <20210411114659.15051-1-eric.auger@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series brings the VFIO part of HW nested paging support in the SMMUv3. The series depends on: [PATCH v15 00/13] SMMUv3 Nested Stage Setup (IOMMU part) 3 new IOCTLs are introduced that allow the userspace to 1) pass the guest stage 1 configuration 2) pass stage 1 MSI bindings 3) invalidate stage 1 related caches They map onto the related new IOMMU API functions. We introduce the capability to register specific interrupt indexes (see [1]). A new DMA_FAULT interrupt index allows to register an eventfd to be signaled whenever a stage 1 related fault is detected at physical level. Also two specific regions allow to - expose the fault records to the user space and - inject page responses. This latter functionality is not exercised in this series but is provided as a POC for further vSVA activities (Shameer's input). Best Regards Eric This series can be found at: https://github.com/eauger/linux/tree/v5.12-rc6-jean-iopf-14-2stage-v15 The series series includes Tina's patch steming from [1] "[RFC PATCH v2 1/3] vfio: Use capability chains to handle device specific irq" plus patches originally contributed by Yi. History: v12 -> v13: - Comment fix for VFIO_IOMMU_SET_PASID_TABLE (Zenghui) v11 -> v12: - numerous fixes following feedbacks. Many thanks to all of you - See individual history log. v10 -> v11: - rebase on top of v5.10-rc4 - adapt to changes on the IOMMU API (compliant with the doc written by Jacob/Yi) - addition of the page response region - Took into account Zenghui's comments - In this version I have kept the ioctl separate. Since Yi's series [2] is currently stalled, I've just rebased here. [2] [PATCH v7 00/16] vfio: expose virtual Shared Virtual Addressing to VMs v9 -> v10 - rebase on top of 5.6.0-rc3 (no change versus v9) Eric Auger (10): vfio: VFIO_IOMMU_SET_MSI_BINDING vfio/pci: Add VFIO_REGION_TYPE_NESTED region type vfio/pci: Register an iommu fault handler vfio/pci: Allow to mmap the fault queue vfio/pci: Add framework for custom interrupt indices vfio: Add new IRQ for DMA fault reporting vfio/pci: Register and allow DMA FAULT IRQ signaling vfio: Document nested stage control vfio/pci: Register a DMA fault response region vfio/pci: Inject page response upon response region fill Liu, Yi L (2): vfio: VFIO_IOMMU_SET_PASID_TABLE vfio: VFIO_IOMMU_CACHE_INVALIDATE Tina Zhang (1): vfio: Use capability chains to handle device specific irq Documentation/driver-api/vfio.rst | 77 +++++ drivers/vfio/pci/vfio_pci.c | 447 ++++++++++++++++++++++++++-- drivers/vfio/pci/vfio_pci_intrs.c | 62 ++++ drivers/vfio/pci/vfio_pci_private.h | 33 ++ drivers/vfio/pci/vfio_pci_rdwr.c | 84 ++++++ drivers/vfio/vfio_iommu_type1.c | 178 +++++++++++ include/uapi/linux/vfio.h | 142 ++++++++- 7 files changed, 1003 insertions(+), 20 deletions(-) -- 2.26.3