From: Dan Magenheimer Subject: RE: [PATCH]: xl, allow setting of timer_mode, hpet and vpt_align parameters Date: Mon, 5 Jul 2010 09:04:13 -0700 (PDT) Message-ID: References: <1278342170.1723.77.camel@qabil.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <1278342170.1723.77.camel@qabil.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Gianni Tedesco , Xen-devel Cc: Dulloor , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Hi Gianni -- If you have a chance, could you look at porting disable_migrate support also from xend to xl? It is needed for full TSC support and also for Dulloor's NUMA work. Thanks, Dan > -----Original Message----- > From: Gianni Tedesco [mailto:gianni.tedesco@citrix.com] > Sent: Monday, July 05, 2010 9:03 AM > To: Xen-devel > Cc: Stefano Stabellini > Subject: [Xen-devel] [PATCH]: xl, allow setting of timer_mode, hpet and > vpt_align parameters >=20 > Implement parsing for timer_mode, hpet and vpt_align parameters. >=20 > These are all HVM only parameters and hpet/vpt_align are boolean so > change types and place in hvm union accordingly. Also HPET is x86 only > on principle so make this compile-time conditional on arch as-is > viridian. >=20 > libxl.h | 6 +++--- > libxl_dom.c | 7 ------- > xenguest.c | 3 +++ > xl_cmdimpl.c | 18 ++++++++++++------ > 4 files changed, 18 insertions(+), 16 deletions(-) >=20 > Signed-off-by: Gianni Tedesco >=20 > diff -r 6e70c88167bb tools/libxl/libxl.h > --- a/tools/libxl/libxl.h=09Thu Jul 01 16:49:24 2010 +0100 > +++ b/tools/libxl/libxl.h=09Mon Jul 05 16:00:57 2010 +0100 > @@ -90,9 +90,6 @@ > } libxl_domain_create_info; >=20 > typedef struct { > - int timer_mode; > - int hpet; > - int vpt_align; > int max_vcpus; > int cur_vcpus; > int tsc_mode; > @@ -110,6 +107,9 @@ > bool nx; > bool viridian; > char *timeoffset; > + bool hpet; > + bool vpt_align; > + int timer_mode; > } hvm; > struct { > uint32_t slack_memkb; > diff -r 6e70c88167bb tools/libxl/libxl_dom.c > --- a/tools/libxl/libxl_dom.c=09Thu Jul 01 16:49:24 2010 +0100 > +++ b/tools/libxl/libxl_dom.c=09Mon Jul 05 16:00:57 2010 +0100 > @@ -62,13 +62,6 @@ > int build_pre(struct libxl_ctx *ctx, uint32_t domid, > libxl_domain_build_info *info, libxl_domain_build_state > *state) > { > - if (info->timer_mode !=3D -1) > - xc_set_hvm_param(ctx->xch, domid, HVM_PARAM_TIMER_MODE, > - (unsigned long) info->timer_mode); > - if (info->hpet !=3D -1) > - xc_set_hvm_param(ctx->xch, domid, HVM_PARAM_HPET_ENABLED, > (unsigned long) info->hpet); > - if (info->vpt_align !=3D -1) > - 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->target_memkb + > LIBXL_MAXMEM_CONSTANT); > xc_domain_set_memmap_limit(ctx->xch, domid, > diff -r 6e70c88167bb tools/libxl/xenguest.c > --- a/tools/libxl/xenguest.c=09Thu Jul 01 16:49:24 2010 +0100 > +++ b/tools/libxl/xenguest.c=09Mon Jul 05 16:00:57 2010 +0100 > @@ -49,7 +49,10 @@ > xc_set_hvm_param(handle, domid, HVM_PARAM_PAE_ENABLED, info- > >u.hvm.pae); > #if defined(__i386__) || defined(__x86_64__) > xc_set_hvm_param(handle, domid, HVM_PARAM_VIRIDIAN, info- > >u.hvm.viridian); > + xc_set_hvm_param(handle, domid, HVM_PARAM_HPET_ENABLED, (unsigned > long) info->u.hvm.hpet); > #endif > + xc_set_hvm_param(handle, domid, HVM_PARAM_TIMER_MODE, (unsigned > long) info->u.hvm.timer_mode); > + xc_set_hvm_param(handle, domid, HVM_PARAM_VPT_ALIGN, (unsigned > long) info->u.hvm.vpt_align); > xc_set_hvm_param(handle, domid, HVM_PARAM_STORE_EVTCHN, > store_evtchn); > return 0; > } > diff -r 6e70c88167bb tools/libxl/xl_cmdimpl.c > --- a/tools/libxl/xl_cmdimpl.c=09Thu Jul 01 16:49:24 2010 +0100 > +++ b/tools/libxl/xl_cmdimpl.c=09Mon Jul 05 16:00:57 2010 +0100 > @@ -189,9 +189,6 @@ > static void init_build_info(libxl_domain_build_info *b_info, > libxl_domain_create_info *c_info) > { > memset(b_info, '\0', sizeof(*b_info)); > - b_info->timer_mode =3D -1; > - b_info->hpet =3D 1; > - b_info->vpt_align =3D -1; > b_info->max_vcpus =3D 1; > b_info->max_memkb =3D 32 * 1024; > b_info->target_memkb =3D b_info->max_memkb; > @@ -205,6 +202,9 @@ > b_info->u.hvm.acpi =3D 1; > b_info->u.hvm.nx =3D 1; > b_info->u.hvm.viridian =3D 0; > + b_info->u.hvm.hpet =3D 1; > + b_info->u.hvm.vpt_align =3D 1; > + b_info->u.hvm.timer_mode =3D 0; > } else { > b_info->u.pv.slack_memkb =3D 8 * 1024; > } > @@ -356,9 +356,6 @@ >=20 >=20 > printf("\t(domain_build_info)\n"); > - printf("\t(timer_mode %d)\n", b_info->timer_mode); > - printf("\t(hpet %d)\n", b_info->hpet); > - printf("\t(vpt_align %d)\n", b_info->vpt_align); > printf("\t(max_vcpus %d)\n", b_info->max_vcpus); > printf("\t(tsc_mode %d)\n", b_info->tsc_mode); > printf("\t(max_memkb %d)\n", b_info->max_memkb); > @@ -375,6 +372,9 @@ > printf("\t\t\t(acpi %d)\n", b_info->u.hvm.acpi); > printf("\t\t\t(nx %d)\n", b_info->u.hvm.nx); > printf("\t\t\t(viridian %d)\n", b_info->u.hvm.viridian); > + printf("\t\t\t(hpet %d)\n", b_info->u.hvm.hpet); > + printf("\t\t\t(vpt_align %d)\n", b_info->u.hvm.vpt_align); > + printf("\t\t\t(timer_mode %d)\n", b_info->u.hvm.timer_mode); >=20 > printf("\t\t\t(device_model %s)\n", dm_info->device_model); > printf("\t\t\t(videoram %d)\n", dm_info->videoram); > @@ -571,6 +571,12 @@ > b_info->u.hvm.nx =3D l; > if (!xlu_cfg_get_long (config, "viridian", &l)) > b_info->u.hvm.viridian =3D l; > + if (!xlu_cfg_get_long (config, "hpet", &l)) > + b_info->u.hvm.hpet =3D l; > + if (!xlu_cfg_get_long (config, "vpt_align", &l)) > + b_info->u.hvm.vpt_align =3D l; > + if (!xlu_cfg_get_long (config, "timer_mode", &l)) > + b_info->u.hvm.timer_mode =3D l; > } else { > char *cmdline =3D NULL; > const char *root =3D NULL, *extra =3D ""; >=20 >=20 >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel