Re: [virtio-dev] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-21 Thread Jason Wang
On Thu, Sep 21, 2023 at 2:28 PM Chen, Jiqian wrote: > > Hi Jason, > > On 2023/9/21 12:22, Jason Wang wrote: > > On Tue, Sep 19, 2023 at 7:43 PM Jiqian Chen wrote: > >> > >> When guest vm does S3, Qemu will reset and clear some things of virtio > >> devices, but guest can't aware that, so that may

Re: [virtio-dev] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Chen, Jiqian
Hi Jason, On 2023/9/21 12:22, Jason Wang wrote: > On Tue, Sep 19, 2023 at 7:43 PM Jiqian Chen wrote: >> >> When guest vm does S3, Qemu will reset and clear some things of virtio >> devices, but guest can't aware that, so that may cause some problems. >> For excample, Qemu calls virtio_reset->virt

Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Jason Wang
On Tue, Sep 19, 2023 at 7:43 PM Jiqian Chen wrote: > > When guest vm does S3, Qemu will reset and clear some things of virtio > devices, but guest can't aware that, so that may cause some problems. > For excample, Qemu calls virtio_reset->virtio_gpu_gl_reset when guest > resume, that function will

Re: [virtio-comment] RE: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Chen, Jiqian
On 2023/9/20 15:56, Parav Pandit wrote: > Hi Jiquian, > >> From: Chen, Jiqian >> Sent: Wednesday, September 20, 2023 1:24 PM >> >> Hi Lingshan, >> Please reply to your own email thread, below are not related to my patches. >> Thanks a lot. > > They are related to your patch. > Both the patche

RE: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Parav Pandit
Hi Jiquian, > From: Chen, Jiqian > Sent: Wednesday, September 20, 2023 1:24 PM > > Hi Lingshan, > Please reply to your own email thread, below are not related to my patches. > Thanks a lot. They are related to your patch. Both the patches have overlapping functionalities. You probably missed

Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Zhu, Lingshan
On 9/20/2023 3:51 PM, Parav Pandit wrote: From: Zhu, Lingshan Sent: Wednesday, September 20, 2023 1:17 PM This is not live or device migration. This is restoring the device context initiated by the driver owning the device. restore the device context should be done by the hypervisor before

Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Chen, Jiqian
Hi Lingshan, Please reply to your own email thread, below are not related to my patches. Thanks a lot. On 2023/9/20 15:47, Zhu, Lingshan wrote: > > > On 9/20/2023 3:35 PM, Parav Pandit wrote: >>> From: Zhu, Lingshan >>> Sent: Wednesday, September 20, 2023 1:00 PM >>> >>> On 9/20/2023 3:24 PM,

RE: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Parav Pandit
> From: Zhu, Lingshan > Sent: Wednesday, September 20, 2023 1:17 PM > > This is not live or device migration. This is restoring the device context > initiated by the driver owning the device. > restore the device context should be done by the hypervisor before setting > DRIVER_OK and waking up t

RE: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Parav Pandit
> From: Zhu, Lingshan > Sent: Wednesday, September 20, 2023 1:16 PM [..] > > In my view, setting the DRIVER_OK is the signal regardless of hypervisor or > physical device. > > Hence the re-read is must. > Yes, as I said below, should verify by re-read. > > Thanks.

Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Zhu, Lingshan
On 9/20/2023 3:35 PM, Parav Pandit wrote: From: Zhu, Lingshan Sent: Wednesday, September 20, 2023 1:00 PM On 9/20/2023 3:24 PM, Chen, Jiqian wrote: Hi Lingshan, It seems you reply to the wrong email thread. They are not related to my patch. These reply to Parva's comments. @Parva, if you w

Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Zhu, Lingshan
On 9/20/2023 3:32 PM, Parav Pandit wrote: From: Zhu, Lingshan Sent: Wednesday, September 20, 2023 12:58 PM On 9/20/2023 3:10 PM, Parav Pandit wrote: From: Zhu, Lingshan Sent: Wednesday, September 20, 2023 12:37 PM The problem to overcome in [1] is, resume operation needs to be synchrono

