aboutsummaryrefslogtreecommitdiff
path: root/target-ppc
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2013-07-18 14:32:58 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2013-07-29 10:37:08 -0500
commita83000f5e3fac30a7f213af1ba6a8f827622854d (patch)
tree7bf4b793f453f37a241d0dbd147f5ec258cfb217 /target-ppc
parentdb1b58e937fd80513a4bb14432808495a5846ffe (diff)
downloadqemu-a83000f5e3fac30a7f213af1ba6a8f827622854d.zip
qemu-a83000f5e3fac30a7f213af1ba6a8f827622854d.tar.gz
qemu-a83000f5e3fac30a7f213af1ba6a8f827622854d.tar.bz2
spapr-tce: make sPAPRTCETable a proper device
Model TCE tables as a device that's hooked up as a child object to the owner. Besides the code cleanup, we get a few nice benefits: 1) free actually works now (it was dead code before) 2) the TCE information is visible in the device tree 3) we can expose table information as properties such that if we change the window_size, we can use globals to keep migration working. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Message-id: 1374175984-8930-6-git-send-email-aliguori@us.ibm.com [dwg: pseries: savevm support for PAPR TCE tables] Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> [alexey: ppc kvm: fix to compile] Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'target-ppc')
-rw-r--r--target-ppc/kvm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index b0099e1..9f2e4f0 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -1626,7 +1626,7 @@ void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t window_size, int *pfd)
return NULL;
}
- len = (window_size / SPAPR_TCE_PAGE_SIZE) * sizeof(sPAPRTCE);
+ len = (window_size / SPAPR_TCE_PAGE_SIZE) * sizeof(uint64_t);
/* FIXME: round this up to page size */
table = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
@@ -1649,7 +1649,7 @@ int kvmppc_remove_spapr_tce(void *table, int fd, uint32_t window_size)
return -1;
}
- len = (window_size / SPAPR_TCE_PAGE_SIZE)*sizeof(sPAPRTCE);
+ len = (window_size / SPAPR_TCE_PAGE_SIZE)*sizeof(uint64_t);
if ((munmap(table, len) < 0) ||
(close(fd) < 0)) {
fprintf(stderr, "KVM: Unexpected error removing TCE table: %s",