From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [patch 4/5] KVM: MMU: reload request from GET_DIRTY_LOG path Date: Thu, 19 Jun 2014 11:17:19 +0300 Message-ID: <20140619081719.GD10948@minantech.com> References: <20140618231203.846608908@amt.cnet> <20140618231521.718959400@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, ak@linux.intel.com, pbonzini@redhat.com, xiaoguangrong@linux.vnet.ibm.com, avi@cloudius-systems.com To: mtosatti@redhat.com Return-path: Received: from mail-wi0-f177.google.com ([209.85.212.177]:52577 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757460AbaFSIRX (ORCPT ); Thu, 19 Jun 2014 04:17:23 -0400 Received: by mail-wi0-f177.google.com with SMTP id r20so2394266wiv.4 for ; Thu, 19 Jun 2014 01:17:22 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140618231521.718959400@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Jun 18, 2014 at 08:12:07PM -0300, mtosatti@redhat.com wrote: > Reload remote vcpus MMU from GET_DIRTY_LOG codepath, before > deleting a pinned spte. > > Signed-off-by: Marcelo Tosatti > > --- > arch/x86/kvm/mmu.c | 3 +++ > 1 file changed, 3 insertions(+) > > Index: kvm.pinned-sptes/arch/x86/kvm/mmu.c > =================================================================== > --- kvm.pinned-sptes.orig/arch/x86/kvm/mmu.c 2014-06-13 16:50:50.040140594 -0300 > +++ kvm.pinned-sptes/arch/x86/kvm/mmu.c 2014-06-13 16:51:05.620104451 -0300 > @@ -1247,6 +1247,9 @@ > spte &= ~SPTE_MMU_WRITEABLE; > spte = spte & ~PT_WRITABLE_MASK; > > + if (is_pinned_spte(spte)) > + mmu_reload_pinned_vcpus(kvm); > + Why write protect it at all? mmu_reload_pinned_vcpus() will unprotected it anyway on the next vmentry. Isn't it better to just report all pinned pages as dirty alway. > return mmu_spte_update(sptep, spte); > } > > > -- Gleb.