KVM: x86/mmu: Refactor yield safe root iterator
authorBen Gardon <bgardon@google.com>
Thu, 1 Apr 2021 23:37:28 +0000 (16:37 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 19 Apr 2021 13:05:24 +0000 (09:05 -0400)
commitcfc109979b3c879ea9df05e048bb83615964f3e3
tree73889cddaca2d8136fb590f85a458ca527632ba4
parent2bdb3d84cebca2e3b482788615ff1559bc8cedb5
KVM: x86/mmu: Refactor yield safe root iterator

Refactor the yield safe TDP MMU root iterator to be more amenable to
changes in future commits which will allow it to be used under the MMU
lock in read mode. Currently the iterator requires a complicated dance
between the helper functions and different parts of the for loop which
makes it hard to reason about. Moving all the logic into a single function
simplifies the iterator substantially.

Signed-off-by: Ben Gardon <bgardon@google.com>
Message-Id: <20210401233736.638171-6-bgardon@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/tdp_mmu.c