]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: x86/tdp_mmu: Introduce KVM MMU root types to specify page table type
authorIsaku Yamahata <isaku.yamahata@intel.com>
Thu, 18 Jul 2024 21:12:22 +0000 (14:12 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 23 Dec 2024 13:31:54 +0000 (08:31 -0500)
commitde86ef7bf50f181b29dcc1046e903ff1ca7eeb9f
tree84f7d77232f34474d6784706f160852112146dc3
parente84b8e4e4430d2a81a3464be8ebe5959da9a6d4a
KVM: x86/tdp_mmu: Introduce KVM MMU root types to specify page table type

Define an enum kvm_tdp_mmu_root_types to specify the KVM MMU root type [1]
so that the iterator on the root page table can consistently filter the
root page table type instead of only_valid.

TDX KVM will operate on KVM page tables with specified types.  Shared page
table, private page table, or both.  Introduce an enum instead of bool
only_valid so that we can easily enhance page table types applicable to
shared, private, or both in addition to valid or not.  Replace
only_valid=false with KVM_ANY_ROOTS and only_valid=true with
KVM_ANY_VALID_ROOTS.  Use KVM_ANY_ROOTS and KVM_ANY_VALID_ROOTS to wrap
KVM_VALID_ROOTS to avoid further code churn when direct vs mirror root
concepts are introduced in future patches.

Link: https://lore.kernel.org/kvm/ZivazWQw1oCU8VBC@google.com/
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Message-ID: <20240718211230.1492011-11-rick.p.edgecombe@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/tdp_mmu.c
arch/x86/kvm/mmu/tdp_mmu.h