RE: [PATCH 4/4] virtio_pci: Support surprise removal of virtio pci device
From: Parav Pandit via Virtualization <hidden>
Date: 2021-07-19 14:15:12
From: Michael S. Tsirkin <mst@redhat.com> Sent: Monday, July 19, 2021 5:37 PM On Mon, Jul 19, 2021 at 05:44:49AM +0000, Parav Pandit wrote:quoted
quoted
From: Michael S. Tsirkin <mst@redhat.com> Sent: Sunday, July 18, 2021 2:17 AM On Sat, Jul 17, 2021 at 10:42:58AM +0300, Parav Pandit wrote:quoted
When a virtio pci device undergo surprise removal (aka async removaln intypoFixing it. Checkpatch.pl and codespell, both didn't catch it. 😊quoted
OK that's nice, but I suspect this is not enough. For example we need to also fix up all config space reads to handle all-ones patterns specially. E.g. /* After writing 0 to device_status, the driver MUST wait for a read of * device_status to return 0 before reinitializing the device. * This will flush out the status write, and flush in device writes, * including MSI-X interrupts, if any. */ while (vp_modern_get_status(mdev)) msleep(1); lots of code in drivers needs to be fixed too.Above one particularly known to us in the hot plug area. Above fix is needed to close the race of hot plug and unplug happening inparallel, which is occurring today, but less common.quoted
It is in my todo list to fix it. Will take care of it in near future in other series.quoted
I guess we need to annotate drivers somehow to mark up whether they support surprise removal? And maybe find a way to let host know?What is the benefit of it? Who can make use of that information?For example, host could avoid removing devices by hot removal if guest is not ready for it. Or libosinfo could use that to tell users what to do.
Not sure how to achieve it. Because this is decided by the pci hot plug driver at bit early stage. And pci hot plug slot doesn't know what is going to arrive in it.
quoted
In virtio pci case, it is similar improvement to what nvme pci driver wentthrough few years back to support hot plug/unplug.quoted
Lets complete this of fixes to make it little more robust like nvme.At least please mention in commit log that it's incomplete.
This fix is self-contained. I don’t see mentioning about other bugs in this commit log. But sure yes, I will mentioned in the cover letter that more improvements will be done subsequently. Thanks. _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization