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] x86: Fix ept and vt-d co-existence issue.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: Fix ept and vt-d co-existence issue.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 16 Oct 2009 01:10:13 -0700
Delivery-date: Fri, 16 Oct 2009 01:10:20 -0700
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 1255677917 -3600
# Node ID 648c674fcc96b09fc8fb9428843fec08c8d2fc4e
# Parent  7a69f773548e7fc88f13bf59db4ac73208ec32c5
x86: Fix ept and vt-d co-existence issue.

For vt-d's mmio address ranges, once ept enables, they should
be added to ept page tables with p2m lock held, and then guest can
access these ranges like conventional ram, but to change the ept
entries, it should take the p2m lock first.

Signed-off-by: Xiantao Zhang <xiantao.zhang@xxxxxxxxx>
---
 xen/arch/x86/mm/hap/p2m-ept.c |    2 ++
 xen/arch/x86/mm/p2m.c         |    4 ++++
 2 files changed, 6 insertions(+)

diff -r 7a69f773548e -r 648c674fcc96 xen/arch/x86/mm/hap/p2m-ept.c
--- a/xen/arch/x86/mm/hap/p2m-ept.c     Fri Oct 16 08:24:47 2009 +0100
+++ b/xen/arch/x86/mm/hap/p2m-ept.c     Fri Oct 16 08:25:17 2009 +0100
@@ -524,6 +524,7 @@ void ept_change_entry_emt_with_range(str
     mfn_t mfn;
     int order = 0;
 
+    p2m_lock(d->arch.p2m);
     for ( gfn = start_gfn; gfn <= end_gfn; gfn++ )
     {
         e = ept_get_entry_content(d, gfn);
@@ -561,6 +562,7 @@ void ept_change_entry_emt_with_range(str
                 ept_set_entry(d, gfn, mfn, order, e.avail1);
         }
     }
+    p2m_unlock(d->arch.p2m);
 }
 
 /* 
diff -r 7a69f773548e -r 648c674fcc96 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Fri Oct 16 08:24:47 2009 +0100
+++ b/xen/arch/x86/mm/p2m.c     Fri Oct 16 08:25:17 2009 +0100
@@ -2237,7 +2237,9 @@ set_mmio_p2m_entry(struct domain *d, uns
     }
 
     P2M_DEBUG("set mmio %lx %lx\n", gfn, mfn_x(mfn));
+    p2m_lock(d->arch.p2m);
     rc = set_p2m_entry(d, gfn, mfn, 0, p2m_mmio_direct);
+    p2m_unlock(d->arch.p2m);
     if ( 0 == rc )
         gdprintk(XENLOG_ERR,
             "set_mmio_p2m_entry: set_p2m_entry failed! mfn=%08lx\n",
@@ -2261,7 +2263,9 @@ clear_mmio_p2m_entry(struct domain *d, u
             "clear_mmio_p2m_entry: gfn_to_mfn failed! gfn=%08lx\n", gfn);
         return 0;
     }
+    p2m_lock(d->arch.p2m);
     rc = set_p2m_entry(d, gfn, _mfn(INVALID_MFN), 0, 0);
+    p2m_unlock(d->arch.p2m);
 
     return rc;
 }

_______________________________________________
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] x86: Fix ept and vt-d co-existence issue., Xen patchbot-unstable <=