diff options
author | Ben Herrenschmidt <benh@kernel.crashing.org> | 2011-04-01 15:15:32 +1100 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2011-04-01 18:34:57 +0200 |
commit | 08942ac17922d923a7cc5cf9854e9cc4b150b942 (patch) | |
tree | b080513d06e331b97f9a8d38101e4e5bc0e03c3c /hw/spapr_vio.h | |
parent | 6e270446d0e107b5227d8c51d2f85546f8811e99 (diff) |
Add a PAPR TCE-bypass mechanism for the pSeries machine
Usually, PAPR virtual IO devices use a virtual IOMMU mechanism, TCEs,
to mediate all DMA transfers. While this is necessary for some sorts of
operation, it can be complex to program and slow for others.
This patch implements a mechanism for bypassing TCE translation, treating
"IO" addresses as plain (guest) physical memory addresses. This has two
main uses:
* Simple, but 64-bit aware programs like firmwares can use the VIO devices
without the complexity of TCE setup.
* The guest OS can optionally use the TCE bypass to improve performance in
suitable situations.
The mechanism used is a per-device flag which disables TCE translation.
The flag is toggled with some (hypervisor-implemented) RTAS methods.
Signed-off-by: Ben Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/spapr_vio.h')
-rw-r--r-- | hw/spapr_vio.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/spapr_vio.h b/hw/spapr_vio.h index b7d0daab0..841b04351 100644 --- a/hw/spapr_vio.h +++ b/hw/spapr_vio.h @@ -48,6 +48,8 @@ typedef struct VIOsPAPR_CRQ { typedef struct VIOsPAPRDevice { DeviceState qdev; uint32_t reg; + uint32_t flags; +#define VIO_PAPR_FLAG_DMA_BYPASS 0x1 qemu_irq qirq; uint32_t vio_irq_num; target_ulong signal_state; @@ -104,4 +106,7 @@ void spapr_vlan_create(VIOsPAPRBus *bus, uint32_t reg, NICInfo *nd, void spapr_vscsi_create(VIOsPAPRBus *bus, uint32_t reg, qemu_irq qirq, uint32_t vio_irq_num); +int spapr_tce_set_bypass(uint32_t unit, uint32_t enable); +void spapr_vio_quiesce(void); + #endif /* _HW_SPAPR_VIO_H */ |