From: Don Slutz <dslutz@verizon.com>
To: xen-devel@lists.xen.org
Cc: Kevin Tian <kevin.tian@intel.com>, Keir Fraser <keir@xen.org>,
Ian Campbell <ian.campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Jun Nakajima <jun.nakajima@intel.com>,
Eddie Dong <eddie.dong@intel.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Don Slutz <dslutz@verizon.com>, Tim Deegan <tim@xen.org>,
Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>,
Jan Beulich <jbeulich@suse.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Subject: [PATCH v3 02/16] tools part of add vmware_hw to xl.cfg
Date: Mon, 8 Sep 2014 09:15:44 -0400 [thread overview]
Message-ID: <1410182158-8542-3-git-send-email-dslutz@verizon.com> (raw)
In-Reply-To: <1410182158-8542-1-git-send-email-dslutz@verizon.com>
If non-zero then
Force use of VMware's VGA in QEMU.
Signed-off-by: Don Slutz <dslutz@verizon.com>
---
docs/man/xl.cfg.pod.5 | 6 ++++++
tools/libxc/xc_domain_restore.c | 14 ++++++++++++++
tools/libxc/xc_domain_save.c | 11 +++++++++++
tools/libxc/xg_save_restore.h | 2 ++
tools/libxl/libxl_create.c | 4 +++-
tools/libxl/libxl_dm.c | 33 +++++++++++++++++++++------------
tools/libxl/libxl_dom.c | 2 ++
tools/libxl/libxl_types.idl | 1 +
tools/libxl/xl_cmdimpl.c | 2 ++
9 files changed, 62 insertions(+), 13 deletions(-)
diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 517ae2f..7f7319a 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1147,6 +1147,12 @@ some other Operating Systems and in some circumstance can prevent
Xen's own paravirtualisation interfaces for HVM guests from being
used.
+=item B<vmware_hw=NUMBER>
+
+Turns on or off the exposure of VMware cpuid. The number is the
+VMware's hardware version number, where 0 is off. If on it also
+forces the use of VMware's VGA in QEMU.
+
=back
=head3 Emulated VGA Graphics Device
diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c
index b9a56d5..bc5cd57 100644
--- a/tools/libxc/xc_domain_restore.c
+++ b/tools/libxc/xc_domain_restore.c
@@ -743,6 +743,7 @@ typedef struct {
uint64_t vm_generationid_addr;
uint64_t ioreq_server_pfn;
uint64_t nr_ioreq_server_pages;
+ uint64_t vmware_hw;
struct toolstack_data_t tdata;
} pagebuf_t;
@@ -927,6 +928,16 @@ static int pagebuf_get_one(xc_interface *xch, struct restore_ctx *ctx,
}
return pagebuf_get_one(xch, ctx, buf, fd, dom);
+ case XC_SAVE_ID_HVM_VMWARE_HW:
+ /* Skip padding 4 bytes then read the vmware hw version. */
+ if ( RDEXACT(fd, &buf->vmware_hw, sizeof(uint32_t)) ||
+ RDEXACT(fd, &buf->vmware_hw, sizeof(uint64_t)) )
+ {
+ PERROR("error read the vmware_hw value");
+ return -1;
+ }
+ return pagebuf_get_one(xch, ctx, buf, fd, dom);
+
case XC_SAVE_ID_TOOLSTACK:
{
if ( RDEXACT(fd, &buf->tdata.len, sizeof(buf->tdata.len)) )
@@ -1760,6 +1771,9 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
}
}
+ if (pagebuf.vmware_hw != 0)
+ xc_set_hvm_param(xch, dom, HVM_PARAM_VMWARE_HW, pagebuf.vmware_hw);
+
if (pagebuf.acpi_ioport_location == 1) {
DBGPRINTF("Use new firmware ioport from the checkpoint\n");
xc_hvm_param_set(xch, dom, HVM_PARAM_ACPI_IOPORTS_LOCATION, 1);
diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
index 254fdb3..76dc307 100644
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -1750,6 +1750,17 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
PERROR("Error when writing the ioreq server gmfn count");
goto out;
}
+
+ chunk.id = XC_SAVE_ID_HVM_VMWARE_HW;
+ chunk.data = 0;
+ xc_hvm_param_get(xch, dom, HVM_PARAM_VMWARE_HW, &chunk.data);
+
+ if ( (chunk.data != 0) &&
+ wrexact(io_fd, &chunk, sizeof(chunk)) )
+ {
+ PERROR("Error when writing the vmware_hw value");
+ goto out;
+ }
}
if ( callbacks != NULL && callbacks->toolstack_save != NULL )
diff --git a/tools/libxc/xg_save_restore.h b/tools/libxc/xg_save_restore.h
index bdd9009..d185ba9 100644
--- a/tools/libxc/xg_save_restore.h
+++ b/tools/libxc/xg_save_restore.h
@@ -262,6 +262,8 @@
/* These are a pair; it is an error for one to exist without the other */
#define XC_SAVE_ID_HVM_IOREQ_SERVER_PFN -19
#define XC_SAVE_ID_HVM_NR_IOREQ_SERVER_PAGES -20
+/* VMware data */
+#define XC_SAVE_ID_HVM_VMWARE_HW -21
/*
** We process save/restore/migrate in batches of pages; the below
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index ee328e9..54842ee 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -428,13 +428,15 @@ int libxl__domain_build(libxl__gc *gc,
vments[4] = "start_time";
vments[5] = libxl__sprintf(gc, "%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
- localents = libxl__calloc(gc, 7, sizeof(char *));
+ localents = libxl__calloc(gc, 9, sizeof(char *));
localents[0] = "platform/acpi";
localents[1] = libxl_defbool_val(info->u.hvm.acpi) ? "1" : "0";
localents[2] = "platform/acpi_s3";
localents[3] = libxl_defbool_val(info->u.hvm.acpi_s3) ? "1" : "0";
localents[4] = "platform/acpi_s4";
localents[5] = libxl_defbool_val(info->u.hvm.acpi_s4) ? "1" : "0";
+ localents[6] = "platform/vmware_hw";
+ localents[7] = libxl__sprintf(gc, "%"PRId64, info->u.hvm.vmware_hw);
break;
case LIBXL_DOMAIN_TYPE_PV:
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 103cbca..c79274b 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -542,19 +542,28 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
}
}
- switch (b_info->u.hvm.vga.kind) {
- case LIBXL_VGA_INTERFACE_TYPE_STD:
- flexarray_append_pair(dm_args, "-device",
- GCSPRINTF("VGA,vgamem_mb=%d",
- libxl__sizekb_to_mb(b_info->video_memkb)));
- break;
- case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
+ if (b_info->u.hvm.vmware_hw) {
flexarray_append_pair(dm_args, "-device",
- GCSPRINTF("cirrus-vga,vgamem_mb=%d",
- libxl__sizekb_to_mb(b_info->video_memkb)));
- break;
- case LIBXL_VGA_INTERFACE_TYPE_NONE:
- break;
+ GCSPRINTF("vmware-svga,vgamem_mb=%d",
+ libxl__sizekb_to_mb(
+ b_info->video_memkb)));
+ } else {
+ switch (b_info->u.hvm.vga.kind) {
+ case LIBXL_VGA_INTERFACE_TYPE_STD:
+ flexarray_append_pair(dm_args, "-device",
+ GCSPRINTF("VGA,vgamem_mb=%d",
+ libxl__sizekb_to_mb(
+ b_info->video_memkb)));
+ break;
+ case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
+ flexarray_append_pair(dm_args, "-device",
+ GCSPRINTF("cirrus-vga,vgamem_mb=%d",
+ libxl__sizekb_to_mb(
+ b_info->video_memkb)));
+ break;
+ case LIBXL_VGA_INTERFACE_TYPE_NONE:
+ break;
+ }
}
if (b_info->u.hvm.boot) {
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index c944804..63ae4c5 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -219,6 +219,8 @@ static void hvm_set_conf_params(xc_interface *handle, uint32_t domid,
libxl_defbool_val(info->u.hvm.viridian));
xc_hvm_param_set(handle, domid, HVM_PARAM_HPET_ENABLED,
libxl_defbool_val(info->u.hvm.hpet));
+ xc_set_hvm_param(handle, domid, HVM_PARAM_VMWARE_HW,
+ info->u.hvm.vmware_hw);
#endif
xc_hvm_param_set(handle, domid, HVM_PARAM_TIMER_MODE, timer_mode(info));
xc_hvm_param_set(handle, domid, HVM_PARAM_VPT_ALIGN,
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 931c9e9..d0bd657 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -375,6 +375,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
("timeoffset", string),
("hpet", libxl_defbool),
("vpt_align", libxl_defbool),
+ ("vmware_hw", UInt(64, init_val = 0)),
("timer_mode", libxl_timer_mode),
("nested_hvm", libxl_defbool),
("smbios_firmware", string),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 8a38077..c30341a 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1033,6 +1033,8 @@ static void parse_config_data(const char *config_source,
xlu_cfg_get_defbool(config, "acpi_s4", &b_info->u.hvm.acpi_s4, 0);
xlu_cfg_get_defbool(config, "nx", &b_info->u.hvm.nx, 0);
xlu_cfg_get_defbool(config, "viridian", &b_info->u.hvm.viridian, 0);
+ if (!xlu_cfg_get_long(config, "vmware_hw", &l, 1))
+ b_info->u.hvm.vmware_hw = l;
xlu_cfg_get_defbool(config, "hpet", &b_info->u.hvm.hpet, 0);
xlu_cfg_get_defbool(config, "vpt_align", &b_info->u.hvm.vpt_align, 0);
--
1.8.4
next prev parent reply other threads:[~2014-09-08 13:15 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-08 13:15 [PATCH v3 00/16] Xen VMware tools support Don Slutz
2014-09-08 13:15 ` [PATCH v3 01/16] hypervisor part of add vmware_hw to xl.cfg Don Slutz
2014-09-11 10:52 ` George Dunlap
2014-09-11 17:21 ` Don Slutz
2014-09-08 13:15 ` Don Slutz [this message]
2014-09-11 11:23 ` [PATCH v3 02/16] tools " George Dunlap
2014-09-11 17:48 ` Don Slutz
2014-09-08 13:15 ` [PATCH v3 03/16] vmware: Add VMware provided include files Don Slutz
2014-09-08 13:15 ` [PATCH v3 04/16] hypervisor part of add vmware_port to xl.cfg Don Slutz
2014-09-08 15:01 ` Boris Ostrovsky
2014-09-08 15:22 ` Jan Beulich
2014-09-08 15:32 ` Andrew Cooper
2014-09-08 15:43 ` Boris Ostrovsky
2014-09-08 17:56 ` Don Slutz
2014-09-08 17:20 ` Don Slutz
2014-09-11 15:34 ` George Dunlap
2014-09-08 13:15 ` [PATCH v3 05/16] tools " Don Slutz
2014-09-15 10:03 ` George Dunlap
2014-09-20 15:52 ` Slutz, Donald Christopher
2014-09-08 13:15 ` [PATCH v3 06/16] hypervisor part of convert vmware_port to xentrace usage Don Slutz
2014-09-08 13:15 ` [PATCH v3 07/16] tools " Don Slutz
2014-09-08 13:15 ` [PATCH v3 08/16] hypervisor part of add limited support of VMware's hyper-call rpc Don Slutz
2014-09-08 13:15 ` [PATCH v3 09/16] tools " Don Slutz
2014-09-08 13:15 ` [PATCH v3 10/16] Add VMware tool's triggers Don Slutz
2014-09-08 13:15 ` [PATCH v3 11/16] Add live migration of VMware's hyper-call RPC Don Slutz
2014-09-08 13:15 ` [PATCH v3 12/16] Add dump of HVM_SAVE_CODE(VMPORT) to xen-hvmctx Don Slutz
2014-09-08 13:15 ` [optional][PATCH v3 13/16] Add xen-hvm-param Don Slutz
2014-09-08 13:15 ` [optional][PATCH v3 14/16] Add xen-vmware-guestinfo Don Slutz
2014-09-08 13:15 ` [optional][PATCH v3 15/16] Add xen-list-vmware-guestinfo Don Slutz
2014-09-08 13:15 ` [optional][PATCH v3 16/16] Add xen-hvm-send-trigger Don Slutz
2014-09-08 13:38 ` [PATCH v3 00/16] Xen VMware tools support Ian Campbell
2014-09-08 16:58 ` Don Slutz
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=1410182158-8542-3-git-send-email-dslutz@verizon.com \
--to=dslutz@verizon.com \
--cc=Aravind.Gopalakrishnan@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=eddie.dong@intel.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=jun.nakajima@intel.com \
--cc=keir@xen.org \
--cc=kevin.tian@intel.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.org \
/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).