All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Xen VMware tools support
@ 2014-09-01 15:33 Don Slutz
  2014-09-01 15:33 ` [PATCH v2 1/3] Add vmware_hw to xl.cfg Don Slutz
                   ` (4 more replies)
  0 siblings, 5 replies; 54+ messages in thread
From: Don Slutz @ 2014-09-01 15:33 UTC (permalink / raw)
  To: xen-devel
  Cc: Kevin Tian, Keir Fraser, Ian Campbell, Stefano Stabellini,
	Jun Nakajima, Eddie Dong, Ian Jackson, Don Slutz, Tim Deegan,
	Aravind Gopalakrishnan, Jan Beulich, Andrew Cooper,
	Boris Ostrovsky, Suravee Suthikulpanit

This is a small part of the changes needed to allow running Linux
and windows (and others) guests that were built on VMware and run
run them unchanged on Xen.

This small part is the start of Xen support of VMware backdoor I/O
port which is how VMware tools (a standard addition installed on a
guest) communicates to the hypervisor.

I picked this subset to start with because it only has changes in
Xen.

Some of this code is already in QEMU and so KVM has some of this
already.  QEMU supported backdoor commands include VMware mouse
support.  A later patch set exists that links these changes, new
code and Xen changes to QEMU to provide VMware mouse support under
Xen.  The important part is that VMware mouse is an absolute
position mouse and so network delays do not effect usage of the
virtual mouse.

For example from the guest:

[root@C63-min-tools ~]# vmtoolsd --cmd "info-get guestinfo.joejoel"
No value found
[root@C63-min-tools ~]# vmtoolsd --cmd "info-set guestinfo.joejoel short"

[root@C63-min-tools ~]# vmtoolsd --cmd "info-get guestinfo.joejoel"
short
[root@C63-min-tools ~]# vmtoolsd --cmd "info-set guestinfo.joejoel long222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000joel"

[root@C63-min-tools ~]# vmtoolsd --cmd "info-get guestinfo.key1"
data1
[root@C63-min-tools ~]# vmtoolsd --cmd "info-get guestinfo.key2"
No value found
[root@C63-min-tools ~]# vmtoolsd --cmd "info-get guestinfo.key2"
data2
[root@C63-min-tools ~]# 


Most of this code has been reverse engineered by looking at
source code for Linux and open VMware tools.

http://open-vm-tools.sourceforge.net


changes RFC to v2:

Jan Beulich:
  Add xen/arch/x86/hvm/vmware.c for cpuid_vmware_leaves
  Fewer patches

Andrew Cooper:
  use the proper constant for apic_khz
  Follow 839b966e3f587bbb1a0d954230fb3904330dccb6 style changes.
  Changed HVM_PARAM_VMWARE_HW to write once (make is_vmware_domain()
    more static).
  Dropped vmport status stuff.
  Added checks for xzalloc() having failed.
  You should include backdoor_def.h ...
     Every thing I tried did not work better.  So I did not
     change VMPORT_PORT and BDOOR_PORT being the same value.
     I did not try and adjust VMware's include file backdoor_def.h
     to working in other xen source files.
  Switching to s_time_t is not valid. get_sec() is defined:
    unsigned long get_sec(void);
  and so my uses of it should be using unsigned long.  However
  since that is not a fixed width type, I used the uint64_t
  data type which is almost the same, but does allow the 32 bit
  build of libxc, libxl to do the correct thing.


Konrad Rzeszutek Wilk:
  Please don't include the address. It should be, etc
      about the Vmware provided include files.
    I went with no changes to these files.  Even if the files should
    be changed to match xen coding style, etc I still feel that the
    original ones should be added via a patch, and then adjusted in a
    2nd patch.
  Can you use XenBus?
    I would say no.  XenBus (and XenStore) is about domain to domain
    communication.  This is about VMware's hyper-call and providing
    access to VMware's guest info very low speed access.

Olaf Hering:
   Dropped changing of bios-strings.  Still needs some documentation
   about this may be needed to do in a tool stack or set of commands.


Boris Ostrovsky:
  Use svm_nextrip_insn_length()
    Looks like __get_instruction_length() does this, so switched to
    __get_instruction_length().
 
RFC:

See

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1009458

for info on detecting VMware.

Linux does not follow this exactly.  It checks for CPUID 1st.  If
that fails, it checks for SMBIOS containing "VMware" (not VMware- or
VMW).

So this patch set provides:

        SMBIOS -- Add string VMware-
        CPUID -- Add VMware's CPUID (Note: currently HyperV (viridian support) breaks this check.)
        Add the magic VMware port
            Allow VMware tools poweroff and reboot
            Enable access to VMware's guest info
            Provide the VMware tools build number


