OSDN Git Service

KVM: PPC: Book3S PR: Exit KVM on failed mapping
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Fri, 24 Mar 2017 06:48:10 +0000 (17:48 +1100)
committerPaul Mackerras <paulus@ozlabs.org>
Thu, 20 Apr 2017 01:38:04 +0000 (11:38 +1000)
commitbd9166ffe624000140fc6b606b256df01fc0d060
tree6f8b599ca31ba427832497e0a0c50880851647eb
parent9eecec126e006768c21ba2b4588ce5b0e23fda0b
KVM: PPC: Book3S PR: Exit KVM on failed mapping

At the moment kvmppc_mmu_map_page() returns -1 if
mmu_hash_ops.hpte_insert() fails for any reason so the page fault handler
resumes the guest and it faults on the same address again.

This adds distinction to kvmppc_mmu_map_page() to return -EIO if
mmu_hash_ops.hpte_insert() failed for a reason other than full pteg.
At the moment only pSeries_lpar_hpte_insert() returns -2 if
plpar_pte_enter() failed with a code other than H_PTEG_FULL.
Other mmu_hash_ops.hpte_insert() instances can only fail with
-1 "full pteg".

With this change, if PR KVM fails to update HPT, it can signal
the userspace about this instead of returning to guest and having
the very same page fault over and over again.

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_mmu_host.c
arch/powerpc/kvm/book3s_pr.c