]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: x86/mmu: Avoid indirect call for get_cr3
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 8 May 2023 15:45:58 +0000 (17:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:53:29 +0000 (11:53 +0200)
commitd20a0195b3fec4c9ec1ffd2a1625bfa060d3150b
tree046718825e29e1f6f1907a3a953334e54f69f081
parent28d0f85aff342921d75597bc4997f9d6e83be2ef
KVM: x86/mmu: Avoid indirect call for get_cr3

[ Upstream commit 2fdcc1b324189b5fb20655baebd40cd82e2bdf0c ]

Most of the time, calls to get_guest_pgd result in calling
kvm_read_cr3 (the exception is only nested TDP).  Hardcode
the default instead of using the get_cr3 function, avoiding
a retpoline if they are enabled.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Link: https://lore.kernel.org/r/20230322013731.102955-2-minipli@grsecurity.net
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Mathias Krause <minipli@grsecurity.net> # backport to v6.1.x
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/paging_tmpl.h