diff options
author | David Gibson | 2012-09-12 18:57:20 +0200 |
---|---|---|
committer | Alexander Graf | 2012-10-04 15:54:18 +0200 |
commit | 53724ee565565f69560dbe17553bede8c0169379 (patch) | |
tree | ef73b2b50f6b30ee1c55c24da8ff858632ca9e3f /hw/spapr.h | |
parent | pseries: Remove never used flags field from spapr vio devices (diff) | |
download | qemu-53724ee565565f69560dbe17553bede8c0169379.tar.gz qemu-53724ee565565f69560dbe17553bede8c0169379.tar.xz qemu-53724ee565565f69560dbe17553bede8c0169379.zip |
pseries: Rework implementation of TCE bypass
On the pseries machine the IOMMU (aka TCE tables) is always active for all
PCI and VIO devices. Mostly to simplify the SLOF firmware, we implement an
extension which allows the IOMMU to be temporarily disabled for certain
devices.
Currently this is implemented by setting the device's DMAContext pointer to
NULL (thus reverting to qemu's default no-IOMMU DMA behaviour), then
replacing it when bypass mode is disabled.
This approach causes a bunch of complications though. It complexifies the
management of the DMAContext lifetimes, it's problematic for savevm/loadvm,
and it means that while bypass is active we have nowhere to store the
device's LIOBN (Logical IO Bus Number, used to identify DMA address
spaces). At present we regenerate the LIOBN from other address information
but this restricts how we can allocate LIOBNs.
This patch gives up on this approach, replacing it with the much simpler
one of having a 'bypass' boolean flag in the TCE state structure.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/spapr.h')
-rw-r--r-- | hw/spapr.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/spapr.h b/hw/spapr.h index 51a966b1e9..e984e3fc3c 100644 --- a/hw/spapr.h +++ b/hw/spapr.h @@ -339,6 +339,7 @@ void spapr_iommu_init(void); DMAContext *spapr_tce_new_dma_context(uint32_t liobn, size_t window_size); void spapr_tce_free(DMAContext *dma); void spapr_tce_reset(DMAContext *dma); +void spapr_tce_set_bypass(DMAContext *dma, bool bypass); int spapr_dma_dt(void *fdt, int node_off, const char *propname, uint32_t liobn, uint64_t window, uint32_t size); int spapr_tcet_dma_dt(void *fdt, int node_off, const char *propname, |