Skip to content

Commit 2d5faa6

Browse files
jgross1sean-jc
authored andcommitted
KVM/x86: add comment to kvm_mmu_do_page_fault()
On a first glance it isn't obvious why calling kvm_tdp_page_fault() in kvm_mmu_do_page_fault() is special cased, as the general case of using an indirect case would result in calling of kvm_tdp_page_fault() anyway. Add a comment to explain the reason. Signed-off-by: Juergen Gross <jgross@suse.com> Link: https://lore.kernel.org/r/20241108161416.28552-1-jgross@suse.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 3522c41 commit 2d5faa6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/x86/kvm/mmu/mmu_internal.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,10 @@ static inline int kvm_mmu_do_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,
321321
fault.slot = kvm_vcpu_gfn_to_memslot(vcpu, fault.gfn);
322322
}
323323

324+
/*
325+
* With retpoline being active an indirect call is rather expensive,
326+
* so do a direct call in the most common case.
327+
*/
324328
if (IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) && fault.is_tdp)
325329
r = kvm_tdp_page_fault(vcpu, &fault);
326330
else

0 commit comments

Comments
 (0)