Re: [Qemu-devel] [PATCH] usb/xchi: avoid trigger assertion if guest write wrong epid

2019-04-29 Thread Longpeng (Mike)
On 2019/4/30 13:06, Philippe Mathieu-Daudé wrote: > On 4/30/19 4:02 AM, Longpeng (Mike) wrote: >> On 2019/4/29 20:10, Philippe Mathieu-Daudé wrote: >>> On 4/29/19 1:42 PM, Longpeng (Mike) wrote: >>>> Hi Philippe, >>>> >>>> On 2019/4/29 1

[Qemu-devel] [PATCH v2] usb/xchi: avoid trigger assertion if guest write wrong epid

2019-04-29 Thread Longpeng(Mike)
From: Longpeng we found the following core in our environment: 0 0x7fc6b06c2237 in raise () 1 0x7fc6b06c3928 in abort () 2 0x7fc6b06bb056 in __assert_fail_base () 3 0x7fc6b06bb102 in __assert_fail () 4 0x00702e36 in xhci_kick_ep (...) 5 0x0047897a in memory_r

[PATCH] migration: handle CANCELLING state in migration_completion()

2020-11-05 Thread Longpeng(Mike)
ort(). The migration_completion() should not change the migration state to COMPLETED if it is already changed to CANCELLING. Signed-off-by: Longpeng(Mike) --- migration/migration.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index 3263aa5..b11a

RE: [PATCH v5 4/6] kvm: irqchip: extract kvm_irqchip_add_deferred_msi_route

2021-11-11 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
Hi Paolo, Ping... Do you have any suggestions about this change ? It seems Alex has no objection on this series now, but we need your ACK, thanks. > -Original Message- > From: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > Sent: Wednesday, November 3, 2021 4:1

RE: [PATCH v5 4/6] kvm: irqchip: extract kvm_irqchip_add_deferred_msi_route

2021-11-13 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
> -Original Message- > From: Paolo Bonzini [mailto:pbonz...@redhat.com] > Sent: Friday, November 12, 2021 5:32 PM > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > ; alex.william...@redhat.com > Cc: qemu-devel@nongnu.org; k...@vger.kernel.

RE: [PATCH v3 9/9] vfio: defer to commit kvm irq routing when enable msi/msix

2021-10-05 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
> -Original Message- > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Saturday, October 2, 2021 7:05 AM > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > > Cc: phi...@redhat.com; pbonz...@redhat.com; marcel.apfelb...@gmail.com;

RE: [PATCH v4 6/6] vfio: defer to commit kvm irq routing when enable msi/msix

2021-11-02 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
> -Original Message- > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Friday, October 22, 2021 4:51 AM > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > > Cc: pbonz...@redhat.com; qemu-devel@nongnu.org; k...@vger.kernel.or

RE: [PATCH v3 4/9] msix: simplify the conditional in msix_set/unset_vector_notifiers

2021-10-07 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
> -Original Message- > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Saturday, October 2, 2021 7:04 AM > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > > Cc: phi...@redhat.com; pbonz...@redhat.com; marcel.apfelb...@gmail.com;

RE: [PATCH v3 7/9] vfio: add infrastructure to commit the deferred kvm routing

2021-10-07 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
> -Original Message- > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Saturday, October 2, 2021 7:05 AM > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > > Cc: phi...@redhat.com; pbonz...@redhat.com; marcel.apfelb...@gmail.com;

RE: [PATCH v3 8/9] Revert "vfio: Avoid disabling and enabling vectors repeatedly in VFIO migration"

2021-10-07 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
> -Original Message- > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Saturday, October 2, 2021 7:04 AM > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > > Cc: phi...@redhat.com; pbonz...@redhat.com; marcel.apfelb...@gmail.com;

[Question] An issue when repeat reboot in guest during migration

