Re: [PATCH v3 kvm/queue 14/16] KVM: Handle page fault for private memory

2022-01-13 Thread Yan Zhao
hi Sean, Sorry for the late reply. I just saw this mail in my mailbox. On Wed, Jan 05, 2022 at 08:52:39PM +, Sean Christopherson wrote: > On Wed, Jan 05, 2022, Yan Zhao wrote: > > Sorry, maybe I didn't express it clearly. > > > > As in the kvm_faultin_pfn_p

Re: [PATCH v3 kvm/queue 14/16] KVM: Handle page fault for private memory

2022-01-05 Thread Yan Zhao
On Wed, Jan 05, 2022 at 02:28:10PM +0800, Chao Peng wrote: > On Tue, Jan 04, 2022 at 06:06:12PM +0800, Yan Zhao wrote: > > On Tue, Jan 04, 2022 at 05:10:08PM +0800, Chao Peng wrote: <...> > > Thanks. So QEMU will re-generate memslots and set KVM_MEM_PRIVATE > > accord

Re: [PATCH v3 kvm/queue 14/16] KVM: Handle page fault for private memory

2022-01-04 Thread Yan Zhao
On Tue, Jan 04, 2022 at 05:10:08PM +0800, Chao Peng wrote: > On Tue, Jan 04, 2022 at 09:46:35AM +0800, Yan Zhao wrote: > > On Thu, Dec 23, 2021 at 08:30:09PM +0800, Chao Peng wrote: > > > When a page fault from the secondary page table while the guest is > > > runnin

Re: [PATCH v3 kvm/queue 14/16] KVM: Handle page fault for private memory

2022-01-03 Thread Yan Zhao
On Thu, Dec 23, 2021 at 08:30:09PM +0800, Chao Peng wrote: > When a page fault from the secondary page table while the guest is > running happens in a memslot with KVM_MEM_PRIVATE, we need go > different paths for private access and shared access. > > - For private access, KVM checks if the page

Re: VFIO Migration

2020-11-05 Thread Yan Zhao
On Tue, Nov 03, 2020 at 10:13:05AM -0700, Alex Williamson wrote: > On Tue, 3 Nov 2020 11:03:24 + > Stefan Hajnoczi wrote: <...> > > > Management tools need to match the device model/configuration from the > > source device against the destination device. If the destination is > > capable of

Re: [PATCH v28 03/17] vfio: Add save and load functions for VFIO PCI devices

2020-10-24 Thread Yan Zhao
On Sat, Oct 24, 2020 at 08:16:30AM -0600, Alex Williamson wrote: > On Sat, 24 Oct 2020 19:53:39 +0800 > Yan Zhao wrote: > > > hi > > when I migrating VFs, the PCI_COMMAND is not properly saved. and the > > target side would meet below bug > > root@tester:~#

Re: [PATCH v28 10/17] memory: Set DIRTY_MEMORY_MIGRATION when IOMMU is enabled

2020-10-24 Thread Yan Zhao
Reviewed-by: Yan Zhao On Fri, Oct 23, 2020 at 04:10:36PM +0530, Kirti Wankhede wrote: > mr->ram_block is NULL when mr->is_iommu is true, then fr.dirty_log_mask > wasn't set correctly due to which memory listener's log_sync doesn't > get called. >

Re: [PATCH v28 09/17] vfio: Add load state functions to SaveVMHandlers

2020-10-24 Thread Yan Zhao
Reviewed-by: Yan Zhao On Fri, Oct 23, 2020 at 04:10:35PM +0530, Kirti Wankhede wrote: > Sequence during _RESUMING device state: > While data for this device is available, repeat below steps: > a. read data_offset from where user application should write data. > b. write data of

Re: [PATCH v28 08/17] vfio: Add save state functions to SaveVMHandlers

2020-10-24 Thread Yan Zhao
Reviewed-by: Yan Zhao On Fri, Oct 23, 2020 at 04:10:34PM +0530, Kirti Wankhede wrote: > Added .save_live_pending, .save_live_iterate and .save_live_complete_precopy > functions. These functions handles pre-copy and stop-and-copy phase. > > In _SAVING|_RUNNING device state or pr

Re: [PATCH v28 14/17] vfio: Dirty page tracking when vIOMMU is enabled

2020-10-24 Thread Yan Zhao
Reviewed-by: Yan Zhao On Fri, Oct 23, 2020 at 04:10:40PM +0530, Kirti Wankhede wrote: > When vIOMMU is enabled, add MAP notifier from log_sync when all > devices in container are in stop and copy phase of migration. Call replay > and then from notifier callback, get dirty pages. >

Re: [PATCH v28 03/17] vfio: Add save and load functions for VFIO PCI devices

2020-10-24 Thread Yan Zhao
+0x120/0x140 [ 199.415876] ? process_one_work+0x410/0x410 [ 199.416380] ? __kthread_parkme+0x70/0x70 [ 199.416864] ret_from_fork+0x35/0x40 I fixed it with below patch. commit ad3efa0eeea7edb352294bfce35b904b8d3c759c Author: Yan Zhao Date: Sat Oct 24 19:45:01 2020 +0800 msix fix. S

Re: [PATCH v28 07/17] vfio: Register SaveVMHandlers for VFIO device

2020-10-24 Thread Yan Zhao
> + > +ret = vfio_migration_set_state(vbasedev, VFIO_DEVICE_STATE_MASK, > + VFIO_DEVICE_STATE_SAVING); > +if (ret) { > +error_report("%s: Failed to set state SAVING", vbasedev->name); > +return ret; > +}

Re: device compatibility interface for live migration with assigned devices

2020-09-10 Thread Yan Zhao
On Thu, Sep 10, 2020 at 12:02:44PM -0600, Alex Williamson wrote: > On Thu, 10 Sep 2020 13:50:11 +0100 > Sean Mooney wrote: > > > On Thu, 2020-09-10 at 14:38 +0200, Cornelia Huck wrote: > > > On Wed, 9 Sep 2020 10:13:09 +0800 > > > Yan Zhao wrote: > > >

Re: device compatibility interface for live migration with assigned devices

2020-09-08 Thread Yan Zhao
hi All, Per our previous discussion, there are two main concerns to the previous proposal: (1) it's currently hard for openstack to match mdev types. (2) complicated. so, we further propose below changes: (1) requiring two compatible mdevs to have the same mdev type for now. (though kernel sti

Re: device compatibility interface for live migration with assigned devices

2020-09-08 Thread Yan Zhao
> > still, I'd like to put it more explicitly to make ensure it's not missed: > > the reason we want to specify compatible_type as a trait and check > > whether target compatible_type is the superset of source > > compatible_type is for the consideration of backward compatibility. > > e.g. > > an o

Re: device compatibility interface for live migration with assigned devices

2020-08-30 Thread Yan Zhao
On Fri, Aug 28, 2020 at 03:04:12PM +0100, Sean Mooney wrote: > On Fri, 2020-08-28 at 15:47 +0200, Cornelia Huck wrote: > > On Wed, 26 Aug 2020 14:41:17 +0800 > > Yan Zhao wrote: > > > > > previously, we want to regard the two mdevs created with dsa-1dwq x 30 and >

Re: device compatibility interface for live migration with assigned devices

2020-08-30 Thread Yan Zhao
On Fri, Aug 28, 2020 at 03:47:41PM +0200, Cornelia Huck wrote: > On Wed, 26 Aug 2020 14:41:17 +0800 > Yan Zhao wrote: > > > previously, we want to regard the two mdevs created with dsa-1dwq x 30 and > > dsa-2dwq x 15 as compatible, because the two mdevs consist equal resour

Re: device compatibility interface for live migration with assigned devices

2020-08-26 Thread Yan Zhao
On Thu, Aug 20, 2020 at 02:24:26PM +0100, Sean Mooney wrote: > On Thu, 2020-08-20 at 14:27 +0800, Yan Zhao wrote: > > On Thu, Aug 20, 2020 at 06:16:28AM +0100, Sean Mooney wrote: > > > On Thu, 2020-08-20 at 12:01 +0800, Yan Zhao wrote: > > > > On Thu, Aug 20, 2020 at

Re: device compatibility interface for live migration with assigned devices

