All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/shadow: unconditionally set the p2m/log-dirty allocation functions
@ 2011-02-14 13:50 Tim Deegan
  0 siblings, 0 replies; only message in thread
From: Tim Deegan @ 2011-02-14 13:50 UTC (permalink / raw)
  To: xen-devel; +Cc: Gianni.Tedesco

[-- Attachment #1: Type: text/plain, Size: 223 bytes --]

Otherwise enabling log-dirty mode on a PV guest that already has
a shadow allocation can leave the alloc/free functions pointers NULL,
and later try to dereference them.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>



[-- Attachment #2: xen-unstable.hg.patch --]
[-- Type: text/x-patch, Size: 1295 bytes --]

# HG changeset patch
# User Tim Deegan <Tim.Deegan@citrix.com>
# Date 1297690988 0
# Node ID 2af74339b90422fc26ba7aebd7868b1eb802de2f
# Parent  20140bcb4c047c5410594b3acc9e8b1f243b8ff9
x86/shadow: unconditionally set the p2m/log-dirty allocation functions.

Otherwise enabling log-dirty mode on a PV guest that already has
a shadow allocation can leave the alloc/free functions pointers NULL,
and later try to dereference them.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>

diff -r 20140bcb4c04 -r 2af74339b904 xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c	Mon Feb 14 13:40:32 2011 +0000
+++ b/xen/arch/x86/mm/shadow/common.c	Mon Feb 14 13:43:08 2011 +0000
@@ -3337,12 +3337,12 @@ static int shadow_one_bit_enable(struct 
             sh_set_allocation(d, 0, NULL);
             return -ENOMEM;
         }
-
-        /* Allow p2m and log-dirty code to borrow shadow memory */
-        d->arch.paging.alloc_page = shadow_alloc_p2m_page;
-        d->arch.paging.free_page = shadow_free_p2m_page;
     }
 
+    /* Allow p2m and log-dirty code to borrow shadow memory */
+    d->arch.paging.alloc_page = shadow_alloc_p2m_page;
+    d->arch.paging.free_page = shadow_free_p2m_page;
+
     if ( d->arch.paging.mode == 0 )
     {
         /* Init the shadow hash table */

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-02-14 13:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-14 13:50 [PATCH] x86/shadow: unconditionally set the p2m/log-dirty allocation functions Tim Deegan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.