2020-03-08 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
and safe but it just reduce the probability. 2. To support nest pause. Use a refcount to instead of the 'bool stop', switch the 'stopped' to false only when the refcount reduce to zero. Maybe this can completely solve the problem but it seems easy to introduce other bugs if imprudence. Any suggestions ? Thanks. --- Regards, Longpeng(Mike)

Re: [PATCH 2/2] migration: add vsock as data channel support

2020-08-13 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
在 2020/8/12 17:52, Dr. David Alan Gilbert 写道: * Longpeng(Mike) (longpe...@huawei.com) wrote: The vsock channel is more widely use in some new features, for example, the Nitro/Enclave. It can also be used as the migration channel. Signed-off-by: Longpeng(Mike) OK; it might be worth adding

Re: [PATCH RESEND 2/3] vhost: fix a null pointer reference of vhost_log

2020-03-09 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
Hi Michael, ping... On 2020/2/24 14:42, Longpeng(Mike) wrote: > From: Longpeng > > vhost_log_alloc() may fails and returned pointer of log is null. > However there're two places derefernce the return pointer without > check. > > Signed-off-by: Longpeng >

Re: [PATCH RESEND 2/3] vhost: fix a null pointer reference of vhost_log

2020-03-10 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
On 2020/3/10 13:57, Michael S. Tsirkin wrote: > On Mon, Feb 24, 2020 at 02:42:18PM +0800, Longpeng(Mike) wrote: >> From: Longpeng >> >> vhost_log_alloc() may fails and returned pointer of log is null. >> However there're two places derefernce the return pointe

Re: [PATCH] vfio/pci: Use defined memcpy() behavior

