From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v2 4/5] kvm: x86: mmu: Lockless access tracking for Intel CPUs without EPT A bits. Date: Fri, 2 Dec 2016 03:33:38 -0500 (EST) Message-ID: <1327709090.1161444.1480667618524.JavaMail.zimbra@redhat.com> References: <1478646030-101103-5-git-send-email-junaids@google.com> <56954113.ZmdEA1QfJc@js-desktop.mtv.corp.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, andreslc@google.com, pfeiner@google.com, guangrong xiao To: Junaid Shahid Return-path: Received: from mx6-phx2.redhat.com ([209.132.183.39]:51048 "EHLO mx6-phx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753396AbcLBIdl (ORCPT ); Fri, 2 Dec 2016 03:33:41 -0500 In-Reply-To: <56954113.ZmdEA1QfJc@js-desktop.mtv.corp.google.com> Sender: kvm-owner@vger.kernel.org List-ID: > On Monday, November 21, 2016 03:42:23 PM Paolo Bonzini wrote: > > Please rewrite kvm_age_rmapp to use the new mmu_spte_age instead > > Hi Paolo, > > While updating kvm_age_rmapp/mmu_spte_age, I noticed an inconsistency in the > existing kvm code between the A/D and non-A/D cases. When using A/D bits, > kvm_age_hva calls kvm_age_rmapp, which does NOT call kvm_set_pfn_accessed. > However, when using EPT without A/D bits, kvm_unmap_rmapp is called, which > does internally end up in a call to kvm_set_pfn_accessed. Do you know if > this difference is deliberate? If not, should we call kvm_set_pfn_accessed > in the A/D case as well, or should we leave that as is? Does it make any > difference? I think it's correct _not_ to call kvm_set_pfn_accessed, because the clear_flush_young MMU notifier is called when you want to clear the accessed bit. So your patch would be fixing a bug in the case where EPT A/D bits aren't available. Thanks, Paolo