[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZLTM+kyIGYVX7rG7@li-a450e7cc-27df-11b2-a85c-b5a9ac31e8ef.ibm.com>
Date: Mon, 17 Jul 2023 10:39:14 +0530
From: Kautuk Consul <kconsul@...ux.vnet.ibm.com>
To: Jordan Niethe <jniethe5@...il.com>
Cc: Nicholas Piggin <npiggin@...il.com>,
Fabiano Rosas <farosas@...ux.ibm.com>, jpn@...ux.vnet.ibm.com,
Michael Ellerman <mpe@...erman.id.au>,
Paul Mackerras <paulus@...abs.org>,
Thomas Huth <thuth@...hat.com>,
Paolo Bonzini <pbonzini@...hat.com>,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, linux-doc@...r.kernel.org
Subject: Re: [PATCH] KVM: ppc64: Enable ring-based dirty memory tracking
Hi Jordan,
On 2023-07-06 14:15:13, Jordan Niethe wrote:
>
>
> On 8/6/23 10:34 pm, Kautuk Consul wrote:
>
> Need at least a little context in the commit message itself:
>
> "Enable ring-based dirty memory tracking on ppc64:"
Sure will take this in the v2 patch.
>
> > - Enable CONFIG_HAVE_KVM_DIRTY_RING_ACQ_REL as ppc64 is weakly
> > ordered.
> > - Enable CONFIG_NEED_KVM_DIRTY_RING_WITH_BITMAP because the
> > kvmppc_xive_native_set_attr is called in the context of an ioctl
> > syscall and will call kvmppc_xive_native_eq_sync for setting the
> > KVM_DEV_XIVE_EQ_SYNC attribute which will call mark_dirty_page()
> > when there isn't a running vcpu. Implemented the
> > kvm_arch_allow_write_without_running_vcpu to always return true
> > to allow mark_page_dirty_in_slot to mark the page dirty in the
> > memslot->dirty_bitmap in this case.
>
> Should kvm_arch_allow_write_without_running_vcpu() only return true in the
> context of kvmppc_xive_native_eq_sync()?
Not required. Reason is: kvm_arch_allow_write_without_running_vcpu() is
anyway used only for avoiding the WARN_ON_ONCE in
mark_page_dirty_in_slot(). The memslot->dirty_bitmap in mark_page_dirty_in_slot()
will be anyway used only when the KVM_CAP_DIRTY_LOG_RING_WITH_BITMAP is
set and the vcpu returned by kvm_get_running_vcpu() is NULL which is
what happens only when kvmppc_xive_native_eq_sync is called via the
ioctl syscall I mentioned.
> > + *ptep = __pte(pte_val(*ptep) & ~(_PAGE_WRITE));
> On rpt I think you'd need to use kvmppc_radix_update_pte()?
Sure. I'll add a check for radix_enabled() and call
kvmppc_radix_update_pte() or a similar function in the v2 patch for this.
Powered by blists - more mailing lists