mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
pseries: Convert sPAPR TCEs to use generic IOMMU infrastructure
The pseries platform already contains an IOMMU implementation, since it is essential for the platform's paravirtualized VIO devices. This IOMMU support is currently built into the implementation of the VIO "bus" and the various VIO devices. This patch converts this code to make use of the new common IOMMU infrastructure. We don't yet handle synchronization of map/unmap callbacks vs. invalidations, this will require some complex interaction with the kernel and is not a major concern at this stage. Cc: Alex Graf <agraf@suse.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
e5332e6334
commit
ad0ebb91cd
10 changed files with 369 additions and 342 deletions
17
hw/spapr.h
17
hw/spapr.h
|
@ -1,6 +1,7 @@
|
|||
#if !defined(__HW_SPAPR_H__)
|
||||
#define __HW_SPAPR_H__
|
||||
|
||||
#include "dma.h"
|
||||
#include "hw/xics.h"
|
||||
|
||||
struct VIOsPAPRBus;
|
||||
|
@ -320,4 +321,20 @@ target_ulong spapr_rtas_call(sPAPREnvironment *spapr,
|
|||
int spapr_rtas_device_tree_setup(void *fdt, target_phys_addr_t rtas_addr,
|
||||
target_phys_addr_t rtas_size);
|
||||
|
||||
#define SPAPR_TCE_PAGE_SHIFT 12
|
||||
#define SPAPR_TCE_PAGE_SIZE (1ULL << SPAPR_TCE_PAGE_SHIFT)
|
||||
#define SPAPR_TCE_PAGE_MASK (SPAPR_TCE_PAGE_SIZE - 1)
|
||||
|
||||
typedef struct sPAPRTCE {
|
||||
uint64_t tce;
|
||||
} sPAPRTCE;
|
||||
|
||||
#define SPAPR_VIO_BASE_LIOBN 0x00000000
|
||||
|
||||
void spapr_iommu_init(void);
|
||||
DMAContext *spapr_tce_new_dma_context(uint32_t liobn, size_t window_size);
|
||||
void spapr_tce_free(DMAContext *dma);
|
||||
int spapr_dma_dt(void *fdt, int node_off, const char *propname,
|
||||
DMAContext *dma);
|
||||
|
||||
#endif /* !defined (__HW_SPAPR_H__) */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue