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

2020-03-20 Thread Alex Williamson
On Fri, 20 Mar 2020 23:19:14 +0530 Kirti Wankhede wrote: > On 3/20/2020 4:27 AM, Alex Williamson wrote: > > On Fri, 20 Mar 2020 01:46:41 +0530 > > Kirti Wankhede wrote: > > > >> VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: > >> - Start

Re: [PATCH v14 Kernel 5/7] vfio iommu: Update UNMAP_DMA ioctl to get dirty bitmap before unmap

2020-03-20 Thread Alex Williamson
On Fri, 20 Mar 2020 09:40:39 -0600 Alex Williamson wrote: > On Fri, 20 Mar 2020 04:35:29 -0400 > Yan Zhao wrote: > > > On Thu, Mar 19, 2020 at 03:41:12AM +0800, Kirti Wankhede wrote: > > > DMA mapped pages, including those pinned by mdev vendor drivers, might > &g

Re: [PATCH v14 Kernel 5/7] vfio iommu: Update UNMAP_DMA ioctl to get dirty bitmap before unmap

2020-03-20 Thread Alex Williamson
On Fri, 20 Mar 2020 04:35:29 -0400 Yan Zhao wrote: > On Thu, Mar 19, 2020 at 03:41:12AM +0800, Kirti Wankhede wrote: > > DMA mapped pages, including those pinned by mdev vendor drivers, might > > get unpinned and unmapped while migration is active and device is still > > running. For example, in

Re: [PATCH v14 Kernel 1/7] vfio: KABI for migration interface for device state

2020-03-19 Thread Alex Williamson
On Thu, 19 Mar 2020 23:06:56 -0400 Yan Zhao wrote: > On Fri, Mar 20, 2020 at 10:34:40AM +0800, Alex Williamson wrote: > > On Thu, 19 Mar 2020 21:30:39 -0400 > > Yan Zhao wrote: > > > > > On Thu, Mar 19, 2020 at 09:09:21PM +0800, Alex Williamson wrote: > &

Re: [PATCH v14 Kernel 1/7] vfio: KABI for migration interface for device state

2020-03-19 Thread Alex Williamson
On Thu, 19 Mar 2020 21:30:39 -0400 Yan Zhao wrote: > On Thu, Mar 19, 2020 at 09:09:21PM +0800, Alex Williamson wrote: > > On Thu, 19 Mar 2020 01:05:54 -0400 > > Yan Zhao wrote: > > > > > On Thu, Mar 19, 2020 at 11:49:26AM +0800, Alex Williamson wrote: > &

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

2020-03-19 Thread Alex Williamson
On Fri, 20 Mar 2020 01:46:41 +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 content of

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

2020-03-19 Thread Alex Williamson
On Fri, 20 Mar 2020 01:55:10 +0530 Kirti Wankhede wrote: > On 3/19/2020 9:52 PM, Alex Williamson wrote: > > On Thu, 19 Mar 2020 20:22:41 +0530 > > Kirti Wankhede wrote: > > > >> On 3/19/2020 9:15 AM, Alex Williamson wrote: > >>> On Thu, 19 Ma

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

2020-03-19 Thread Alex Williamson
On Thu, 19 Mar 2020 20:22:41 +0530 Kirti Wankhede wrote: > On 3/19/2020 9:15 AM, Alex Williamson wrote: > > On Thu, 19 Mar 2020 01:11:11 +0530 > > Kirti Wankhede wrote: > > > >> VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: > >> - Start

Re: [PATCH v14 Kernel 1/7] vfio: KABI for migration interface for device state

2020-03-19 Thread Alex Williamson
On Thu, 19 Mar 2020 01:05:54 -0400 Yan Zhao wrote: > On Thu, Mar 19, 2020 at 11:49:26AM +0800, Alex Williamson wrote: > > On Wed, 18 Mar 2020 21:17:03 -0400 > > Yan Zhao wrote: > > > > > On Thu, Mar 19, 2020 at 03:41:08AM +0800, Kirti Wankhede wrote: > >

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

2020-03-19 Thread Alex Williamson
On Thu, 19 Mar 2020 02:15:34 -0400 Yan Zhao wrote: > On Thu, Mar 19, 2020 at 12:40:53PM +0800, Alex Williamson wrote: > > On Thu, 19 Mar 2020 00:15:33 -0400 > > Yan Zhao wrote: > > > > > On Thu, Mar 19, 2020 at 12:01:00PM +0800, Alex Williamson wrote: > &

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

2020-03-18 Thread Alex Williamson
On Thu, 19 Mar 2020 00:15:33 -0400 Yan Zhao wrote: > On Thu, Mar 19, 2020 at 12:01:00PM +0800, Alex Williamson wrote: > > On Wed, 18 Mar 2020 23:06:39 -0400 > > Yan Zhao wrote: > > > > > On Thu, Mar 19, 2020 at 03:41:11AM +0800, Kirti Wankhede wrote: > &

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

2020-03-18 Thread Alex Williamson
On Wed, 18 Mar 2020 23:06:39 -0400 Yan Zhao wrote: > On Thu, Mar 19, 2020 at 03:41:11AM +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

Re: [PATCH v14 Kernel 1/7] vfio: KABI for migration interface for device state

2020-03-18 Thread Alex Williamson
On Wed, 18 Mar 2020 21:17:03 -0400 Yan Zhao wrote: > On Thu, Mar 19, 2020 at 03:41:08AM +0800, Kirti Wankhede wrote: > > - Defined MIGRATION region type and sub-type. > > > > - Defined vfio_device_migration_info structure which will be placed at the > > 0th offset of migration region to get/se

