mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
x86, hvm: Hyper-V guest interface support with small set of enlightenments
A minimal implementation of the Viridian (Hyper-V) guest interface. The only enlightenments advertised and supported are vAPIC MSRs and long-spin-wait notifications. The set of enlightenments can easily be extended in future, as they are found to provide a performance win, and configured via an extended HVM_PARAM_VIRIDIAN hvm parameter. Signed-off-by: Peter Johnston <peter.johnston@citrix.com> Signed-off-by: Tim Deegan <tim.deegan@citrix.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
This commit is contained in:
1 parent
b525c05cf9
commit
39f97ffa29
22 files changed
+1330
-825
No files matched your search
@@ -155,6 +155,7 @@ XENAPI_PLATFORM_CFG_TYPES = {
|
||||
'vncdisplay': int,
|
||||
'vnclisten': str,
|
||||
'timer_mode': int,
|
||||
'viridian': int,
|
||||
'vncpasswd': str,
|
||||
'vncunused': int,
|
||||
'xauthority': str,
|
||||
@@ -442,6 +443,8 @@ class XendConfig(dict):
|
||||
if self.is_hvm():
|
||||
if 'timer_mode' not in self['platform']:
|
||||
self['platform']['timer_mode'] = 1
|
||||
if 'viridian' not in self['platform']:
|
||||
self['platform']['viridian'] = 0
|
||||
if 'rtc_timeoffset' not in self['platform']:
|
||||
self['platform']['rtc_timeoffset'] = 0
|
||||
if 'hpet' not in self['platform']:
|
||||
|
||||
@@ -43,9 +43,10 @@ HVM_PARAM_STORE_EVTCHN = 2
|
||||
HVM_PARAM_PAE_ENABLED = 4
|
||||
HVM_PARAM_IOREQ_PFN = 5
|
||||
HVM_PARAM_BUFIOREQ_PFN = 6
|
||||
HVM_PARAM_NVRAM_FD = 7
|
||||
HVM_PARAM_VHPT_SIZE = 8
|
||||
HVM_PARAM_BUFPIOREQ_PFN = 9
|
||||
HVM_PARAM_NVRAM_FD = 7 # ia64
|
||||
HVM_PARAM_VHPT_SIZE = 8 # ia64
|
||||
HVM_PARAM_BUFPIOREQ_PFN = 9 # ia64
|
||||
HVM_PARAM_VIRIDIAN = 9 # x86
|
||||
HVM_PARAM_TIMER_MODE = 10
|
||||
HVM_PARAM_HPET_ENABLED = 11
|
||||
HVM_PARAM_ACPI_S_STATE = 14
|
||||
|
||||
@@ -2078,6 +2078,11 @@ class XendDomainInfo:
|
||||
xc.hvm_set_param(self.domid, HVM_PARAM_TIMER_MODE,
|
||||
long(timer_mode))
|
||||
|
||||
# Set Viridian interface configuration of domain
|
||||
viridian = self.info["platform"].get("viridian")
|
||||
if arch.type == "x86" and hvm and viridian is not None:
|
||||
xc.hvm_set_param(self.domid, HVM_PARAM_VIRIDIAN, long(viridian))
|
||||
|
||||
# Optionally enable virtual HPET
|
||||
hpet = self.info["platform"].get("hpet")
|
||||
if hvm and hpet is not None:
|
||||
|
||||
@@ -218,6 +218,11 @@ 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('viridian', val='VIRIDIAN',
|
||||
fn=set_int, default=0,
|
||||
use="""Expose Viridian interface to x86 HVM guest?
|
||||
(Default is 0).""")
|
||||
|
||||
gopts.var('acpi', val='ACPI',
|
||||
fn=set_int, default=1,
|
||||
use="Disable or enable ACPI of HVM domain.")
|
||||
@@ -856,7 +861,8 @@ def configure_hvm(config_image, vals):
|
||||
'vnc', 'vncdisplay', 'vncunused', 'vncconsole', 'vnclisten',
|
||||
'sdl', 'display', 'xauthority', 'rtc_timeoffset', 'monitor',
|
||||
'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci', 'hpet',
|
||||
'guest_os_type', 'hap', 'opengl', 'cpuid', 'cpuid_check']
|
||||
'guest_os_type', 'hap', 'opengl', 'cpuid', 'cpuid_check',
|
||||
'viridian' ]
|
||||
|
||||
for a in args:
|
||||
if a in vals.__dict__ and vals.__dict__[a] is not None:
|
||||
|
||||
@@ -969,6 +969,7 @@ class sxp2xml:
|
||||
'usbdevice',
|
||||
'hpet',
|
||||
'timer_mode',
|
||||
'viridian',
|
||||
'vhpt',
|
||||
'guest_os_type',
|
||||
'hap',
|
||||
|
||||