mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
Make sure the minimum shadow allocation is never zero.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
This commit is contained in:
1 parent
2d8eb0f62d
commit
46785b54f8
1 file changed
+3
-2
@@ -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)
|
||||
|
||||