Re: [PATCH v4 3/6] KVM: arm64: Enable ring-based dirty memory tracking

2022-10-04 Thread Marc Zyngier
On Tue, 04 Oct 2022 05:26:23 +0100, Gavin Shan wrote: [...] > > Why another capability? Just allowing dirty logging to be enabled > > before we saving the GIC state should be enough, shouldn't it? > > > > The GIC state would be just one case where no vcpu can be used to push > dirty page

Re: [PATCH v4 3/6] KVM: arm64: Enable ring-based dirty memory tracking

2022-10-04 Thread Peter Xu
On Tue, Oct 04, 2022 at 12:26:23PM +0800, Gavin Shan wrote: > Note: for post-copy and snapshot, I assume we need to save the dirty bitmap > in the last synchronization, right after the VM is stopped. Agreed on postcopy. Note that snapshot doesn't use kvm dirty logging because it requires

Re: [PATCH v4 3/6] KVM: arm64: Enable ring-based dirty memory tracking

2022-10-03 Thread Gavin Shan
Hi Marc, On 9/29/22 10:42 PM, Marc Zyngier wrote: On Thu, 29 Sep 2022 10:50:12 +0100, Gavin Shan wrote: On 9/29/22 12:52 AM, Peter Xu wrote: On Wed, Sep 28, 2022 at 09:25:34AM +0100, Marc Zyngier wrote: On Wed, 28 Sep 2022 00:47:43 +0100, Gavin Shan wrote: I have rough idea as below.

Re: [PATCH v4 3/6] KVM: arm64: Enable ring-based dirty memory tracking

2022-09-30 Thread Marc Zyngier
On Thu, 29 Sep 2022 15:32:03 +0100, Peter Xu wrote: > > > If I'm correct, Marc may be talking about SMMU, which is emulated in host > > instead of QEMU. In this case, the DMA target pages are similar to those > > pages for vgic/its tables. Both sets of pages are invisible from QEMU. > > OK, I'm

Re: [PATCH v4 3/6] KVM: arm64: Enable ring-based dirty memory tracking

2022-09-29 Thread Marc Zyngier
On Thu, 29 Sep 2022 12:31:34 +0100, Gavin Shan wrote: > > I've had the following PATCH[v5 3/7] to reuse bitmap for these particular > cases. KVM_GET_DIRTY_LOG and KVM_CLEAR_DIRTY_LOG ioctls are used to visit > the bitmap. The new capability is advertised by KVM_CAP_DIRTY_LOG_RING_BITMAP. > Note

Re: [PATCH v4 3/6] KVM: arm64: Enable ring-based dirty memory tracking

2022-09-29 Thread Marc Zyngier
On Thu, 29 Sep 2022 10:50:12 +0100, Gavin Shan wrote: > > Hi Marc and Peter, > > On 9/29/22 12:52 AM, Peter Xu wrote: > > On Wed, Sep 28, 2022 at 09:25:34AM +0100, Marc Zyngier wrote: > >> On Wed, 28 Sep 2022 00:47:43 +0100, > >> Gavin Shan wrote: > >> > >>> I have rough idea as below. It's

Re: [PATCH v4 3/6] KVM: arm64: Enable ring-based dirty memory tracking

2022-09-29 Thread Marc Zyngier
On Wed, 28 Sep 2022 15:52:00 +0100, Peter Xu wrote: > > On Wed, Sep 28, 2022 at 09:25:34AM +0100, Marc Zyngier wrote: > > Hi Gavin, > > > > On Wed, 28 Sep 2022 00:47:43 +0100, > > Gavin Shan wrote: > > > > > I have rough idea as below. It's appreciated if you can comment before I'm > > >

Re: [PATCH v4 3/6] KVM: arm64: Enable ring-based dirty memory tracking

2022-09-29 Thread Peter Xu
On Thu, Sep 29, 2022 at 07:50:12PM +1000, Gavin Shan wrote: > Hi Marc and Peter, > > On 9/29/22 12:52 AM, Peter Xu wrote: > > On Wed, Sep 28, 2022 at 09:25:34AM +0100, Marc Zyngier wrote: > > > On Wed, 28 Sep 2022 00:47:43 +0100, > > > Gavin Shan wrote: > > > > > > > I have rough idea as below.

Re: [PATCH v4 3/6] KVM: arm64: Enable ring-based dirty memory tracking

