From: Qing He <qing.he@intel.com>
To: xen-devel@lists.xensource.com
Cc: Qing He <qing.he@intel.com>
Subject: [PATCH 17/17] tools: nest: allow enabling nesting
Date: Thu, 22 Apr 2010 17:41:29 +0800 [thread overview]
Message-ID: <1271929289-18572-18-git-send-email-qing.he@intel.com> (raw)
In-Reply-To: <1271929289-18572-1-git-send-email-qing.he@intel.com>
Add hvm config option to allow nesting
Signed-off-by: Qing He <qing.he@intel.com>
---
examples/xmexample.hvm | 12 ++++++++++++
python/xen/xend/XendConfig.py | 4 ++++
python/xen/xend/XendDomainInfo.py | 5 ++++-
python/xen/xm/create.py | 7 ++++++-
python/xen/xm/xenapi_create.py | 1 +
5 files changed, 27 insertions(+), 2 deletions(-)
diff -r 3a7b55a0be9c -r 682f3d39f719 tools/examples/xmexample.hvm
--- a/tools/examples/xmexample.hvm Thu Apr 22 22:30:10 2010 +0800
+++ b/tools/examples/xmexample.hvm Thu Apr 22 22:39:56 2010 +0800
@@ -371,3 +371,15 @@
#
#vscsi = [ '/dev/sdx, 0:0:0:0' ]
+
+# Enable nested virtualization
+#
+# Turn on this option allow the guest to present virtualization
+# hardware. So that guest can use VMX or SVM to run another guest.
+# Turning off the option not only masks availability reporting, but
+# also disables all related controls, including related instructions,
+# cpuid, msr, etc. for security concerns.
+#
+# This feature is experimental, and the default is off.
+#
+#nesting=0
diff -r 3a7b55a0be9c -r 682f3d39f719 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py Thu Apr 22 22:30:10 2010 +0800
+++ b/tools/python/xen/xend/XendConfig.py Thu Apr 22 22:39:56 2010 +0800
@@ -176,6 +176,7 @@
'vhpt': int,
'guest_os_type': str,
'hap': int,
+ 'nesting': int,
'xen_extended_power_mgmt': int,
'pci_msitranslate': int,
'pci_power_mgmt': int,
@@ -2219,6 +2220,9 @@
def is_hap(self):
return self['platform'].get('hap', 0)
+ def is_nesting(self):
+ return self['platform'].get('nesting', 0)
+
def is_pv_and_has_pci(self):
for dev_type, dev_info in self.all_devices_sxpr():
if dev_type != 'pci':
diff -r 3a7b55a0be9c -r 682f3d39f719 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py Thu Apr 22 22:30:10 2010 +0800
+++ b/tools/python/xen/xend/XendDomainInfo.py Thu Apr 22 22:39:56 2010 +0800
@@ -2511,9 +2511,11 @@
self.restart_in_progress = False
hap = 0
+ nesting = 0
hvm = self.info.is_hvm()
if hvm:
hap = self.info.is_hap()
+ nesting = self.info.is_nesting()
info = xc.xeninfo()
if 'hvm' not in info['xen_caps']:
raise VmError("HVM guest support is unavailable: is VT/AMD-V "
@@ -2540,7 +2542,8 @@
oos = self.info['platform'].get('oos', 1)
oos_off = 1 - int(oos)
- flags = (int(hvm) << 0) | (int(hap) << 1) | (int(s3_integrity) << 2) | (int(oos_off) << 3)
+ flags = (int(hvm) << 0) | (int(hap) << 1) | (int(s3_integrity) << 2) \
+ | (int(oos_off) << 3) | (int(nesting) << 4)
try:
self.domid = xc.domain_create(
diff -r 3a7b55a0be9c -r 682f3d39f719 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py Thu Apr 22 22:30:10 2010 +0800
+++ b/tools/python/xen/xm/create.py Thu Apr 22 22:39:56 2010 +0800
@@ -643,6 +643,11 @@
use="""Should out-of-sync shadow page tabled be enabled?
(0=OOS is disabled; 1=OOS is enabled.""")
+gopts.var('nesting', val='Nesting',
+ fn=set_int, default=0,
+ use="""Nesting availability (0=nesting is forbidden;
+ 1=nesting is allowed.""")
+
gopts.var('cpuid', val="IN[,SIN]:eax=EAX,ebx=EBX,ecx=ECX,edx=EDX",
fn=append_value, default=[],
use="""Cpuid description.""")
@@ -1065,7 +1070,7 @@
'device_model', 'display',
'fda', 'fdb',
'gfx_passthru', 'guest_os_type',
- 'hap', 'hpet',
+ 'hap', 'hpet', 'nesting',
'isa',
'keymap',
'localtime',
diff -r 3a7b55a0be9c -r 682f3d39f719 tools/python/xen/xm/xenapi_create.py
--- a/tools/python/xen/xm/xenapi_create.py Thu Apr 22 22:30:10 2010 +0800
+++ b/tools/python/xen/xm/xenapi_create.py Thu Apr 22 22:39:56 2010 +0800
@@ -1105,6 +1105,7 @@
'guest_os_type',
'hap',
'oos',
+ 'nesting',
'pci_msitranslate',
'pci_power_mgmt',
'xen_platform_pci',
next prev parent reply other threads:[~2010-04-22 9:41 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-22 9:41 [PATCH 00/17][RFC] Nested virtualization for VMX Qing He
2010-04-22 9:41 ` [PATCH 01/17] vmx: nest: fix CR4.VME in update_guest_cr Qing He
2010-05-20 9:26 ` Tim Deegan
2010-05-20 9:36 ` Qing He
2010-04-22 9:41 ` [PATCH 02/17] vmx: nest: rename host_vmcs Qing He
2010-04-22 9:41 ` [PATCH 03/17] vmx: nest: wrapper for control update Qing He
2010-05-20 9:34 ` Tim Deegan
2010-05-20 9:46 ` Qing He
2010-05-20 12:57 ` Keir Fraser
2010-04-22 9:41 ` [PATCH 04/17] vmx: nest: domain and vcpu flags Qing He
2010-05-20 9:37 ` Tim Deegan
2010-05-20 9:51 ` Christoph Egger
2010-05-20 9:54 ` Qing He
2010-05-20 10:55 ` Tim Deegan
2010-05-20 12:53 ` Qing He
2010-05-20 14:06 ` Christoph Egger
2010-04-22 9:41 ` [PATCH 05/17] vmx: nest: nested control structure Qing He
2010-04-22 9:41 ` [PATCH 06/17] vmx: nest: virtual vmcs layout Qing He
2010-04-22 9:41 ` [PATCH 07/17] vmx: nest: handling VMX instruction exits Qing He
2010-05-20 10:53 ` Tim Deegan
2010-05-20 13:28 ` Qing He
2010-04-22 9:41 ` [PATCH 08/17] vmx: nest: L1 <-> L2 context switch Qing He
2010-05-20 11:11 ` Tim Deegan
2010-05-20 13:49 ` Qing He
2010-05-21 9:19 ` Tim Deegan
2010-05-21 10:31 ` Qing He
2010-05-25 15:27 ` Tim Deegan
2010-04-22 9:41 ` [PATCH 09/17] vmx: nest: interrupt Qing He
2010-05-20 11:21 ` Tim Deegan
2010-05-20 15:55 ` Qing He
2010-04-22 9:41 ` [PATCH 10/17] vmx: nest: VMExit handler in L2 Qing He
2010-05-20 11:44 ` Tim Deegan
2010-05-20 16:06 ` Qing He
2010-05-21 8:42 ` Tim Deegan
2010-05-21 10:35 ` Qing He
2010-05-25 15:34 ` Tim Deegan
2010-04-22 9:41 ` [PATCH 11/17] vmx: nest: L2 tsc Qing He
2010-05-20 11:47 ` Tim Deegan
2010-05-20 16:07 ` Qing He
2010-04-22 9:41 ` [PATCH 12/17] vmx: nest: CR0.TS and #NM Qing He
2010-04-22 9:41 ` [PATCH 13/17] vmx: nest: capability reporting MSRs Qing He
2010-05-20 11:52 ` Tim Deegan
2010-04-22 9:41 ` [PATCH 14/17] vmx: nest: enable virtual VMX Qing He
2010-04-22 9:41 ` [PATCH 15/17] vmx: nest: virtual ept for nested Qing He
2010-05-20 12:21 ` Tim Deegan
2010-05-21 10:24 ` Qing He
2010-05-25 16:02 ` Tim Deegan
2010-04-22 9:41 ` [PATCH 16/17] vmx: nest: hvmtrace " Qing He
2010-04-22 9:41 ` Qing He [this message]
2010-04-22 10:15 ` [PATCH 00/17][RFC] Nested virtualization for VMX Christoph Egger
2010-04-23 10:10 ` He, Qing
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1271929289-18572-18-git-send-email-qing.he@intel.com \
--to=qing.he@intel.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).