spapr_iommu: Move table allocation to helpers
commitfec5d3a1cd8fea7d70778f8b408589d75c88c3e7
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Wed, 4 May 2016 06:52:19 +0000 (4 16:52 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 26 May 2016 23:40:23 +0000 (27 09:40 +1000)
treed7d34dbfb3b2d5f5c8e98e711791464939fe3e4d
parentf94819d6012fbc2a6022eeacd65608e58dacbada
spapr_iommu: Move table allocation to helpers

At the moment presence of vfio-pci devices on a bus affect the way
the guest view table is allocated. If there is no vfio-pci on a PHB
and the host kernel supports KVM acceleration of H_PUT_TCE, a table
is allocated in KVM. However, if there is vfio-pci and we do yet not
KVM acceleration for these, the table has to be allocated by
the userspace. At the moment the table is allocated once at boot time
but next patches will reallocate it.

This moves kvmppc_create_spapr_tce/g_malloc0 and their counterparts
to helpers.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_iommu.c
trace-events