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: check p2mt in p2m_mem_paging f

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xenpaging: check p2mt in p2m_mem_paging functions
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Thu, 20 Oct 2011 18:22:14 +0100
Delivery-date: Thu, 20 Oct 2011 10:22:29 -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 Olaf Hering <olaf@xxxxxxxxx>
# Date 1319106355 -3600
# Node ID fd3fa0a850207f64017f9312d5fe235aa53957e3
# Parent  14b369de76adeb8b247608253f7dd650e27c31fa
xenpaging: check p2mt in p2m_mem_paging functions

Add checks to forward the p2m_ram_paging* state properly during page-in.

Resume can be called several times if several vcpus called populate for
the gfn. Finish resume only once.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
Acked-by: Tim Deegan <tim@xxxxxxx>
Committed-by: Tim Deegan <tim@xxxxxxx>
---


diff -r 14b369de76ad -r fd3fa0a85020 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Wed Oct 19 12:51:42 2011 +0200
+++ b/xen/arch/x86/mm/p2m.c     Thu Oct 20 11:25:55 2011 +0100
@@ -851,16 +851,22 @@
     p2m_access_t a;
     mfn_t mfn;
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
-    int ret = -ENOMEM;
+    int ret;
 
     p2m_lock(p2m);
 
     mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query, NULL);
 
+    ret = -ENOENT;
+    /* Allow only missing pages */
+    if ( p2mt != p2m_ram_paging_in_start )
+        goto out;
+
     /* Allocate a page if the gfn does not have one yet */
     if ( !mfn_valid(mfn) )
     {
         /* Get a free page */
+        ret = -ENOMEM;
         page = alloc_domheap_page(p2m->domain, 0);
         if ( unlikely(page == NULL) )
             goto out;
@@ -896,9 +902,15 @@
     {
         p2m_lock(p2m);
         mfn = p2m->get_entry(p2m, rsp.gfn, &p2mt, &a, p2m_query, NULL);
-        set_p2m_entry(p2m, rsp.gfn, mfn, 0, p2m_ram_rw, a);
-        set_gpfn_from_mfn(mfn_x(mfn), rsp.gfn);
-        audit_p2m(p2m, 1);
+        /* Allow only pages which were prepared properly, or pages which
+         * were nominated but not evicted */
+        if ( mfn_valid(mfn) && 
+             (p2mt == p2m_ram_paging_in || p2mt == p2m_ram_paging_in_start) )
+        {
+            set_p2m_entry(p2m, rsp.gfn, mfn, 0, p2m_ram_rw, a);
+            set_gpfn_from_mfn(mfn_x(mfn), rsp.gfn);
+            audit_p2m(p2m, 1);
+        }
         p2m_unlock(p2m);
     }
 

_______________________________________________
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: check p2mt in p2m_mem_paging functions, Xen patchbot-unstable <=