]> git.karo-electronics.de Git - karo-tx-linux.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)
commitda6f59e19233efdda58f196afbae8e05f6030d7f
tree61dbbdafde5e5fcad4f2d7ddbaf3b3e98b060755
parent503bfcbe18576a79be0bc5173b23b530845e704a
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