]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: x86/mmu: Only allocate shadowed translation cache for sp->role.level <= KVM_MAX_...
authorHou Wenlong <houwenlong.hwl@antgroup.com>
Sat, 11 May 2024 03:46:37 +0000 (11:46 +0800)
committerSean Christopherson <seanjc@google.com>
Mon, 3 Jun 2024 21:06:39 +0000 (14:06 -0700)
commit9ecc1c119b28d28869135a3745541c03965d52be
tree4528bf00f3f1215c01f2a08932e2a1a08a9e878d
parent4f8973e65fcd362b85942c80362cc9a7231b09fa
KVM: x86/mmu: Only allocate shadowed translation cache for sp->role.level <= KVM_MAX_HUGEPAGE_LEVEL

Only the indirect SP with sp->role.level <= KVM_MAX_HUGEPAGE_LEVEL might
have leaf gptes, so allocation of shadowed translation cache is needed
only for it. Then, it can use sp->shadowed_translation to determine
whether to use the information in the shadowed translation cache or not.
Also, extend the WARN in FNAME(sync_spte)() to ensure that this won't
break shadow_mmu_get_sp_for_split().

Suggested-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
Signed-off-by: Hou Wenlong <houwenlong.hwl@antgroup.com>
Link: https://lore.kernel.org/r/5b0cda8a7456cda476b14fca36414a56f921dd52.1715398655.git.houwenlong.hwl@antgroup.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/paging_tmpl.h