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] [SHADOW] Crash the guest rather than BUGing the whole sy

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [SHADOW] Crash the guest rather than BUGing the whole system when out of memory.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 19 May 2006 18:46:15 +0000
Delivery-date: Fri, 19 May 2006 11:47:57 -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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 3c2e7925bb932cd88151d64beb3cfe985245b6c2
# Parent  d0d9f50517f75a57292b353edbb9ee9fe47dc1b0
[SHADOW] Crash the guest rather than BUGing the whole system when out of memory.
Signed-off-by: Yunhong Jiang <yunhong.jiang@xxxxxxxxx>
---
 xen/arch/x86/shadow.c        |    6 ++++--
 xen/arch/x86/shadow32.c      |    8 +++++++-
 xen/arch/x86/shadow_public.c |    5 +++++
 3 files changed, 16 insertions(+), 3 deletions(-)

diff -r d0d9f50517f7 -r 3c2e7925bb93 xen/arch/x86/shadow.c
--- a/xen/arch/x86/shadow.c     Fri May 19 17:31:34 2006 +0100
+++ b/xen/arch/x86/shadow.c     Fri May 19 17:50:32 2006 +0100
@@ -430,7 +430,8 @@ no_shadow_page:
            perfc_value(shadow_l2_pages),
            perfc_value(hl2_table_pages),
            perfc_value(snapshot_pages));
-    BUG(); /* XXX FIXME: try a shadow flush to free up some memory. */
+    /* XXX FIXME: try a shadow flush to free up some memory. */
+    domain_crash_synchronous();
 
     return 0;
 }
@@ -3064,7 +3065,8 @@ static inline unsigned long init_bl2(
     if ( unlikely(!(smfn = alloc_shadow_page(d, gpfn, gmfn, PGT_l4_shadow))) )
     {
         printk("Couldn't alloc an L4 shadow for pfn=%lx mfn=%lx\n", gpfn, 
gmfn);
-        BUG(); /* XXX Deal gracefully with failure. */
+        /* XXX Deal gracefully with failure. */
+        domain_crash_synchronous();
     }
 
     spl4e = (l4_pgentry_t *)map_domain_page(smfn);
diff -r d0d9f50517f7 -r 3c2e7925bb93 xen/arch/x86/shadow32.c
--- a/xen/arch/x86/shadow32.c   Fri May 19 17:31:34 2006 +0100
+++ b/xen/arch/x86/shadow32.c   Fri May 19 17:50:32 2006 +0100
@@ -246,7 +246,8 @@ alloc_shadow_page(struct domain *d,
                perfc_value(shadow_l2_pages),
                perfc_value(hl2_table_pages),
                perfc_value(snapshot_pages));
-        BUG(); /* XXX FIXME: try a shadow flush to free up some memory. */
+        /* XXX FIXME: try a shadow flush to free up some memory. */
+        domain_crash_synchronous();
     }
 
     smfn = page_to_mfn(page);
@@ -983,6 +984,11 @@ alloc_p2m_table(struct domain *d)
     else
     {
         page = alloc_domheap_page(NULL);
+        if (!page)
+        {
+            printk("Alloc p2m table fail\n");
+            domain_crash(d);
+        }
 
         l1tab = map_domain_page(page_to_mfn(page));
         memset(l1tab, 0, PAGE_SIZE);
diff -r d0d9f50517f7 -r 3c2e7925bb93 xen/arch/x86/shadow_public.c
--- a/xen/arch/x86/shadow_public.c      Fri May 19 17:31:34 2006 +0100
+++ b/xen/arch/x86/shadow_public.c      Fri May 19 17:50:32 2006 +0100
@@ -324,6 +324,11 @@ static void alloc_monitor_pagetable(stru
 
     mmfn_info = alloc_domheap_page(NULL);
     ASSERT( mmfn_info );
+    if (!mmfn_info)
+    {
+        printk("Fail to allocate monitor pagetable\n");
+        domain_crash(v->domain);
+    }
 
     mmfn = page_to_mfn(mmfn_info);
     mpl4e = (l4_pgentry_t *) map_domain_page_global(mmfn);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [SHADOW] Crash the guest rather than BUGing the whole system when out of memory., Xen patchbot-unstable <=