On 30/09/20 20:04, Sean Christopherson wrote:
>> +    for_each_tdp_mmu_root(kvm, root) {
>> +            root_as_id = kvm_mmu_page_as_id(root);
>> +            if (root_as_id != slot->as_id)
>> +                    continue;
> This pattern pops up quite a few times, probably worth adding
> 
> #define for_each_tdp_mmu_root_using_memslot(...)      \
>       for_each_tdp_mmu_root(...)                      \
>               if (kvm_mmu_page_as_id(root) != slot->as_id) {
>               } else
> 

It's not really relevant that it's a memslot, but

        for_each_tdp_mmu_root_using_as_id

makes sense too.

Paolo

Reply via email to