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=1796286385; b=qeL3yYFgEqAYwX7Y+yv6ITqRodElMXnPP3sEtMGPFdTFCKwaNxvE0/pVg4G9cObNEXn+ Ni3ErtNqw+s87RJoNCxRzJklBchciC0QeTQezz1cyiQprDC4qu6jGDaaw1QaCke7MFyb+ b6AHNeT84VsUwZP0G+qXJH6b2j4toyYGB5BB0YMoDs5O/eLnmFYT3K7fg2RXycZy8+5lo l5W8VVJUQ46ttmGIgW8GcdMGTcbowtQYwN3q1jCjied0UDTvVhGxdthSMGclgHrBjpNaS udyPbURcb4Johp6+fFqgHc1gNnGtbmkZl9o1J639Tao9YTJH6OYYT4c2YYR+EMvgyrg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796286385; h=Received:DKIM-Signature:X-Mailer:From:To:Cc:Subject:In-Reply-To: References:Date:Message-ID:MIME-Version:Content-Type; bh=HlyGyNJKsYzt77ijDMRz/kwXkq17OV//KU9JKEV8W4U=; b=xfjSmukfYdXIQRle8ij1XymmUMfC1zECLnRSPGvMlBIgEJmM5mHowBBIsakjnlXedEa7 PR3+sRY4OUKwKTBDe9vcujSjQg7OkYDynQYtNgoM2iaQRAFmz7tP6AsbtIv6Y2lTqVJIy QXj+DMnhpK80mztNMspc7ee5kZNVMc9DER8GBodmdzLcLL1rPzwgT/DgU7tD/oksUyxGJ X52p3ktVQ4xvBS4JOXQcKBhkIld7jxyVcSTOUbSG/WoEw7dyG6pFQsJOmD2WNQG9PotC3 pcqEp89SwvRVvSj5Jrd4ROiHygn9h707tq0SCINav9FuyI0w4xAfpXN4GO06NzpSnPQ== 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=i2mkEJud; 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 9B473606A32C; Thu, 3 Dec 2026 08:26:25 +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=i2mkEJud Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8DB91F00893; Thu, 3 Dec 2026 08:26:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796286385; bh=HlyGyNJKsYzt77ijDMRz/kwXkq17OV//KU9JKEV8W4U=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=i2mkEJudguVFsMbSdHa+cUlDPhWLjoHQtROoMNfIlE4hPUfZJME5XaT9JBqd4R+88 o10kOET4CQqlSGNJxiTx8bTcupLzpX8NM3yoPJB693NOZHfWEc0Z+xwqegWxEGO3NF ruwHPFqu2piE5a/iIjw/1btjDV9xjCPBUk2G3C4K8IfoSnG2tpnEqbBcaN1owybdtv fop6+m7J2jxKxsa/sVwLN5AP5RUCj4vMtR/q1adHOmPMcnfcyblZqAAH9yJk7xboWj d0k8XIl1hj/yGgohtwPb13V8a5O/v+o+R70mLsCKsCoxzPpH/dRrYyv0XOJxOMPtkO GEfWHXoC8BPzg== 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 10/18] PCI/TSM: Add helpers to prevent disconnect while in use In-Reply-To: References: <20261125081121.379481-1-aneesh.kumar@kernel.org> <20261125081121.379481-11-aneesh.kumar@kernel.org> Date: Thu, 03 Dec 2026 13:56:14 +0530 Message-ID: X-Mailing-List: kvm@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 "Tian, Kevin" writes: >> From: Aneesh Kumar K.V (Arm) >> Sent: Wednesday, November 25, 2026 4:11 PM >> >> Add PCI TEE Security Manager (TSM) helpers that prevent PF0 disconnect >> while a function is in use. Validate the function's TSM association and >> increment PF0's dsm_context_users count on get. Find PF0 through the >> same function and decrement the count on put. Reject disconnect with >> -EBUSY until all users have released it. > > 'context' is confusing here. what about 'link_users" as the real purpose > is to reject link disconnect when the count is positive? > > then the related helpers can be renamed: > > pci_tsm_context_get/put() -> pci_tsm_link_get/put() > Sure, I'll update the names. > >> >> The caller must prevent removal of the function between get and put, for >> example by keeping its VFIO device open. No per-call allocation is >> needed. > > closing the VFIO device doesn't remove the pci device. > What I meant is that VFIO prevents the PCI function itself from being removed. -aneesh