All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] amd iommu: Large io page support - Interface
@ 2010-12-03 16:03 Wei Wang2
  2010-12-03 16:17 ` Keir Fraser
  0 siblings, 1 reply; 4+ messages in thread
From: Wei Wang2 @ 2010-12-03 16:03 UTC (permalink / raw)
  To: xen-devel@lists.xensource.com

[-- Attachment #1: Type: text/plain, Size: 334 bytes --]

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

Thanks,
Wei
Signed-off-by: Wei Wang <wei.wang2@amd.com>
--
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

[-- Attachment #2: iommu_spage_interface.patch --]
[-- Type: text/x-diff, Size: 2924 bytes --]

diff -r 79b71c77907b xen/drivers/passthrough/amd/pci_amd_iommu.c
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c	Wed Nov 24 10:20:03 2010 +0000
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c	Wed Nov 24 17:13:43 2010 +0100
@@ -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,
 };
diff -r 79b71c77907b xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Wed Nov 24 10:20:03 2010 +0000
+++ b/xen/drivers/passthrough/vtd/iommu.c	Wed Nov 24 17:13:43 2010 +0100
@@ -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,
 };
 
 /*
diff -r 79b71c77907b xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Wed Nov 24 10:20:03 2010 +0000
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Wed Nov 24 17:13:43 2010 +0100
@@ -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);
diff -r 79b71c77907b xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h	Wed Nov 24 10:20:03 2010 +0000
+++ b/xen/include/xen/iommu.h	Wed Nov 24 17:13:43 2010 +0100
@@ -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);

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/4] amd iommu: Large io page support - Interface
  2010-12-03 16:03 [PATCH 1/4] amd iommu: Large io page support - Interface Wei Wang2
@ 2010-12-03 16:17 ` Keir Fraser
  2010-12-03 16:21   ` Keir Fraser
  0 siblings, 1 reply; 4+ messages in thread
From: Keir Fraser @ 2010-12-03 16:17 UTC (permalink / raw)
  To: Wei Wang2, xen-devel@lists.xensource.com

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

On 03/12/2010 08:03, "Wei Wang2" <wei.wang2@amd.com> wrote:

> This patch extends generic iommu interfaces to support different page size.
> 
> Thanks,
> Wei
> Signed-off-by: Wei Wang <wei.wang2@amd.com>
> --
> 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
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/4] amd iommu: Large io page support - Interface
  2010-12-03 16:17 ` Keir Fraser
@ 2010-12-03 16:21   ` Keir Fraser
  2010-12-03 16:24     ` Wei Wang2
  0 siblings, 1 reply; 4+ messages in thread
From: Keir Fraser @ 2010-12-03 16:21 UTC (permalink / raw)
  To: Wei Wang2, xen-devel@lists.xensource.com

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

On 03/12/2010 08:17, "Keir Fraser" <keir@xen.org> wrote:

> 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
> 
> On 03/12/2010 08:03, "Wei Wang2" <wei.wang2@amd.com> wrote:
> 
>> This patch extends generic iommu interfaces to support different page size.
>> 
>> Thanks,
>> Wei
>> Signed-off-by: Wei Wang <wei.wang2@amd.com>
>> --
>> 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
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/4] amd iommu: Large io page support - Interface
  2010-12-03 16:21   ` Keir Fraser
@ 2010-12-03 16:24     ` Wei Wang2
  0 siblings, 0 replies; 4+ messages in thread
From: Wei Wang2 @ 2010-12-03 16:24 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel@lists.xensource.com

Thanks, I will fix that.
Wei

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
>
> On 03/12/2010 08:17, "Keir Fraser" <keir@xen.org> wrote:
> > 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
> >
> > On 03/12/2010 08:03, "Wei Wang2" <wei.wang2@amd.com> wrote:
> >> This patch extends generic iommu interfaces to support different page
> >> size.
> >>
> >> Thanks,
> >> Wei
> >> Signed-off-by: Wei Wang <wei.wang2@amd.com>
> >> --
> >> 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
> >> Xen-devel@lists.xensource.com
> >> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-12-03 16:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-03 16:03 [PATCH 1/4] amd iommu: Large io page support - Interface Wei Wang2
2010-12-03 16:17 ` Keir Fraser
2010-12-03 16:21   ` Keir Fraser
2010-12-03 16:24     ` Wei Wang2

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.