Re: [virtio-comment] Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Zhu, Lingshan
On 9/20/2023 3:17 PM, Chen, Jiqian wrote: Hi Lingshan, On 2023/9/20 14:58, Zhu, Lingshan wrote: On 9/20/2023 2:33 PM, Chen, Jiqian wrote: Hi Lingshan, On 2023/9/20 13:59, Zhu, Lingshan wrote: On 9/19/2023 8:31 PM, Michael S. Tsirkin wrote: On Tue, Sep 19, 2023 at 07:42:42PM +0800, Jiqia

RE: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Parav Pandit
> From: Zhu, Lingshan > Sent: Wednesday, September 20, 2023 1:00 PM > > On 9/20/2023 3:24 PM, Chen, Jiqian wrote: > > Hi Lingshan, > > It seems you reply to the wrong email thread. They are not related to my > patch. > These reply to Parva's comments. > @Parva, if you want to discuss more about

RE: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Parav Pandit
> From: Zhu, Lingshan > Sent: Wednesday, September 20, 2023 12:58 PM > > On 9/20/2023 3:10 PM, Parav Pandit wrote: > >> From: Zhu, Lingshan > >> Sent: Wednesday, September 20, 2023 12:37 PM > >>> The problem to overcome in [1] is, resume operation needs to be > >>> synchronous > >> as it invol

Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Zhu, Lingshan
On 9/20/2023 3:24 PM, Chen, Jiqian wrote: Hi Lingshan, It seems you reply to the wrong email thread. They are not related to my patch. These reply to Parva's comments. @Parva, if you want to discuss more about live migration, please reply in my thread, lets don't flood here. On 2023/9/20 1

Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Zhu, Lingshan
On 9/20/2023 3:10 PM, Parav Pandit wrote: From: Zhu, Lingshan Sent: Wednesday, September 20, 2023 12:37 PM The problem to overcome in [1] is, resume operation needs to be synchronous as it involves large part of context to resume back, and hence just asynchronously setting DRIVER_OK is not

Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Chen, Jiqian
Hi Lingshan, It seems you reply to the wrong email thread. They are not related to my patch. On 2023/9/20 15:06, Zhu, Lingshan wrote: > > > On 9/20/2023 2:58 PM, Parav Pandit wrote: >>> From: Chen, Jiqian >>> Sent: Wednesday, September 20, 2023 12:03 PM >>> If driver write 0 to reset device, ca

Re: [virtio-comment] Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Chen, Jiqian
Hi Lingshan, On 2023/9/20 14:58, Zhu, Lingshan wrote: > > > On 9/20/2023 2:33 PM, Chen, Jiqian wrote: >> Hi Lingshan, >> >> On 2023/9/20 13:59, Zhu, Lingshan wrote: >>> >>> On 9/19/2023 8:31 PM, Michael S. Tsirkin wrote: On Tue, Sep 19, 2023 at 07:42:42PM +0800, Jiqian Chen wrote: > Whe

