]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Use preregistered memory API to access TCE list
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Wed, 22 Mar 2017 04:21:54 +0000 (15:21 +1100)
committerPaul Mackerras <paulus@ozlabs.org>
Thu, 20 Apr 2017 01:39:16 +0000 (11:39 +1000)
commit2f3b64dac358ceecc35dd5f793922a6605fada1a
tree61dbbdafde5e5fcad4f2d7ddbaf3b3e98b060755
parent113fadf2b219c0faebc6410f9b3f5dd6e7457e39
KVM: PPC: Use preregistered memory API to access TCE list

VFIO on sPAPR already implements guest memory pre-registration
when the entire guest RAM gets pinned. This can be used to translate
the physical address of a guest page containing the TCE list
from H_PUT_TCE_INDIRECT.

This makes use of the pre-registrered memory API to access TCE list
pages in order to avoid unnecessary locking on the KVM memory
reverse map as we know that all of guest memory is pinned and
we have a flat array mapping GPA to HPA which makes it simpler and
quicker to index into that array (even with looking up the
kernel page tables in vmalloc_to_phys) than it is to find the memslot,
lock the rmap entry, look up the user page tables, and unlock the rmap
entry. Note that the rmap pointer is initialized to NULL
where declared (not in this patch).

If a requested chunk of memory has not been preregistered, this will
fall back to non-preregistered case and lock rmap.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/book3s_64_vio_hv.c