aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-01-14 14:11:25 +0000
committerKeir Fraser <keir.fraser@citrix.com>2010-01-14 14:11:25 +0000
commit46785b54f8cda84811f02bdeee8d9bd780fa29dc (patch)
treeeeabd87649980f095a69c8375b2ae793f7fd12a3
parent2d8eb0f62d39abc9d1a49a808f1e69169ea23212 (diff)
downloadxen-46785b54f8cda84811f02bdeee8d9bd780fa29dc.tar.gz
xen-46785b54f8cda84811f02bdeee8d9bd780fa29dc.tar.bz2
xen-46785b54f8cda84811f02bdeee8d9bd780fa29dc.zip
Make sure the minimum shadow allocation is never zero.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
-rw-r--r--xen/arch/x86/mm/shadow/common.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 434d567536..5e37bb01d4 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1244,10 +1244,11 @@ int shadow_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p,
* instruction, we must be able to map a large number (about thirty) VAs
* at the same time, which means that to guarantee progress, we must
* allow for more than ninety allocated pages per vcpu. We round that
- * up to 128 pages, or half a megabyte per vcpu. */
+ * up to 128 pages, or half a megabyte per vcpu, and add 1 more vcpu's
+ * worth to make sure we never return zero. */
static unsigned int shadow_min_acceptable_pages(struct domain *d)
{
- u32 vcpu_count = 0;
+ u32 vcpu_count = 1;
struct vcpu *v;
for_each_vcpu(d, v)