# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1260016246 0
# Node ID e0351b16a747681a94320db70eea9253b3d437c0
# Parent d4bf9bac7868457d5d770b44f835c8df834da3e7
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 <andres@xxxxxxxxxxxxxxxx>
Acked-by: Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx>
---
tools/libxl/libxl.c | 2 ++
tools/libxl/libxl.h | 1 +
tools/libxl/libxl_dom.c | 4 +++-
3 files changed, 6 insertions(+), 1 deletion(-)
diff -r d4bf9bac7868 -r e0351b16a747 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c Sat Dec 05 12:29:48 2009 +0000
+++ b/tools/libxl/libxl.c Sat Dec 05 12:30:46 2009 +0000
@@ -2100,6 +2100,8 @@ void init_build_info(libxl_domain_build_
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 -r d4bf9bac7868 -r e0351b16a747 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h Sat Dec 05 12:29:48 2009 +0000
+++ b/tools/libxl/libxl.h Sat Dec 05 12:30:46 2009 +0000
@@ -80,6 +80,7 @@ typedef struct {
char *timeoffset;
} hvm;
struct {
+ uint32_t slack_memkb;
const char *cmdline;
const char *ramdisk;
const char *features;
diff -r d4bf9bac7868 -r e0351b16a747 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c Sat Dec 05 12:29:48 2009 +0000
+++ b/tools/libxl/libxl_dom.c Sat Dec 05 12:30:46 2009 +0000
@@ -53,7 +53,9 @@ int build_pre(struct libxl_ctx *ctx, uin
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;
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|