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 get_page_from_l1e() and avoid ho

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: Fix get_page_from_l1e() and avoid host crash on 'xm save'.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 20 Oct 2007 05:50:21 -0700
Delivery-date: Sat, 20 Oct 2007 05:52:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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@xxxxxxxxxxxxx>
# Date 1192800610 -3600
# Node ID 6236adfbebe667d7509b9c81081e48c1a7fb3672
# Parent  bf3514726c1b84c0a284f30a276b8420d700421f
x86: Fix get_page_from_l1e() and avoid host crash on 'xm save'.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/mm.c     |    9 ++++-----
 xen/common/rangeset.c |    2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)

diff -r bf3514726c1b -r 6236adfbebe6 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Fri Oct 19 11:32:18 2007 +0100
+++ b/xen/arch/x86/mm.c Fri Oct 19 14:30:10 2007 +0100
@@ -152,7 +152,8 @@ unsigned long total_pages;
 #define PAGE_CACHE_ATTRS (_PAGE_PAT|_PAGE_PCD|_PAGE_PWT)
 
 #define l1_disallow_mask(d)                                     \
-    ((rangeset_is_empty((d)->iomem_caps) &&                     \
+    ((d != dom_io) &&                                           \
+     (rangeset_is_empty((d)->iomem_caps) &&                     \
       rangeset_is_empty((d)->arch.ioport_caps)) ?               \
      L1_DISALLOW_MASK : (L1_DISALLOW_MASK & ~PAGE_CACHE_ATTRS))
 
@@ -619,17 +620,15 @@ get_page_from_l1e(
 {
     unsigned long mfn = l1e_get_pfn(l1e);
     struct page_info *page = mfn_to_page(mfn);
-    unsigned int disallow_mask;
     int okay;
 
     if ( !(l1e_get_flags(l1e) & _PAGE_PRESENT) )
         return 1;
 
-    disallow_mask = l1_disallow_mask((d == dom_io) ? current->domain : d);
-    if ( unlikely(l1e_get_flags(l1e) & disallow_mask) )
+    if ( unlikely(l1e_get_flags(l1e) & l1_disallow_mask(d)) )
     {
         MEM_LOG("Bad L1 flags %x",
-                l1e_get_flags(l1e) & disallow_mask);
+                l1e_get_flags(l1e) & l1_disallow_mask(d));
         return 0;
     }
 
diff -r bf3514726c1b -r 6236adfbebe6 xen/common/rangeset.c
--- a/xen/common/rangeset.c     Fri Oct 19 11:32:18 2007 +0100
+++ b/xen/common/rangeset.c     Fri Oct 19 14:30:10 2007 +0100
@@ -263,7 +263,7 @@ int rangeset_is_empty(
 int rangeset_is_empty(
     struct rangeset *r)
 {
-    return list_empty(&r->range_list);
+    return ((r == NULL) || list_empty(&r->range_list));
 }
 
 struct rangeset *rangeset_new(

_______________________________________________
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 get_page_from_l1e() and avoid host crash on 'xm save'., Xen patchbot-unstable <=