2020-03-10 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
v); > } > > -memcpy(&val, vdev->rom + addr, > - (addr < vdev->rom_size) ? MIN(size, vdev->rom_size - addr) : 0); > +if (addr < vdev->rom_size) { > +memcpy(&val, vdev->rom + addr, MIN(size, vdev->rom_size - addr)); > +} > > switch (size) { > case 1: > > . > --- Regards, Longpeng(Mike)

Re: [RFC] cpus: avoid get stuck in pause_all_vcpus

2020-03-12 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
On 2020/3/12 23:28, Paolo Bonzini wrote: > On 10/03/20 10:14, Longpeng(Mike) wrote: >> From: Longpeng >> >> We find an issue when repeat reboot in guest during migration, it cause the >> migration thr

Re: [RFC] cpus: avoid get stuck in pause_all_vcpus

2020-03-13 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
On 2020/3/13 15:09, Paolo Bonzini wrote: > On 13/03/20 02:43, Longpeng (Mike, Cloud Infrastructure Service Product > Dept.) wrote: >>> diff --git a/cpus.c b/cpus.c >>> index b4f8b84b61..1eb7533a91 100644 >>> --- a/cpus.c >>> +++ b/cpus.c >>>

Re: [RFC] cpus: avoid get stuck in pause_all_vcpus

2020-03-13 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
On 2020/3/13 17:22, Paolo Bonzini wrote: > On 13/03/20 09:36, Longpeng (Mike, Cloud Infrastructure Service Product > Dept.) wrote: >>> You're right, do_vm_stop sets the runstate after pause_all_vcpus. We >>> can move that before and it should fix your case too. &g

Re: A bug of Monitor Chardev ?

2021-05-24 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
Hi Marc, 在 2021/5/22 0:59, Marc-André Lureau 写道: > Hi > > On Fri, May 21, 2021 at 8:56 PM Daniel P. Berrangé > wrote: > > On Fri, May 21, 2021 at 05:33:46PM +0100, Daniel P. Berrangé wrote: > > On Fri, May 21, 2021 at 10:43:36AM -0400, Peter Xu wrote: > >

A bug of Monitor Chardev ?

2021-05-17 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
We find a race during QEMU starting, which would case the QEMU process coredump. | | [1] create MON chardev | qemu_create_early_backends | chardev_init_func |

Re: [PATCH v16 QEMU 04/16] vfio: Add save and load functions for VFIO PCI devices

2020-04-06 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
= { > .vfio_compute_needs_reset = vfio_pci_compute_needs_reset, > .vfio_hot_reset_multi = vfio_pci_hot_reset_multi, > .vfio_eoi = vfio_intx_eoi, > .vfio_get_object = vfio_pci_get_object, > +.vfio_save_config = vfio_pci_save_config, > +.vfio_load_config = vfio_pci_load_config, > }; > > int vfio_populate_vga(VFIOPCIDevice *vdev, Error **errp) > diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h > index 74261feaeac9..d69a7f3ae31e 100644 > --- a/include/hw/vfio/vfio-common.h > +++ b/include/hw/vfio/vfio-common.h > @@ -120,6 +120,8 @@ struct VFIODeviceOps { > int (*vfio_hot_reset_multi)(VFIODevice *vdev); > void (*vfio_eoi)(VFIODevice *vdev); > Object *(*vfio_get_object)(VFIODevice *vdev); > +void (*vfio_save_config)(VFIODevice *vdev, QEMUFile *f); > +int (*vfio_load_config)(VFIODevice *vdev, QEMUFile *f); > }; > > typedef struct VFIOGroup { > -- --- Regards, Longpeng(Mike)

Re: [PATCH RESEND 1/3] vfio/pci: fix a null pointer reference in vfio_rom_read

2020-02-24 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
On 2020/2/25 0:04, Alex Williamson wrote: > On Mon, 24 Feb 2020 14:42:17 +0800 > "Longpeng(Mike)" wrote: > >> From: Longpeng >> >> vfio_pci_load_rom() maybe failed and then the vdev->rom is NULL in >> some situation (though I've not enco

Re: [RFC] vfio/migration: reduce the msix virq setup cost in resume phase

2021-08-17 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
在 2021/8/18 4:26, Alex Williamson 写道: > On Fri, 13 Aug 2021 12:06:14 +0800 > "Longpeng(Mike)" wrote: > >> In migration resume phase, all unmasked msix vectors need to be >> setup when load the VF state. However, the setup operation would >> takes longe

Re: [RFC] vfio/migration: reduce the msix virq setup cost in resume phase

2021-08-17 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
在 2021/8/18 11:50, Longpeng (Mike, Cloud Infrastructure Service Product Dept.) 写道: > > > 在 2021/8/18 4:26, Alex Williamson 写道: >> On Fri, 13 Aug 2021 12:06:14 +0800 >> "Longpeng(Mike)" wrote: >> >>> In migration resume phase, all unmasked msix

Re: [PATCH 2/5] msix: simplfy the conditional in msix_set/unset_vector_notifiers

2021-08-25 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
在 2021/8/25 17:52, Philippe Mathieu-Daudé 写道: > On 8/25/21 9:56 AM, Longpeng(Mike) wrote: >> 'msix_function_masked' is kept pace with the device's config, >> we can use it to replace the complex conditional in >> msix_set/unset_vector_notifiers. >

Re: [PATCH 3/5] vfio: defer to enable msix in migration resume phase

2021-08-25 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
在 2021/8/25 17:57, Philippe Mathieu-Daudé 写道: > On 8/25/21 9:56 AM, Longpeng(Mike) wrote: >> The vf's unmasked msix vectors will be enable one by one in >> migraiton resume phase, VFIO_DEVICE_SET_IRQS will be called > > Typo "migration" > Ok. >>

Re: [PATCH 0/5] optimize the downtime for vfio migration

2021-08-25 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
在 2021/8/25 18:05, Philippe Mathieu-Daudé 写道: > Cc'ing David/Juan for migration big picture (just in case). > > On 8/25/21 9:56 AM, Longpeng(Mike) wrote: >> In vfio migration resume phase, the cost would increase if the >> vfio device has more unmasked vectors. We try

Re: A bug of Monitor Chardev ?

2021-06-08 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
在 2021/6/8 23:37, Daniel P. Berrangé 写道: > On Tue, Jun 08, 2021 at 04:07:30PM +0200, Markus Armbruster wrote: >> "Longpeng (Mike, Cloud Infrastructure Service Product Dept.)" >> writes: >> >>> We find a race during QEMU starting, which w

[Question] Reduce the msix_load cost for VFIO device

2021-08-03 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
Hi Alex, We found that the msix_load() will cost 40~50ms if the VF has 60+ interrupts, the following code cost too much for each interrupt: msix_load: for (vector = 0; vector < 60; vector++) msix_handle_mask_update vfio_msix_vector_do_use vfio_add_kvm_msi_virq kvm_ir

Re: [Question] Reduce the msix_load cost for VFIO device

2021-08-03 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
在 2021/8/3 22:19, Alex Williamson 写道: > On Tue, 3 Aug 2021 16:43:07 +0800 > "Longpeng (Mike, Cloud Infrastructure Service Product Dept.)" > wrote: > >> Hi Alex, >> >> We found that the msix_load() will cost 40~50ms if the VF has 60+ interrupts, >

Re: [Question] Reduce the msix_load cost for VFIO device

2021-08-09 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
Hi Alex, 在 2021/8/3 22:19, Alex Williamson 写道: > On Tue, 3 Aug 2021 16:43:07 +0800 > "Longpeng (Mike, Cloud Infrastructure Service Product Dept.)" > wrote: > >> Hi Alex, >> >> We found that the msix_load() will cost 40~50ms if the VF has 60+ interrupts,

Re: [PATCH v2 0/9] optimize the downtime for vfio migration

2021-09-20 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
Hi guys, Ping... I just sent out V3, please review on V3, thanks! 在 2021/9/9 14:06, Longpeng(Mike) 写道: > Hi guys, > > In vfio migration resume phase, the cost would increase if the > vfio device has more unmasked vectors. We try to optimize it in > this series. > > Y

Re: [PATCH 0/5] optimize the downtime for vfio migration

2021-09-02 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
Hi maintainers, Ping... 在 2021/8/25 15:56, Longpeng(Mike) 写道: > In vfio migration resume phase, the cost would increase if the > vfio device has more unmasked vectors. We try to optimize it in > this series. > > Patch 1 & 2 are simple code cleanups. > Patch 3 defers to

Re: [PATCH 1/5] vfio: use helper to simplfy the failure path in vfio_msi_enable

2021-09-06 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
在 2021/9/4 5:55, Alex Williamson 写道: > On Wed, 25 Aug 2021 15:56:16 +0800 > "Longpeng(Mike)" wrote: > >> The main difference of the failure path in vfio_msi_enable and >> vfio_msi_disable_common is enable INTX or not. >> >> Extend the vfio_ms

Re: [PATCH 3/5] vfio: defer to enable msix in migration resume phase

2021-09-06 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
在 2021/9/4 5:56, Alex Williamson 写道: > On Wed, 25 Aug 2021 15:56:18 +0800 > "Longpeng(Mike)" wrote: > >> The vf's unmasked msix vectors will be enable one by one in >> migraiton resume phase, VFIO_DEVICE_SET_IRQS will be called >> for each vecto

Re: [PATCH 4/5] kvm: irqchip: support defer to commit the route

2021-09-06 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
在 2021/9/4 5:57, Alex Williamson 写道: > On Wed, 25 Aug 2021 15:56:19 +0800 > "Longpeng(Mike)" wrote: > >> The kvm_irqchip_commit_routes() is relatively expensive, so >> provide the users a choice to commit the route immediately >> or not when they ad

Re: [PATCH 5/5] vfio: defer to commit kvm route in migraiton resume phase

2021-09-06 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
在 2021/9/4 5:57, Alex Williamson 写道: > On Wed, 25 Aug 2021 15:56:20 +0800 > "Longpeng(Mike)" wrote: > >> In migration resume phase, all unmasked msix vectors need to be >> setup when load the VF state. However, the setup operation would >> takes longe

<    1   2   3   4   5   6