Make sure the minimum shadow allocation is never zero.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
This commit is contained in:
Keir Fraser committed 2010-01-14 14:11:25 +00:00
1 parent 2d8eb0f62d
commit 46785b54f8
1 file changed
+3 -2
+3 -2
View File
@@ -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)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.