Re: [PATCH v14 Kernel 5/7] vfio iommu: Update UNMAP_DMA ioctl to get dirty bitmap before unmap

2020-03-18 Thread Alex Williamson
On Thu, 19 Mar 2020 01:11:12 +0530 Kirti Wankhede wrote: > DMA mapped pages, including those pinned by mdev vendor drivers, might > get unpinned and unmapped while migration is active and device is still > running. For example, in pre-copy phase while guest driver could access > those pages, host

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

2020-03-18 Thread Alex Williamson
On Thu, 19 Mar 2020 01:11:11 +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 content of

Re: [PATCH v14 Kernel 7/7] vfio: Selective dirty page tracking if IOMMU backed device pins pages

2020-03-18 Thread Alex Williamson
On Thu, 19 Mar 2020 01:11:14 +0530 Kirti Wankhede wrote: > Added a check such that only singleton IOMMU groups can pin pages. > From the point when vendor driver pins any pages, consider IOMMU group > dirty page scope to be limited to pinned pages. > > To optimize to avoid walking list often, ad

Re: [PATCH v14 Kernel 3/7] vfio iommu: Add ioctl definition for dirty pages tracking.

2020-03-18 Thread Alex Williamson
On Thu, 19 Mar 2020 01:11:10 +0530 Kirti Wankhede wrote: > IOMMU container maintains a list of all pages pinned by vfio_pin_pages API. > All pages pinned by vendor driver through this API should be considered as > dirty during migration. When container consists of IOMMU capable device and > all p

Re: [PATCH v13 Kernel 7/7] vfio: Selective dirty page tracking if IOMMU backed device pins pages

2020-03-18 Thread Alex Williamson
On Wed, 18 Mar 2020 20:30:19 +0530 Kirti Wankhede wrote: > On 3/18/2020 12:30 AM, Alex Williamson wrote: > > On Tue, 17 Mar 2020 23:58:38 +0530 > > Kirti Wankhede wrote: > > > >> On 3/14/2020 2:19 AM, Alex Williamson wrote: > >>> On Thu, 12 Ma

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

2020-03-18 Thread Alex Williamson
On Wed, 18 Mar 2020 12:13:12 + "Dr. David Alan Gilbert" wrote: > * Kirti Wankhede (kwankh...@nvidia.com) wrote: > > VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: > > - Start pinned and unpinned pages tracking while migration is active > > - Stop pinned and unpinned dirty pages track

Re: [PATCH v3.1 4/5] KVM: Kick resamplefd for split kernel irqchip

2020-03-17 Thread Alex Williamson
for level triggered irqs [Alex] > accel/kvm/kvm-all.c| 79 -- > accel/kvm/trace-events | 1 + > hw/intc/ioapic.c | 17 + > include/sysemu/kvm.h | 4 +++ > 4 files changed, 99 insertions(+), 2 deletions(-) Reviewed-by: A

Re: [PATCH v3 3/5] KVM: Pass EventNotifier into kvm_irqchip_assign_irqfd

2020-03-17 Thread Alex Williamson
d-off-by: Peter Xu > --- > accel/kvm/kvm-all.c | 16 ++-- > 1 file changed, 10 insertions(+), 6 deletions(-) Reviewed-by: Alex Williamson > diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c > index 439a4efe52..d49b74512a 100644 > --- a/accel/kvm/kvm-all.c >

Re: [PATCH v3 5/5] Revert "vfio/pci: Disable INTx fast path if using split irqchip"

2020-03-17 Thread Alex Williamson
--- > hw/vfio/pci.c | 12 > 1 file changed, 12 deletions(-) Reviewed-by: Alex Williamson Acked-by: Alex Williamson > diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c > index 09703362df..1c0aa27386 100644 > --- a/hw/vfio/pci.c > +++ b/hw/vfio/pci.c > @@ -124,18

Re: [PATCH v3 1/5] vfio/pci: Disable INTx fast path if using split irqchip

