aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-02-13 09:43:06 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-02-13 09:43:06 +0000
commit0eecf73be6e7304f382dd16491cd2917f5135bae (patch)
tree7dbede426b91e2337b906fda58bebe380279d7a1 /tools
parent737073ac89f753d7601933a29bf71365f733744b (diff)
downloadxen-0eecf73be6e7304f382dd16491cd2917f5135bae.tar.gz
xen-0eecf73be6e7304f382dd16491cd2917f5135bae.tar.bz2
xen-0eecf73be6e7304f382dd16491cd2917f5135bae.zip
hvm: Align periodic vpts.
Aligned periodic vpts can improve the HVM guest power consumption a lot, especially while the guest using high HZ such as 1000HZ. Signed-off-by: Wei Gang <gang.wei@intel.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/python/xen/xend/XendConfig.py3
-rw-r--r--tools/python/xen/xend/XendConstants.py1
-rw-r--r--tools/python/xen/xend/XendDomainInfo.py6
-rw-r--r--tools/python/xen/xm/create.py7
-rw-r--r--tools/python/xen/xm/xenapi_create.py1
5 files changed, 17 insertions, 1 deletions
diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py
index 4b30c1ae43..2d2138559b 100644
--- a/tools/python/xen/xend/XendConfig.py
+++ b/tools/python/xen/xend/XendConfig.py
@@ -158,6 +158,7 @@ XENAPI_PLATFORM_CFG_TYPES = {
'vncdisplay': int,
'vnclisten': str,
'timer_mode': int,
+ 'vpt_align': int,
'viridian': int,
'vncpasswd': str,
'vncunused': int,
@@ -459,6 +460,8 @@ class XendConfig(dict):
self['platform']['rtc_timeoffset'] = 0
if 'hpet' not in self['platform']:
self['platform']['hpet'] = 0
+ if 'vpt_align' not in self['platform']:
+ self['platform']['vpt_align'] = 1
if 'loader' not in self['platform']:
# Old configs may have hvmloader set as PV_kernel param
if self.has_key('PV_kernel') and self['PV_kernel'] != '':
diff --git a/tools/python/xen/xend/XendConstants.py b/tools/python/xen/xend/XendConstants.py
index 13e046a086..3130f75c08 100644
--- a/tools/python/xen/xend/XendConstants.py
+++ b/tools/python/xen/xend/XendConstants.py
@@ -50,6 +50,7 @@ HVM_PARAM_VIRIDIAN = 9 # x86
HVM_PARAM_TIMER_MODE = 10
HVM_PARAM_HPET_ENABLED = 11
HVM_PARAM_ACPI_S_STATE = 14
+HVM_PARAM_VPT_ALIGN = 16
restart_modes = [
"restart",
diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
index 5c08992963..b56d3c55ef 100644
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -2237,6 +2237,12 @@ class XendDomainInfo:
xc.hvm_set_param(self.domid, HVM_PARAM_HPET_ENABLED,
long(hpet))
+ # Optionally enable periodic vpt aligning
+ vpt_align = self.info["platform"].get("vpt_align")
+ if hvm and vpt_align is not None:
+ xc.hvm_set_param(self.domid, HVM_PARAM_VPT_ALIGN,
+ long(vpt_align))
+
# Set maximum number of vcpus in domain
xc.domain_max_vcpus(self.domid, int(self.info['VCPUs_max']))
diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py
index f87f5ccc53..d1a8ca2e0c 100644
--- a/tools/python/xen/xm/create.py
+++ b/tools/python/xen/xm/create.py
@@ -219,6 +219,10 @@ gopts.var('timer_mode', val='TIMER_MODE',
use="""Timer mode (0=delay virtual time when ticks are missed;
1=virtual time is always wallclock time.""")
+gopts.var('vpt_align', val='VPT_ALIGN',
+ fn=set_int, default=1,
+ use="Enable aligning all periodic vpt to reduce timer interrupts.")
+
gopts.var('viridian', val='VIRIDIAN',
fn=set_int, default=0,
use="""Expose Viridian interface to x86 HVM guest?
@@ -891,7 +895,8 @@ def configure_hvm(config_image, vals):
'sdl', 'display', 'xauthority', 'rtc_timeoffset', 'monitor',
'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci', 'hpet',
'guest_os_type', 'hap', 'opengl', 'cpuid', 'cpuid_check',
- 'viridian', 'xen_extended_power_mgmt', 'pci_msitranslate' ]
+ 'viridian', 'xen_extended_power_mgmt', 'pci_msitranslate',
+ 'vpt_align' ]
for a in args:
if a in vals.__dict__ and vals.__dict__[a] is not None:
diff --git a/tools/python/xen/xm/xenapi_create.py b/tools/python/xen/xm/xenapi_create.py
index 39489e497f..74a534f58c 100644
--- a/tools/python/xen/xm/xenapi_create.py
+++ b/tools/python/xen/xm/xenapi_create.py
@@ -1037,6 +1037,7 @@ class sxp2xml:
'usbdevice',
'hpet',
'timer_mode',
+ 'vpt_align',
'viridian',
'vhpt',
'guest_os_type',