mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
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>
This commit is contained in:
parent
db1b58e937
commit
a83000f5e3
6 changed files with 117 additions and 63 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue