This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] [PATCH] xl: tsc_mode parameter in guest configuration fi

To: Vincent Hanquez <Vincent.Hanquez@xxxxxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xl: tsc_mode parameter in guest configuration file
From: Eric Chanudet <eric.chanudet@xxxxxxxxxx>
Date: Mon, 29 Mar 2010 19:32:11 +0100
Cc: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
Delivery-date: Mon, 29 Mar 2010 11:35:04 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4BB0CAAB.4060404@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix
References: <h2v5d81b2881003290535g7edc14f8g4e1a17294b3fb209@xxxxxxxxxxxxxx> <446767b3-2fdf-493f-9947-b5c57d70d556@default> <4BB0CAAB.4060404@xxxxxxxxxxxxx>
Reply-to: eric.chanudet@xxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Mon, 2010-03-29 at 11:43 -0400, Vincent Hanquez wrote:
> I don't believe we ever did that, with seems wrong indeed. Thanks for 
> pointing it out.
> Eric, any chance you can move the tsc_mode call to build_pre (which is 
> called by pv and hvm) and refresh the patch ?

Here is the new patch including these changes.

Acked-by: Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx>

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -74,6 +74,7 @@ typedef struct {
     int vpt_align;
     int max_vcpus;
     int cur_vcpus;
+    int tsc_mode;
     uint32_t max_memkb;
     uint32_t target_memkb;
     uint32_t video_memkb;
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -72,6 +72,7 @@ int build_pre(struct libxl_ctx *ctx, uin
     xc_domain_set_memmap_limit(ctx->xch, domid, 
             (info->hvm) ? info->max_memkb : 
             (info->max_memkb + info->u.pv.slack_memkb));
+    xc_domain_set_tsc_info(ctx->xch, domid, info->tsc_mode, 0, 0, 0);
     if (info->hvm) {
         unsigned long shadow;
diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -235,6 +235,7 @@ static void printf_info(libxl_domain_cre
     printf("hpet: %d\n", b_info->hpet);
     printf("vpt_align: %d\n", b_info->vpt_align);
     printf("max_vcpus: %d\n", b_info->max_vcpus);
+    printf("tsc_mode: %d\n", b_info->tsc_mode);
     printf("max_memkb: %d\n", b_info->max_memkb);
     printf("target_memkb: %d\n", b_info->target_memkb);
     printf("kernel: %s\n", b_info->kernel);
@@ -382,6 +383,9 @@ static void parse_config_file(const char
         b_info->target_memkb = b_info->max_memkb;
+    if (!xlu_cfg_get_long(config, "tsc_mode", &l))
+        b_info->tsc_mode = l;
     if (!xlu_cfg_get_long (config, "shadow_memory", &l))
         b_info->shadow_memkb = l * 1024;

Eric Chanudet
XenClient Team

Xen-devel mailing list