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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E33D8C3DA4A for ; Tue, 20 Aug 2024 08:21:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hSwrIo6MlWvOQ+mcUv6uS1wZ25LrFB1ewOcC/h8kM+Q=; b=oFvb4aiOSAl+ZSsCLcUBg2PSMq oAe9WtGdXuM4g1FkUxFISNscwJqMdDRbo9RhImKsjT0mAc75joXPpE9hhThNA+wbqqX8g6Cy882jN DpCt7FtZcfCRI54pHYbZacI2IwEQbvZqbjZIS9whwT7RrIgiZvrblHSulVT43PHlXRNY7CeQmI4FB lNOyo7Pd9CdAiRrBVf6hOp/QUt7WKdtV3ucV0TUXpc06VEQmWyZLKuY6YPMLsu+nYP1WEfQpjfPp2 t10UXHDXb29ZS/EZRaFjsW11GjA46AL/kA0lzmExegWEkc13kMgI871WZJ063Uj/8fLGcjGd5ySya cvfBO1LA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgK7I-00000004MlP-3pqY; Tue, 20 Aug 2024 08:21:24 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgK6a-00000004MWP-2ljG for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2024 08:20:42 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-428e12f6e56so23725e9.0 for ; Tue, 20 Aug 2024 01:20:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1724142038; x=1724746838; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=hSwrIo6MlWvOQ+mcUv6uS1wZ25LrFB1ewOcC/h8kM+Q=; b=XJHuVRBDXstuA2Y6lrw6RqNMvTxC4DqLSk2TsLPndnqPED9eA5ml7jg6C2s5RL6UKA OFg+JOtd+TggSMD6vmbMYzLVahRaeYN5MaMujjvJntVifKnK1lE8bxB49uMKIw7lXLgV DEj0lFLTKNeqtTSD9md774qhgbiIh4tt207s84BNBFUE76oh5lQ3TuSxaeufU/bxIfP3 lEqZ2pkWUsrEKm27bmrKWZCOuVd57FnU3NtDK6Q3ppAVXnfS3fk65pnZX3DECd94LMtv Mo0RMiVkDgRylxXoFZ9T3sIL/vPHD1EBlgB2KIi8XjF2jmQDZD+MWdVW4+/L/MRZOu1V QTNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724142038; x=1724746838; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hSwrIo6MlWvOQ+mcUv6uS1wZ25LrFB1ewOcC/h8kM+Q=; b=CT3l1oeTVYTBH9wmhWRh6+8Di2KUNXGau6Yd7mKTJaLSwGS7lASKVsvXJdAtVlEwcP QzyDrU+yUX8LcXqIMNSxb3YSOWOCmO/1/ezelOh79A2f1FDi4mg8tvQbKD4i9ZmbYgjz xhdSVo+FKaDuiJwSxiJkrvmk255wCOKxgXmsPNpBuFNkl1jh9nRQwr7FLxbIK8ZDxCT8 nYvfQ0vZ0673SREhCQTewURejUkqH+vm7oXjfVy17v2CSa2gJ6Pd9BCk7xkXLK8vFeuC 4c5dVJTbDD4aRRRSRLpSUalp4/lqRx8IoTt0kgBZCBSyOPbV18qOfsbdaSEuS6waQikq qRhA== X-Forwarded-Encrypted: i=1; AJvYcCXwUGxnNjP+lfUUKDn6Rp8m/A3eCRuyWAW9Wmtfv9SFgiGmpqhmM737nxKXKB2fwr98cJHK9JhZ0f6cD+TaBqZ/wkwfRoBkU65YtX+Rb+s9FAZadLg= X-Gm-Message-State: AOJu0Yyke/dl2CJEYGIjYSREOD2CPb3v38PXaBznQLhBKOsE4L2h8zqI EJFdl3masCI6/s8c4WM+cXPkVkHwZGxvZNPeICFo0trjS0UIQGHgAemQcYtZdg== X-Google-Smtp-Source: AGHT+IFkxwYbutMYvAck6HWY9AZnwzgvx67PU4bYEmqMtnbNvH7bwgVYyvbPkbuBgiiDj1GbnYCL7w== X-Received: by 2002:a05:600c:a0e:b0:426:66a0:6df6 with SMTP id 5b1f17b1804b1-42ab5bee335mr461955e9.0.1724142037758; Tue, 20 Aug 2024 01:20:37 -0700 (PDT) Received: from google.com (203.75.199.104.bc.googleusercontent.com. [104.199.75.203]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ab87ef024sm10121515e9.1.2024.08.20.01.20.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2024 01:20:37 -0700 (PDT) Date: Tue, 20 Aug 2024 08:20:32 +0000 From: Mostafa Saleh To: Jason Gunthorpe Cc: acpica-devel@lists.linux.dev, Alex Williamson , Hanjun Guo , iommu@lists.linux.dev, Joerg Roedel , Kevin Tian , kvm@vger.kernel.org, Len Brown , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Lorenzo Pieralisi , "Rafael J. Wysocki" , Robert Moore , Robin Murphy , Sudeep Holla , Will Deacon , Eric Auger , Jean-Philippe Brucker , Moritz Fischer , Michael Shavit , Nicolin Chen , patches@lists.linux.dev, Shameerali Kolothum Thodi Subject: Re: [PATCH 0/8] Initial support for SMMUv3 nested translation Message-ID: References: <0-v1-54e734311a7f+14f72-smmuv3_nesting_jgg@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0-v1-54e734311a7f+14f72-smmuv3_nesting_jgg@nvidia.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240820_012040_723163_706E06FE X-CRM114-Status: GOOD ( 28.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Jason, On Tue, Aug 06, 2024 at 08:41:13PM -0300, Jason Gunthorpe wrote: > This brings support for the IOMMFD ioctls: > > - IOMMU_GET_HW_INFO > - IOMMU_HWPT_ALLOC_NEST_PARENT > - IOMMU_DOMAIN_NESTED > - ops->enforce_cache_coherency() > > This is quite straightforward as the nested STE can just be built in the > special NESTED domain op and fed through the generic update machinery. > > The design allows the user provided STE fragment to control several > aspects of the translation, including putting the STE into a "virtual > bypass" or a aborting state. This duplicates functionality available by > other means, but it allows trivially preserving the VMID in the STE as we > eventually move towards the VIOMMU owning the VMID. > > Nesting support requires the system to either support S2FWB or the > stronger CANWBS ACPI flag. This is to ensure the VM cannot bypass the > cache and view incoherent data, currently VFIO lacks any cache flushing > that would make this safe. > > Yan has a series to add some of the needed infrastructure for VFIO cache > flushing here: > > https://lore.kernel.org/linux-iommu/20240507061802.20184-1-yan.y.zhao@intel.com/ > > Which may someday allow relaxing this further. > > Remove VFIO_TYPE1_NESTING_IOMMU since it was never used and superseded by > this. > > This is the first series in what will be several to complete nesting > support. At least: > - IOMMU_RESV_SW_MSI related fixups > - VIOMMU object support to allow ATS invalidations > - vCMDQ hypervisor support for direct invalidation queue assignment > - KVM pinned VMID using VIOMMU for vBTM > - Cross instance S2 sharing > - Virtual Machine Structure using VIOMMU (for vMPAM?) > - Fault forwarding support through IOMMUFD's fault fd for vSVA > > It is enough to allow significant amounts of qemu work to progress. > Are there any qemu patches to tests this? As I am confused with some of the user space bits and that would help. Thanks, Mostafa > This is on github: https://github.com/jgunthorpe/linux/commits/smmuv3_nesting > > Jason Gunthorpe (5): > vfio: Remove VFIO_TYPE1_NESTING_IOMMU > iommu/arm-smmu-v3: Use S2FWB when available > iommu/arm-smmu-v3: Report IOMMU_CAP_ENFORCE_CACHE_COHERENCY for CANWBS > iommu/arm-smmu-v3: Implement IOMMU_HWPT_ALLOC_NEST_PARENT > iommu/arm-smmu-v3: Support IOMMU_DOMAIN_NESTED > > Nicolin Chen (3): > ACPI/IORT: Support CANWBS memory access flag > iommu/arm-smmu-v3: Support IOMMU_GET_HW_INFO via struct > arm_smmu_hw_info > iommu/arm-smmu-v3: Add arm_smmu_cache_invalidate_user > > drivers/acpi/arm64/iort.c | 13 + > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 398 ++++++++++++++++++-- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 27 ++ > drivers/iommu/arm/arm-smmu/arm-smmu.c | 16 - > drivers/iommu/io-pgtable-arm.c | 24 +- > drivers/iommu/iommu.c | 10 - > drivers/iommu/iommufd/vfio_compat.c | 7 +- > drivers/vfio/vfio_iommu_type1.c | 12 +- > include/acpi/actbl2.h | 1 + > include/linux/io-pgtable.h | 2 + > include/linux/iommu.h | 54 ++- > include/uapi/linux/iommufd.h | 79 ++++ > include/uapi/linux/vfio.h | 2 +- > 13 files changed, 572 insertions(+), 73 deletions(-) > > > base-commit: e5e288d94186b266b062b3e44c82c285dfe68712 > -- > 2.46.0 >