iommu: exports set_entry
PATCH 2/3 iommu: exports set_entry
Exports iommu_set_entry to the rest of xen.
Signed-off-by Jean Guyader <[email protected]>
---
xen/drivers/passthrough/iommu.c +17 -0
@@ -418,6 +418,23 @@ ops->suspend (); } +int iommu_set_entry (struct domain *d,unsigned long gfn,unsigned long mfn, +unsigned int flags,int map) +{ +const struct iommu_ops *ops =iommu_get_ops (); +if ( iommu_enabled ) +return ops->set_entry (d, gfn, mfn, flags, map); +return -1 ; +} + +int iommu_flush_iotlb (struct domain *d,unsigned long gfn,unsigned int nr) +{ +const struct iommu_ops *ops =iommu_get_ops (); +if ( iommu_enabled ) +return ops->flush_iotlb (d, gfn, nr); +return -1 ; +} +/* * Local variables: * mode: C
xen/drivers/passthrough/vtd/iommu.c +2 -0
@@ -2197,6 +2197,8 @@ .read_msi_from_ire = msi_msg_read_remap_rte, .suspend = vtd_suspend, .resume = vtd_resume, + .set_entry = intel_iommu_set_entry, + .flush_iotlb = intel_iommu_flush_iotlb };/*
xen/include/xen/iommu.h +7 -0
@@ -84,6 +84,10 @@ unsigned int flags);int iommu_unmap_page (struct domain *d,unsigned long gfn); +int iommu_set_entry (struct domain *d,unsigned long gfn,unsigned long mfn, +unsigned int flags,int map); +int iommu_flush_iotlb (struct domain *d,unsigned long gfn,unsigned int nr); +void iommu_domain_teardown (struct domain *d);int hvm_do_IRQ_dpci (struct domain *d,unsigned int irq);int dpci_ioport_intercept (ioreq_t *p);
@@ -130,6 +134,9 @@unsigned int (*read_apic_from_ire)(unsigned int apic,unsigned int reg);void (*suspend)(void );void (*resume)(void ); +int (*set_entry)(struct domain *d,unsigned long gfn,unsigned long mfn, +unsigned int flags,int map); +int (*flush_iotlb)(struct domain *d,unsigned long gfn,unsigned int nr); };void iommu_update_ire_from_apic (unsigned int apic,unsigned int reg,unsigned int value);
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
xen/drivers/passthrough/iommu.c line 426
Quoted 13 lines · Jean Guyader
diff -r
93ae9939b4a5xen/drivers/passthrough/iommu.cxen/drivers/passthrough/iommu.c +6
-0@@ -418,6 +418,23 @@ ops->suspend (); } +int iommu_set_entry (struct domain *d,unsigned long gfn,unsigned long mfn, +unsigned int flags,int map) +{ +const struct iommu_ops *ops =iommu_get_ops (); +if ( iommu_enabled ) +return ops->set_entry (d, gfn, mfn, flags, map);
Needs a check that set_entry() isn't NULL or it'll crash on AMD IOMMUs.
xen/drivers/passthrough/iommu.c line 434
Quoted 8 lines
xen/drivers/passthrough/iommu.c +8
-0+return -1 ; +} + +int iommu_flush_iotlb (struct domain *d,unsigned long gfn,unsigned int nr) +{ +const struct iommu_ops *ops =iommu_get_ops (); +if ( iommu_enabled ) +return ops->flush_iotlb (d, gfn, nr);
Likewise.
Quoted 47 lines
xen/drivers/passthrough/iommu.c +3
-0+return -1 ; +} +/* * Local variables: * mode: C diff -r
93ae9939b4a5xen/drivers/passthrough/vtd/iommu.cxen/drivers/passthrough/vtd/iommu.c +2
-0@@ -2197,6 +2197,8 @@ .read_msi_from_ire = msi_msg_read_remap_rte, .suspend = vtd_suspend, .resume = vtd_resume, + .set_entry = intel_iommu_set_entry, + .flush_iotlb = intel_iommu_flush_iotlb };/* diff -r
93ae9939b4a5xen/include/xen/iommu.hxen/include/xen/iommu.h +7
-0@@ -84,6 +84,10 @@ unsigned int flags);int iommu_unmap_page (struct domain *d,unsigned long gfn); +int iommu_set_entry (struct domain *d,unsigned long gfn,unsigned long mfn, +unsigned int flags,int map); +int iommu_flush_iotlb (struct domain *d,unsigned long gfn,unsigned int nr); +void iommu_domain_teardown (struct domain *d);int hvm_do_IRQ_dpci (struct domain *d,unsigned int irq);int dpci_ioport_intercept (ioreq_t *p);@@ -130,6 +134,9 @@unsigned int (*read_apic_from_ire)(unsigned int apic,unsigned int reg);void (*suspend)(void );void (*resume)(void ); +int (*set_entry)(struct domain *d,unsigned long gfn,unsigned long mfn, +unsigned int flags,int map); +int (*flush_iotlb)(struct domain *d,unsigned long gfn,unsigned int nr); };void iommu_update_ire_from_apic (unsigned int apic,unsigned int reg,unsigned int value);_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Signature · 3 lines
Tim Deegan <[email protected]> Principal Software Engineer, Xen Platform Team Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)