Gianni Tedesco
2010-Jul-05 15:02 UTC
[Xen-devel] [PATCH]: xl, allow setting of timer_mode, hpet and vpt_align parameters
Implement parsing for timer_mode, hpet and vpt_align parameters.
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.
libxl.h | 6 +++---
libxl_dom.c | 7 -------
xenguest.c | 3 +++
xl_cmdimpl.c | 18 ++++++++++++------
4 files changed, 18 insertions(+), 16 deletions(-)
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
diff -r 6e70c88167bb tools/libxl/libxl.h
--- a/tools/libxl/libxl.h Thu Jul 01 16:49:24 2010 +0100
+++ b/tools/libxl/libxl.h Mon Jul 05 16:00:57 2010 +0100
@@ -90,9 +90,6 @@
} libxl_domain_create_info;
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 Thu Jul 01 16:49:24 2010 +0100
+++ b/tools/libxl/libxl_dom.c Mon 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 != -1)
- xc_set_hvm_param(ctx->xch, domid, HVM_PARAM_TIMER_MODE,
- (unsigned long) info->timer_mode);
- if (info->hpet != -1)
- xc_set_hvm_param(ctx->xch, domid, HVM_PARAM_HPET_ENABLED, (unsigned
long) info->hpet);
- if (info->vpt_align != -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 Thu Jul 01 16:49:24 2010 +0100
+++ b/tools/libxl/xenguest.c Mon 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 Thu Jul 01 16:49:24 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c Mon 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 = -1;
- b_info->hpet = 1;
- b_info->vpt_align = -1;
b_info->max_vcpus = 1;
b_info->max_memkb = 32 * 1024;
b_info->target_memkb = b_info->max_memkb;
@@ -205,6 +202,9 @@
b_info->u.hvm.acpi = 1;
b_info->u.hvm.nx = 1;
b_info->u.hvm.viridian = 0;
+ b_info->u.hvm.hpet = 1;
+ b_info->u.hvm.vpt_align = 1;
+ b_info->u.hvm.timer_mode = 0;
} else {
b_info->u.pv.slack_memkb = 8 * 1024;
}
@@ -356,9 +356,6 @@
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);
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 = l;
if (!xlu_cfg_get_long (config, "viridian", &l))
b_info->u.hvm.viridian = l;
+ if (!xlu_cfg_get_long (config, "hpet", &l))
+ b_info->u.hvm.hpet = l;
+ if (!xlu_cfg_get_long (config, "vpt_align", &l))
+ b_info->u.hvm.vpt_align = l;
+ if (!xlu_cfg_get_long (config, "timer_mode", &l))
+ b_info->u.hvm.timer_mode = l;
} else {
char *cmdline = NULL;
const char *root = NULL, *extra = "";
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Dan Magenheimer
2010-Jul-05 16:04 UTC
RE: [Xen-devel] [PATCH]: xl, allow setting of timer_mode, hpet and vpt_align parameters
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 > > Implement parsing for timer_mode, hpet and vpt_align parameters. > > 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. > > libxl.h | 6 +++--- > libxl_dom.c | 7 ------- > xenguest.c | 3 +++ > xl_cmdimpl.c | 18 ++++++++++++------ > 4 files changed, 18 insertions(+), 16 deletions(-) > > Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> > > diff -r 6e70c88167bb tools/libxl/libxl.h > --- a/tools/libxl/libxl.h Thu Jul 01 16:49:24 2010 +0100 > +++ b/tools/libxl/libxl.h Mon Jul 05 16:00:57 2010 +0100 > @@ -90,9 +90,6 @@ > } libxl_domain_create_info; > > 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 Thu Jul 01 16:49:24 2010 +0100 > +++ b/tools/libxl/libxl_dom.c Mon 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 != -1) > - xc_set_hvm_param(ctx->xch, domid, HVM_PARAM_TIMER_MODE, > - (unsigned long) info->timer_mode); > - if (info->hpet != -1) > - xc_set_hvm_param(ctx->xch, domid, HVM_PARAM_HPET_ENABLED, > (unsigned long) info->hpet); > - if (info->vpt_align != -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 Thu Jul 01 16:49:24 2010 +0100 > +++ b/tools/libxl/xenguest.c Mon 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 Thu Jul 01 16:49:24 2010 +0100 > +++ b/tools/libxl/xl_cmdimpl.c Mon 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 = -1; > - b_info->hpet = 1; > - b_info->vpt_align = -1; > b_info->max_vcpus = 1; > b_info->max_memkb = 32 * 1024; > b_info->target_memkb = b_info->max_memkb; > @@ -205,6 +202,9 @@ > b_info->u.hvm.acpi = 1; > b_info->u.hvm.nx = 1; > b_info->u.hvm.viridian = 0; > + b_info->u.hvm.hpet = 1; > + b_info->u.hvm.vpt_align = 1; > + b_info->u.hvm.timer_mode = 0; > } else { > b_info->u.pv.slack_memkb = 8 * 1024; > } > @@ -356,9 +356,6 @@ > > > 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); > > 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 = l; > if (!xlu_cfg_get_long (config, "viridian", &l)) > b_info->u.hvm.viridian = l; > + if (!xlu_cfg_get_long (config, "hpet", &l)) > + b_info->u.hvm.hpet = l; > + if (!xlu_cfg_get_long (config, "vpt_align", &l)) > + b_info->u.hvm.vpt_align = l; > + if (!xlu_cfg_get_long (config, "timer_mode", &l)) > + b_info->u.hvm.timer_mode = l; > } else { > char *cmdline = NULL; > const char *root = NULL, *extra = ""; > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefano Stabellini
2010-Jul-06 16:26 UTC
[Xen-devel] Re: [PATCH]: xl, allow setting of timer_mode, hpet and vpt_align parameters
On Mon, 5 Jul 2010, Gianni Tedesco (3P) wrote:> Implement parsing for timer_mode, hpet and vpt_align parameters. > > 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. > > libxl.h | 6 +++--- > libxl_dom.c | 7 ------- > xenguest.c | 3 +++ > xl_cmdimpl.c | 18 ++++++++++++------ > 4 files changed, 18 insertions(+), 16 deletions(-) > > Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> >Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel