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

[Xen-changelog] [xen-unstable] xenpaging: Add checks for p2m_is_valid() after calls to gfn_to_mfn()



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1261392051 0
# Node ID 42304d2fc83ebb3f2c8f3ee8d8d732d3e435488b
# Parent  1f315181731a74b295d5357c8514d040275cfbbf
xenpaging: Add checks for p2m_is_valid() after calls to gfn_to_mfn()
that replace calls to gmfn_to_mfn(), which does the check internally.

Signed-off-by: Patrick Colp <Patrick.Colp@xxxxxxxxxx>
---
 xen/arch/x86/mm.c        |    2 ++
 xen/common/grant_table.c |    4 ++++
 2 files changed, 6 insertions(+)

diff -r 1f315181731a -r 42304d2fc83e xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Mon Dec 21 10:39:48 2009 +0000
+++ b/xen/arch/x86/mm.c Mon Dec 21 10:40:51 2009 +0000
@@ -3105,6 +3105,8 @@ int do_mmu_update(
             req.ptr -= cmd;
             gmfn = req.ptr >> PAGE_SHIFT;
             mfn = mfn_x(gfn_to_mfn(pt_owner, gmfn, &p2mt));
+            if ( !p2m_is_valid(p2mt) )
+              mfn = INVALID_MFN;
 
             if ( p2m_is_paged(p2mt) )
             {
diff -r 1f315181731a -r 42304d2fc83e xen/common/grant_table.c
--- a/xen/common/grant_table.c  Mon Dec 21 10:39:48 2009 +0000
+++ b/xen/common/grant_table.c  Mon Dec 21 10:40:51 2009 +0000
@@ -1888,6 +1888,8 @@ __gnttab_copy(
     {
         p2m_type_t p2mt;
         s_frame = mfn_x(gfn_to_mfn(sd, op->source.u.gmfn, &p2mt));
+        if ( !p2m_is_valid(p2mt) )
+          s_frame = INVALID_MFN;
         if ( p2m_is_paging(p2mt) )
         {
             p2m_mem_paging_populate(sd, op->source.u.gmfn);
@@ -1929,6 +1931,8 @@ __gnttab_copy(
     {
         p2m_type_t p2mt;
         d_frame = gfn_to_mfn_private(dd, op->dest.u.gmfn, &p2mt);
+        if ( !p2m_is_valid(p2mt) )
+          d_frame = INVALID_MFN;
         if ( p2m_is_paging(p2mt) )
         {
             p2m_mem_paging_populate(dd, op->dest.u.gmfn);

_______________________________________________
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®.