From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.12 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796006436; b=Ngn5HQqRwkiJ2YppWLUElD4IinpVsRReFDOQB7VukNEkFQLdzZuw4v2DoiuvqIMKzBLW Ps1hBoQpmZkpWCO3ixszJJ4HMAxWeGn2eRkoPeitf5aq0wDRFevpb50Kbz8hSZ6AxPuoI JClB+0TlQAtZm3Yz2NuQWEwbIvPLYy8+vd4DJaQLqng8JNk8NryQ0fXZ4R05PxGx4/V3s hW7V4sMj7Tfk81CfdoIRJHOkUZkvzJkKNEd9SWzTfcLvEb6EifskC+jR7ru8qjCwLfYcr GMRBfdy4uwIvWbVVBzMUaCHuVBC9NvZp4mvyly3tYhZqx1DmHJB3CiOfhN2uPnxW6UA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796006436; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=jyLbjYLS+HapePZGwduEkpp6ccN3gTMuOyi1QOsnPUw=; b=HUsuj63zycjYCZPIlvNeSv4WHdTmYB1D25BJGaHVJiyvNltSwzDftT/1wAHUvE5TA5WG gRFaOmehaBC1KdnHi8rE66qRTDpo3KQr9QMSszKZDAu/bF0UrlPua/Evvt+L6jvgYcibm FS4HGADoDsutIDcDIkbsWQ0NUE3XBbyDWm5AgVGtbhuQoZRgso57DTo8IvfMRGf0ygldJ /+upI40tEvUdL2GNH+Z3grU4R3dtmRBrrS95ja8+5An1oBvhjRjawYN/ehqc8BDx0W9a7 Fy+Wzew+ilvDoqtVLEYBed3Ys/cv3xXMhgKUaJdwdGvXHAA5Dti+zfCAbb4xr6413Dw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=A1jvoG68; arc=none smtp.remote-ip=192.198.163.12 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22FDF606A32F for ; Mon, 30 Nov 2026 02:40:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 22FDF606A32F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=A1jvoG68 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796006435; x=1827542435; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=hY2NoTPP78LcTwbwzcY5e6dj4Qcc7unayiJ1wUkYj8E=; b=A1jvoG68CxFIEwRrTtN8DBpCt/In4qaR7Q9MZS0PIL8bk6QYogBX1tO0 1xsTRmmWZMq2qkI44qCRtlWPunFAJKEAU8bIyHwyTRndz+Gw0H+N1WDKh lTDKDxSMk7RCsZQMKkYHv9vSegHZHZU0bi0QroY/Qfcz7k3riYK5Uw49S Y+3U5a/Ql/G7TFXb+c/mEN+oXeUVkJIoEeUKMMSudkphejVStxn28cH3X W7epTjcS7nUEY5vOBQ8TCMVWHGMql77AoBWVJOsFMyktB4vddcKLYtsN0 xuDUVzPexjrYObZ9OMt7vymuL0vXPNwStuKMfp9h8E13W5xeXiw7gYP0y Q==; X-CSE-ConnectionGUID: L+iiDQhiTS2tbSX1BN2Gyg== X-CSE-MsgGUID: XoDGNycyTwm/+oUH/LlOFg== X-IronPort-AV: E=McAfee;i="6800,10657,11981"; a="4726475" X-IronPort-AV: E=Sophos;i="6.27,241,1787036400"; d="scan'208";a="4726475" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2026 18:40:34 -0800 X-CSE-ConnectionGUID: JkxYNMgFRqKLjumnwta6Mg== X-CSE-MsgGUID: cwI+HGvoSHOsRiZF4lIXSA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,241,1787036400"; d="scan'208";a="12812459" Received: from unknown (HELO gnr-sp-2s-612) ([10.112.229.148]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2026 18:40:30 -0800 Date: Mon, 30 Nov 2026 10:40:23 +0800 From: Zhenzhong Duan To: Nicolin Chen Cc: Jason Gunthorpe , joro@8bytes.org, Will Deacon , Robin Murphy , Catalin Marinas , rafael@kernel.org, Danilo Krummrich , Johan Hovold , Marek Szyprowski , Mark Rutland , Greg Kroah-Hartman , Pranjal Shrivastava , Mostafa Saleh , linux-kernel@vger.kernel.org, iommu@lists.linux.dev, driver-core@lists.linux.dev, Sonang Patel , Ankit Agrawal , shameerali.kolothum.thodi@huawei.com Subject: Re: [PATCH v3 0/7] iommu/arm-smmu-v3: Support guest-level Realm VSMMU (Part-1) Message-ID: References: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Nov 10, 2026 at 12:50:05PM -0800, Nicolin Chen wrote: > This series prepares Realm guest IOMMU and DMA subsystems for devices that > are present but not yet inside the Realm trust boundary. > > Inside a confidential guest, we expect that all the iommus are going to be > T=1 aware; there seems to be no interest in supporting IOMMUs that handle > T=0 only. This means they only work on devices that have been put into the > run state and issue T=1 transactions. > > Today an iommu driver assumes it translates for every device behind it: it > probes the device, takes a translating default domain, and puts the DMA API > on its page tables. That assumption is wrong for T=0 devices, whose DMA the > hypervisor translates instead, so the mappings made by the guest are never > consulted and the device silently stops working. > > To solve this problem, make TDISP T=0 the default for devices associated > with a confidential IOMMU. The tdisp_t1 flag records the future T=1 state. > > While T=0, the device remains outside the Realm trust boundary. Its DMA is > translated by the host or hypervisor: > > [device: T=0] ===> [hypervisor] ===> [memory] > | > +-- (guest association) --> [confidential IOMMU: blocking DMA] > > Legend: ===> DMA path; --> guest topology and control > > After reaching T=1, the device is inside the Realm trust boundary. Its DMA > may use the guest VSMMU after RMM binds the device to its virtual stream: > > [device] ===> [VSMMU: S1] ===> [RMM/PSMMU: S2 + DPT] ===> [memory] Just curious, do we support other domains for a T=1 device, e.g., bypassing S1, I mean attaching it to an identity domain in guest, or VSMMU is forecly enabled for this device if T=1? Thanks Zhenzhong > > As part 1 of Realm VSMMU support, implement enough core infrastructure to > manage a confidential vIOMMU: > - Detect and mark it as confidential in the core iommu structures > - Support devices in T=0 mode by keeping the DMA API in direct mode. The > iommu is up and running, but parks such a device in its blocking domain > and translates for nothing, as the core takes over what the device still > needs, which today is ATS > - Keep it parked: refuse a translating domain by every route in, whether > through the default domain, sysfs, group attach or replace, or PASID > > Part 1 only adds the helpers required for T=0 setup and teardown. It does > not add iommu_tdisp_enter_t1() until part 2 has a transition to perform. > > Then implement SMMUv3 support: > - Let a CPU-integrated IOMMU declare that its DMA can reach private > memory, so coherent allocations and streaming mappings avoid the SWIOTLB > shared pool > - Identify a T=1 VSMMU using trusted RSI because firmware does not > distinguish it from a normal T=0 SMMU > - Validate the firmware MMIO range against RSI before activating the VSMMU > and allocating its queues and tables from private memory > > The series is on github: > https://github.com/nicolinc/iommufd/commits/smmuv3_realm_guest_p1-v3 > > Changelog > v3: > * Add Acked-by from Marek > * Disable and enable ATS for T=0 devices across a PCI reset > * Rename dma_require_decrypted() to dma_require_unencrypted() > * Explain the minimum STU used to enable ATS while TDISP is T=0 > v2: > https://lore.kernel.org/all/cover.1793676742.git.nicolinc@nvidia.com/ > * Rebase on v7.4-rc1 > * Drop Assisted-by tags > * Drop Aneesh's firmware patch that was merged > * Skip Tegra CMDQV implementation in the realm world > * Use arm_smccc_1_2_smc() to zero inputs as RMM spec demands > * Add missing iommu_using_t0_stream() check in iommu_dma_prepare_msi() > v1: > https://lore.kernel.org/all/cover.1789010941.git.nicolinc@nvidia.com/ > > Future work > =========== > > Part 2 will add the T=1 transition after validation through: > > - TSM, whose guest-side interface remains under discussion > - RMM, using the Arm-specific RSI VDEV command > > For a multi-device IOMMU group, the first device accepted into T=1 claims > the group. Part 2 will reject T=1 for every other member. > > The current RSI binding validation returns one VSID, so part 2 must reject > a firmware specification containing multiple SIDs upon the T=1 transition. > > Nicolin Chen (7): > firmware: arm_rmm: Add VSMMU commands and fields > dma-mapping: Let a device declare that it reaches private memory > dma-mapping: Keep DMA memory private for capable devices > iommu: Let a driver mark an IOMMU as confidential > iommu: Introduce TDISP T=0 state for confidential IOMMUs > iommu: Park TDISP T=0 devices in the blocking domain > iommu/arm-smmu-v3: Probe a guest-level Realm VSMMU via RSI commands > > drivers/iommu/Makefile | 3 + > drivers/iommu/iommu-priv.h | 19 ++++ > include/linux/arm-rsi-cmds.h | 29 ++++++ > include/linux/arm-smccc-rsi.h | 20 ++++ > include/linux/device.h | 4 + > include/linux/dma-direct.h | 7 +- > include/linux/dma-mapping.h | 4 + > include/linux/iommu.h | 14 +++ > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 64 +++++++++++- > drivers/iommu/iommu-cc.c | 63 ++++++++++++ > drivers/iommu/iommu.c | 104 +++++++++++++++++++- > kernel/dma/direct.c | 21 ++-- > kernel/dma/mapping.c | 23 ++++- > kernel/dma/swiotlb.c | 2 +- > 14 files changed, 357 insertions(+), 20 deletions(-) > create mode 100644 drivers/iommu/iommu-cc.c > > > base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4 > -- > 2.43.0 >