archive mirror
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <>
To: Sean Christopherson <>
Cc: Wanpeng Li <>,
	Jim Mattson <>, Joerg Roedel <>,,,
	Paolo Bonzini <>
Subject: Re: [PATCH] KVM: x86/mmu: Avoid retpoline on ->page_fault() with TDP
Date: Fri, 07 Feb 2020 10:29:16 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Sean Christopherson <> writes:

> Wrap calls to ->page_fault() with a small shim to directly invoke the
> TDP fault handler when the kernel is using retpolines and TDP is being
> used.  Denote the TDP fault handler by nullifying mmu->page_fault, and
> annotate the TDP path as likely to coerce the compiler into preferring
> the TDP path.
> Rename tdp_page_fault() to kvm_tdp_page_fault() as it's exposed outside
> of mmu.c to allow inlining the shim.
> Signed-off-by: Sean Christopherson <>
> ---

Out of pure curiosity, if we do something like

if (vcpu->arch.mmu->page_fault == tdp_page_fault)
else if (vcpu->arch.mmu->page_fault == nonpaging_page_fault)

we also defeat the retpoline, right? Should we use this technique
... everywhere? :-)


  reply	other threads:[~2020-02-07  9:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-06 22:14 Sean Christopherson
2020-02-07  9:29 ` Vitaly Kuznetsov [this message]
2020-02-07 15:55   ` Sean Christopherson
2020-02-07 16:15     ` Vitaly Kuznetsov
2020-02-12 11:55     ` Paolo Bonzini
2020-02-12 16:22       ` Sean Christopherson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] KVM: x86/mmu: Avoid retpoline on ->page_fault() with TDP' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).