From: Keir Fraser Date: Sat, 5 Dec 2009 12:30:46 +0000 (+0000) Subject: libxenlight: physmap slack for pv domains X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~12956 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1f29decb33b86e47d38fc2cf7d5ddd5869bb5fed;p=xen.git libxenlight: physmap slack for pv domains 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 Acked-by: Vincent Hanquez --- diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 39373385fc..54cdd413c8 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -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; } } diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index 2ac3669afa..900f020c13 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -80,6 +80,7 @@ typedef struct { char *timeoffset; } hvm; struct { + uint32_t slack_memkb; const char *cmdline; const char *ramdisk; const char *features; diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index aeb96d4e3c..f99f20e976 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -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;