RE: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Parav Pandit
> From: Zhu, Lingshan > Sent: Wednesday, September 20, 2023 12:37 PM > > The problem to overcome in [1] is, resume operation needs to be synchronous > as it involves large part of context to resume back, and hence just > asynchronously setting DRIVER_OK is not enough. > > The sw must verify back

Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Zhu, Lingshan
On 9/20/2023 2:58 PM, Parav Pandit wrote: From: Chen, Jiqian Sent: Wednesday, September 20, 2023 12:03 PM If driver write 0 to reset device, can the SUSPEND bit be cleared? It must as reset operation, resets everything else and so the suspend too. (pci_pm_resume->virtio_pci_restore->virtio

Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Zhu, Lingshan
On 9/20/2023 2:33 PM, Chen, Jiqian wrote: Hi Lingshan, On 2023/9/20 13:59, Zhu, Lingshan wrote: On 9/19/2023 8:31 PM, Michael S. Tsirkin wrote: On Tue, Sep 19, 2023 at 07:42:42PM +0800, Jiqian Chen wrote: When guest vm does S3, Qemu will reset and clear some things of virtio devices, but

RE: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-19 Thread Parav Pandit
> From: Chen, Jiqian > Sent: Wednesday, September 20, 2023 12:03 PM > If driver write 0 to reset device, can the SUSPEND bit be cleared? It must as reset operation, resets everything else and so the suspend too. > (pci_pm_resume->virtio_pci_restore->virtio_device_restore- > >virtio_reset_device

Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-19 Thread Chen, Jiqian
Hi Lingshan, On 2023/9/20 13:59, Zhu, Lingshan wrote: > > > On 9/19/2023 8:31 PM, Michael S. Tsirkin wrote: >> On Tue, Sep 19, 2023 at 07:42:42PM +0800, Jiqian Chen wrote: >>> When guest vm does S3, Qemu will reset and clear some things of virtio >>> devices, but guest can't aware that, so that

Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-19 Thread Zhu, Lingshan
On 9/19/2023 8:31 PM, Michael S. Tsirkin wrote: On Tue, Sep 19, 2023 at 07:42:42PM +0800, Jiqian Chen wrote: When guest vm does S3, Qemu will reset and clear some things of virtio devices, but guest can't aware that, so that may cause some problems. For excample, Qemu calls virtio_reset->virt

Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-19 Thread Chen, Jiqian
Hi Michael S. Tsirkin, On 2023/9/19 20:31, Michael S. Tsirkin wrote: > On Tue, Sep 19, 2023 at 07:42:42PM +0800, Jiqian Chen wrote: >> When guest vm does S3, Qemu will reset and clear some things of virtio >> devices, but guest can't aware that, so that may cause some problems. >> For excample, Qe

RE: [virtio-dev] RE: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-19 Thread Parav Pandit
> From: Chen, Jiqian > Sent: Wednesday, September 20, 2023 9:28 AM > >> For above purpose, we need a mechanism that allows guests and QEMU to > >> negotiate their reset behavior. So this patch add a new parameter > >> named > > Freeze != reset. :) > > Please fix it to say freeze or suspend. > B

Re: [virtio-dev] RE: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-19 Thread Chen, Jiqian
Hi Parav, On 2023/9/19 20:10, Parav Pandit wrote: > Hi Jiqian, > >> From: Jiqian Chen >> Sent: Tuesday, September 19, 2023 5:13 PM >> >> When guest vm does S3, Qemu will reset and clear some things of virtio >> devices, but guest can't aware that, so that may cause some problems. > It is not tru

Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-19 Thread Michael S. Tsirkin
On Tue, Sep 19, 2023 at 12:10:29PM +, Parav Pandit wrote: > Hi Jiqian, > > > From: Jiqian Chen > > Sent: Tuesday, September 19, 2023 5:13 PM > > > > When guest vm does S3, Qemu will reset and clear some things of virtio > > devices, but guest can't aware that, so that may cause some problems

Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-19 Thread Michael S. Tsirkin
On Tue, Sep 19, 2023 at 07:42:42PM +0800, Jiqian Chen wrote: > When guest vm does S3, Qemu will reset and clear some things of virtio > devices, but guest can't aware that, so that may cause some problems. > For excample, Qemu calls virtio_reset->virtio_gpu_gl_reset when guest > resume, that functi

RE: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-19 Thread Parav Pandit
Hi Jiqian, > From: Jiqian Chen > Sent: Tuesday, September 19, 2023 5:13 PM > > When guest vm does S3, Qemu will reset and clear some things of virtio > devices, but guest can't aware that, so that may cause some problems. It is not true that guest VM is not aware of it. As you show in your kerne

[VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-19 Thread Jiqian Chen
When guest vm does S3, Qemu will reset and clear some things of virtio devices, but guest can't aware that, so that may cause some problems. For excample, Qemu calls virtio_reset->virtio_gpu_gl_reset when guest resume, that function will destroy render resources of virtio-gpu. As a result, after gu