OSDN Git Service

KVM: x86/mmu: Factor out tdp_iter_return_to_root
authorBen Gardon <bgardon@google.com>
Mon, 15 Mar 2021 23:38:02 +0000 (16:38 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 16 Mar 2021 18:16:17 +0000 (14:16 -0400)
commitb601c3bc9d5053065acdaa1481c21481d0dc3f10
tree7640e9ffb25982d1b6cf8a7fd19b8fe5f6459448
parent14f6fec2e8e04b83c87c339b8d8ff4cc62b23d35
KVM: x86/mmu: Factor out tdp_iter_return_to_root

In tdp_mmu_iter_cond_resched there is a call to tdp_iter_start which
causes the iterator to continue its walk over the paging structure from
the root. This is needed after a yield as paging structure could have
been freed in the interim.

The tdp_iter_start call is not very clear and something of a hack. It
requires exposing tdp_iter fields not used elsewhere in tdp_mmu.c and
the effect is not obvious from the function name. Factor a more aptly
named function out of tdp_iter_start and call it from
tdp_mmu_iter_cond_resched and tdp_iter_start.

No functional change intended.

Signed-off-by: Ben Gardon <bgardon@google.com>
Message-Id: <20210315233803.2706477-4-bgardon@google.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/tdp_iter.c
arch/x86/kvm/mmu/tdp_iter.h
arch/x86/kvm/mmu/tdp_mmu.c