[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [HVM] iommu p2m ops: check guest is translated, and maintain m2p consistency



# HG changeset patch
# User Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
# Date 1190282092 -3600
# Node ID a93ebecda83bbc73d01449ef6d3c89a7809db5fb
# Parent  c2d65181174119bc262da42e9d484b351dd0a7ef
[HVM] iommu p2m ops: check guest is translated, and maintain m2p consistency
Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
---
 xen/arch/x86/mm/p2m.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletion(-)

diff -r c2d651811741 -r a93ebecda83b xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Thu Sep 20 10:31:49 2007 +0100
+++ b/xen/arch/x86/mm/p2m.c     Thu Sep 20 10:54:52 2007 +0100
@@ -873,6 +873,18 @@ set_mmio_p2m_entry(struct domain *d, uns
 set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
 {
     int rc = 0;
+    p2m_type_t ot;
+    mfn_t omfn;
+
+    if ( !paging_mode_translate(d) )
+        return 0;
+
+    omfn = gfn_to_mfn(d, gfn, &ot);
+    if ( p2m_is_ram(ot) )
+    {
+        ASSERT(mfn_valid(omfn));
+        set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
+    }
 
     rc = set_p2m_entry(d, gfn, mfn, p2m_mmio_direct);
     if ( 0 == rc )
@@ -886,8 +898,11 @@ clear_mmio_p2m_entry(struct domain *d, u
 clear_mmio_p2m_entry(struct domain *d, unsigned long gfn)
 {
     int rc = 0;
-
     unsigned long mfn;
+
+    if ( !paging_mode_translate(d) )
+        return 0;
+
     mfn = gmfn_to_mfn(d, gfn);
     if ( INVALID_MFN == mfn )
     {

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.