[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [XEN PATCH v14 6/8] tools: Add vmware_port support



From: Don Slutz <don.slutz@xxxxxxxxx>

This new libxl_domain_create_info field is used to set
XEN_DOMCTL_CONFIG_VMWARE_PORT_MASK in the xc_domain_configuration_t
for x86.

In xen it is is_vmware_port_enabled.

If is_vmware_port_enabled then
  enable a limited support of VMware's hyper-call.

VMware's hyper-call is also known as VMware Backdoor I/O Port.

if vmware_port is not specified in the config file, let
"vmware_hwver != 0" be the default value.  This means that only
vmware_hwver = 7 needs to be specified to enable both features.

vmware_hwver = 7 is special because that is what controls the
enable of CPUID leaves for VMware (vmware_hwver >= 7).

Note: vmware_port and nestedhvm cannot be specified at the
same time.

Signed-off-by: Don Slutz <dslutz@xxxxxxxxxxx>
CC: Don Slutz <don.slutz@xxxxxxxxx>
---
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

v14:
  Reworked to current code.

v13:
  Added Acked-by: Ian Campbell

v12:
    s/come/comes/

      In v11 this seems to have morphed into only
    LIBXL_HAVE_LIBXL_VGA_INTERFACE_TYPE_VMWARE being provided, which
    is clearly not an appropriate umbrella #define.

    "#define LIBXL_HAVE_CREATEINFO_VMWARE 1"
    Lets just have a single one of these indicating support for
    vmware, it should be added at the end of the series after all
    the baseline vmware functionality is in place. I think that
    means hwver, vga=vmware and this port stuff.

      Make (tools: Add vga=vmware) no longer independent.
      Change the #define to "LIBXL_HAVE_VMWARE"


v11:
  Dropped "If non-zero then default VGA to VMware's VGA"

v10:
    If..." at the start of the sentence ...
    Also, why is 7 special?


 docs/man/xl.cfg.5.pod.in    | 15 +++++++++++++++
 tools/libxl/libxl.h         |  5 +++++
 tools/libxl/libxl_create.c  | 10 ++++++++++
 tools/libxl/libxl_types.idl |  1 +
 tools/libxl/libxl_x86.c     |  2 ++
 tools/xl/xl_parse.c         |  1 +
 6 files changed, 34 insertions(+)

diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index 10eac33..3c73985 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -2359,6 +2359,8 @@ Turns on or off the exposure of VMware cpuid.  The number 
is
 VMware's hardware version number, where 0 is off.  A number >= 7
 is needed to enable exposure of VMware cpuid.
 
+If not zero it changes the default for vmware_port to on.
+
 The hardware version number (vmware_hwver) comes from VMware config files.
 
 =over 4
@@ -2370,6 +2372,19 @@ For vssd:VirtualSystemType == vmx-07, vmware_hwver = 7.
 
 =back
 
+=item B<vmware_port=BOOLEAN>
+
+Turns on or off the exposure of VMware port.  This is known as
+vmport in QEMU.  Also called VMware Backdoor I/O Port.  Not all
+defined VMware backdoor commands are implemented.  All of the
+ones that Linux kernel uses are defined.
+
+Defaults to enabled if vmware_hwver is non-zero (i.e. enabled)
+otherwise defaults to disabled.
+
+Note: vmware_port and nestedhvm cannot be specified at the
+same time.
+
 =back
 
 =head3 Emulated VGA Graphics Device
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 1cd6c38..48ab231 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -439,6 +439,11 @@
 #define LIBXL_HAVE_CREATEINFO_PASSTHROUGH 1
 
 /*
+ * libxl has VMware changes.
+ */
+#define LIBXL_HAVE_VMWARE 1
+
+/*
  * libxl ABI compatibility
  *
  * The only guarantee which libxl makes regarding ABI compatibility
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index e28d175..6689443 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -51,6 +51,7 @@ int libxl__domain_create_info_setdefault(libxl__gc *gc,
         libxl_defbool_setdefault(&c_info->oos, true);
     }
 
+    libxl_defbool_setdefault(&c_info->vmware_port, c_info->vmware_hwver != 0);
     libxl_defbool_setdefault(&c_info->run_hotplug_scripts, true);
     libxl_defbool_setdefault(&c_info->driver_domain, false);
 
@@ -1185,6 +1186,15 @@ int libxl__domain_config_setdefault(libxl__gc *gc,
         goto error_out;
     }
 
+    if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_HVM &&
+        libxl_defbool_val(d_config->b_info.nested_hvm) &&
+        libxl_defbool_val(d_config->c_info.vmware_port)) {
+        ret = ERROR_INVAL;
+        LOGD(ERROR, domid,
+            "vmware_port and nestedhvm cannot be enabled simultaneously\n");
+        goto error_out;
+    }
+
     if (d_config->c_info.type != LIBXL_DOMAIN_TYPE_PV &&
         (libxl_defbool_val(d_config->b_info.nested_hvm) &&
         ((d_config->c_info.type == LIBXL_DOMAIN_TYPE_HVM &&
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 89a9ee7..f563980 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -421,6 +421,7 @@ libxl_domain_create_info = Struct("domain_create_info",[
     ("passthrough",  libxl_passthrough),
     ("xend_suspend_evtchn_compat",libxl_defbool),
     ("vmware_hwver", uint32),
+    ("vmware_port",  libxl_defbool),
     ], dir=DIR_IN)
 
 libxl_domain_restore_params = Struct("domain_restore_params", [
diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index 0ee7418..8da9913 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -22,6 +22,8 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
     }
 
     config->arch.vmware_hwver = d_config->c_info.vmware_hwver;
+    if (libxl_defbool_val(d_config->c_info.vmware_port))
+        config->arch.emulation_flags |= XEN_X86_EMU_VMWARE_PORT;
     return 0;
 }
 
diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index 4794398..b655e25 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -1321,6 +1321,7 @@ void parse_config_data(const char *config_source,
     }
 
     xlu_cfg_get_defbool(config, "oos", &c_info->oos, 0);
+    xlu_cfg_get_defbool(config, "vmware_port", &c_info->vmware_port, 0);
 
     if (!xlu_cfg_get_string (config, "pool", &buf, 0))
         xlu_cfg_replace_string(config, "pool", &c_info->pool_name, 0);
-- 
1.8.3.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.