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] xenpaging: Add checks for p2m_is_valid()

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xenpaging: Add checks for p2m_is_valid() after calls to gfn_to_mfn()
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 Dec 2009 03:05:15 -0800
Delivery-date: Mon, 21 Dec 2009 03:05:28 -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 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xenpaging: Add checks for p2m_is_valid() after calls to gfn_to_mfn(), Xen patchbot-unstable <=