Re: [PATCH 18/22] kvm: mmu: Support disabling dirty logging for the tdp MMU

2020-10-07 Thread Paolo Bonzini
On 07/10/20 19:28, Ben Gardon wrote: >> No, that would be just another way to write the same thing. That said, >> making the iteration API more complicated also has disadvantages because >> if get a Cartesian explosion of changes. > I wouldn't be too worried about that. The only things I ever

Re: [PATCH 18/22] kvm: mmu: Support disabling dirty logging for the tdp MMU

2020-10-07 Thread Ben Gardon
On Wed, Oct 7, 2020 at 10:21 AM Paolo Bonzini wrote: > > On 07/10/20 18:30, Ben Gardon wrote: > >> I'm starting to wonder if another iterator like > >> for_each_tdp_leaf_pte_root would be clearer, since this idiom repeats > >> itself quite often. The tdp_iter_next_leaf function would be easily >

Re: [PATCH 18/22] kvm: mmu: Support disabling dirty logging for the tdp MMU

2020-10-07 Thread Paolo Bonzini
On 07/10/20 18:30, Ben Gardon wrote: >> I'm starting to wonder if another iterator like >> for_each_tdp_leaf_pte_root would be clearer, since this idiom repeats >> itself quite often. The tdp_iter_next_leaf function would be easily >> implemented as >> >> while (likely(iter->valid) && >>

Re: [PATCH 18/22] kvm: mmu: Support disabling dirty logging for the tdp MMU

2020-10-07 Thread Ben Gardon
On Fri, Sep 25, 2020 at 6:09 PM Paolo Bonzini wrote: > > On 25/09/20 23:22, Ben Gardon wrote: > > + for_each_tdp_pte_root(iter, root, start, end) { > > + if (!is_shadow_present_pte(iter.old_spte) || > > + is_last_spte(iter.old_spte, iter.level)) > > +

Re: [PATCH 18/22] kvm: mmu: Support disabling dirty logging for the tdp MMU

2020-09-25 Thread Paolo Bonzini
On 25/09/20 23:22, Ben Gardon wrote: > + for_each_tdp_pte_root(iter, root, start, end) { > + if (!is_shadow_present_pte(iter.old_spte) || > + is_last_spte(iter.old_spte, iter.level)) > + continue; > + I'm starting to wonder if another iterator

[PATCH 18/22] kvm: mmu: Support disabling dirty logging for the tdp MMU

2020-09-25 Thread Ben Gardon
Dirty logging ultimately breaks down MMU mappings to 4k granularity. When dirty logging is no longer needed, these granaular mappings represent a useless performance penalty. When dirty logging is disabled, search the paging structure for mappings that could be re-constituted into a large page