]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Avoid retpoline on ->page_fault() with TDP
authorSean Christopherson <sean.j.christopherson@intel.com>
Thu, 6 Feb 2020 22:14:34 +0000 (14:14 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 12 Feb 2020 19:09:42 +0000 (20:09 +0100)
commite5018de3b873f6faab2681b60da0640f03b39e7f
tree7b0b88516d18701b891c089c34870d5558214fdf
parent311e324d02590d1e51d8bdec8d21254486424d75
KVM: x86/mmu: Avoid retpoline on ->page_fault() with TDP

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.  Single out the TDP fault handler and annotate the TDP path as
likely to coerce the compiler into preferring it over the indirect
function call.

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 <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu.h
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/x86.c