WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] VT-d: clean up dynamic page mapping

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] VT-d: clean up dynamic page mapping
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 04 Jan 2010 01:15:13 -0800
Delivery-date: Mon, 04 Jan 2010 01:15:20 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1262595962 0
# Node ID b76fe58d07018a12f934aacb43a3e880323a2ede
# Parent  042b371d8728843cef41dd3827ab026607c83ed1
VT-d: clean up dynamic page mapping

Before dynamic VT-d page table for hvm guest (changeset 20152),
need_iommu is only used for PV guest. And it maps pages into VT-d for
PV guest in get_page_type and grant table.  Now need_iommu is used
both hvm and pv guests, this patch makes those code still only for PV
guest, because it needn't to map pages there for hvm domain.

Signed-off-by: Weidong Han <Weidong.han@xxxxxxxxx>
---
 xen/arch/x86/mm.c        |    2 +-
 xen/common/grant_table.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff -r 042b371d8728 -r b76fe58d0701 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Mon Jan 04 09:04:53 2010 +0000
+++ b/xen/arch/x86/mm.c Mon Jan 04 09:06:02 2010 +0000
@@ -2391,7 +2391,7 @@ static int __get_page_type(struct page_i
     {
         /* Special pages should not be accessible from devices. */
         struct domain *d = page_get_owner(page);
-        if ( d && unlikely(need_iommu(d)) )
+        if ( d && !is_hvm_domain(d) && unlikely(need_iommu(d)) )
         {
             if ( (x & PGT_type_mask) == PGT_writable_page )
                 iommu_unmap_page(d, mfn_to_gmfn(d, page_to_mfn(page)));
diff -r 042b371d8728 -r b76fe58d0701 xen/common/grant_table.c
--- a/xen/common/grant_table.c  Mon Jan 04 09:04:53 2010 +0000
+++ b/xen/common/grant_table.c  Mon Jan 04 09:06:02 2010 +0000
@@ -596,7 +596,7 @@ __gnttab_map_grant_ref(
         goto undo_out;
     }
 
-    if ( need_iommu(ld) &&
+    if ( (!is_hvm_domain(ld) && need_iommu(ld)) &&
          !(old_pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask)) &&
          (act_pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask)) )
     {
@@ -779,7 +779,7 @@ __gnttab_unmap_common(
             act->pin -= GNTPIN_hstw_inc;
     }
 
-    if ( need_iommu(ld) &&
+    if ( (!is_hvm_domain(ld) && need_iommu(ld)) &&
          (old_pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask)) &&
          !(act->pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask)) )
     {

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] VT-d: clean up dynamic page mapping, Xen patchbot-unstable <=