]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
x86/kvm: Cache gfn to pfn translation
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Thu, 5 Dec 2019 01:30:51 +0000 (01:30 +0000)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 14 May 2020 08:54:22 +0000 (10:54 +0200)
commit411ddd646a1ad596979ada3063da53659a0b2174
treedf1147f845e6df022934794c4799e04d9492aa0f
parent4afbc69ae9c82648968a5fab4e3e53ebc25913b8
x86/kvm: Cache gfn to pfn translation

BugLink: https://bugs.launchpad.net/bugs/1877461
commit 917248144db5d7320655dbb41d3af0b8a0f3d589 upstream.

__kvm_map_gfn()'s call to gfn_to_pfn_memslot() is
* relatively expensive
* in certain cases (such as when done from atomic context) cannot be called

Stashing gfn-to-pfn mapping should help with both cases.

This is part of CVE-2019-3016.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/x86.c
include/linux/kvm_host.h
include/linux/kvm_types.h
virt/kvm/kvm_main.c