diff mbox

[RFC,for-4.5,07/12] xen/passthrough: iommu: Don't need to map dom0 page when the PT is shared

Message ID 1391794991-5919-8-git-send-email-julien.grall@linaro.org
State Accepted
Commit 9b51591c330672765d866a5ed4ed8e40c75bb1cf
Headers show

Commit Message

Julien Grall Feb. 7, 2014, 5:43 p.m. UTC
Currently iommu_init_dom0 is browsing the page list and call map_page callback
on each page.

On both AMD and VTD drivers, the function will directly return if the page
table is shared with the processor. So Xen can safely avoid to run through
the page list.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Cc: Xiantao Zhang <xiantao.zhang@intel.com>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/iommu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ian Campbell Feb. 19, 2014, 12:37 p.m. UTC | #1
On Fri, 2014-02-07 at 17:43 +0000, Julien Grall wrote:
> Currently iommu_init_dom0 is browsing the page list and call map_page callback
> on each page.
> 
> On both AMD and VTD drivers, the function will directly return if the page
> table is shared with the processor. So Xen can safely avoid to run through
> the page list.
> 
> Signed-off-by: Julien Grall <julien.grall@linaro.org>
> Cc: Xiantao Zhang <xiantao.zhang@intel.com>
> Cc: Jan Beulich <jbeulich@suse.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> ---
>  xen/drivers/passthrough/iommu.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
> index 26a5d91..0a26956 100644
> --- a/xen/drivers/passthrough/iommu.c
> +++ b/xen/drivers/passthrough/iommu.c
> @@ -157,7 +157,7 @@ void __init iommu_dom0_init(struct domain *d)
>  
>      register_keyhandler('o', &iommu_p2m_table);
>      d->need_iommu = !!iommu_dom0_strict;
> -    if ( need_iommu(d) )
> +    if ( need_iommu(d) && !iommu_use_hap_pt(d) )
>      {
>          struct page_info *page;
>          unsigned int i = 0;
diff mbox

Patch

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 26a5d91..0a26956 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -157,7 +157,7 @@  void __init iommu_dom0_init(struct domain *d)
 
     register_keyhandler('o', &iommu_p2m_table);
     d->need_iommu = !!iommu_dom0_strict;
-    if ( need_iommu(d) )
+    if ( need_iommu(d) && !iommu_use_hap_pt(d) )
     {
         struct page_info *page;
         unsigned int i = 0;