]> git.proxmox.com Git - mirror_qemu.git/commit - hw/ppc/spapr_vio.c
spapr_iommu: Introduce "enabled" state for TCE table
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Wed, 1 Jun 2016 08:57:33 +0000 (18:57 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 7 Jun 2016 00:17:45 +0000 (10:17 +1000)
commitdf7625d422a61acbdb9b10a5b4f3bd576ec94c50
tree2ac2e5d15c009ca13969926b2b6676d76416a8cc
parent705124ea6dca3ebfa13afddac9ce9475caf981a6
spapr_iommu: Introduce "enabled" state for TCE table

Currently TCE tables are created once at start and their sizes never
change. We are going to change that by introducing a Dynamic DMA windows
support where DMA configuration may change during the guest execution.

This changes spapr_tce_new_table() to create an empty zero-size IOMMU
memory region (IOMMU MR). Only LIOBN is assigned by the time of creation.
It still will be called once at the owner object (VIO or PHB) creation.

This introduces an "enabled" state for TCE table objects, some
helper functions are added:
- spapr_tce_table_enable() receives TCE table parameters, stores in
sPAPRTCETable and allocates a guest view of the TCE table
(in the user space or KVM) and sets the correct size on the IOMMU MR;
- spapr_tce_table_disable() disposes the table and resets the IOMMU MR
size; it is made public as the following DDW code will be using it.

This changes the PHB reset handler to do the default DMA initialization
instead of spapr_phb_realize(). This does not make differenct now but
later with more than just one DMA window, we will have to remove them all
and create the default one on a system reset.

No visible change in behaviour is expected except the actual table
will be reallocated every reset. We might optimize this later.

The other way to implement this would be dynamically create/remove
the TCE table QOM objects but this would make migration impossible
as the migration code expects all QOM objects to exist at the receiver
so we have to have TCE table objects created when migration begins.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_iommu.c
hw/ppc/spapr_pci.c
hw/ppc/spapr_vio.c
include/hw/ppc/spapr.h