2020-03-17 Thread Alex Williamson
+ > 1 file changed, 12 insertions(+) Reviewed-by: Alex Williamson Acked-by: Alex Williamson > diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c > index 5e75a95129..98e0e0c994 100644 > --- a/hw/vfio/pci.c > +++ b/hw/vfio/pci.c > @@ -128,6 +128,18 @@ static void vfio_intx_enable_kvm(VFI

Re: [PATCH v3 2/5] vfio/pci: Use kvm_irqchip_add_irqfd_notifier_gsi() for irqfds

2020-03-17 Thread Alex Williamson
s for kvm irqfd, so that > VFIO can easily leverage that after the switch. > > Reviewed-by: Eric Auger > Reviewed-by: Cornelia Huck > Signed-off-by: Peter Xu > --- > hw/vfio/pci.c | 37 +++-- > 1 file changed, 15 insertions(+), 22 del

Re: [PATCH v3 4/5] KVM: Kick resamplefd for split kernel irqchip

2020-03-17 Thread Alex Williamson
On Tue, 17 Mar 2020 17:41:08 -0400 Peter Xu wrote: > On Tue, Mar 17, 2020 at 03:06:46PM -0600, Alex Williamson wrote: > > [...] > > > > diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c > > > index 15747fe2c2..81a17cc2b8 100644 > > > --- a/hw/int

Re: [PATCH v3 4/5] KVM: Kick resamplefd for split kernel irqchip

2020-03-17 Thread Alex Williamson
On Tue, 17 Mar 2020 15:50:41 -0400 Peter Xu wrote: > This is majorly only for X86 because that's the only one that supports > split irqchip for now. > > When the irqchip is split, we face a dilemma that KVM irqfd will be > enabled, however the slow irqchip is still running in the userspace. > It

Re: [PATCH v13 Kernel 7/7] vfio: Selective dirty page tracking if IOMMU backed device pins pages

2020-03-17 Thread Alex Williamson
On Tue, 17 Mar 2020 23:58:38 +0530 Kirti Wankhede wrote: > On 3/14/2020 2:19 AM, Alex Williamson wrote: > > On Thu, 12 Mar 2020 23:23:27 +0530 > > Kirti Wankhede wrote: > > > >> Added a check such that only singleton IOMMU groups can pin pages. > >>

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

2020-03-16 Thread Alex Williamson
On Tue, 17 Mar 2020 00:19:05 +0530 Kirti Wankhede wrote: > On 3/13/2020 11:43 PM, Alex Williamson wrote: > > On Thu, 12 Mar 2020 23:23:24 +0530 > > Kirti Wankhede wrote: > > > > Subject: s/to // > > > >> VFIO_IOMMU_DIRTY_PAGES ioctl performs three op

Re: [PATCH v13 Kernel 7/7] vfio: Selective dirty page tracking if IOMMU backed device pins pages

2020-03-13 Thread Alex Williamson
On Thu, 12 Mar 2020 23:23:27 +0530 Kirti Wankhede wrote: > Added a check such that only singleton IOMMU groups can pin pages. > From the point when vendor driver pins any pages, consider IOMMU group > dirty page scope to be limited to pinned pages. > > To optimize to avoid walking list often, ad

Re: [PATCH v13 Kernel 5/7] vfio iommu: Update UNMAP_DMA ioctl to get dirty bitmap before unmap

2020-03-13 Thread Alex Williamson
On Thu, 12 Mar 2020 23:23:25 +0530 Kirti Wankhede wrote: > Pages, pinned by external interface for requested IO virtual address > range, might get unpinned and unmapped while migration is active and "DMA mapped pages, including those pinned by mdev vendor drivers, might get..." > device is st

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

2020-03-13 Thread Alex Williamson
On Thu, 12 Mar 2020 23:23:24 +0530 Kirti Wankhede wrote: Subject: s/to // > VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: > - Start pinned and unpinned pages tracking while migration is active > - Stop pinned and unpinned dirty pages tracking. This is also used to > stop dirty pages

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

2020-03-12 Thread Alex Williamson
On Thu, 12 Mar 2020 06:50:30 +0100 Markus Armbruster wrote: > Alex Williamson writes: > > > On Wed, 11 Mar 2020 08:04:28 +0100 > > Markus Armbruster wrote: > > > >> Alex Williamson writes: > >> > >> > On Mon, 24

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

2020-03-11 Thread Alex Williamson
On Wed, 11 Mar 2020 10:54:12 +0800 "Longpeng (Mike, Cloud Infrastructure Service Product Dept.)" wrote: > On 2020/3/11 1:15, Alex Williamson wrote: > > vfio_rom_read() relies on memcpy() doing the logically correct thing, > > ie. safely copying zero bytes from a NULL

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

2020-03-11 Thread Alex Williamson
On Wed, 11 Mar 2020 11:28:26 +0100 Laszlo Ersek wrote: > On 03/11/20 08:08, Markus Armbruster wrote: > > Alex Williamson writes: > > > >> On Wed, 11 Mar 2020 00:14:31 +0100 > >> Laszlo Ersek wrote: > > [...] > >>> So from a memc

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

2020-03-11 Thread Alex Williamson
On Wed, 11 Mar 2020 08:04:28 +0100 Markus Armbruster wrote: > Alex Williamson writes: > > > On Mon, 24 Feb 2020 14:42:17 +0800 > > "Longpeng(Mike)" wrote: > > > >> From: Longpeng > >> > >> vfio_pci_load_rom() maybe failed and t

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

2020-03-10 Thread Alex Williamson
On Wed, 11 Mar 2020 00:14:31 +0100 Laszlo Ersek wrote: > On 03/10/20 17:11, Alex Williamson wrote: > > > commit 2088fc1e1f426b98e9ca4d7bcdbe53d886a18c37 > > Author: Alex Williamson > > Date: Tue Mar 10 10:04:36 2020 -0600 > > > > vfi

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

2020-03-10 Thread Alex Williamson
expressed previously by the ternary. Additionally, we still use @val to fill data based on the provided @size regardless of mempcy(), so we should initialize @val rather than @data. Reported-by: Longpeng Reported-by: Laszlo Ersek Signed-off-by: Alex Williamson --- hw/vfio/pci.c |9 + 1

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

2020-03-10 Thread Alex Williamson
On Tue, 25 Feb 2020 07:48:33 +0800 "Longpeng (Mike, Cloud Infrastructure Service Product Dept.)" wrote: > On 2020/2/25 0:04, Alex Williamson wrote: > > On Mon, 24 Feb 2020 14:42:17 +0800 > > "Longpeng(Mike)" wrote: > > > >> From: Longpeng &

Re: [PATCH v2 4/5] KVM: Kick resamplefd for split kernel irqchip

2020-03-09 Thread Alex Williamson
On Mon, 9 Mar 2020 20:38:08 -0400 Peter Xu wrote: > On Mon, Mar 09, 2020 at 04:33:59PM -0600, Alex Williamson wrote: > > [...] > > > > > diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c > > > > index 15747fe2c2..13921b333d 100644 > > > > --- a

Re: [PATCH v2 4/5] KVM: Kick resamplefd for split kernel irqchip

2020-03-09 Thread Alex Williamson
On Mon, 9 Mar 2020 16:10:59 -0600 Alex Williamson wrote: > On Fri, 28 Feb 2020 11:15:02 -0500 > Peter Xu wrote: > > > This is majorly only for X86 because that's the only one that supports > > split irqchip for now. > > > > When the irqchip is split, we

Re: [PATCH v2 4/5] KVM: Kick resamplefd for split kernel irqchip

2020-03-09 Thread Alex Williamson
On Fri, 28 Feb 2020 11:15:02 -0500 Peter Xu wrote: > This is majorly only for X86 because that's the only one that supports > split irqchip for now. > > When the irqchip is split, we face a dilemma that KVM irqfd will be > enabled, however the slow irqchip is still running in the userspace. > It

Re: [PATCH v2 4/5] KVM: Kick resamplefd for split kernel irqchip

2020-03-09 Thread Alex Williamson
On Thu, 5 Mar 2020 19:43:24 -0500 Peter Xu wrote: > On Thu, Mar 05, 2020 at 04:58:57PM -0700, Alex Williamson wrote: > > Hi, Alex, > > [...] > > > > +bool kvm_resample_fd_notify(int gsi) > > > +{ > > > +KVMResampleFd *rfd;

Re: [PATCH v2 4/5] KVM: Kick resamplefd for split kernel irqchip

2020-03-05 Thread Alex Williamson
On Fri, 28 Feb 2020 11:15:02 -0500 Peter Xu wrote: > This is majorly only for X86 because that's the only one that supports > split irqchip for now. > > When the irqchip is split, we face a dilemma that KVM irqfd will be > enabled, however the slow irqchip is still running in the userspace. > It

Re: [PATCH] vfio: avoid SET_ACTION_TRIGGER ioctls

2020-03-05 Thread Alex Williamson
On Fri, 28 Feb 2020 13:08:00 +0100 Roman Kapl wrote: > For MSI-X interrupts, remember what the last used eventfd was (KVM > bypass vs QEMU) and only call vfio_set_irq_signaling if it has changed. > > This not only helps with performance, but it seems that interrupts can > be lost during VFIO_IRQ

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

2020-02-24 Thread Alex Williamson
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 encountered yet), maybe we should > avoid the VM abort. > > Signed-off-by: Longpeng > --- > hw/vfio/pci.c | 13

[Bug 1863333] Re: Assigning NVMe disk to a domain causes VFIO_MAP_DMA errors

2020-02-20 Thread Alex Williamson
This seems to be due to the vfio-helper code assuming it can map an arbitrarily large IOVA range starting at 64K base address. x86 processors typically have a reserved range near the top of the 32-bit address space which is used for MSI support which is used by the interrupt remapper where we cann

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

2020-02-18 Thread Alex Williamson
On Wed, 19 Feb 2020 09:51:32 +0530 Kirti Wankhede wrote: > On 2/19/2020 3:11 AM, Alex Williamson wrote: > > On Tue, 18 Feb 2020 11:28:53 +0530 > > Kirti Wankhede wrote: > > > >> > >> > >>>>>>> As I understand the above

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

2020-02-18 Thread Alex Williamson
On Tue, 18 Feb 2020 11:28:53 +0530 Kirti Wankhede wrote: > > > >As I understand the above algorithm, we find a vfio_dma > > overlapping the request and populate the bitmap for that range. Then > > we go back and put_user() for each byte that we touched. We could > > instea

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

2020-02-17 Thread Alex Williamson
On Tue, 18 Feb 2020 00:43:48 +0530 Kirti Wankhede wrote: > On 2/14/2020 4:50 AM, Alex Williamson wrote: > > On Fri, 14 Feb 2020 01:41:35 +0530 > > Kirti Wankhede wrote: > > > >> > >> > >>>>>> > >>>>>>

Re: [PATCH] Report stringified errno in VFIO related errors

2020-02-14 Thread Alex Williamson
On Fri, 14 Feb 2020 10:19:50 +0100 Michal Privoznik wrote: > On 2/14/20 9:47 AM, Michal Privoznik wrote: > > In a few places we report errno formatted as a negative integer. > > This is not as user friendly as it can be. Use strerror() and/or > > error_setg_errno() instead. > > > > Signed-off-by

Re: [PATCH v2] Report stringified errno in VFIO related errors

2020-02-14 Thread Alex Williamson
sizeof(s->mappings[0]) * (s->nr_mappings - index - 1)); > @@ -669,7 +669,7 @@ int qemu_vfio_dma_reset_temporary(QEMUVFIOState *s) > trace_qemu_vfio_dma_reset_temporary(s); > qemu_mutex_lock(&s->lock); > if (ioctl(s->container, VFIO_IOMMU_UNMAP_DMA, &unmap)) { > -error_report("VFIO_UNMAP_DMA: %d", -errno); > +error_report("VFIO_UNMAP_DMA failed: %s", strerror(errno)); > qemu_mutex_unlock(&s->lock); > return -errno; > } Reviewed-by: Alex Williamson (hoping this gets grabbed by trivial)

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

2020-02-13 Thread Alex Williamson
On Fri, 14 Feb 2020 01:41:35 +0530 Kirti Wankhede wrote: > > > > +static int vfio_iova_dirty_bitmap(struct vfio_iommu *iommu, dma_addr_t > iova, > + size_t size, uint64_t pgsize, > + unsigned char __

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

2020-02-12 Thread Alex Williamson
On Thu, 13 Feb 2020 02:26:23 +0530 Kirti Wankhede wrote: > On 2/10/2020 10:55 PM, Alex Williamson wrote: > > On Sat, 8 Feb 2020 01:12:31 +0530 > > Kirti Wankhede wrote: > > > >> VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: > >> - Start p

Re: [PATCH] target/i386: check for availability of MSR_IA32_UCODE_REV as an emulated MSR

2020-02-11 Thread Alex Williamson
on INIT or RESET" should also be applied.] > > Reported-by: Alex Williamson > Signed-off-by: Paolo Bonzini > --- > target/i386/kvm.c | 7 +-- > 1 file changed, 5 insertions(+), 2 deletions(-) Fixed! Thanks, Alex > diff --git a/target/i386/kvm.c b/target/i386/

[Bug 1862110] Re: qemu in script is not parsing properly

2020-02-11 Thread Alex Williamson
** Changed in: qemu Status: New => Invalid -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1862110 Title: qemu in script is not parsing properly Status in QEMU: Invalid Bug description:

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

2020-02-10 Thread Alex Williamson
On Mon, 10 Feb 2020 21:52:51 -0500 Yan Zhao wrote: > On Tue, Feb 11, 2020 at 03:44:54AM +0800, Alex Williamson wrote: > > On Mon, 10 Feb 2020 04:49:54 -0500 > > Yan Zhao wrote: > > > > > On Sat, Feb 08, 2020 at 03:42:31AM +0800, Kirti Wankhede wrote: > &

Re: [PULL 20/59] target/i386: kvm: initialize microcode revision from KVM

2020-02-10 Thread Alex Williamson
On Fri, 7 Feb 2020 08:51:58 -0700 Alex Williamson wrote: > On Fri, 7 Feb 2020 00:40:31 +0100 > Paolo Bonzini wrote: > > > On 07/02/20 00:24, Alex Williamson wrote: > > > Hey Paolo, > > > > > > My Windows 10 VM boot loops with this :-\ It seems

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

2020-02-10 Thread Alex Williamson
On Mon, 10 Feb 2020 04:49:54 -0500 Yan Zhao wrote: > On Sat, Feb 08, 2020 at 03:42:31AM +0800, Kirti Wankhede wrote: > > VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: > > - Start pinned and unpinned pages tracking while migration is active > > - Stop pinned and unpinned dirty pages trac

Re: [PATCH v12 Kernel 7/7] vfio: Selective dirty page tracking if IOMMU backed device pins pages

2020-02-10 Thread Alex Williamson
On Sat, 8 Feb 2020 01:12:34 +0530 Kirti Wankhede wrote: > Added a check such that only singleton IOMMU groups can pin pages. > From the point when vendor driver pins any pages, consider IOMMU group > dirty page scope to be limited to pinned pages. > > To optimize to avoid walking list often, add

Re: [PATCH v12 Kernel 5/7] vfio iommu: Update UNMAP_DMA ioctl to get dirty bitmap before unmap

2020-02-10 Thread Alex Williamson
On Sat, 8 Feb 2020 01:12:32 +0530 Kirti Wankhede wrote: > Pages, pinned by external interface for requested IO virtual address > range, might get unpinned and unmapped while migration is active and > device is still running, that is, in pre-copy phase while guest driver > still could access tho

Re: [PATCH v12 Kernel 1/7] vfio: KABI for migration interface for device state

2020-02-10 Thread Alex Williamson
On Sat, 8 Feb 2020 01:12:28 +0530 Kirti Wankhede wrote: > - Defined MIGRATION region type and sub-type. > > - Defined vfio_device_migration_info structure which will be placed at 0th > offset of migration region to get/set VFIO device related information. > Defined members of structure and u

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

2020-02-10 Thread Alex Williamson
On Sat, 8 Feb 2020 01:12:31 +0530 Kirti Wankhede wrote: > VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: > - Start pinned and unpinned pages tracking while migration is active > - Stop pinned and unpinned dirty pages tracking. This is also used to > stop dirty pages tracking if migrati

Re: [PULL 20/59] target/i386: kvm: initialize microcode revision from KVM

2020-02-07 Thread Alex Williamson
On Fri, 7 Feb 2020 00:40:31 +0100 Paolo Bonzini wrote: > On 07/02/20 00:24, Alex Williamson wrote: > > Hey Paolo, > > > > My Windows 10 VM boot loops with this :-\ It seems to be related to > > the CPU model. Now fails (host-passthrough): > > > > -cpu

[PULL 1/1] hw/vfio: Move the IGD quirk code to a separate file

2020-02-06 Thread Alex Williamson
e the code to a separate file instead and introduce a proper Kconfig switch for it which gets only enabled by default if we also have CONFIG_PC_PCI enabled. Signed-off-by: Thomas Huth Signed-off-by: Alex Williamson --- hw/vfio/Kconfig |5 hw/vfio/Makefile.objs |1 hw/vfio/igd.c

[PULL 0/1] VFIO update 2020-02-06

2020-02-06 Thread Alex Williamson
The following changes since commit 2021b7c9716cd579e20b4993ed75842f4e0deb34: Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-pull-request' into staging (2020-02-06 12:57:54 +) are available in the Git repository at: git://github.com/awilliam/qemu-vfio.git tags/vfio-up

Re: [PULL 20/59] target/i386: kvm: initialize microcode revision from KVM

2020-02-06 Thread Alex Williamson
On Thu, 23 Jan 2020 14:50:10 +0100 Paolo Bonzini wrote: > KVM can return the host microcode revision as a feature MSR. > Use it as the default value for -cpu host. > > Signed-off-by: Paolo Bonzini > Message-Id: <1579544504-3616-4-git-send-email-pbonz...@redhat.com> > Signed-off-by: Paolo Bonzin

[Bug 1862110] Re: qemu in script is not parsing properly

2020-02-06 Thread Alex Williamson
Your script is broken, you cannot mix continued lines, blank lines, and comments. Take for instance this example: --- #!/bin/bash echo Hello \ World echo Hello \ World echo Hello \ # Earth World --- Which results in: $ ./hello.sh Hello World Hello ./hello.sh: line 8: World: command not f

Re: Documentation and VFIO on SPARC

2020-01-27 Thread Alex Williamson
On Fri, 24 Jan 2020 14:48:40 + Graeme Brett Houston wrote: > 2 Queries: > > 1st is there any Good Documentation on Writing VGA devices? > > 2nd Can VFIO devices be successfully passed to the sparc engine & > hopefully Solaris 9 actually bootup > > I am thinking a Actual PCI SPARC Card wit

Re: question about handling MSI-X by VFIO

2020-01-21 Thread Alex Williamson
On Tue, 21 Jan 2020 13:36:26 + Thanos Makatos wrote: > I'm passing through a virtual PCI device to a QEMU guest via VFIO/mdev and I > notice that MSI-X interrupts are disabled in the device (MSIXCAP.MXC.MXE is > zero) and the BARs containing the table and PBA (4 and 5 in my case) are never >

Re: [PATCH] hw/vfio: Move the IGD quirk code to a separate file

2020-01-14 Thread Alex Williamson
On Tue, 14 Jan 2020 18:10:26 +0100 Philippe Mathieu-Daudé wrote: > On 1/14/20 5:17 PM, Thomas Huth wrote: > > The IGD quirk code defines a separate device, the so-called > > "vfio-pci-igd-lpc-bridge" which shows up as a user-creatable > > device in all QEMU binaries that include the vfio code. Th

Re: PCIe device paththrough via vfio issue

2020-01-14 Thread Alex Williamson
On Tue, 14 Jan 2020 19:02:41 +0300 yurij wrote: > On 1/14/20 5:04 PM, Alex Williamson wrote: > > On Tue, 14 Jan 2020 17:14:33 +1100 > > Alexey Kardashevskiy wrote: > > > >> On 14/01/2020 03:28, Alex Williamson wrote: > >>> On Mon, 13

Re: [PATCH v2 2/3] memory: Allow a MemoryRegion to be marked no_vhost

2020-01-14 Thread Alex Williamson
On Tue, 14 Jan 2020 02:19:39 -0500 "Michael S. Tsirkin" wrote: > On Mon, Jan 13, 2020 at 05:36:46PM +, Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > > > Allow a memory region to be marked as 'no_vhost' and > > exclude that region from vhost's list build. > > >

Re: PCIe device paththrough via vfio issue

2020-01-14 Thread Alex Williamson
On Tue, 14 Jan 2020 17:14:33 +1100 Alexey Kardashevskiy wrote: > On 14/01/2020 03:28, Alex Williamson wrote: > > On Mon, 13 Jan 2020 18:49:21 +0300 > > yurij wrote: > > > >> Hello everybody! > >> > >> I have a specific PCIe device (sorry, but

Re: PCIe device paththrough via vfio issue

2020-01-13 Thread Alex Williamson
On Mon, 13 Jan 2020 18:49:21 +0300 yurij wrote: > Hello everybody! > > I have a specific PCIe device (sorry, but I can't tell about what is it > and what it does) but PCI configuration space consists of 4 BARs (lspci > output brief): > > lspci -s 84:00.00 -vvv > > . . . > Region 0: Memory at

Re: [PATCH v11 Kernel 3/6] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-01-09 Thread Alex Williamson
On Thu, 9 Jan 2020 18:59:40 +0530 Kirti Wankhede wrote: > On 1/9/2020 3:59 AM, Alex Williamson wrote: > > On Thu, 9 Jan 2020 01:31:16 +0530 > > Kirti Wankhede wrote: > > > >> On 1/8/2020 3:32 AM, Alex Williamson wrote: > >>> On Wed, 8 Jan 2020

Re: [PATCH v11 Kernel 6/6] vfio: Selective dirty page tracking if IOMMU backed device pins pages

2020-01-08 Thread Alex Williamson
On Thu, 9 Jan 2020 02:22:26 +0530 Kirti Wankhede wrote: > On 1/8/2020 5:39 AM, Alex Williamson wrote: > > On Wed, 8 Jan 2020 02:15:01 +0530 > > Kirti Wankhede wrote: > > > >> On 12/18/2019 5:42 AM, Alex Williamson wrote: > >>> On Tue, 17 Dec 2019

Re: [PATCH v10 Kernel 1/5] vfio: KABI for migration interface for device state

2020-01-08 Thread Alex Williamson
On Thu, 9 Jan 2020 02:11:11 +0530 Kirti Wankhede wrote: > On 1/9/2020 12:01 AM, Alex Williamson wrote: > > On Wed, 8 Jan 2020 15:59:55 +0100 > > Cornelia Huck wrote: > > > >> On Tue, 7 Jan 2020 11:56:02 -0700 > >> Alex Williamson wrote: > &g

Re: [PATCH v11 Kernel 3/6] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-01-08 Thread Alex Williamson
On Thu, 9 Jan 2020 01:31:16 +0530 Kirti Wankhede wrote: > On 1/8/2020 3:32 AM, Alex Williamson wrote: > > On Wed, 8 Jan 2020 01:37:03 +0530 > > Kirti Wankhede wrote: > > > > > > >>>> + > >>>> +

Re: [PATCH v10 Kernel 1/5] vfio: KABI for migration interface for device state

2020-01-08 Thread Alex Williamson
On Wed, 8 Jan 2020 15:59:55 +0100 Cornelia Huck wrote: > On Tue, 7 Jan 2020 11:56:02 -0700 > Alex Williamson wrote: > > > On Tue, 7 Jan 2020 23:23:17 +0530 > > Kirti Wankhede wrote: > > > > There are 3 invalid states: > > > * 101b => I

Re: [PATCH v11 Kernel 6/6] vfio: Selective dirty page tracking if IOMMU backed device pins pages

2020-01-07 Thread Alex Williamson
On Wed, 8 Jan 2020 02:15:01 +0530 Kirti Wankhede wrote: > On 12/18/2019 5:42 AM, Alex Williamson wrote: > > On Tue, 17 Dec 2019 22:40:51 +0530 > > Kirti Wankhede wrote: > > > > > > > > > This will fail when there are devices within the I

Re: [PATCH v11 Kernel 3/6] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-01-07 Thread Alex Williamson
On Wed, 8 Jan 2020 01:37:03 +0530 Kirti Wankhede wrote: > On 12/18/2019 3:42 AM, Alex Williamson wrote: > > On Tue, 17 Dec 2019 22:40:48 +0530 > > Kirti Wankhede wrote: > > > >> VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: > >> - Start un

Re: [PATCH v10 Kernel 1/5] vfio: KABI for migration interface for device state

2020-01-07 Thread Alex Williamson
On Tue, 7 Jan 2020 23:23:17 +0530 Kirti Wankhede wrote: > On 1/7/2020 10:39 PM, Alex Williamson wrote: > > On Tue, 7 Jan 2020 12:58:22 +0530 > > Kirti Wankhede wrote: > > > >> On 1/7/2020 4:48 AM, Alex Williamson wrote: > >>> On Thu, 2 Jan 2020 18

Re: [PATCH v10 Kernel 1/5] vfio: KABI for migration interface for device state

2020-01-07 Thread Alex Williamson
On Tue, 7 Jan 2020 12:58:22 +0530 Kirti Wankhede wrote: > On 1/7/2020 4:48 AM, Alex Williamson wrote: > > On Thu, 2 Jan 2020 18:25:37 + > > "Dr. David Alan Gilbert" wrote: > > > >> * Alex Williamson (alex.william...@redhat.com) wrote:

Re: [PATCH v10 Kernel 1/5] vfio: KABI for migration interface for device state

2020-01-07 Thread Alex Williamson
On Tue, 7 Jan 2020 09:57:40 + "Dr. David Alan Gilbert" wrote: > * Alex Williamson (alex.william...@redhat.com) wrote: > > On Thu, 2 Jan 2020 18:25:37 + > > "Dr. David Alan Gilbert" wrote: > > > > > * Alex Williamson (alex.william...@r

Re: [PATCH v10 Kernel 1/5] vfio: KABI for migration interface for device state

2020-01-06 Thread Alex Williamson
On Thu, 2 Jan 2020 18:25:37 + "Dr. David Alan Gilbert" wrote: > * Alex Williamson (alex.william...@redhat.com) wrote: > > On Fri, 20 Dec 2019 01:40:35 +0530 > > Kirti Wankhede wrote: > > > > > On 12/19/2019 10:57 PM, Alex Williamson wrote: > &g

Re: [PATCH] vfio/pci: Don't remove irqchip notifier if not registered

2020-01-06 Thread Alex Williamson
e from the system. Change it to conditionally remove the > notifier only if the notify hook is setup. > > CC: Eduardo Habkost > CC: David Gibson > CC: Alex Williamson > Reported-by: yangh...@redhat.com > Fixes: c5478fea27 ("vfio/pci: Respond to KVM irqchip change

[PULL 1/1] vfio/pci: Don't remove irqchip notifier if not registered

2020-01-06 Thread Alex Williamson
ifier only if the notify hook is setup. CC: Eduardo Habkost CC: David Gibson CC: Alex Williamson Cc: qemu-sta...@nongnu.org # v4.2 Reported-by: yangh...@redhat.com Debugged-by: Eduardo Habkost Fixes: c5478fea27ac ("vfio/pci: Respond to KVM irqchip change notifier")

[PULL 0/1] VFIO fixes 2020-01-06

2020-01-06 Thread Alex Williamson
The following changes since commit 48008198270e3ebcc9394401d676c54ed5ac139c: Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2019-12-20 11:20:25 +) are available in the Git repository at: git://github.com/awilliam/qemu-vfio.git tags/vfio-fixes-20200106.0

Re: [RFC v4 PATCH 00/49] Initial support of multi-process qemu - status update

2019-12-20 Thread Alex Williamson
On Fri, 20 Dec 2019 14:14:33 + Felipe Franciosi wrote: > > On Dec 20, 2019, at 9:50 AM, Paolo Bonzini wrote: > > > > On 20/12/19 10:47, Stefan Hajnoczi wrote: > >>> If it doesn't create too large of a burden to support both, then I think > >>> it is very desirable. IIUC, this is saying a

Re: [PATCH v10 Kernel 1/5] vfio: KABI for migration interface for device state

2019-12-19 Thread Alex Williamson
On Fri, 20 Dec 2019 01:40:35 +0530 Kirti Wankhede wrote: > On 12/19/2019 10:57 PM, Alex Williamson wrote: > > > > > >>>>>> + * 2. When VFIO application save state or suspend application, VFIO > >>>>>> device > >>>&g

Re: [PATCH v10 Kernel 4/5] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2019-12-19 Thread Alex Williamson
On Fri, 20 Dec 2019 00:12:30 +0530 Kirti Wankhede wrote: > On 12/19/2019 3:09 AM, Alex Williamson wrote: > > On Tue, 17 Dec 2019 14:54:14 +0530 > > Kirti Wankhede wrote: > > > >> On 12/17/2019 10:45 AM, Yan Zhao wrote: > >>> On Tue, Dec 17, 2019

Re: [PATCH v10 Kernel 1/5] vfio: KABI for migration interface for device state

2019-12-19 Thread Alex Williamson
On Thu, 19 Dec 2019 21:38:44 +0530 Kirti Wankhede wrote: > On 12/18/2019 12:13 AM, Alex Williamson wrote: > > On Tue, 17 Dec 2019 11:58:44 +0530 > > Kirti Wankhede wrote: > > > >> On 12/17/2019 4:14 AM, Alex Williamson wrote: > >>> On Tue, 17 De

Re: [PATCH v10 Kernel 4/5] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2019-12-18 Thread Alex Williamson
On Tue, 17 Dec 2019 14:54:14 +0530 Kirti Wankhede wrote: > On 12/17/2019 10:45 AM, Yan Zhao wrote: > > On Tue, Dec 17, 2019 at 04:21:39AM +0800, Kirti Wankhede wrote: > >> + } else if (range.flags & > >> + VFIO_IOMMU_DIRTY_PAGES_FLAG_GET_BITMAP) { > >> +

Re: [PATCH v11 Kernel 6/6] vfio: Selective dirty page tracking if IOMMU backed device pins pages

2019-12-17 Thread Alex Williamson
nt ret; > + > + list_for_each_entry(d, &iommu->domain_list, next) { > + list_for_each_entry(g, &d->group_list, next) { > + ret = iommu_group_for_each_dev(g->iommu_group, &capable, > + vfio_is_

Re: [PATCH v11 Kernel 4/6] vfio iommu: Update UNMAP_DMA ioctl to get dirty bitmap before unmap

2019-12-17 Thread Alex Williamson
On Tue, 17 Dec 2019 22:40:49 +0530 Kirti Wankhede wrote: > Pages, pinned by external interface for requested IO virtual address > range, might get unpinned and unmapped while migration is active and > device is still running, that is, in pre-copy phase while guest driver > still could access th

Re: [PATCH v11 Kernel 3/6] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2019-12-17 Thread Alex Williamson
On Tue, 17 Dec 2019 22:40:48 +0530 Kirti Wankhede wrote: > VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: > - Start unpinned pages dirty pages tracking while migration is active and > device is running, i.e. during pre-copy phase. > - Stop unpinned pages dirty pages tracking. This is r

Re: [PATCH] memory: Do not allow subregion out of the parent region range

2019-12-17 Thread Alex Williamson
On Tue, 17 Dec 2019 19:31:41 +0100 Paolo Bonzini wrote: > On 17/12/19 19:17, Peter Maydell wrote: > > On Tue, 17 Dec 2019 at 16:57, Richard Henderson > > wrote: > >> > >> On 12/17/19 1:58 AM, Christophe de Dinechin wrote: > >>> > >>> > On 17 Dec 2019, at 11:51, Paolo Bonzini wrote: >

Re: [PATCH v10 Kernel 1/5] vfio: KABI for migration interface for device state

2019-12-17 Thread Alex Williamson
On Tue, 17 Dec 2019 11:58:44 +0530 Kirti Wankhede wrote: > On 12/17/2019 4:14 AM, Alex Williamson wrote: > > On Tue, 17 Dec 2019 01:51:36 +0530 > > Kirti Wankhede wrote: > > > >> - Defined MIGRATION region type and sub-type. > >> > >> - Defined

Re: [PATCH v10 Kernel 2/5] vfio iommu: Adds flag to indicate dirty pages tracking capability support

2019-12-16 Thread Alex Williamson
On Tue, 17 Dec 2019 01:51:37 +0530 Kirti Wankhede wrote: > Flag VFIO_IOMMU_INFO_DIRTY_PGS in VFIO_IOMMU_GET_INFO indicates that driver > support dirty pages tracking. > > Signed-off-by: Kirti Wankhede > Reviewed-by: Neo Jia > --- > drivers/vfio/vfio_iommu_type1.c | 3 ++- > include/uapi/linux

Re: [PATCH v10 Kernel 1/5] vfio: KABI for migration interface for device state

2019-12-16 Thread Alex Williamson
On Tue, 17 Dec 2019 01:51:36 +0530 Kirti Wankhede wrote: > - Defined MIGRATION region type and sub-type. > > - Defined vfio_device_migration_info structure which will be placed at 0th > offset of migration region to get/set VFIO device related information. > Defined members of structure and

<    5   6   7   8   9   10   11   12   13   14   >