From: Jason Gunthorpe <jgg@nvidia.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>
Cc: sashiko-reviews@lists.linux.dev, linux-coco@lists.linux.dev,
kvm@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH v7 09/16] tsm: Remove the device from lookup before PCI teardown
Date: Tue, 13 Oct 2026 08:57:48 -0300 [thread overview]
Message-ID: <20261013115748.GO13920@nvidia.com> (raw)
In-Reply-To: <yq5ald82q934.fsf@kernel.org>
On Tue, Oct 13, 2026 at 02:19:03PM +0530, Aneesh Kumar K.V wrote:
> The proposed fix is to reorder registration so that device_add() is
> called last.
IMHO I'd leave this until we have a complete story. I'm nervous it was
written this way for some reason that still isn't obvious.
> I expect these operations to require manual setup: the administrator
> would first unbind the device from its driver, configure IDE, and then
> bind it to vfio-pci if the device is to be passed through.
No, definitely not. Once a driver is bound that is a security decision
that cannot be taken back. If this stuff is going to provide any
security it must happen before the driver is bound. This is why the
trust level exists to prevent driver binding so userspace can inject
some measurement and policy.
In bare metal cases where you might want to use the SW DOE flow this
still has to happen before binding any drivers, we can take a
measurement of the device and log it before granting it any access to
the system.
So the whole thing needs to work in some fairly automatic way where
the device-accept-d in the initrd is starting up SPDM, making
measurements, applying some policy, then binding drivers.
Meaning right at the very start it has to know if some kind of
platform TSM is available and it has to be able to auto-load the SW
DOE if there isn't..
And make decisions about which devices even have a TSM option or
not.
> Since device bind and unbind operations are already driven through
> sysfs, it seems natural for the connect operation to use sysfs as
> well?
Only if it can be made to actually work properly.
Jason
next prev parent reply other threads:[~2026-10-13 11:57 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 5:59 [PATCH v7 00/16] iommufd: vIOMMUs and TSM guest requests for confidential guests Aneesh Kumar K.V (Arm)
2026-10-08 5:59 ` [PATCH v7 01/16] KVM: Introduce file_to_kvm_<arch>() infrastructure Aneesh Kumar K.V (Arm)
2026-10-08 5:59 ` [PATCH v7 02/16] KVM: Add file back-pointer to struct kvm Aneesh Kumar K.V (Arm)
2026-10-08 5:59 ` [PATCH v7 03/16] KVM: x86: Use file_to_kvm_x86() in SEV Aneesh Kumar K.V (Arm)
2026-10-08 5:59 ` [PATCH v7 04/16] KVM/vfio: Use file-based reference counting for KVM Aneesh Kumar K.V (Arm)
2026-10-08 5:59 ` [PATCH v7 05/16] KVM: Restrict kvm_get_kvm/kvm_put_kvm export to internal KVM modules Aneesh Kumar K.V (Arm)
2026-10-08 5:59 ` [PATCH v7 06/16] KVM: Remove unused file_is_kvm Aneesh Kumar K.V (Arm)
2026-10-08 5:59 ` [PATCH v7 07/16] iommufd/device: Associate KVM file pointer with iommufd_device Aneesh Kumar K.V (Arm)
2026-10-08 5:59 ` [PATCH v7 08/16] iommufd/viommu: Keep a reference to the KVM file Aneesh Kumar K.V (Arm)
2026-10-08 5:59 ` [PATCH v7 09/16] tsm: Remove the device from lookup before PCI teardown Aneesh Kumar K.V (Arm)
[not found] ` <sashiko-outbox-163673@kernel.org>
2026-10-12 9:14 ` Aneesh Kumar K.V
2026-10-12 13:01 ` Jason Gunthorpe
2026-10-13 8:49 ` Aneesh Kumar K.V
2026-10-13 11:57 ` Jason Gunthorpe [this message]
2026-10-08 5:59 ` [PATCH v7 10/16] iommufd: Add the vdevice TSM request ioctl Aneesh Kumar K.V (Arm)
2026-10-08 5:59 ` [PATCH v7 11/16] PCI/TSM: Remove the legacy guest request interface Aneesh Kumar K.V (Arm)
2026-10-08 5:59 ` [PATCH v7 12/16] PCI/TSM: Add vIOMMU-bound contexts for vdevices Aneesh Kumar K.V (Arm)
2026-10-08 5:59 ` [PATCH v7 13/16] iommufd/viommu: Select vIOMMU operations before allocation Aneesh Kumar K.V (Arm)
2026-10-08 5:59 ` [PATCH v7 14/16] iommufd/viommu: Allow PCI TSM backends to provide vIOMMU operations Aneesh Kumar K.V (Arm)
[not found] ` <sashiko-outbox-163680@kernel.org>
2026-10-12 9:55 ` Aneesh Kumar K.V
2026-10-08 5:59 ` [PATCH v7 15/16] iommufd: Allow vIOMMUs without a parent HWPT Aneesh Kumar K.V (Arm)
2026-10-08 5:59 ` [PATCH v7 16/16] PCI/TSM: wait for vdevice contexts before removing a DSM Aneesh Kumar K.V (Arm)
[not found] ` <sashiko-outbox-163687@kernel.org>
2026-10-12 10:01 ` Aneesh Kumar K.V
2026-10-12 13:07 ` Jason Gunthorpe
2026-10-13 9:44 ` Aneesh Kumar K.V
2026-10-13 11:59 ` Jason Gunthorpe
2026-10-12 20:34 ` Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261013115748.GO13920@nvidia.com \
--to=jgg@nvidia.com \
--cc=aneesh.kumar@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-pci@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox