summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu/tdp_iter.h
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2021-03-15 16:38:03 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2021-03-16 14:16:34 -0400
commit08889894cc82bc3b213bdb192f274358e5a6b78d (patch)
tree78145b0f09f4a5e0a4ca0d296911a21f1101efc5 /arch/x86/kvm/mmu/tdp_iter.h
parentb601c3bc9d5053065acdaa1481c21481d0dc3f10 (diff)
downloadcachepc-linux-08889894cc82bc3b213bdb192f274358e5a6b78d.tar.gz
cachepc-linux-08889894cc82bc3b213bdb192f274358e5a6b78d.zip
KVM: x86/mmu: Store the address space ID in the TDP iterator
Store the address space ID in the TDP iterator so that it can be retrieved without having to bounce through the root shadow page. This streamlines the code and fixes a Sparse warning about not properly using rcu_dereference() when grabbing the ID from the root on the fly. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Ben Gardon <bgardon@google.com> Message-Id: <20210315233803.2706477-5-bgardon@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu/tdp_iter.h')
-rw-r--r--arch/x86/kvm/mmu/tdp_iter.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu/tdp_iter.h b/arch/x86/kvm/mmu/tdp_iter.h
index 8eb424d17c91..b1748b988d3a 100644
--- a/arch/x86/kvm/mmu/tdp_iter.h
+++ b/arch/x86/kvm/mmu/tdp_iter.h
@@ -36,6 +36,8 @@ struct tdp_iter {
int min_level;
/* The iterator's current level within the paging structure */
int level;
+ /* The address space ID, i.e. SMM vs. regular. */
+ int as_id;
/* A snapshot of the value at sptep */
u64 old_spte;
/*
@@ -62,7 +64,6 @@ tdp_ptep_t spte_to_child_pt(u64 pte, int level);
void tdp_iter_start(struct tdp_iter *iter, u64 *root_pt, int root_level,
int min_level, gfn_t next_last_level_gfn);
void tdp_iter_next(struct tdp_iter *iter);
-tdp_ptep_t tdp_iter_root_pt(struct tdp_iter *iter);
void tdp_iter_restart(struct tdp_iter *iter);
#endif /* __KVM_X86_MMU_TDP_ITER_H */