Re: [PATCH 14/22] kvm: mmu: Add access tracking for tdp_mmu

2020-10-06 Thread Ben Gardon
On Wed, Sep 30, 2020 at 10:49 AM Sean Christopherson wrote: > > On Fri, Sep 25, 2020 at 02:22:54PM -0700, Ben Gardon wrote: > > @@ -1945,12 +1944,24 @@ static void rmap_recycle(struct kvm_vcpu *vcpu, u64 > > *spte, gfn_t gfn) > > > > int kvm_age_hva(struct kvm *kvm, unsigned long start,

Re: [PATCH 14/22] kvm: mmu: Add access tracking for tdp_mmu

2020-09-30 Thread Sean Christopherson
On Fri, Sep 25, 2020 at 02:22:54PM -0700, Ben Gardon wrote: > @@ -1945,12 +1944,24 @@ static void rmap_recycle(struct kvm_vcpu *vcpu, u64 > *spte, gfn_t gfn) > > int kvm_age_hva(struct kvm *kvm, unsigned long start, unsigned long end) > { > - return kvm_handle_hva_range(kvm, start, end,

Re: [PATCH 14/22] kvm: mmu: Add access tracking for tdp_mmu

2020-09-25 Thread Paolo Bonzini
On 25/09/20 23:22, Ben Gardon wrote: > @@ -332,7 +331,7 @@ static inline bool kvm_vcpu_ad_need_write_protect(struct > kvm_vcpu *vcpu) > return vcpu->arch.mmu == >arch.guest_mmu; > } > > -static inline bool spte_ad_enabled(u64 spte) > +inline bool spte_ad_enabled(u64 spte) > { >

[PATCH 14/22] kvm: mmu: Add access tracking for tdp_mmu

2020-09-25 Thread Ben Gardon
In order to interoperate correctly with the rest of KVM and other Linux subsystems, the TDP MMU must correctly handle various MMU notifiers. The main Linux MM uses the access tracking MMU notifiers for swap and other features. Add hooks to handle the test/flush HVA (range) family of MMU notifiers.