[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200115152055.GF233443@xz-x1>
Date: Wed, 15 Jan 2020 10:20:55 -0500
From: Peter Xu <peterx@...hat.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
Christophe de Dinechin <dinechin@...hat.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <sean.j.christopherson@...el.com>,
Yan Zhao <yan.y.zhao@...el.com>,
Alex Williamson <alex.williamson@...hat.com>,
Jason Wang <jasowang@...hat.com>,
Kevin Kevin <kevin.tian@...el.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
"Dr . David Alan Gilbert" <dgilbert@...hat.com>,
Lei Cao <lei.cao@...atus.com>,
Andrew Jones <drjones@...hat.com>
Subject: Re: [PATCH v3 12/21] KVM: X86: Implement ring-based dirty memory
tracking
On Wed, Jan 15, 2020 at 01:50:08AM -0500, Michael S. Tsirkin wrote:
> On Tue, Jan 14, 2020 at 03:01:34PM -0500, Peter Xu wrote:
> > On Thu, Jan 09, 2020 at 02:35:46PM -0500, Michael S. Tsirkin wrote:
> > > ``void flush_dcache_page(struct page *page)``
> > >
> > > Any time the kernel writes to a page cache page, _OR_
> > > the kernel is about to read from a page cache page and
> > > user space shared/writable mappings of this page potentially
> > > exist, this routine is called.
[1]
> > >
> > >
> > > > Also, I believe this is the similar question that Jason has asked in
> > > > V2. Sorry I should mention this earlier, but I didn't address that in
> > > > this series because if we need to do so we probably need to do it
> > > > kvm-wise, rather than only in this series.
> > >
> > > You need to document these things.
> > >
> > > > I feel like it's missing
> > > > probably only because all existing KVM supported archs do not have
> > > > virtual-tagged caches as you mentioned.
> > >
> > > But is that a fact? ARM has such a variety of CPUs,
> > > I can't really tell. Did you research this to make sure?
> > >
> > > > If so, I would prefer if you
> > > > can allow me to ignore that issue until KVM starts to support such an
> > > > arch.
> > >
> > > Document limitations pls. Don't ignore them.
> >
> > Hi, Michael,
> >
> > I failed to find a good place to document about flush_dcache_page()
> > for KVM. Could you give me a suggestion?
>
> Maybe where the field is introduced. I posted the suggestions to the
> relevant patch.
(will reply there)
>
> > And I don't know about whether there's any ARM hosts that requires
> > flush_dcache_page(). I think not, because again I didn't see any
> > caller of flush_dcache_page() in KVM code yet. Otherwise I think we
> > should at least call it before the kernel reading kvm_run or after
> > publishing data to kvm_run.
>
> But is kvm run ever accessed while VCPU is running on another CPU?
> I always assumed no but maybe I'm missing something?
IMHO we need to call it even if it's running on the same CPU - please
refer to [1] above, there's no restriction on which CPU the code is
running on. I think it makes sense, especially the systems for
virtually-tagged caches because even if the memory accesses happened
on the same CPU, the virtual addresses to access the same page could
still be different when accessed from kernel/userspace.
Thanks,
--
Peter Xu
Powered by blists - more mailing lists