public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Robin Murphy <robin.murphy@arm.com>
Cc: Ethan Zhao <haifeng.zhao@linux.intel.com>,
	bhelgaas@google.com, baolu.lu@linux.intel.com,
	dwmw2@infradead.org, will@kernel.org, linux-pci@vger.kernel.org,
	iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
	Haorong Ye <yehaorong@bytedance.com>
Subject: Re: [PATCH 2/2] iommu/vt-d: don's issue devTLB flush request when device is disconnected
Date: Thu, 21 Dec 2023 12:07:43 +0100	[thread overview]
Message-ID: <20231221110743.GA1619@wunner.de> (raw)
In-Reply-To: <6f49be01-89e3-4407-9813-51d62e723947@arm.com>

On Thu, Dec 21, 2023 at 11:01:56AM +0000, Robin Murphy wrote:
> On 2023-12-21 10:42 am, Lukas Wunner wrote:
> > On Wed, Dec 13, 2023 at 11:54:05AM +0000, Robin Murphy wrote:
> > > I think if we want to ensure ATCs are invalidated on hot-unplug we need an
> > > additional pre-removal notifier to take care of that, and that step would
> > > then want to distinguish between an orderly removal where cleaning up is
> > > somewhat meaningful, and a surprise removal where it definitely isn't.
> > 
> > Even if a user starts the process for orderly removal, the device may be
> > surprise-removed *during* that process.  So we cannot assume that the
> > device is actually accessible if orderly removal has been initiated.
> > If the form factor supports surprise removal, the device may be gone
> > at any time.
> 
> Sure, whatever we do there's always going to be some unavoidable
> time-of-check-to-time-of-use race window so we can never guarantee that
> sending a request to the device will succeed. I was just making the point
> that if we *have* already detected a surprise removal, then cleaning up its
> leftover driver model state should still generate a BUS_NOTIFY_REMOVE_DEVICE
> call, but in that case we can know there's no point trying to send any
> requests to the device that's already gone.

Right, using pci_dev_is_disconnected() as a *speedup* when we
definitely know the device is gone, that's perfectly fine.

So in that sense the proposed patch is acceptable *after* this
series has been extended to make sure hard lockups can *never*
occur on unplug.

Thanks,

Lukas

  reply	other threads:[~2023-12-21 11:07 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13  3:46 [PATCH RFC 0/2] fix vt-d hard lockup when hotplug ATS capable device Ethan Zhao
2023-12-13  3:46 ` [PATCH 1/2] PCI: make pci_dev_is_disconnected() helper public for other drivers Ethan Zhao
2023-12-13 10:49   ` Lukas Wunner
2023-12-14  0:58     ` Ethan Zhao
2023-12-21 10:51       ` Lukas Wunner
2023-12-22  2:35         ` Ethan Zhao
2023-12-13  3:46 ` [PATCH 2/2] iommu/vt-d: don's issue devTLB flush request when device is disconnected Ethan Zhao
2023-12-13 10:44   ` Lukas Wunner
2023-12-13 11:54     ` Robin Murphy
2023-12-14  2:40       ` Ethan Zhao
2023-12-21 10:42       ` Lukas Wunner
2023-12-21 11:01         ` Robin Murphy
2023-12-21 11:07           ` Lukas Wunner [this message]
2023-12-22  3:20         ` Ethan Zhao
2023-12-14  2:16     ` Ethan Zhao
2023-12-15  0:43       ` Ethan Zhao
2023-12-13 11:59   ` Baolu Lu
2023-12-14  2:26     ` Ethan Zhao
2023-12-15  1:03       ` Ethan Zhao
2023-12-15  1:34         ` Baolu Lu
2023-12-15  1:51           ` Ethan Zhao
  -- strict thread matches above, loose matches on Subject: below --
2023-12-20  0:51 [PATCH v4 0/2] fix vt-d hard lockup when hotplug ATS capable device Ethan Zhao
2023-12-20  0:51 ` [PATCH v4 1/2] PCI: make pci_dev_is_disconnected() helper public for other drivers Ethan Zhao
2023-12-20  0:51 ` [PATCH v4 2/2] iommu/vt-d: don's issue devTLB flush request when device is disconnected Ethan Zhao
2023-12-21 10:39   ` Lukas Wunner
2023-12-21 11:01     ` Lukas Wunner
2023-12-22  2:08       ` Ethan Zhao
2023-12-22  3:56       ` Ethan Zhao
2023-12-22  1:56     ` Ethan Zhao
2023-12-22  8:14       ` Lukas Wunner
2023-12-22  9:01         ` Ethan Zhao

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=20231221110743.GA1619@wunner.de \
    --to=lukas@wunner.de \
    --cc=baolu.lu@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=dwmw2@infradead.org \
    --cc=haifeng.zhao@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    --cc=yehaorong@bytedance.com \
    /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