From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796303706; b=CBabl5DUdZnis+hGiNJSbympmezUEE/IB2ptPN3FU8g1LegVTAqdNCBJttZ6SQwCYXZH uxkKAW5+Sc4Tt5IB3Tiz9bi9SmNnhzC49iWe19Dz2CGpf+LQ5FMjnnN/sZx1hgD9Mzzkf bqjDy+3yD5A7T0DXz5FvT4T7AS8trN0fdY+hlroxywjoJ/WS10XqCRIGApWgJ6OpvrIyB mV1/UncZITb5pY3QgvipAF99Hxy2xbhyHTaje9s8OX6ccz0bit0pye3CJRfkokiyPa3hN LU9XypwFF/t4yAgHlU2sfoCAvR17tFkYFAAC8fncbsTUYCwKnz8/iX/c6e+LPjXTkoA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796303706; h=Received:DKIM-Signature:X-Mailer:From:To:Cc:Subject:In-Reply-To: References:Date:Message-ID:MIME-Version:Content-Type; bh=5iYwn9r5ItKcN+qaZcNU19to3FSlMpBZ1Ft/EHNJN4Y=; b=hc/US/+B3Jx9VDeWH9gpVnI2g5lJF0QwwEugzrBgwomSPQDSsY48dawffnCB17sf+lpO X+fyiZcHVOFjCq86X/v8hKyVjfZF5H7GcRFqGuJvV8wcTiXUDuxyX+rr7CmvblePK9C4F SFJOD6QGcVXL6Vk80GS8KLd1nrYyJJnLUdH0ZVy3S4J15bQclqmunzAgfCf8Kz2C13qQO e+wzkRn2G2ej2TuItFPUmRnOiAfPgGvrsOOcx+B6A0GgU1b7FWglZkJQC/5Cbhl2g1Q0n EFKWSy7doVTy1SEBb4023K+NSOLLuutzOgAj6fmHslFF+A3RUgpAwV4+Fu6qHUzpC2w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=PAmLP8hW; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3517C606A32C; Thu, 3 Dec 2026 13:15:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=PAmLP8hW Received: by smtp.kernel.org (Postfix) with ESMTPSA id 238FE1F0089F; Thu, 3 Dec 2026 13:14:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796303705; bh=5iYwn9r5ItKcN+qaZcNU19to3FSlMpBZ1Ft/EHNJN4Y=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=PAmLP8hWc9XYYwYxeYGh/duS1YX/TUn50BPk1R6f5Bj1VNb+gzSPedshoPkvplahF itxWOpazZfFBIqGY4LUxR+D8hOY26NS+j9n2ZB6itkHQ84Iq+uGB833Rmm1IOYoBHP +fYBXqyrPzcVU9IkNylIei8TGp4GinXb3K1qP+LMc/1Y252FgomflGojqLDQxumF6n R++LC7BGSAlmv3lyAvLgvTaW7FumBwvmydKDBAQk9cHn2aTjALQOUe7QR61HrtMzq2 mByGMnZbw9LuOJBTOa0kfJ1c1yuei0Qm9VZwHZtUz6N/5cUw8/8xH+ZVStqYxdDmz9 5d2KK3bYB8EdQ== X-Mailer: emacs 31.1 (via feedmail 11-beta-1 I) From: Aneesh Kumar K.V To: "Tian, Kevin" , "linux-coco@lists.linux.dev" Cc: Alex Williamson , Alexey Kardashevskiy , Bjorn Helgaas , Catalin Marinas , Jacob Pan , Jason Gunthorpe , Joerg Roedel , Jonathan Cameron , Jonathan Hunter , Krishna Reddy , Lukas Wunner , Nicolin Chen , Robin Murphy , Samuel Ortiz , Shameer Kolothum , Steven Price , Suravee Suthikulpanit , Suzuki K Poulose , Thierry Reding , Vasant Hegde , Will Deacon , Xu Yilun , Ashish Kalra , Herbert Xu , Jonathan Cameron , Tom Lendacky , "kvm@vger.kernel.org" , "iommu@lists.linux.dev" , "linux-arm-kernel@lists.infradead.org" , "linux-pci@vger.kernel.org" , "linux-tegra@vger.kernel.org" , "patches@lists.linux.dev" Subject: RE: [PATCH v10 00/18] iommufd: TSM-backed virtual IOMMUs for confidential guests In-Reply-To: References: <20261125081121.379481-1-aneesh.kumar@kernel.org> Date: Thu, 03 Dec 2026 18:44:51 +0530 Message-ID: X-Mailing-List: linux-pci@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 Aneesh Kumar K.V writes: > "Tian, Kevin" writes: > >>> From: Aneesh Kumar K.V (Arm) >>> Sent: Wednesday, November 25, 2026 4:11 PM >>> >>> This series adds IOMMUFD and PCI/TSM infrastructure for assigning PCI >>> devices to confidential guests. A TEE Security Manager (TSM) can provide a >>> virtual IOMMU (vIOMMU), and an IOMMUFD vDEVICE object represents a >>> physical >>> device within that virtual IOMMU. >>> >>> The series adds a common framework for operations on vDEVICE objects and >>> updates lifetime management to keep the VM and device-security resources >>> available while those objects are in use. >>> >>> The Arm CCA backend is provided in a separate series, together with >>> operations for TEE Device Interface Security Protocol (TDISP) state changes >>> and access to cached device-attestation objects. >>> >>> The full series, including the Arm CCA backend, is available at: >>> >>> https://git.gitlab.arm.com/linux-arm/linux-cca.git >>> branch: cca/topics/7.4/cca-da-integration-v2 >>> >>> Notes: >>> * Codex was used to assist with commit message formatting and code >>> rearrangement. >>> >>> Changes from v9: >>> https://lore.kernel.org/all/20261116081935.85372-1- >>> aneesh.kumar@kernel.org >>> * Split the PCI/TSM get/put helpers from removal of the legacy bind/unbind >>> interface. >>> * Split the TSM lookup/reference helpers from their IOMMUFD >>> callers >>> * Replace allocated PCI/TSM contexts with get/put helpers that update the >>> DSM user count on PF0. Remove unused context accessors and >>> pci_tsm_is_configured(). >>> * Add a tagged union for the physical IOMMU and TSM pointers in a >>> vIOMMU. >>> >> >> I think this is respun too quickly. As Jason pointed out there are many dependencies >> here, so it's still far from landing. It would be better to allow more time between >> versions to ensure receiving as much feedback as possible from key stakeholders >> (Jason, Alexey, etc.) >> > > One reason for the quick respin was to accommodate feedback from related > discussions in other threads. The last two patches and their locking > will be simplified further based on: > > https://patch.msgid.link/20261123083337.2731019-9-aneesh.kumar@kernel.org > > So you can skip reviewing those patches for now. > To elaborate, with the changes I have ready, PF0 removal retries the disconnect until dsm_context_users reaches zero. While waiting, it drops pci_tsm_rwsem and waits on the tsm_dev::disconnect_wait wait queue. This allows pci_dsm_context_put() to release assignment references and wake the waiter. PF0 removal therefore waits for the disconnect to complete. TSM unregistration disconnects all DSMs using the same checks and wait/retry mechanism. Once they are disconnected, it drops the initial user reference taken during tsm_register() and waits for a completion while the remaining users, such as vIOMMUs, release their references. This considerably simplifies the last two patches. Based on your earlier feedback, I will wait another week before sending these changes? -aneesh