libxenlight: physmap slack for pv domains
authorKeir Fraser <keir.fraser@citrix.com>
Sat, 5 Dec 2009 12:30:46 +0000 (12:30 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Sat, 5 Dec 2009 12:30:46 +0000 (12:30 +0000)
Contemplate a memory space slack for PV domains,
since they do ballooning (or flipping network rx)
and need some extra room in their pfn space.

Note that this does not allocate any extra memory
to the domain, it simply extends the physmap with
some extra room for "bounce bufffering back" pfn's
that are yielded to dom0.

The default slack is set at 8MB.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
Acked-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl.h
tools/libxl/libxl_dom.c

index 39373385fc93d14f2b57871ec5626583cff4ff53..54cdd413c8123a81c6999de5559bc70e507aeba4 100644 (file)
@@ -2100,6 +2100,8 @@ void init_build_info(libxl_domain_build_info *b_info, libxl_domain_create_info *
         b_info->u.hvm.acpi = 1;
         b_info->u.hvm.nx = 1;
         b_info->u.hvm.viridian = 0;
+    } else {
+        b_info->u.pv.slack_memkb = 8 * 1024;
     }
 }
 
index 2ac3669afab48830b1b577bacb28c1d8c6e3e60c..900f020c13035bb87b0c7bc39ec0d8f7c4bb06de 100644 (file)
@@ -80,6 +80,7 @@ typedef struct {
             char *timeoffset;
         } hvm;
         struct {
+            uint32_t   slack_memkb;
             const char *cmdline;
             const char *ramdisk;
             const char *features;
index aeb96d4e3c794d44a50ac29e31396168e373a6d4..f99f20e9767c7f01dd4bcdb369f4a585ed2ba364 100644 (file)
@@ -53,7 +53,9 @@ int build_pre(struct libxl_ctx *ctx, uint32_t domid,
         xc_set_hvm_param(ctx->xch, domid, HVM_PARAM_VPT_ALIGN, (unsigned long) info->vpt_align);
     xc_domain_max_vcpus(ctx->xch, domid, info->max_vcpus);
     xc_domain_setmaxmem(ctx->xch, domid, info->max_memkb + info->video_memkb);
-    xc_domain_set_memmap_limit(ctx->xch, domid, info->max_memkb);
+    xc_domain_set_memmap_limit(ctx->xch, domid, 
+            (info->hvm) ? info->max_memkb : 
+            (info->max_memkb + info->u.pv.slack_memkb));
 
     if (info->hvm) {
         unsigned long shadow;