• Alexey Kardashevskiy's avatar
    KVM: PPC: Book3S PR: Exit KVM on failed mapping · bd9166ff
    Alexey Kardashevskiy authored
    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: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
    Reviewed-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    bd9166ff
book3s_64_mmu_host.c 10.2 KB