for ( i = 0; i < (1ul << page_order); i++ )
{
- rc = hd->platform_ops->map_page(d, dfn_add(dfn, i), mfn_add(mfn, i),
- flags, flush_flags);
+ rc = iommu_call(hd->platform_ops, map_page, d, dfn_add(dfn, i),
+ mfn_add(mfn, i), flags, flush_flags);
if ( likely(!rc) )
continue;
while ( i-- )
/* if statement to satisfy __must_check */
- if ( hd->platform_ops->unmap_page(d, dfn_add(dfn, i),
- flush_flags) )
+ if ( iommu_call(hd->platform_ops, unmap_page, d, dfn_add(dfn, i),
+ flush_flags) )
continue;
if ( !is_hardware_domain(d) )
for ( i = 0; i < (1ul << page_order); i++ )
{
- int err = hd->platform_ops->unmap_page(d, dfn_add(dfn, i),
- flush_flags);
+ int err = iommu_call(hd->platform_ops, unmap_page, d, dfn_add(dfn, i),
+ flush_flags);
if ( likely(!err) )
continue;
if ( !iommu_enabled || !hd->platform_ops || !hd->platform_ops->lookup_page )
return -EOPNOTSUPP;
- return hd->platform_ops->lookup_page(d, dfn, mfn, flags);
+ return iommu_call(hd->platform_ops, lookup_page, d, dfn, mfn, flags);
}
static void iommu_free_pagetables(unsigned long unused)
spin_unlock(&iommu_pt_cleanup_lock);
if ( !pg )
return;
- iommu_get_ops()->free_page_table(pg);
+ iommu_vcall(iommu_get_ops(), free_page_table, pg);
} while ( !softirq_pending(smp_processor_id()) );
tasklet_schedule_on_cpu(&iommu_pt_cleanup_tasklet,
if ( dfn_eq(dfn, INVALID_DFN) )
return -EINVAL;
- rc = hd->platform_ops->iotlb_flush(d, dfn, page_count, flush_flags);
+ rc = iommu_call(hd->platform_ops, iotlb_flush, d, dfn, page_count,
+ flush_flags);
if ( unlikely(rc) )
{
if ( !d->is_shutting_down && printk_ratelimit() )
* The operation does a full flush so we don't need to pass the
* flush_flags in.
*/
- rc = hd->platform_ops->iotlb_flush_all(d);
+ rc = iommu_call(hd->platform_ops, iotlb_flush_all, d);
if ( unlikely(rc) )
{
if ( !d->is_shutting_down && printk_ratelimit() )
struct msi_desc *msi_desc, struct msi_msg *msg)
{
return iommu_intremap
- ? iommu_get_ops()->update_ire_from_msi(msi_desc, msg) : 0;
+ ? iommu_call(&iommu_ops, update_ire_from_msi, msi_desc, msg) : 0;
}
void iommu_read_msi_from_ire(
struct msi_desc *msi_desc, struct msi_msg *msg)
{
if ( iommu_intremap )
- iommu_get_ops()->read_msi_from_ire(msi_desc, msg);
+ iommu_vcall(&iommu_ops, read_msi_from_ire, msi_desc, msg);
}
static int iommu_add_device(struct pci_dev *pdev)
void iommu_update_ire_from_apic(
unsigned int apic, unsigned int reg, unsigned int value)
{
- const struct iommu_ops *ops = iommu_get_ops();
- ops->update_ire_from_apic(apic, reg, value);
+ iommu_vcall(&iommu_ops, update_ire_from_apic, apic, reg, value);
}
unsigned int iommu_read_apic_from_ire(unsigned int apic, unsigned int reg)
{
- const struct iommu_ops *ops = iommu_get_ops();
- return ops->read_apic_from_ire(apic, reg);
+ return iommu_call(&iommu_ops, read_apic_from_ire, apic, reg);
}
int __init iommu_setup_hpet_msi(struct msi_desc *msi)