2022-09-29 Thread Gavin Shan
Hi Peter and Marc, On 9/29/22 7:50 PM, Gavin Shan wrote: On 9/29/22 12:52 AM, Peter Xu wrote: On Wed, Sep 28, 2022 at 09:25:34AM +0100, Marc Zyngier wrote: On Wed, 28 Sep 2022 00:47:43 +0100, Gavin Shan wrote: I have rough idea as below. It's appreciated if you can comment before I'm going

Re: [PATCH v4 3/6] KVM: arm64: Enable ring-based dirty memory tracking

2022-09-29 Thread Gavin Shan
Hi Marc and Peter, On 9/29/22 12:52 AM, Peter Xu wrote: On Wed, Sep 28, 2022 at 09:25:34AM +0100, Marc Zyngier wrote: On Wed, 28 Sep 2022 00:47:43 +0100, Gavin Shan wrote: I have rough idea as below. It's appreciated if you can comment before I'm going a head for the prototype. The overall

Re: [PATCH v4 3/6] KVM: arm64: Enable ring-based dirty memory tracking

2022-09-28 Thread Peter Xu
On Wed, Sep 28, 2022 at 09:25:34AM +0100, Marc Zyngier wrote: > Hi Gavin, > > On Wed, 28 Sep 2022 00:47:43 +0100, > Gavin Shan wrote: > > > I have rough idea as below. It's appreciated if you can comment before I'm > > going a head for the prototype. The overall idea is to introduce another > >

Re: [PATCH v4 3/6] KVM: arm64: Enable ring-based dirty memory tracking

2022-09-28 Thread Marc Zyngier
Hi Gavin, On Wed, 28 Sep 2022 00:47:43 +0100, Gavin Shan wrote: > I have rough idea as below. It's appreciated if you can comment before I'm > going a head for the prototype. The overall idea is to introduce another > dirty ring for KVM (kvm-dirty-ring). It's updated and visited separately > to

Re: [PATCH v4 3/6] KVM: arm64: Enable ring-based dirty memory tracking

2022-09-27 Thread Gavin Shan
Hi Peter and Marc, On 9/28/22 4:21 AM, Peter Xu wrote: On Tue, Sep 27, 2022 at 01:32:07PM -0400, Marc Zyngier wrote: On Tue, 27 Sep 2022 12:02:52 -0400, Peter Xu wrote: [...] Any decision made on how to tackle with the GIC status dirty bits? Which dirty bits? Are you talking of the

Re: [PATCH v4 3/6] KVM: arm64: Enable ring-based dirty memory tracking

2022-09-27 Thread Peter Xu
On Tue, Sep 27, 2022 at 01:32:07PM -0400, Marc Zyngier wrote: > On Tue, 27 Sep 2022 12:02:52 -0400, > Peter Xu wrote: > > > > On Tue, Sep 27, 2022 at 08:54:36AM +0800, Gavin Shan wrote: > > > Enable ring-based dirty memory tracking on arm64 by selecting > > > CONFIG_HAVE_KVM_DIRTY_RING_ACQ_REL

Re: [PATCH v4 3/6] KVM: arm64: Enable ring-based dirty memory tracking

2022-09-27 Thread Marc Zyngier
On Tue, 27 Sep 2022 12:02:52 -0400, Peter Xu wrote: > > On Tue, Sep 27, 2022 at 08:54:36AM +0800, Gavin Shan wrote: > > Enable ring-based dirty memory tracking on arm64 by selecting > > CONFIG_HAVE_KVM_DIRTY_RING_ACQ_REL and providing the ring buffer's > > physical page offset

Re: [PATCH v4 3/6] KVM: arm64: Enable ring-based dirty memory tracking

2022-09-27 Thread Peter Xu
On Tue, Sep 27, 2022 at 08:54:36AM +0800, Gavin Shan wrote: > Enable ring-based dirty memory tracking on arm64 by selecting > CONFIG_HAVE_KVM_DIRTY_RING_ACQ_REL and providing the ring buffer's > physical page offset (KVM_DIRTY_LOG_PAGE_OFFSET). > > Signed-off-by: Gavin Shan Gavin, Any decision

[PATCH v4 3/6] KVM: arm64: Enable ring-based dirty memory tracking

2022-09-26 Thread Gavin Shan
Enable ring-based dirty memory tracking on arm64 by selecting CONFIG_HAVE_KVM_DIRTY_RING_ACQ_REL and providing the ring buffer's physical page offset (KVM_DIRTY_LOG_PAGE_OFFSET). Signed-off-by: Gavin Shan --- Documentation/virt/kvm/api.rst| 2 +- arch/arm64/include/uapi/asm/kvm.h | 1 +