Don Slutz (3):
  Add vmware_hw to xl.cfg
  vmport: Add VMware provided include files.
  Add limited support of VMware's hyper-call

 docs/man/xl.cfg.pod.5                        |    6 +
 tools/firmware/hvmloader/pci.c               |   10 +-
 tools/libxc/xc_domain.c                      |  115 +++
 tools/libxc/xc_domain_restore.c              |   14 +
 tools/libxc/xc_domain_save.c                 |   11 +
 tools/libxc/xenctrl.h                        |   24 +
 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 +
 tools/misc/xen-hvmctx.c                      |  229 ++++
 tools/xentrace/formats                       |    8 +
 xen/arch/x86/domctl.c                        |   34 +
 xen/arch/x86/hvm/Makefile                    |    4 +-
 xen/arch/x86/hvm/hvm.c                       |  499 ++++++++-
 xen/arch/x86/hvm/io.c                        |    1 +
 xen/arch/x86/hvm/svm/emulate.c               |    3 +
 xen/arch/x86/hvm/svm/svm.c                   |   79 ++
 xen/arch/x86/hvm/svm/vmcb.c                  |    1 +
 xen/arch/x86/hvm/vmport/Makefile             |    1 +
 xen/arch/x86/hvm/vmport/backdoor_def.h       |  167 +++
 xen/arch/x86/hvm/vmport/guest_msg_def.h      |   87 ++
 xen/arch/x86/hvm/vmport/includeCheck.h       |   17 +
 xen/arch/x86/hvm/vmport/vmport.c             | 1436 ++++++++++++++++++++++++++
 xen/arch/x86/hvm/vmware.c                    |   85 ++
 xen/arch/x86/hvm/vmx/vmcs.c                  |    1 +
 xen/arch/x86/hvm/vmx/vmx.c                   |   90 ++
 xen/arch/x86/hvm/vmx/vvmx.c                  |   14 +
 xen/arch/x86/traps.c                         |    7 +-
 xen/include/asm-x86/hvm/domain.h             |    5 +
 xen/include/asm-x86/hvm/hvm.h                |    3 +
 xen/include/asm-x86/hvm/svm/emulate.h        |    1 +
 xen/include/asm-x86/hvm/trace.h              |   31 +
 xen/include/asm-x86/hvm/vmport.h             |   90 ++
 xen/include/asm-x86/hvm/vmware.h             |   32 +
 xen/include/public/arch-x86/hvm/save.h       |   39 +-
 xen/include/public/arch-x86/hvm/vmporttype.h |  105 ++
 xen/include/public/domctl.h                  |    3 +
 xen/include/public/hvm/hvm_op.h              |   18 +
 xen/include/public/hvm/params.h              |    8 +-
 xen/include/public/trace.h                   |    7 +
 43 files changed, 3309 insertions(+), 20 deletions(-)
 create mode 100644 xen/arch/x86/hvm/vmport/Makefile
 create mode 100644 xen/arch/x86/hvm/vmport/backdoor_def.h
 create mode 100644 xen/arch/x86/hvm/vmport/guest_msg_def.h
 create mode 100644 xen/arch/x86/hvm/vmport/includeCheck.h
 create mode 100644 xen/arch/x86/hvm/vmport/vmport.c
 create mode 100644 xen/arch/x86/hvm/vmware.c
 create mode 100644 xen/include/asm-x86/hvm/vmport.h
 create mode 100644 xen/include/asm-x86/hvm/vmware.h
 create mode 100644 xen/include/public/arch-x86/hvm/vmporttype.h

-- 
1.8.4

^ permalink raw reply	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2014-09-12 12:25 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-01 15:33 [PATCH v2 0/3] Xen VMware tools support Don Slutz
2014-09-01 15:33 ` [PATCH v2 1/3] Add vmware_hw to xl.cfg Don Slutz
2014-09-02  7:28   ` Jan Beulich
2014-09-02 18:24     ` Don Slutz
2014-09-03  7:45       ` Jan Beulich
2014-09-03 10:59         ` Don Slutz
2014-09-03 12:33           ` Jan Beulich
2014-09-03 12:51             ` Don Slutz
2014-09-08 13:21           ` Ian Campbell
2014-09-08 13:47             ` Don Slutz
2014-09-08 13:55               ` Ian Campbell
2014-09-08 13:20         ` Ian Campbell
2014-09-08 13:56           ` Don Slutz
2014-09-08 14:07             ` Andrew Cooper
2014-09-08 18:39               ` Don Slutz
2014-09-08 22:11               ` Don Slutz
2014-09-08 23:34                 ` Andrew Cooper
2014-09-08 14:21             ` Jan Beulich
2014-09-08 15:16               ` Boris Ostrovsky
2014-09-08 15:27                 ` Jan Beulich
2014-09-08 22:41                   ` Don Slutz
2014-09-08 13:17   ` Ian Campbell
2014-09-08 13:27     ` Andrew Cooper
2014-09-08 13:41       ` Ian Campbell
2014-09-08 14:18         ` Don Slutz
2014-09-08 19:16     ` Don Slutz
2014-09-09  9:39       ` Ian Campbell
2014-09-09 17:02         ` Don Slutz
2014-09-10  9:30           ` Ian Campbell
2014-09-10 17:44             ` Don Slutz
2014-09-12 12:25             ` Slutz, Donald Christopher
2014-09-08 22:14     ` Don Slutz
2014-09-01 15:33 ` [PATCH v2 2/3] vmport: Add VMware provided include files Don Slutz
2014-09-02  7:34   ` Jan Beulich
2014-09-02 18:46     ` Don Slutz
2014-09-03  7:51       ` Jan Beulich
2014-09-03 12:38         ` Don Slutz
2014-09-01 15:33 ` [PATCH v2 3/3] Add limited support of VMware's hyper-call Don Slutz
2014-09-02  8:16   ` Jan Beulich
2014-09-03  0:55     ` Don Slutz
2014-09-03  8:25       ` Jan Beulich
2014-09-03 18:28         ` Don Slutz
2014-09-08 13:35   ` Ian Campbell
2014-09-08 16:57     ` Don Slutz
2014-09-09  9:36       ` Ian Campbell
2014-09-09 17:31         ` Don Slutz
2014-09-09 19:22           ` Boris Ostrovsky
2014-09-10  9:32           ` Ian Campbell
2014-09-10 17:25             ` Don Slutz
2014-09-01 16:10 ` [PATCH v2 0/3] Xen VMware tools support Jan Beulich
2014-09-01 18:14   ` Don Slutz
2014-09-08 13:03 ` Ian Campbell
2014-09-08 13:18   ` Don Slutz
2014-09-08 13:42     ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.