diff options
author | Greg Kurz <groug@kaod.org> | 2017-09-15 15:16:20 +0200 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2017-09-27 13:05:41 +1000 |
commit | 14b0d748877d79d61017e7e38b1ae98c3fd339bc (patch) | |
tree | 3d775d1dcc7d7174fb9a8d7f89ecff0c2bd7045e /target/ppc/kvm_ppc.h | |
parent | 82be8e7394b31fd2d740651365b8ebdd0c847529 (diff) | |
download | qemu-14b0d748877d79d61017e7e38b1ae98c3fd339bc.zip qemu-14b0d748877d79d61017e7e38b1ae98c3fd339bc.tar.gz qemu-14b0d748877d79d61017e7e38b1ae98c3fd339bc.tar.bz2 |
ppc/kvm: generalize the use of kvmppc_get_htab_fd()
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 c1385933804bb:
"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: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target/ppc/kvm_ppc.h')
-rw-r--r-- | target/ppc/kvm_ppc.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h index 08aab46..349f892 100644 --- a/target/ppc/kvm_ppc.h +++ b/target/ppc/kvm_ppc.h @@ -51,7 +51,7 @@ uint64_t kvmppc_rma_size(uint64_t current_size, unsigned int hash_shift); #endif /* !CONFIG_USER_ONLY */ bool kvmppc_has_cap_epr(void); int kvmppc_define_rtas_kernel_token(uint32_t token, const char *function); -int kvmppc_get_htab_fd(bool write); +int kvmppc_get_htab_fd(bool write, uint64_t index, Error **errp); int kvmppc_save_htab(QEMUFile *f, int fd, size_t bufsize, int64_t max_ns); int kvmppc_load_htab_chunk(QEMUFile *f, int fd, uint32_t index, uint16_t n_valid, uint16_t n_invalid); @@ -245,7 +245,7 @@ static inline int kvmppc_define_rtas_kernel_token(uint32_t token, return -1; } -static inline int kvmppc_get_htab_fd(bool write) +static inline int kvmppc_get_htab_fd(bool write, uint64_t index, Error **errp) { return -1; } |