2020-08-25 Thread Yan Zhao
On Tue, Aug 25, 2020 at 04:39:25PM +0200, Cornelia Huck wrote: <...> > > do you think the bin_attribute I proposed yesterday good? > > Then we can have a single compatible with a variable in the mdev_type and > > aggregator. > > > >mdev_type=i915-GVTg_V5_{val1:int:2,4,8} > >aggregator={val

Re: device compatibility interface for live migration with assigned devices

2020-08-19 Thread Yan Zhao
On Thu, Aug 20, 2020 at 06:16:28AM +0100, Sean Mooney wrote: > On Thu, 2020-08-20 at 12:01 +0800, Yan Zhao wrote: > > On Thu, Aug 20, 2020 at 02:29:07AM +0100, Sean Mooney wrote: > > > On Thu, 2020-08-20 at 08:39 +0800, Yan Zhao wrote: > > > > On Tue, Aug 18, 2020

Re: device compatibility interface for live migration with assigned devices

2020-08-19 Thread Yan Zhao
On Thu, Aug 20, 2020 at 02:29:07AM +0100, Sean Mooney wrote: > On Thu, 2020-08-20 at 08:39 +0800, Yan Zhao wrote: > > On Tue, Aug 18, 2020 at 11:36:52AM +0200, Cornelia Huck wrote: > > > On Tue, 18 Aug 2020 10:16:28 +0100 > > > Daniel P. Berrangé wrote: > > >

Re: device compatibility interface for live migration with assigned devices

2020-08-19 Thread Yan Zhao
On Wed, Aug 19, 2020 at 09:22:34PM -0600, Alex Williamson wrote: > On Thu, 20 Aug 2020 08:39:22 +0800 > Yan Zhao wrote: > > > On Tue, Aug 18, 2020 at 11:36:52AM +0200, Cornelia Huck wrote: > > > On Tue, 18 Aug 2020 10:16:28 +0100 > > > Daniel P. Berrangé wrote

Re: device compatibility interface for live migration with assigned devices

2020-08-19 Thread Yan Zhao
On Wed, Aug 19, 2020 at 09:13:45PM -0600, Alex Williamson wrote: > On Thu, 20 Aug 2020 08:18:10 +0800 > Yan Zhao wrote: > > > On Wed, Aug 19, 2020 at 11:50:21AM -0600, Alex Williamson wrote: > > <...> > > > > > > > What I care abou

Re: device compatibility interface for live migration with assigned devices

2020-08-19 Thread Yan Zhao
; > > On Tue, Aug 18, 2020 at 11:24:30AM +0800, Jason Wang wrote: > > > > > > On 2020/8/14 下午1:16, Yan Zhao wrote: > > > > > > On Thu, Aug 13, 2020 at 12:24:50PM +0800, Jason Wang wrote: > > > > > > On 2020/8/10 下午3:46, Yan

Re: device compatibility interface for live migration with assigned devices

2020-08-19 Thread Yan Zhao
On Wed, Aug 19, 2020 at 11:50:21AM -0600, Alex Williamson wrote: <...> > > > > > What I care about is that we have a *standard* userspace API for > > > > > performing device compatibility checking / state migration, for use by > > > > > QEMU/libvirt/ OpenStack, such that we can write code without c

Re: [ovirt-devel] Re: device compatibility interface for live migration with assigned devices

2020-08-19 Thread Yan Zhao
On Wed, Aug 19, 2020 at 03:39:50PM +0800, Jason Wang wrote: > > On 2020/8/19 下午2:59, Yan Zhao wrote: > > On Wed, Aug 19, 2020 at 02:57:34PM +0800, Jason Wang wrote: > > > On 2020/8/19 上午11:30, Yan Zhao wrote: > > > > hi All, > > > > could we decid

Re: [ovirt-devel] Re: device compatibility interface for live migration with assigned devices

2020-08-19 Thread Yan Zhao
On Wed, Aug 19, 2020 at 02:57:34PM +0800, Jason Wang wrote: > > On 2020/8/19 上午11:30, Yan Zhao wrote: > > hi All, > > could we decide that sysfs is the interface that every VFIO vendor driver > > needs to provide in order to support vfio live migration, otherwise the >

Re: device compatibility interface for live migration with assigned devices

2020-08-18 Thread Yan Zhao
On Tue, Aug 18, 2020 at 09:39:24AM +, Parav Pandit wrote: > Hi Cornelia, > > > From: Cornelia Huck > > Sent: Tuesday, August 18, 2020 3:07 PM > > To: Daniel P. Berrangé > > Cc: Jason Wang ; Yan Zhao > > ; k...@vger.kernel.org; libvir-l...@redhat.c

Re: device compatibility interface for live migration with assigned devices

2020-08-16 Thread Yan Zhao
On Fri, Aug 14, 2020 at 01:30:00PM +0100, Sean Mooney wrote: > On Fri, 2020-08-14 at 13:16 +0800, Yan Zhao wrote: > > On Thu, Aug 13, 2020 at 12:24:50PM +0800, Jason Wang wrote: > > > > > > On 2020/8/10 下午3:46, Yan Zhao wrote: > > > > > driver is it hand

Re: device compatibility interface for live migration with assigned devices

2020-08-13 Thread Yan Zhao
On Thu, Aug 13, 2020 at 12:24:50PM +0800, Jason Wang wrote: > > On 2020/8/10 下午3:46, Yan Zhao wrote: > > > driver is it handled by? > > It looks that the devlink is for network device specific, and in > > devlink.h, it says > > include/uapi/linux/devlink.h

Re: device compatibility interface for live migration with assigned devices

2020-08-10 Thread Yan Zhao
Aug 05, 2020 at 04:41:54AM CEST, jasow...@redhat.com wrote: > >> > > On 2020/8/5 上午10:16, Yan Zhao wrote: > >> > > > On Wed, Aug 05, 2020 at 10:22:15AM +0800, Jason Wang wrote: > >> > > > > On 2020/8/5 上午12:35, Cornelia Huck wrote: > >> >

Re: device compatibility interface for live migration with assigned devices

2020-08-05 Thread Yan Zhao
On Wed, Aug 05, 2020 at 04:02:48PM +0800, Jason Wang wrote: > > On 2020/8/5 下午3:56, Jiri Pirko wrote: > > Wed, Aug 05, 2020 at 04:41:54AM CEST, jasow...@redhat.com wrote: > > > On 2020/8/5 上午10:16, Yan Zhao wrote: > > > > On Wed, Aug 05, 2020 at 10:22:15AM +080

Re: device compatibility interface for live migration with assigned devices

2020-08-04 Thread Yan Zhao
On Wed, Aug 05, 2020 at 10:22:15AM +0800, Jason Wang wrote: > > On 2020/8/5 上午12:35, Cornelia Huck wrote: > > [sorry about not chiming in earlier] > > > > On Wed, 29 Jul 2020 16:05:03 +0800 > > Yan Zhao wrote: > > > > > On Mon, Jul 27, 20

Re: device compatibility interface for live migration with assigned devices

2020-08-04 Thread Yan Zhao
> > yes, include a device_api field is better. > > for mdev, "device_type=vfio-mdev", is it right? > > No, vfio-mdev is not a device API, it's the driver that attaches to the > mdev bus device to expose it through vfio. The device_api exposes the > actual interface of the vfio device, it's also v

Re: device compatibility interface for live migration with assigned devices

2020-07-29 Thread Yan Zhao
On Wed, Jul 29, 2020 at 01:12:55PM -0600, Alex Williamson wrote: > On Wed, 29 Jul 2020 12:28:46 +0100 > Sean Mooney wrote: > > > On Wed, 2020-07-29 at 16:05 +0800, Yan Zhao wrote: > > > On Mon, Jul 27, 2020 at 04:23:21PM -0600, Alex Williamson wrote: > > > >

Re: device compatibility interface for live migration with assigned devices

2020-07-29 Thread Yan Zhao
On Wed, Jul 29, 2020 at 12:28:46PM +0100, Sean Mooney wrote: > On Wed, 2020-07-29 at 16:05 +0800, Yan Zhao wrote: > > On Mon, Jul 27, 2020 at 04:23:21PM -0600, Alex Williamson wrote: > > > On Mon, 27 Jul 2020 15:24:40 +0800 > > > Yan Zhao wrote: > > > >

Re: device compatibility interface for live migration with assigned devices

2020-07-29 Thread Yan Zhao
On Mon, Jul 27, 2020 at 04:23:21PM -0600, Alex Williamson wrote: > On Mon, 27 Jul 2020 15:24:40 +0800 > Yan Zhao wrote: > > > > > As you indicate, the vendor driver is responsible for checking version > > > > information embedded within the migration stream. The

Re: device compatibility interface for live migration with assigned devices

2020-07-27 Thread Yan Zhao
> > As you indicate, the vendor driver is responsible for checking version > > information embedded within the migration stream. Therefore a > > migration should fail early if the devices are incompatible. Is it > but as I know, currently in VFIO migration protocol, we have no way to > get vendor

Re: device compatibility interface for live migration with assigned devices

2020-07-20 Thread Yan Zhao
On Fri, Jul 17, 2020 at 10:12:58AM -0600, Alex Williamson wrote: <...> > > yes, in another reply, Alex proposed to use an interface in json format. > > I guess we can define something like > > > > { "self" : > > [ > > { "pciid" : "8086591d", > > "driver" : "i915", > > "gvt-versio

Re: device compatibility interface for live migration with assigned devices

2020-07-16 Thread Yan Zhao
On Thu, Jul 16, 2020 at 12:16:26PM +0800, Jason Wang wrote: > > On 2020/7/14 上午7:29, Yan Zhao wrote: > > hi folks, > > we are defining a device migration compatibility interface that helps upper > > layer stack like openstack/ovirt/libvirt to check if two devices are >

Re: device compatibility interface for live migration with assigned devices

2020-07-15 Thread Yan Zhao
P. Berrangé wrote: > > > > > > > On Tue, Jul 14, 2020 at 07:29:57AM +0800, Yan Zhao wrote: > > > > > hi folks, > > > > > we are defining a device migration compatibility interface that helps > > > > > upper > > > >

device compatibility interface for live migration with assigned devices

2020-07-13 Thread Yan Zhao
hi folks, we are defining a device migration compatibility interface that helps upper layer stack like openstack/ovirt/libvirt to check if two devices are live migration compatible. The "devices" here could be MDEVs, physical devices, or hybrid of the two. e.g. we could use it to check whether - a

Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier

2020-06-27 Thread Yan Zhao
On Sat, Jun 27, 2020 at 08:57:14AM -0400, Peter Xu wrote: > On Sat, Jun 27, 2020 at 03:26:45AM -0400, Yan Zhao wrote: > > > -assert(entry->iova >= notifier->start && entry_end <= notifier->end); > > > +if (notifier->notifier_flags & IOMMU

Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier

2020-06-27 Thread Yan Zhao
On Fri, Jun 26, 2020 at 05:29:17PM -0400, Peter Xu wrote: > Hi, Eugenio, > > (CCing Eric, Yan and Michael too) > On Fri, Jun 26, 2020 at 08:41:22AM +0200, Eugenio Pérez wrote: > > diff --git a/memory.c b/memory.c > > index 2f15a4b250..7f789710d2 100644 > > --- a/memory.c > > +++ b/memory.c > > @@

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-06-21 Thread Yan Zhao
On Fri, Jun 19, 2020 at 04:40:46PM -0600, Alex Williamson wrote: > On Tue, 9 Jun 2020 20:37:31 -0400 > Yan Zhao wrote: > > > On Fri, Jun 05, 2020 at 03:39:50PM +0100, Dr. David Alan Gilbert wrote: > > > > > > I tried to simplify the problem a bit, but we keep

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-06-09 Thread Yan Zhao
On Fri, Jun 05, 2020 at 03:39:50PM +0100, Dr. David Alan Gilbert wrote: > > > > I tried to simplify the problem a bit, but we keep going backwards. If > > > > the requirement is that potentially any source device can migrate to any > > > > target device and we cannot provide any means other than w

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-06-02 Thread Yan Zhao
On Tue, Jun 02, 2020 at 09:55:28PM -0600, Alex Williamson wrote: > On Tue, 2 Jun 2020 23:19:48 -0400 > Yan Zhao wrote: > > > On Tue, Jun 02, 2020 at 04:55:27PM -0600, Alex Williamson wrote: > > > On Wed, 29 Apr 2020 20:39:50 -0400 > > > Yan Zhao wrote: > &g

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-06-02 Thread Yan Zhao
On Tue, Jun 02, 2020 at 04:55:27PM -0600, Alex Williamson wrote: > On Wed, 29 Apr 2020 20:39:50 -0400 > Yan Zhao wrote: > > > On Wed, Apr 29, 2020 at 05:48:44PM +0800, Dr. David Alan Gilbert wrote: > > > > > > > > > > > > &

Re: [PATCH Kernel v22 0/8] Add UAPIs to support migration for VFIO devices

2020-05-28 Thread Yan Zhao
On Thu, May 28, 2020 at 04:59:06PM -0600, Alex Williamson wrote: > On Wed, 27 May 2020 09:48:22 +0100 > "Dr. David Alan Gilbert" wrote: > > * Yan Zhao (yan.y.z...@intel.com) wrote: > > > BTW, for viommu, the downtime data is as below. under the same network > &

Re: [PATCH Kernel v22 0/8] Add UAPIs to support migration for VFIO devices

2020-05-28 Thread Yan Zhao
> > > This is my understanding of the protocol as well, when the device is > > > running, pending_bytes might drop to zero if no internal state has > > > changed and may be non-zero on the next iteration due to device > > > activity. When the device is not running, pending_bytes reporting zero > >

Re: [PATCH v6 1/3] memory: drop guest writes to read-only ram device regions

2020-05-27 Thread Yan Zhao
On Thu, May 28, 2020 at 07:10:46AM +0200, Paolo Bonzini wrote: > On 28/05/20 06:35, Yan Zhao wrote: > > On Tue, May 26, 2020 at 10:26:35AM +0100, Peter Maydell wrote: > >> On Mon, 25 May 2020 at 11:20, Paolo Bonzini wrote: > >>> Not all of them, only those that

Re: [PATCH Kernel v23 0/8] Add UAPIs to support migration for VFIO devices

2020-05-27 Thread Yan Zhao
The whole series works for us in general: Reviewed-by: Yan Zhao On Wed, May 20, 2020 at 11:38:00PM +0530, Kirti Wankhede wrote: > Hi, > > This patch set adds: > * IOCTL VFIO_IOMMU_DIRTY_PAGES to get dirty pages bitmap with > respect to IOMMU container rather than

Re: [PATCH v6 1/3] memory: drop guest writes to read-only ram device regions

2020-05-27 Thread Yan Zhao
On Tue, May 26, 2020 at 10:26:35AM +0100, Peter Maydell wrote: > On Mon, 25 May 2020 at 11:20, Paolo Bonzini wrote: > > Not all of them, only those that need to return MEMTX_ERROR. I would > > like some guidance from Peter as to whether (or when) reads from ROMs > > should return MEMTX_ERROR. Th

Re: [PATCH Kernel v22 0/8] Add UAPIs to support migration for VFIO devices

2020-05-26 Thread Yan Zhao
On Tue, May 26, 2020 at 02:19:39PM -0600, Alex Williamson wrote: > On Mon, 25 May 2020 18:50:54 +0530 > Kirti Wankhede wrote: > > > On 5/25/2020 12:29 PM, Yan Zhao wrote: > > > On Tue, May 19, 2020 at 10:58:04AM -0600, Alex Williamson wrote: > > >> Hi folks,

Re: [PATCH v6 1/3] memory: drop guest writes to read-only ram device regions

2020-05-25 Thread Yan Zhao
On Mon, May 25, 2020 at 01:04:56PM +0200, Paolo Bonzini wrote: > On 25/05/20 12:54, Philippe Mathieu-Daudé wrote: > >> Not all of them, only those that need to return MEMTX_ERROR. I would > >> like some guidance from Peter as to whether (or when) reads from ROMs > >> should return MEMTX_ERROR. Th

Re: [PATCH Kernel v22 0/8] Add UAPIs to support migration for VFIO devices

2020-05-25 Thread Yan Zhao
On Tue, May 19, 2020 at 10:58:04AM -0600, Alex Williamson wrote: > Hi folks, > > My impression is that we're getting pretty close to a workable > implementation here with v22 plus respins of patches 5, 6, and 8. We > also have a matching QEMU series and a proposal for a new i40e > consumer, as we

Re: [PATCH v6 1/3] memory: drop guest writes to read-only ram device regions

2020-05-24 Thread Yan Zhao
On Thu, May 21, 2020 at 04:38:47PM +0200, Paolo Bonzini wrote: > On 30/04/20 11:40, Peter Maydell wrote: > >> This does not "drop" a write to a r/o region -- it causes it to generate > >> whatever the guest architecture's equivalent of a bus error is (eg data > >> abort on Arm). > > > > More gene

Re: [PATCH Kernel v22 0/8] Add UAPIs to support migration for VFIO devices

2020-05-21 Thread Yan Zhao
On Thu, May 21, 2020 at 12:39:48PM +0530, Kirti Wankhede wrote: > > > On 5/21/2020 10:38 AM, Yan Zhao wrote: > > On Wed, May 20, 2020 at 10:46:12AM -0600, Alex Williamson wrote: > > > On Wed, 20 May 2020 19:10:07 +0530 > > > Kirti Wankhede wrote: > > &g

Re: [PATCH Kernel v22 0/8] Add UAPIs to support migration for VFIO devices

2020-05-20 Thread Yan Zhao
On Wed, May 20, 2020 at 10:46:12AM -0600, Alex Williamson wrote: > On Wed, 20 May 2020 19:10:07 +0530 > Kirti Wankhede wrote: > > > On 5/20/2020 8:25 AM, Yan Zhao wrote: > > > On Tue, May 19, 2020 at 10:58:04AM -0600, Alex Williamson wrote: > > >> Hi folks,

Re: [PATCH QEMU v22 09/18] vfio: Add save state functions to SaveVMHandlers

2020-05-19 Thread Yan Zhao
On Mon, May 18, 2020 at 11:43:09AM +0530, Kirti Wankhede wrote: <...> > + > +static int vfio_save_buffer(QEMUFile *f, VFIODevice *vbasedev) > +{ > +VFIOMigration *migration = vbasedev->migration; > +VFIORegion *region = &migration->region; > +uint64_t data_offset = 0, data_size = 0; >

Re: [PATCH Kernel v22 0/8] Add UAPIs to support migration for VFIO devices

2020-05-19 Thread Yan Zhao
On Tue, May 19, 2020 at 10:58:04AM -0600, Alex Williamson wrote: > Hi folks, > > My impression is that we're getting pretty close to a workable > implementation here with v22 plus respins of patches 5, 6, and 8. We > also have a matching QEMU series and a proposal for a new i40e > consumer, as we

Re: [PATCH Kernel v21 0/8] Add UAPIs to support migration for VFIO devices

2020-05-17 Thread Yan Zhao
On Mon, May 18, 2020 at 10:39:52AM +0800, Xiang Zheng wrote: > Hi Kirti and Yan, > > How can I test this patch series on my SR-IOV devices? > I have looked through Yan's pathes for i40e VF live migration support: > https://patchwork.kernel.org/patch/11375177/ > I just updated the patches to v

Re: [PATCH Kernel v20 0/8] Add UAPIs to support migration for VFIO devices

2020-05-15 Thread Yan Zhao
On Thu, May 14, 2020 at 09:32:06PM -0600, Alex Williamson wrote: > Hi Yan & Intel folks, > > I'm starting to run out of comments on this series, where are you with > porting GVT-g migration to this API? Are there remaining blocking > issues? Are we satisfied that the API is sufficient to support

Re: [PATCH Kernel v20 5/8] vfio iommu: Implementation of ioctl for dirty pages tracking

2020-05-15 Thread Yan Zhao
On Fri, May 15, 2020 at 02:07:44AM +0530, Kirti Wankhede wrote: > VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: > - Start dirty pages tracking while migration is active > - Stop dirty pages tracking. > - Get dirty pages bitmap. Its user space application's responsibility to > copy conte

Re: [PATCH v16 QEMU 09/16] vfio: Add save state functions to SaveVMHandlers

2020-05-11 Thread Yan Zhao
On Mon, May 11, 2020 at 05:53:37PM +0800, Kirti Wankhede wrote: > > > On 5/5/2020 10:07 AM, Alex Williamson wrote: > > On Tue, 5 May 2020 04:48:14 +0530 > > Kirti Wankhede wrote: > > > >> On 3/26/2020 3:33 AM, Alex Williamson wrote: > >>> On Wed, 25 Mar 2020 02:39:07 +0530 > >>> Kirti Wankhede

Re: [PATCH v16 QEMU 09/16] vfio: Add save state functions to SaveVMHandlers

2020-05-11 Thread Yan Zhao
On Mon, May 11, 2020 at 06:22:47PM +0800, Kirti Wankhede wrote: > > > On 5/9/2020 11:01 AM, Yan Zhao wrote: > > On Wed, Mar 25, 2020 at 05:09:07AM +0800, Kirti Wankhede wrote: > >> Added .save_live_pending, .save_live_iterate and > >> .save_live_complete_precop

Re: [PATCH v16 QEMU 09/16] vfio: Add save state functions to SaveVMHandlers

2020-05-08 Thread Yan Zhao
On Wed, Mar 25, 2020 at 05:09:07AM +0800, Kirti Wankhede wrote: > Added .save_live_pending, .save_live_iterate and .save_live_complete_precopy > functions. These functions handles pre-copy and stop-and-copy phase. > > In _SAVING|_RUNNING device state or pre-copy phase: > - read pending_bytes. If p

Re: [PATCH v1 2/2] Sample mtty: Add migration capability to mtty module

2020-05-07 Thread Yan Zhao
On Thu, May 07, 2020 at 11:19:40AM +0530, Kirti Wankhede wrote: > > > On 5/7/2020 6:31 AM, Yan Zhao wrote: > > On Tue, May 05, 2020 at 01:54:20AM +0800, Kirti Wankhede wrote: > > > This patch makes mtty device migration capable. Purpose od this code is > > >

Re: [PATCH v1 2/2] Sample mtty: Add migration capability to mtty module

2020-05-06 Thread Yan Zhao
On Tue, May 05, 2020 at 01:54:20AM +0800, Kirti Wankhede wrote: > This patch makes mtty device migration capable. Purpose od this code is > to test migration interface. Only stop-and-copy phase is implemented. > Postcopy migration is not supported. > > Actual data for mtty device migration is very

Re: [PATCH Kernel v18 4/7] vfio iommu: Implementation of ioctl for dirty pages tracking.

2020-05-06 Thread Yan Zhao
On Mon, May 04, 2020 at 11:58:56PM +0800, Kirti Wankhede wrote: > VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: > - Start dirty pages tracking while migration is active > - Stop dirty pages tracking. > - Get dirty pages bitmap. Its user space application's responsibility to > copy conte

Re: [PATCH v16 QEMU 08/16] vfio: Register SaveVMHandlers for VFIO device

2020-05-05 Thread Yan Zhao
On Tue, May 05, 2020 at 12:37:26PM +0800, Alex Williamson wrote: > On Tue, 5 May 2020 04:49:10 +0530 > Kirti Wankhede wrote: > > > On 3/26/2020 2:32 AM, Alex Williamson wrote: > > > On Wed, 25 Mar 2020 02:39:06 +0530 > > > Kirti Wankhede wrote: > > > > > >> Define flags to be used as delimete

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

2020-05-05 Thread Yan Zhao
On Tue, May 05, 2020 at 12:37:11PM +0800, Alex Williamson wrote: > On Tue, 5 May 2020 04:48:37 +0530 > Kirti Wankhede wrote: > > > On 3/26/2020 1:26 AM, Alex Williamson wrote: > > > On Wed, 25 Mar 2020 02:39:02 +0530 > > > Kirti Wankhede wrote: > > > > > >> These functions save and restore PC

Re: [PATCH v6 1/3] memory: drop guest writes to read-only ram device regions

2020-04-30 Thread Yan Zhao
On Thu, Apr 30, 2020 at 05:40:25PM +0800, Peter Maydell wrote: > On Thu, 30 Apr 2020 at 09:20, Yan Zhao wrote: > > > > for ram device regions, drop guest writes if the region is read-only. > > > > Cc: Philippe Mathieu-Daudé > > Reviewed-by: Philippe Mathieu-D

[PATCH v6 3/3] hw/vfio: let read-only flag take effect for mmap'd regions

2020-04-30 Thread Yan Zhao
along side setting host page table to be read-only, the memory regions are also required to be read-only, so that when guest writes to the read-only & mmap'd regions, vmexits would happen and region write handlers are called. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Yan Zha

[PATCH v6 2/3] hw/vfio: drop guest writes to ro regions

2020-04-30 Thread Yan Zhao
for vfio regions that are without write permission, drop guest writes to those regions. Cc: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Yan Zhao Signed-off-by: Xin Zeng --- hw/vfio/common.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions

[PATCH v6 1/3] memory: drop guest writes to read-only ram device regions

2020-04-30 Thread Yan Zhao
for ram device regions, drop guest writes if the region is read-only. Cc: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Yan Zhao Signed-off-by: Xin Zeng --- memory.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/memory.c b

[PATCH v6 0/3] drop writes to read-only ram device & vfio regions

2020-04-30 Thread Yan Zhao
(Alex) -modify vfio_region_write() to drop guest writes to non-mmap'd read-only region (Alex) Yan Zhao (3): memory: drop guest writes to read-only ram device regions hw/vfio: drop guest writes to ro regions hw/vfio: let read-only flag take effect for mmap'd regions

Re: [PATCH v5 1/3] memory: drop guest writes to read-only ram device regions

2020-04-30 Thread Yan Zhao
On Thu, Apr 30, 2020 at 03:07:21PM +0800, Philippe Mathieu-Daudé wrote: > On 4/30/20 7:19 AM, Yan Zhao wrote: > > for ram device regions, drop guest writes if the regions is read-only. > > > > Cc: Philippe Mathieu-Daudé > > Signed-off-by: Yan Zhao

Re: [PATCH v5 2/3] hw/vfio: drop guest writes to ro regions

2020-04-30 Thread Yan Zhao
On Thu, Apr 30, 2020 at 03:02:36PM +0800, Philippe Mathieu-Daudé wrote: > On 4/30/20 7:23 AM, Yan Zhao wrote: > > for vfio regions that are without write permission, > > drop guest writes to those regions. > > > > Cc: Philippe Mathieu-Daudé > > Reviewed-by: Phil

[PATCH v5 3/3] hw/vfio: let read-only flag take effect for mmap'd regions

2020-04-29 Thread Yan Zhao
along side setting host page table to be read-only, the memory regions are also required to be read-only, so that when guest writes to the read-only & mmap'd regions, vmexits would happen and region write handlers are called. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Yan Zha

[PATCH v5 2/3] hw/vfio: drop guest writes to ro regions

2020-04-29 Thread Yan Zhao
for vfio regions that are without write permission, drop guest writes to those regions. Cc: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Yan Zhao Signed-off-by: Xin Zeng --- hw/vfio/common.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions

[PATCH v5 1/3] memory: drop guest writes to read-only ram device regions

2020-04-29 Thread Yan Zhao
for ram device regions, drop guest writes if the regions is read-only. Cc: Philippe Mathieu-Daudé Signed-off-by: Yan Zhao Signed-off-by: Xin Zeng --- memory.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/memory.c b/memory.c index 601b749906..90a748912f

[PATCH v5 0/3] drop writes to read-only ram device & vfio regions

2020-04-29 Thread Yan Zhao
ap'd read-only region (Alex) Yan Zhao (3): memory: drop guest writes to read-only ram device regions hw/vfio: drop guest writes to ro regions hw/vfio: let read-only flag take effect for mmap'd regions hw/vfio/common.c | 17 +++-- memory.c | 15

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-04-29 Thread Yan Zhao
On Wed, Apr 29, 2020 at 10:13:01PM +0800, Eric Blake wrote: > [meta-comment] > > On 4/29/20 4:35 AM, Yan Zhao wrote: > > On Wed, Apr 29, 2020 at 04:22:01PM +0800, Dr. David Alan Gilbert wrote: > [...] > >>>>>>>>>>>>>

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-04-29 Thread Yan Zhao
On Wed, Apr 29, 2020 at 05:48:44PM +0800, Dr. David Alan Gilbert wrote: > > > > > > > > > > > > > An mdev type is meant to define a software compatible > > > > > > > > > > > > > interface, so in > > > > > > > > > > > > > the case of mdev->mdev migration, doesn't migrating > > > > > > > > > > > >

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-04-29 Thread Yan Zhao
On Wed, Apr 29, 2020 at 04:22:01PM +0800, Dr. David Alan Gilbert wrote: > * Yan Zhao (yan.y.z...@intel.com) wrote: > > On Tue, Apr 28, 2020 at 10:14:37PM +0800, Dr. David Alan Gilbert wrote: > > > * Yan Zhao (yan.y.z...@intel.com) wrote: > > > > On Mon, Apr 27, 2020

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-04-29 Thread Yan Zhao
On Tue, Apr 28, 2020 at 10:14:37PM +0800, Dr. David Alan Gilbert wrote: > * Yan Zhao (yan.y.z...@intel.com) wrote: > > On Mon, Apr 27, 2020 at 11:37:43PM +0800, Dr. David Alan Gilbert wrote: > > > * Yan Zhao (yan.y.z...@intel.com) wrote: > > > > On Sat, Apr 25, 2020

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-04-27 Thread Yan Zhao
On Mon, Apr 27, 2020 at 11:37:43PM +0800, Dr. David Alan Gilbert wrote: > * Yan Zhao (yan.y.z...@intel.com) wrote: > > On Sat, Apr 25, 2020 at 03:10:49AM +0800, Dr. David Alan Gilbert wrote: > > > * Yan Zhao (yan.y.z...@intel.com) wrote: > > > > On Tue, Apr 21,

Re: [PATCH v4 1/3] memory: drop guest writes to read-only ram device regions

2020-04-27 Thread Yan Zhao
On Mon, Apr 27, 2020 at 05:31:48PM +0800, Philippe Mathieu-Daudé wrote: > On 4/27/20 11:15 AM, Yan Zhao wrote: > > On Sun, Apr 26, 2020 at 09:04:31AM +0800, Yan Zhao wrote: > >> On Sat, Apr 25, 2020 at 06:55:33PM +0800, Paolo Bonzini wrote: > >>> On 17/04/20 09:44,

Re: [PATCH v4 1/3] memory: drop guest writes to read-only ram device regions

2020-04-27 Thread Yan Zhao
On Sun, Apr 26, 2020 at 09:04:31AM +0800, Yan Zhao wrote: > On Sat, Apr 25, 2020 at 06:55:33PM +0800, Paolo Bonzini wrote: > > On 17/04/20 09:44, Yan Zhao wrote: > > > for ram device regions, drop guest writes if the regions is read-only. > > > > > > Cc: Phil

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-04-25 Thread Yan Zhao
On Sat, Apr 25, 2020 at 03:10:49AM +0800, Dr. David Alan Gilbert wrote: > * Yan Zhao (yan.y.z...@intel.com) wrote: > > On Tue, Apr 21, 2020 at 08:08:49PM +0800, Tian, Kevin wrote: > > > > From: Yan Zhao > > > > Sent: Tuesday, April 21, 2020 10:37 AM > > >

Re: [PATCH v4 1/3] memory: drop guest writes to read-only ram device regions

2020-04-25 Thread Yan Zhao
On Sat, Apr 25, 2020 at 06:55:33PM +0800, Paolo Bonzini wrote: > On 17/04/20 09:44, Yan Zhao wrote: > > for ram device regions, drop guest writes if the regions is read-only. > > > > Cc: Philippe Mathieu-Daudé > > Signed-off-by: Yan Zhao > > Signed-off-by: Xi

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-04-22 Thread Yan Zhao
On Tue, Apr 21, 2020 at 08:08:49PM +0800, Tian, Kevin wrote: > > From: Yan Zhao > > Sent: Tuesday, April 21, 2020 10:37 AM > > > > On Tue, Apr 21, 2020 at 06:56:00AM +0800, Alex Williamson wrote: > > > On Sun, 19 Apr 2020 21:24:57 -0400 > > > Yan Zhao wr

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-04-20 Thread Yan Zhao
On Tue, Apr 21, 2020 at 06:56:00AM +0800, Alex Williamson wrote: > On Sun, 19 Apr 2020 21:24:57 -0400 > Yan Zhao wrote: > > > On Fri, Apr 17, 2020 at 07:24:57PM +0800, Cornelia Huck wrote: > > > On Fri, 17 Apr 2020 05:52:02 -0400 > > > Yan Zhao wrote: > >

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-04-19 Thread Yan Zhao
On Fri, Apr 17, 2020 at 07:24:57PM +0800, Cornelia Huck wrote: > On Fri, 17 Apr 2020 05:52:02 -0400 > Yan Zhao wrote: > > > On Fri, Apr 17, 2020 at 04:44:50PM +0800, Cornelia Huck wrote: > > > On Mon, 13 Apr 2020 01:52:01 -0400 > > > Yan Zhao wrote: > >

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-04-17 Thread Yan Zhao
On Fri, Apr 17, 2020 at 04:44:50PM +0800, Cornelia Huck wrote: > On Mon, 13 Apr 2020 01:52:01 -0400 > Yan Zhao wrote: > > > This patchset introduces a migration_version attribute under sysfs of VFIO > > Mediated devices. > > > > This migration_version att

[PATCH v4 3/3] hw/vfio: let read-only flag take effect for mmap'd regions

2020-04-16 Thread Yan Zhao
along side setting host page table to be read-only, the memory regions are also required to be read-only, so that when guest writes to the read-only & mmap'd regions, vmexits would happen and region write handlers are called. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Yan Zha

[PATCH v4 2/3] hw/vfio: drop guest writes to ro regions

2020-04-16 Thread Yan Zhao
for vfio regions that are without write permission, drop guest writes to those regions. Cc: Philippe Mathieu-Daudé Signed-off-by: Yan Zhao Signed-off-by: Xin Zeng --- hw/vfio/common.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio

[PATCH v4 0/3] drop writes to read-only ram device & vfio regions

2020-04-16 Thread Yan Zhao
mory (Alex) -modify vfio_region_write() to drop guest writes to non-mmap'd read-only region (Alex) Yan Zhao (3): memory: drop guest writes to read-only ram device regions hw/vfio: drop guest writes to ro regions hw/vfio: let read-only flag take effect for mmap'd regions h

[PATCH v4 1/3] memory: drop guest writes to read-only ram device regions

2020-04-16 Thread Yan Zhao
for ram device regions, drop guest writes if the regions is read-only. Cc: Philippe Mathieu-Daudé Signed-off-by: Yan Zhao Signed-off-by: Xin Zeng --- memory.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/memory.c b/memory.c index 601b749906..9576dd6807 100644 --- a/memory.c

  1   2   3   4   >