Skip to contentSkip to conversation

amd iommu: Large io page support - Interface

PATCH In review Wei Wang2 2 participants 4 messages Dec 3, 2010

lore
Share & tools
lore

Wei Wang2

author
#0 lore raw

PATCH 1/4 amd iommu: Large io page support - Interface

This patch extends generic iommu interfaces to support different page size.

Thanks,
Wei

--
Legal Information:
Advanced Micro Devices GmbH
Sitz: Dornach, Gemeinde Aschheim, Landkreis München Registergericht München, HRB Nr. 43632
Geschäftsführer:
Alberto Bozzo, Andrew Bowd

xen/drivers/passthrough/amd/pci_amd_iommu.c +2 -0
diff -r 79b71c77907b xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -447,4 +447,6 @@ const struct iommu_ops amd_iommu_ops = {
     .read_msi_from_ire = amd_iommu_read_msi_from_ire,
     .suspend = amd_iommu_suspend,
     .resume = amd_iommu_resume,
+    .map_pages = amd_iommu_map_pages,
+    .unmap_pages = amd_iommu_unmap_pages,
 };
xen/drivers/passthrough/vtd/iommu.c +2 -0
diff -r 79b71c77907b xen/drivers/passthrough/vtd/iommu.c
@@ -2222,6 +2222,8 @@ const struct iommu_ops intel_iommu_ops =
     .read_msi_from_ire = msi_msg_read_remap_rte,
     .suspend = vtd_suspend,
     .resume = vtd_resume,
+    .map_pages = NULL,
+    .unmap_pages = NULL,
 };
 
 /*
xen/include/asm-x86/hvm/svm/amd-iommu-proto.h +5 -0
diff -r 79b71c77907b xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
@@ -55,6 +55,11 @@ int amd_iommu_reserve_domain_unity_map(s
 int amd_iommu_reserve_domain_unity_map(struct domain *domain,
         unsigned long phys_addr, unsigned long size, int iw, int ir);
 void invalidate_all_iommu_pages(struct domain *d);
+
+int amd_iommu_map_pages(struct domain *d, unsigned long gfn, unsigned long mfn,
+                        unsigned int order, unsigned int flags);
+int amd_iommu_unmap_pages(struct domain *d,
+                        unsigned long gfn, unsigned int order);
 
 /* device table functions */
 int get_dma_requestor_id(u16 bdf);
xen/include/xen/iommu.h +7 -0
diff -r 79b71c77907b xen/include/xen/iommu.h
@@ -86,6 +86,10 @@ int iommu_map_page(struct domain *d, uns
                    unsigned int flags);
 int iommu_unmap_page(struct domain *d, unsigned long gfn);
 
+int iommu_map_pages(struct domain *d, unsigned long gfn, unsigned long mfn,
+                    unsigned int order, unsigned int flags);
+int iommu_unmap_pages(struct domain *d, unsigned long gfn, unsigned int order);
+
 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);
@@ -132,6 +136,9 @@ struct iommu_ops {
     unsigned int (*read_apic_from_ire)(unsigned int apic, unsigned int reg);
     void (*suspend)(void);
     void (*resume)(void);
+    int (*map_pages)(struct domain *d, unsigned long gfn, unsigned long mfn,
+                     unsigned int order, unsigned int flags);
+    int (*unmap_pages)(struct domain *d, unsigned long gfn, unsigned int order);
 };
 
 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

#1 lore raw

Why add new map/unmap calls. Better just to extend the existing calls to be able to act on a range, eh? That way you won't end up stubbing out and breaking Intel support in patch 3, either...

-- Keir

Quoted 17 lines · On 03/12/2010 08:03, "Wei Wang2" <[email protected]> wrote:

This patch extends generic iommu interfaces to support different page size.

Thanks,
Wei

--
Legal Information:
Advanced Micro Devices GmbH
Sitz: Dornach, Gemeinde Aschheim,
Landkreis München Registergericht München,
HRB Nr. 43632
Geschäftsführer:
Alberto Bozzo, Andrew Bowd
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw

Also the patch uses but does not define amd_iommu_map_pages(). Looks like you took one big patch and arbitrarily cut it up into a patch series. That is pointless if the series does not step-wise build and work.

-- Keir

Quoted 27 lines · Keir Fraser

Why add new map/unmap calls. Better just to extend the existing calls to be able to act on a range, eh? That way you won't end up stubbing out and breaking Intel support in patch 3, either...

-- Keir

Quoted 17 lines · On 03/12/2010 08:03, "Wei Wang2" <[email protected]> wrote:

This patch extends generic iommu interfaces to support different page size.

Thanks,
Wei

--
Legal Information:
Advanced Micro Devices GmbH
Sitz: Dornach, Gemeinde Aschheim,
Landkreis München Registergericht München,
HRB Nr. 43632
Geschäftsführer:
Alberto Bozzo, Andrew Bowd
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

author
#3 lore raw

Thanks, I will fix that.
Wei

Quoted 32 lines · On Friday 03 December 2010 17:21:03 Keir Fraser wrote:

Also the patch uses but does not define amd_iommu_map_pages(). Looks like you took one big patch and arbitrarily cut it up into a patch series. That is pointless if the series does not step-wise build and work.

-- Keir

Quoted 25 lines · Keir Fraser

Why add new map/unmap calls. Better just to extend the existing calls to be able to act on a range, eh? That way you won't end up stubbing out and breaking Intel support in patch 3, either...

-- Keir

Quoted 18 lines · On 03/12/2010 08:03, "Wei Wang2" <[email protected]> wrote:

This patch extends generic iommu interfaces to support different page size.

Thanks,
Wei

--
Legal Information:
Advanced Micro Devices GmbH
Sitz: Dornach, Gemeinde Aschheim,
Landkreis München Registergericht München,
HRB Nr. 43632
Geschäftsführer:
Alberto Bozzo, Andrew Bowd
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel