aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-08-13 09:05:07 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-08-13 09:05:07 +0100
commit3833bd396d94e6d8ace9b32c2ff09279635f540f (patch)
tree8275c82e6d36ddbd18b189ce22dc0ae09950e39f
parenta12030927aa8e58fcbfefdcf2975e8ce1c021534 (diff)
downloadxen-3833bd396d94e6d8ace9b32c2ff09279635f540f.tar.gz
xen-3833bd396d94e6d8ace9b32c2ff09279635f540f.tar.bz2
xen-3833bd396d94e6d8ace9b32c2ff09279635f540f.zip
[Xen-devel] [PATCH] PoD: Fix domain build populate-on-demand cache
allocation Rather than trying to count the number of PoD entries we're putting in, we simply pass the target # of pages - the vga hole, and let the hypervisor do the calculation. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> xen-unstable changeset: 6f059a340cdf xen-unstable date: Wed Aug 11 15:56:21 2010 +0100
-rw-r--r--tools/libxc/xc_hvm_build.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/tools/libxc/xc_hvm_build.c b/tools/libxc/xc_hvm_build.c
index c7a333e85c..797e8e5949 100644
--- a/tools/libxc/xc_hvm_build.c
+++ b/tools/libxc/xc_hvm_build.c
@@ -107,7 +107,6 @@ static int setup_guest(int xc_handle,
xen_pfn_t *page_array = NULL;
unsigned long i, nr_pages = (unsigned long)memsize << (20 - PAGE_SHIFT);
unsigned long target_pages = (unsigned long)target << (20 - PAGE_SHIFT);
- unsigned long pod_pages = 0;
unsigned long entry_eip, cur_pages;
struct xen_add_to_physmap xatp;
struct shared_info *shared_info;
@@ -209,11 +208,6 @@ static int setup_guest(int xc_handle,
if ( done > 0 )
{
done <<= SUPERPAGE_PFN_SHIFT;
- if ( pod_mode && target_pages > cur_pages )
- {
- int d = target_pages - cur_pages;
- pod_pages += ( done < d ) ? done : d;
- }
cur_pages += done;
count -= done;
}
@@ -225,15 +219,16 @@ static int setup_guest(int xc_handle,
rc = xc_domain_memory_populate_physmap(
xc_handle, dom, count, 0, 0, &page_array[cur_pages]);
cur_pages += count;
- if ( pod_mode )
- pod_pages -= count;
}
}
+ /* Subtract 0x20 from target_pages for the VGA "hole". Xen will
+ * adjust the PoD cache size so that domain tot_pages will be
+ * target_pages - 0x20 after this call. */
if ( pod_mode )
rc = xc_domain_memory_set_pod_target(xc_handle,
dom,
- pod_pages,
+ target_pages - 0x20,
NULL, NULL, NULL);
if ( rc != 0 )