• G
    ppc/kvm: generalize the use of kvmppc_get_htab_fd() · 14b0d748
    Greg Kurz 提交于
    The use of KVM_PPC_GET_HTAB_FD is open-coded in kvmppc_read_hptes()
    and kvmppc_write_hpte().
    
    This patch modifies kvmppc_get_htab_fd() so that it can be used
    everywhere we need to access the in-kernel htab:
    - add an index argument
      => only kvmppc_read_hptes() passes an actual index, all other users
         pass 0
    - add an errp argument to propagate error messages to the caller.
      => spapr migration code prints the error
      => hpte helpers pass &error_abort to keep the current behavior
         of hw_error()
    
    While here, this also fixes a bug in kvmppc_write_hpte() so that it
    opens the htab fd for writing instead of reading as it currently does.
    This never broke anything because we currently never call this code,
    as explained in the changelog of commit c1385933:
    
    "This support updating htab managed by the hypervisor. Currently
     we don't have any user for this feature. This actually bring the
     store_hpte interface in-line with the load_hpte one. We may want
     to use this when we want to emulate henter hcall in qemu for HV
     kvm."
    
    The above is still true today.
    Signed-off-by: NGreg Kurz <groug@kaod.org>
    Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
    14b0d748
kvm.c 78.8 KB