Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp242632pxb; Wed, 18 Nov 2020 03:26:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJyAuQfqUOpcgaWGwvbi0TqTsmEjHVL4K0YwSrrui0igkG/r9Z1QjjHH+g4xDJcUoNlMOaD9 X-Received: by 2002:a17:906:ad8c:: with SMTP id la12mr22876904ejb.521.1605698764792; Wed, 18 Nov 2020 03:26:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605698764; cv=none; d=google.com; s=arc-20160816; b=l5GsrpFKpJoCRgX0v9bVx4cPwcBKXHX8mENcfhb6sJBQ5IK6FzRjuTkfRUsZ3RYuu/ v0l4Bv/DxI96C/XJAFB2x3DRgayqHfvYO9jjPZX/H6RgewxpEdEm5MBhG6pY2QVDX8gn aZwclUWk8L8EUyCX73LBoCka+1q/wcsRKeHhPkuFPMQ3vIhSOAkCB+JSxpIeHIuHmKm/ 6RzIee6MtmvcmEIpfSNuIzRzSggLSfXdUlEmQxcEtumiSzxdL5QkBh9xctfyjlUFPM8p rhITCeKcRLY5j4/qDuLvN4mj3PFJisi3CFKfQ9g3rs3gjTdApkoZuAB0/KXsddCmF48R WHkQ== 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=JkykavBXCXxc/Cc+EpSfpWb6eYs51ekKp9L7LE1iLx4=; b=QD9st0uk1ohmjrlYDNBgYqlQXjU0V1i+W/E11/T3NT1FGHVYjU9awck2uolpYemSNM +982nmyLnNEnIfGv7+6OQZXeFvwD/7u8hkefj3bMNOo9OfKha5KOjItgUn0vJ2a7/9F6 6LG/jfcoRqVKmfNl1ldTLwqUZrGS6f187YIZUfT68jvr2DE30cv7fzLyYMYKxIC05Tnb aQZ0V68i2x4+irZP3717Z0yT/FbsyMLmqOw+5swg/pK/ak2aXkyC6R50SFw6zTkOv2RF sgfnJdpC8eaNGN/rQg3FWiyB+ZLfgmLh0VwezWmsePhXSEBw2ZXM9p9Zjyx6UNcHO0T9 9yjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SwP9znUd; 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 63si16680304edb.454.2020.11.18.03.25.41; Wed, 18 Nov 2020 03:26:04 -0800 (PST) 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=SwP9znUd; 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 S1727065AbgKRLWP (ORCPT + 99 others); Wed, 18 Nov 2020 06:22:15 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23632 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726156AbgKRLWO (ORCPT ); Wed, 18 Nov 2020 06:22:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605698533; 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=JkykavBXCXxc/Cc+EpSfpWb6eYs51ekKp9L7LE1iLx4=; b=SwP9znUd/Uz02RJV2nIBmgcSA05i1BbpxCb+/YgkuyKLRzxhpU/NGA17z2klPi/AmTe4vy cP+LLu2dqHcKCrfgl4t1jkms8WU1a4fEtihP5zJAYjaDJdxdQqZZWf6iEiOOzKbscaTLpX DSgYUlLkyM1AAtqYZ7tCjysunQ7Srl0= 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-11-XmM7ArIhOz2XA7mA8hwAKw-1; Wed, 18 Nov 2020 06:22:10 -0500 X-MC-Unique: XmM7ArIhOz2XA7mA8hwAKw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A11DC873079; Wed, 18 Nov 2020 11:22:07 +0000 (UTC) Received: from laptop.redhat.com (ovpn-115-104.ams2.redhat.com [10.36.115.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id 46D9F51512; Wed, 18 Nov 2020 11:21:54 +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, joro@8bytes.org, maz@kernel.org, robin.murphy@arm.com, alex.williamson@redhat.com Cc: jean-philippe@linaro.org, zhangfei.gao@linaro.org, zhangfei.gao@gmail.com, vivek.gautam@arm.com, shameerali.kolothum.thodi@huawei.com, jacob.jun.pan@linux.intel.com, yi.l.liu@intel.com, tn@semihalf.com, nicoleotsuka@gmail.com, yuzenghui@huawei.com Subject: [PATCH v13 00/15] SMMUv3 Nested Stage Setup (IOMMU part) Date: Wed, 18 Nov 2020 12:21:36 +0100 Message-Id: <20201118112151.25412-1-eric.auger@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series brings the IOMMU part of HW nested paging support in the SMMUv3. The VFIO part is submitted separately. The IOMMU API is extended to support 2 new API functionalities: 1) pass the guest stage 1 configuration 2) pass stage 1 MSI bindings Then those capabilities gets implemented in the SMMUv3 driver. The virtualizer passes information through the VFIO user API which cascades them to the iommu subsystem. This allows the guest to own stage 1 tables and context descriptors (so-called PASID table) while the host owns stage 2 tables and main configuration structures (STE). Best Regards Eric This series can be found at: https://github.com/eauger/linux/tree/5.10-rc4-2stage-v13 (including the VFIO part in his last version: v11) The series includes a patch from Jean-Philippe. It is better to review the original patch: [PATCH v8 2/9] iommu/arm-smmu-v3: Maintain a SID->device structure The VFIO series is sent separately. History: v12 -> v13: - fixed compilation issue with CONFIG_ARM_SMMU_V3_SVA reported by Shameer. This urged me to revisit patch 4 into iommu/smmuv3: Allow s1 and s2 configs to coexist where s1_cfg and s2_cfg are not dynamically allocated anymore. Instead I use a new set field in existing structs - fixed 2 others config checks - Updated "iommu/arm-smmu-v3: Maintain a SID->device structure" according to the last version v11 -> v12: - rebase on top of v5.10-rc4 Eric Auger (14): iommu: Introduce attach/detach_pasid_table API iommu: Introduce bind/unbind_guest_msi iommu/smmuv3: Allow s1 and s2 configs to coexist iommu/smmuv3: Get prepared for nested stage support iommu/smmuv3: Implement attach/detach_pasid_table iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs iommu/smmuv3: Implement cache_invalidate dma-iommu: Implement NESTED_MSI cookie iommu/smmuv3: Nested mode single MSI doorbell per domain enforcement iommu/smmuv3: Enforce incompatibility between nested mode and HW MSI regions iommu/smmuv3: Implement bind/unbind_guest_msi iommu/smmuv3: Report non recoverable faults iommu/smmuv3: Accept configs with more than one context descriptor iommu/smmuv3: Add PASID cache invalidation per PASID Jean-Philippe Brucker (1): iommu/arm-smmu-v3: Maintain a SID->device structure drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 659 ++++++++++++++++++-- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 103 ++- drivers/iommu/dma-iommu.c | 142 ++++- drivers/iommu/iommu.c | 105 ++++ include/linux/dma-iommu.h | 16 + include/linux/iommu.h | 41 ++ include/uapi/linux/iommu.h | 54 ++ 7 files changed, 1042 insertions(+), 78 deletions(-) -- 2.21.3