mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
vfio/spapr: switch to spapr IOMMU BE add/del_section_window
No functional change intended. Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
parent
9b7d38bf5a
commit
233309e8e4
5 changed files with 42 additions and 16 deletions
|
@ -319,10 +319,13 @@ static int vfio_spapr_create_window(VFIOContainer *container,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int vfio_container_add_section_window(VFIOContainer *container,
|
||||
MemoryRegionSection *section,
|
||||
Error **errp)
|
||||
static int
|
||||
vfio_spapr_container_add_section_window(VFIOContainerBase *bcontainer,
|
||||
MemoryRegionSection *section,
|
||||
Error **errp)
|
||||
{
|
||||
VFIOContainer *container = container_of(bcontainer, VFIOContainer,
|
||||
bcontainer);
|
||||
VFIOHostDMAWindow *hostwin;
|
||||
hwaddr pgsize = 0;
|
||||
int ret;
|
||||
|
@ -407,9 +410,13 @@ int vfio_container_add_section_window(VFIOContainer *container,
|
|||
return 0;
|
||||
}
|
||||
|
||||
void vfio_container_del_section_window(VFIOContainer *container,
|
||||
MemoryRegionSection *section)
|
||||
static void
|
||||
vfio_spapr_container_del_section_window(VFIOContainerBase *bcontainer,
|
||||
MemoryRegionSection *section)
|
||||
{
|
||||
VFIOContainer *container = container_of(bcontainer, VFIOContainer,
|
||||
bcontainer);
|
||||
|
||||
if (container->iommu_type != VFIO_SPAPR_TCE_v2_IOMMU) {
|
||||
return;
|
||||
}
|
||||
|
@ -430,6 +437,8 @@ static VFIOIOMMUOps vfio_iommu_spapr_ops;
|
|||
static void setup_spapr_ops(VFIOContainerBase *bcontainer)
|
||||
{
|
||||
vfio_iommu_spapr_ops = *bcontainer->ops;
|
||||
vfio_iommu_spapr_ops.add_window = vfio_spapr_container_add_section_window;
|
||||
vfio_iommu_spapr_ops.del_window = vfio_spapr_container_del_section_window;
|
||||
bcontainer->ops = &vfio_iommu_spapr_ops;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue