mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] KVM/x86: add comment to kvm_mmu_do_page_fault()
@ 2024-11-08 16:14 Juergen Gross
  2024-12-19  2:40 ` Sean Christopherson
  0 siblings, 1 reply; 2+ messages in thread
From: Juergen Gross @ 2024-11-08 16:14 UTC (permalink / raw)
  To: linux-kernel, x86, kvm
  Cc: Juergen Gross, Sean Christopherson, Paolo Bonzini,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
	H. Peter Anvin

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>
---
 arch/x86/kvm/mmu/mmu_internal.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/kvm/mmu/mmu_internal.h b/arch/x86/kvm/mmu/mmu_internal.h
index c98827840e07..a49cd0c438a1 100644
--- a/arch/x86/kvm/mmu/mmu_internal.h
+++ b/arch/x86/kvm/mmu/mmu_internal.h
@@ -322,6 +322,10 @@ static inline int kvm_mmu_do_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,
 		fault.slot = kvm_vcpu_gfn_to_memslot(vcpu, fault.gfn);
 	}
 
+	/*
+	 * With retpoline being active an indirect call is rather expensive,
+	 * so do a direct call in the most common case.
+	 */
 	if (IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) && fault.is_tdp)
 		r = kvm_tdp_page_fault(vcpu, &fault);
 	else
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM/x86: add comment to kvm_mmu_do_page_fault()
  2024-11-08 16:14 [PATCH] KVM/x86: add comment to kvm_mmu_do_page_fault() Juergen Gross
@ 2024-12-19  2:40 ` Sean Christopherson
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Christopherson @ 2024-12-19  2:40 UTC (permalink / raw)
  To: Sean Christopherson, linux-kernel, x86, kvm, Juergen Gross
  Cc: Paolo Bonzini, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, H. Peter Anvin

On Fri, 08 Nov 2024 17:14:16 +0100, Juergen Gross wrote:
> 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.
> 
> [...]

Applied to kvm-x86 mmu, thanks!

[1/1] KVM/x86: add comment to kvm_mmu_do_page_fault()
      https://github.com/kvm-x86/linux/commit/2d5faa6a8402

--
https://github.com/kvm-x86/linux/tree/next

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-19  2:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-08 16:14 [PATCH] KVM/x86: add comment to kvm_mmu_do_page_fault() Juergen Gross
2024-12-19  2:40 ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®