WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] xl: tsc_mode parameter in guest configuration file
From: Eric Chanudet <eric.chanudet@xxxxxxxxxx>
Date: Mon, 29 Mar 2010 13:35:13 +0100
Delivery-date: Mon, 29 Mar 2010 05:36:18 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:from:date :x-google-sender-auth:received:message-id:subject:to:content-type; bh=UveW5SUpXfTRrsw6nrcXzk+fcHAtd607FbyEIULHuss=; b=xI4QAzARtX0RyemWU7FpOvHpYeT76E73uQmkWe6iu/8e9OxbuV6vdT6IHXx/Vg9uUO dxJmYptO3tdp+aUb2Jp7Tt+HZIdLv4jvLk93I9tEpb4CxIIg9/Kx93qRDXidq4+0FDtm Romv4icMtAMMYCDIfgnYWM3eGu08cHz6ZYMrw=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; b=RC1Pubpb1vQiNbXmEmmWPjYLVtVC/PeRzLjK4fWPRGA3jSYOR0Q1UaTrtv/bxN46Hd Ywg6nk7Xk6idZwngMyKfyXRCUzQ4PoASv8QAufrDeBaVlSXrquGbn755Q8qyZIkhq7bJ 5jjNNJNRnttUr4gxCc1QCVPZ13Ep0ypur5548=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
This patch handle tsc_mode argument in guest configuration file.

Acked-by: Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx>
Acked-by: Stefano Stabellini <stefano.stabellini@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
@@ -176,7 +176,7 @@ int build_hvm(struct libxl_ctx *ctx, uin
     ret = hvm_build_set_params(ctx->xch, domid, info->u.hvm.apic,
info->u.hvm.acpi,
                                info->u.hvm.pae, info->u.hvm.nx,
info->u.hvm.viridian,
                                info->max_vcpus,
-                               state->store_port, &state->store_mfn);
+                               state->store_port, &state->store_mfn,
info->tsc_mode);
     if (ret) {
         XL_LOG_ERRNOVAL(ctx, XL_LOG_ERROR, ret, "hvm build set params failed");
         return ERROR_FAIL;
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -158,7 +158,7 @@ int libxl_device_pci_flr(struct libxl_ct
 /* from xenguest (helper */
 int hvm_build_set_params(int handle, uint32_t domid,
                          int apic, int acpi, int pae, int nx, int viridian,
-                         int vcpus, int store_evtchn, unsigned long
*store_mfn);
+                         int vcpus, int store_evtchn, unsigned long
*store_mfn, int tsc_mode);

 /* xl_exec */

diff --git a/tools/libxl/xenguest.c b/tools/libxl/xenguest.c
--- a/tools/libxl/xenguest.c
+++ b/tools/libxl/xenguest.c
@@ -20,7 +20,7 @@

 int hvm_build_set_params(int handle, uint32_t domid,
                          int apic, int acpi, int pae, int nx, int viridian,
-                         int vcpus, int store_evtchn, unsigned long *store_mfn)
+                         int vcpus, int store_evtchn, unsigned long
*store_mfn, int tsc_mode)
 {
     struct hvm_info_table *va_hvm;
     uint8_t *va_map, sum;
@@ -47,5 +47,6 @@ int hvm_build_set_params(int handle, uin
     xc_set_hvm_param(handle, domid, HVM_PARAM_VIRIDIAN, viridian);
 #endif
     xc_set_hvm_param(handle, domid, HVM_PARAM_STORE_EVTCHN, store_evtchn);
+    xc_domain_set_tsc_info(handle, domid, tsc_mode, 0, 0, 0);
     return 0;
 }
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
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel