]> git.ipfire.org Git - thirdparty/open-vm-tools.git/log
thirdparty/open-vm-tools.git
13 years agoDon't use $HOME to get the current user's home directory on Mac OS
VMware, Inc [Thu, 2 Aug 2012 05:19:43 +0000 (22:19 -0700)] 
Don't use $HOME to get the current user's home directory on Mac OS

There are some cases on Mac OS where the $HOME environment variable has
not been set even though the current user does have a valid home
directory. For example, if you enable the "root" user in the UI and then
try to start Fusion via Finder, it would fail spectacularly because it
was unable to figure out the Log and Preferences directories.

In lib/misc, for Mac OS, instead of resorting to $HOME in the case where
we are trying to expand "~" for the current user, we instead use the
posix passwd API, which according to the man page is properly hooked up
to DirectoryServices and thus will give us any user's homedir even if it
isn't actually in the /etc/passwd file.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agolib/file and lib.misc: misc fixes for Android
VMware, Inc [Thu, 2 Aug 2012 05:19:16 +0000 (22:19 -0700)] 
lib/file and lib.misc: misc fixes for Android

We should test for presence of __ANDROID__ macro, not ANDROID_X86.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
13 years agoFix time synchronization when restarting tools
VMware, Inc [Thu, 2 Aug 2012 05:18:49 +0000 (22:18 -0700)] 
Fix time synchronization when restarting tools

When the tools are restarted, and the clock is modified (out of sync
with the host's clock), if 'timeSync' feature is enabled, then the clock
is not synced. This happens only first time after the tools are
restarted. There is no issue from the second time onwards.

In the code, we do the one step synchronization only if the tool status
is stopped. Ideally, we should do this one step synchronization the first
time even after the tools are restarted. This is fixed by setting the
tools status to stopped when the tools are restarted initially.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoUpdating open-vm-tools version for release 2012.05.21-724730. 2012.05.21-724730
Dmitry Torokhov [Mon, 21 May 2012 23:30:01 +0000 (16:30 -0700)] 
Updating open-vm-tools version for release 2012.05.21-724730.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 21 May 2012 22:29:31 +0000 (15:29 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoRemove objectionable code from authPosix.c
VMware, Inc [Mon, 21 May 2012 22:29:00 +0000 (15:29 -0700)] 
Remove objectionable code from authPosix.c

Auth_AuthenticateUser in authPosix.c, for both the PAM and non-PAM
paths, has a short-circuit enabled by defining ACCEPT_XXX_PASS.  When
defined, anyone can login simply by specifying "XXX" as the password.
There is no evidence this has ever been enabled in production code, but
it's apparently X-rated enough that we want it gone immediately.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoAdd PRINTF_DECL to MsgList_Append
VMware, Inc [Mon, 21 May 2012 22:28:43 +0000 (15:28 -0700)] 
Add PRINTF_DECL to MsgList_Append

Use PRINTF_DECL to validate proper message format and arg count for
MsgList_Append. And fix the two remaining errors on compile (others were
fixed while found).

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix HgfsConvertFromNtTimeNsec() for arm-linux builds.
VMware, Inc [Mon, 21 May 2012 22:28:33 +0000 (15:28 -0700)] 
Fix HgfsConvertFromNtTimeNsec() for arm-linux builds.

ARM isn't just Android and iOS...

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoIvy Bridge model 3A is public
VMware, Inc [Mon, 21 May 2012 22:28:28 +0000 (15:28 -0700)] 
Ivy Bridge model 3A is public

Ivy Bridge features are still under wraps, but we no longer need to
hide model 3A from Community Source.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 21 May 2012 22:28:18 +0000 (15:28 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoIntroduce VMW_CONTAINER_OF
VMware, Inc [Mon, 21 May 2012 22:28:12 +0000 (15:28 -0700)] 
Introduce VMW_CONTAINER_OF

container_of() is a useful operation even outide of lists
so let's add it to vm_basic_defs.h so it is available to
everyone.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agochar is unsigned on ARM - change some vars to 'signed char' or 'int'
VMware, Inc [Mon, 21 May 2012 22:28:08 +0000 (15:28 -0700)] 
char is unsigned on ARM - change some vars to 'signed char' or 'int'

Unfortunately GCC isn't very good at warning for this, so I've probably
missed some.  Also fix a couple of uses of asm("int 3").

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix vSockets stats on Linux.
VMware, Inc [Mon, 21 May 2012 22:28:03 +0000 (15:28 -0700)] 
Fix vSockets stats on Linux.

Unfortuntely these have been broken since we switched over to
the QPair interface.  The stats are handy, so let's fix them.
Also keep track of total bytes consumed/produced.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoAdd DEBUGBREAK() macro for ARM.
VMware, Inc [Mon, 21 May 2012 22:27:58 +0000 (15:27 -0700)] 
Add DEBUGBREAK() macro for ARM.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoCleanup and rearchitecture of HGFS server change notification part II
VMware, Inc [Mon, 21 May 2012 22:27:54 +0000 (15:27 -0700)] 
Cleanup and rearchitecture of HGFS server change notification part II

Server APIs for the file system change events renaming and
type renamed.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix arm-7 version of Atomic_FetchAndAddUnfenced().
VMware, Inc [Mon, 21 May 2012 22:27:48 +0000 (15:27 -0700)] 
Fix arm-7 version of Atomic_FetchAndAddUnfenced().

It was overwriting the amount to add with the result, which goes
horribly wrong if the strex fails and the operation is retried.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoUpdate iOS sdk to 5.1 from 4.3 for mobilelibs.
VMware, Inc [Mon, 21 May 2012 22:27:39 +0000 (15:27 -0700)] 
Update iOS sdk to 5.1 from 4.3 for mobilelibs.

Change the compiler to apple llvm 3.1(clang) from gcc. This patch mainly
worked on three things.  Related Makefiles of mobilelibs target are
modified.  Because clang requires explicity of the returen value from
the MACRO, I changed the ThreadUtils.c to return the value.  Add the
preprocess MACRO to separate the header files for IA-32 from non-IA-32
in atomic.c . Add the implementation of RoundupPow2Asm32 for ARM (none
thumb) in vm_basic_asm.h .

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agovmtoolsd: Log plugins' failed signal connection attempts.
VMware, Inc [Mon, 21 May 2012 22:27:34 +0000 (15:27 -0700)] 
vmtoolsd: Log plugins' failed signal connection attempts.

This change doesn't fix anything.  It only adds context for debugging.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoIntroduce SOCK_SEQPACKET to vSockets.
VMware, Inc [Mon, 21 May 2012 22:27:30 +0000 (15:27 -0700)] 
Introduce SOCK_SEQPACKET to vSockets.

Finally, the mythical sequential packet socket type appears.  This socket
type is specifically for guestRPC, over which Tools can communicate with
the VMX.  It is *not* a general sequential socket type: while you can
certainly make these sockets on the host, they won't be able to connect
anywhere, and you can't open such sockets inside the VMX, you can only
receive connections from the guest.

It works by using DGRAMs underneath.  vSocket DGRAMs are bit-compatible
with VMCI DGRAMs, so we can get from vSockets in the guest directly to the
VMX, without having to go through the host vSockets driver.

To make it connected and reliable, we introduce a very simple protocol
using a new packet format.  It consists only of CONNECT, DATA, SHUTDOWN and
CLOSE (the latter two being mostly the same as far as the VMX is
concerned).  Datagrams going to the VMX are already reliable.  In the
other direction, if we fail to receive, we send a CLOSE down with an error
(unlike the STREAM protocol, I actually remembered to embed an error code
this time).  For DATA packets, we place payload after the packet header.
We have to copy in from user-mode anyway, so it doesn't add any copy
overhead.

This is part 1, which is the Linux guest side.  It adds a new socket type
to our family and implements the appropriate socket functions (things like
accept() and so forth are just unecessary).

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoCleanup and rearchitecture of HGFS server change notification part I
VMware, Inc [Mon, 21 May 2012 22:27:23 +0000 (15:27 -0700)] 
Cleanup and rearchitecture of HGFS server change notification part I

Server callback for receiving file system change events renaming and
type renamed.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agovmblock, HGFS: allow compiling on kernels 3.4+
VMware, Inc [Mon, 21 May 2012 22:27:15 +0000 (15:27 -0700)] 
vmblock, HGFS: allow compiling on kernels 3.4+

Commit 32991ab305ace7017c62f8eecbe5eb36dc32e13b removed d_alloc_root()
(it was replaced by d_make_root), adjust our code to call the new
function and provide the replacement on older kernels.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 21 May 2012 22:26:50 +0000 (15:26 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix HGFS build
VMware, Inc [Mon, 21 May 2012 22:26:42 +0000 (15:26 -0700)] 
Fix HGFS build

For some reason gcc options for hgfs are not happy with typecast
of 'const void *' to 'volatile void *'.  I have no idea why, as I
thought that that is what casts are for, but for now let's do not
typecast that thing.  That should keep HGFS happy.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agohostinfoPosix.c: remove reference to sys/timeb.h
VMware, Inc [Mon, 21 May 2012 22:26:37 +0000 (15:26 -0700)] 
hostinfoPosix.c: remove reference to sys/timeb.h

sys/timeb.h is deprecated in FreeBSD9.0 and may cause compilation
warnings turning into breakages when building Open VM Tools.
Luckily we are not using ftime() that this header declares, so
we can simply get rid of it.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoIntroduce {Set,Clear,Complement,Test}BitVector functions
VMware, Inc [Mon, 21 May 2012 22:26:33 +0000 (15:26 -0700)] 
Introduce {Set,Clear,Complement,Test}BitVector functions

There are functions which operate on 32bit and 64bit variables, but
their inline assembly is not suitable for bigger arrays without forcing
variable they operate on always to memory, which is not desirable.
Existing functions also do not report previous value of the bit.

So let's roll out versions that can operate on bit arrays.  As all I
need is 256 bits, I've implemented only version with 32bit index.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agovPageChannel: Failed to allocate packet (channel=ffff880013fda380) (size=69600)
VMware, Inc [Mon, 21 May 2012 22:26:28 +0000 (15:26 -0700)] 
vPageChannel: Failed to allocate packet (channel=ffff880013fda380) (size=69600)

We're trying to perform really large atomic allocations, for example
when allocating a packet to send receive buffers down to the host.  Such
allocations can be hard to fulfil when the kernel cannot block.  So make
the chunks even smaller when we're in an atomic context.

One potential downside to this is that we will signal a lot, i.e., we're
going to signal 16x more for page-sized than for DGRAM-sized packets.  We
fix this by writing out all of the packets and then only signalling
afterwards.  The peer is okay with this: it may peek a packet header but
then not see sufficient data in the QP to be able to read the rest, so it
will bail out, leaving the packet for when all the sends are complete and
it gets signalled.

The other, and more proper, way to fix this is to change the interface so
that packets are iovecs of page-sized chunks.  That's a somewhat more complex
change that we aim to do for v2 anyway (actually we'll have packet lists,
and each packet in the list will be split into page-sized chunks, and each
chunk will hold actual PPNs).

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix a missing break in MXUser_ControlExclLock.
VMware, Inc [Mon, 21 May 2012 22:25:07 +0000 (15:25 -0700)] 
Fix a missing break in MXUser_ControlExclLock.

MXUser_ControlExclLock(lock, MXUSER_CONTROL_ENABLE_STATS, ...) would always
return FALSE due to a missing break... it'd always fall through to the
default case.  No-one seems to care about the return value of the function
so far...

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix vSphere client/vim-cmd not showing IPv6 addresses
VMware, Inc [Mon, 21 May 2012 22:25:04 +0000 (15:25 -0700)] 
Fix vSphere client/vim-cmd not showing IPv6 addresses

The nicInfo structure was not getting populated because the
RecordRoutingInfo function was failing as IPV4 wasnt configured on the
VM (even though IPV6 addresses were configured).

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 21 May 2012 22:24:59 +0000 (15:24 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoAdd support for promoted AVX2 instructions
VMware, Inc [Mon, 21 May 2012 22:24:19 +0000 (15:24 -0700)] 
Add support for promoted AVX2 instructions

This changeset adds support for AVX instructions promoted to enable
use of the full 256bits of the ymm regs by the AVX2 feature set. This
changeset does not introduce any new instructions or encodings. It
just honors the VEX prefix 'L' bit used to indicate the width of the
source and destination operands. Previously, these instructions
would result in a #UD fault under AVX if VEX.L==1.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoDescriptorWrite: revert to in-place write on NFS
VMware, Inc [Mon, 21 May 2012 22:24:09 +0000 (15:24 -0700)] 
DescriptorWrite: revert to in-place write on NFS

The ESX NFSv3 client can't handle rename. So we need to switch back to
the write-the-descriptor codepath on NFS on ESX.

Note that even though we don't use the result of the AtomicTempFile
creation, failures to create/write the AtomicTempFile are still
treated as fatal (see descriptor.c: errorWriteDirect
HostType_OSIsVMK); while there are a few scenarios where we might
be able to continue despite them, the storage is fatally sick
and we should error early rather than limp along.  Furthermore,
special casing these failure paths requires significant additional
code (and therefore development work and risk) with no benefit.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoAdd NULL checks before accessing logger attribute.
VMware, Inc [Mon, 21 May 2012 22:24:04 +0000 (15:24 -0700)] 
Add NULL checks before accessing logger attribute.

When we login into a VM, a new VMware Tools process starts with the
logged in User account.  If the logged in user is the least prviliged
user (guest account in Windows 8), then the process may not be able to
create a logger handler. GlibUtils_Create*Logger() functions may return
NULL.  In such case, accessing the logger handler may result in a crash.

Modified the code to add proper NULL checks everywhere before
accessing the logger handler.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix obj build compile error
VMware, Inc [Mon, 21 May 2012 22:23:53 +0000 (15:23 -0700)] 
Fix obj build compile error

change ~0 to (ULONG)~0

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoBump up the tools version for Fusion 4.1.2
VMware, Inc [Mon, 21 May 2012 22:23:49 +0000 (15:23 -0700)] 
Bump up the tools version for Fusion 4.1.2

Added code to bump up the tools version for Fusion 4.1.2.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 21 May 2012 22:23:44 +0000 (15:23 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoInternal branch sync. Included in this change:
VMware, Inc [Mon, 21 May 2012 22:23:35 +0000 (15:23 -0700)] 
Internal branch sync. Included in this change:

. another fix for File_PathJoin

. remove the utf::string _variant_t/uvariant_t constructors

. changes in shared code that don't affect open-vm-tools functionality

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoAdd support for processor groups to Windows vmmon
VMware, Inc [Mon, 21 May 2012 22:23:16 +0000 (15:23 -0700)] 
Add support for processor groups to Windows vmmon

Many OS APIs represent processors using a uintptr_t bitfield.
Processor groups were added in Win7/W2K8R2 to get beyond the limit
of 64-bit processors on x64.  Currently at most 4 groups, or 256
processors, are supported.  This happens to match the current
max pcpus define.

This change utilizes the Win7 WDK and procgrp.h, which uses
some #defines and thunking to use the native newer APIs on
Win7-and-later, while emulating the behavior on older OSes using
older existing APIs.

By default a process is limited to one processor group.  Certain
operations, e.g., get/set TSCs will only be performed across the
processor group that the vmx process is running on.

HostIF_CallOnEachCPU() will eventually need to be modified to run
across all processor groups rather than the current processor group.
The vmx still needs to be modified to do a more elaborate determination
of the # of processors because the standard OS APIs only return the
vmx passing down a buffer that's too small for IOCTL_VMX86_GET_ALL_MSRS.
This function is also used as part of Task_Terminate()'s call to
TaskIsVMXDisabledOnAllCPUs(), and the call to Vmx86_EnableHV that's
triggered by IOCTL_VMX86_ENABLE_HV.

I also removed some logs that spew too much when running a VM
with a kernel debugger attached.

bcdedit.exe /set groupaware on

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoInternal branch sync. Included in this change:
VMware, Inc [Mon, 21 May 2012 22:23:08 +0000 (15:23 -0700)] 
Internal branch sync. Included in this change:

. return a new error if the 'mount' command fails.

. changes in shared code that don't affect open-vm-tools functionality

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoMake the first of a few changes to accomodate Haswell.
VMware, Inc [Mon, 21 May 2012 22:22:54 +0000 (15:22 -0700)] 
Make the first of a few changes to accomodate Haswell.

The new Haswell CPU seems to behave like the other newish Intel
architectures, so in the main the changes needed are simple. I've added
the  macros to allow for detection for the model family and
architecture. The interpreter changes are to make the interpreted
results consistent with native execution. I also added Haswell to the
list of architectures supported by vpmc. The test changes are the
counterpoint to the monitor changes.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix VThreadBaseNativeIsAlive
VMware, Inc [Mon, 21 May 2012 22:22:45 +0000 (15:22 -0700)] 
Fix VThreadBaseNativeIsAlive

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoresolutionSet: Correct a use-after-free bug
VMware, Inc [Mon, 21 May 2012 22:22:39 +0000 (15:22 -0700)] 
resolutionSet: Correct a use-after-free bug

Customer opened a thread in the Workstation forums noting he had trouble
entering Unity.¹  After some back and forth, even after seeing that
XRRSetScreenConfig claimed success,² this function would return failure.

Here's why:

XRRScreenConfiguration *xrrConfig = XRRGetScreenInfo(...);
XRRScreenSize *xrrSizes = XRRConfigSizes(xrrConfig, ...);
/* xrrSizes simply points to a member of xrrConfig. */

...

XRRFreeScreenConfigInfo(xrrConfig);
return xrrSizes[i].width == width && xrrSizes[i].height == height;

After the call to XRRFreeScreenConfigInfo, xrrSizes is no longer valid.
Whether SelectResolution succeeds is ultimately a matter of luck w/r/t
underlying implementation details.  (“Does XFree() alter the contents
of freed memory?”)

1.  http://communities.vmware.com/thread/397056
2.  We threw away XRRSetScreenConfig's return value.  While this change
doesn't alter logic to depend on this value, it's still at least worth
logging.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoAdd support for BMI1/ABM instructions on Intel.
VMware, Inc [Mon, 21 May 2012 22:22:23 +0000 (15:22 -0700)] 
Add support for BMI1/ABM instructions on Intel.

This group of instructions is already supported on AMD in
previous HW versions. Extend support to Intel starting with HWv10.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoEXTERN: remive archaic definition
VMware, Inc [Mon, 21 May 2012 22:22:02 +0000 (15:22 -0700)] 
EXTERN: remive archaic definition

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 21 May 2012 22:21:59 +0000 (15:21 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoAudit and remove VMX86_WGS
VMware, Inc [Mon, 21 May 2012 22:21:49 +0000 (15:21 -0700)] 
Audit and remove VMX86_WGS

wgs/gsx/server (non-esx) code still lives within its older still active
siblings. I located as much as possible and removed its dependencies and
tried to make appropriate changes related to the code being removed.
This change had the potential to remove a lot of other old products and
tools, but I resisted that temptation (console, mui, ccagent to name a
few). For the most part it was a standard removal.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoInternal branch sync. Included in this change:
VMware, Inc [Mon, 21 May 2012 22:21:36 +0000 (15:21 -0700)] 
Internal branch sync. Included in this change:

. VMCI: increase pinned QP limit to support larger vPageChannel

. VMCI: Doxygen vPageChannel API

. VMCI: fix leaking shm pages in vPageChannel Destroy()

. fix foundry code to use the higher order bits of VixError correcly

. turn on VGAuth code in VIX

. changes in shared code that don't affect open-vm-tools functionality

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoGOSTable: MS Hyper-V Server
VMware, Inc [Mon, 21 May 2012 22:21:19 +0000 (15:21 -0700)] 
GOSTable: MS Hyper-V Server

Formally recognize MS Hyper-V Server in the GOS Table, UI and VMX.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoGOS: bit shaving
VMware, Inc [Mon, 21 May 2012 22:21:13 +0000 (15:21 -0700)] 
GOS: bit shaving

As things stand we can only have 64 unique types of guests for
hosted products. We used them all up and need to add more guest OSen.
Collapse some less important explicit GOS OSen bits together, adjusting
any visible strings accordingly.

We have legal agreements with certain parties that require us to
show an explicit recognition of their product (e.g. RH) so some
things cannot be done away altogether... but we can bit on parties
not likely to complain.

Since the monitor doesn't need to know about differences, collapse
Solaris 6 and 7 together, RHEL 6 and 7 together and SCO OpenServer
5 and 6 together.

Total savings 4 bits (50 cents!). More than enough to add the one
critical addition and leave room for growth in shipping product
until we can implement a system that does away with the 64 guest
OSen limitation.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoGOS: is it an enum or not
VMware, Inc [Mon, 21 May 2012 22:21:05 +0000 (15:21 -0700)] 
GOS: is it an enum or not

Some time ago the GOS table ID values were changed from defines to
an enum however the "enumity" of the values was not fully plumbed
through the source base. Fix this so we get all of the type checking
and visual goodness.

Did a little bit of grouping/rearranging to the guest ID list to make
it clear that the order can be changed (it's for internal use only).
This will make it more obvious how many of each OS we have and make
searching for things that can be compacted easier.

This is the first of a series of changes to create some room for
more guest OSen - we're limited to 64 as things stand (and they
are all used).

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoBump up the Tools version for Hosted12 Techpreview 2.
VMware, Inc [Mon, 21 May 2012 22:20:56 +0000 (15:20 -0700)] 
Bump up the Tools version for Hosted12 Techpreview 2.

Added proper macros to bump up the tools version on hosted12 branch
for TP2.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoVMCI: Set source context ID for DGRAMs destined for VMX
VMware, Inc [Mon, 21 May 2012 22:20:53 +0000 (15:20 -0700)] 
VMCI: Set source context ID for DGRAMs destined for VMX

In the routing code, we overwrite the ANY source context for DGRAMs
destined for the host so that the destination knows who sent it.  We should
do the same for DGRAMs destined for the VMX, so that guestRPC knows who
to reply to.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agolib/lock: clarify reference count and lock count
VMware, Inc [Mon, 21 May 2012 22:20:45 +0000 (15:20 -0700)] 
lib/lock: clarify reference count and lock count

We've got reference counting on locks which is different than
the lock count (recursive depth). Disambiguate the names.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoInternal branch sync. Included in this change:
VMware, Inc [Mon, 21 May 2012 22:20:37 +0000 (15:20 -0700)] 
Internal branch sync. Included in this change:

. remove VMCF transport from DnD

. changes in shared code that don't affect open-vm-tools
functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix vmxnet_load_multicast() function
VMware, Inc [Mon, 21 May 2012 22:20:07 +0000 (15:20 -0700)] 
Fix vmxnet_load_multicast() function

In kernels version greater than 2.6.34 the vmxnet_load_multicast
function used to return the entries to compute the LADRF used to return
0 always. Due to the above reason the IPV6 wasnt working after VMware
Tools installation with upgraded kernel. Modified the function to return
the correct value.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoBump up the tools version.
VMware, Inc [Mon, 21 May 2012 22:20:02 +0000 (15:20 -0700)] 
Bump up the tools version.

Add proper #defines to bump the version of tools for next milestone.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix File_PathJoin ASSERTs some more
VMware, Inc [Mon, 21 May 2012 22:19:56 +0000 (15:19 -0700)] 
Fix File_PathJoin ASSERTs some more

I think that File_PathJoin's ASSERTs were a bit too aggressive.  I
believe that the intention was to disallow UNC paths for the tail
portion of the path, not to disallow all paths that start with a
directory separator. (Allowing a leading directory separator on Linux
but not on Windows seems a bit dangerous anyway.)

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoAdd support for BMI2 instructions.
VMware, Inc [Mon, 21 May 2012 22:19:50 +0000 (15:19 -0700)] 
Add support for BMI2 instructions.

The upcoming Haswell CPU adds 8 new instructions advertised via
a new BMI2 bit from the cpuid instruction. This change set adds the
definitions for 6 of the 8 that can be methodically added to the
existing decoder tables. The remaining 2 instructions require a
bit of custom code and will appear upcoming reviews.
Instruction definitions taken from:
"Intel Architecture Instruction Set Extensions Programming Reference"
February 2012.
New instructions: BZHI,PDEP,PEXT,SARX,SHLX,SHRX

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoDoxygen vmci_sockets.h
VMware, Inc [Mon, 21 May 2012 22:19:35 +0000 (15:19 -0700)] 
Doxygen vmci_sockets.h

This change adds API documentation for vmci_sockets.h using Doxygen.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoIntroduce VMCI firewall in device backend
VMware, Inc [Mon, 21 May 2012 22:19:20 +0000 (15:19 -0700)] 
Introduce VMCI firewall in device backend

This change implements the VMCI device backend part of the
VMCI firewall.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Mon, 21 May 2012 22:19:08 +0000 (15:19 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoUpdating open-vm-tools version for release 2012.03.13-651368. 2012.03.13-651368
VMware, Inc [Wed, 14 Mar 2012 18:34:54 +0000 (11:34 -0700)] 
Updating open-vm-tools version for release 2012.03.13-651368.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoUSB Arbitrator: split version into vm_usbarb_version.h
VMware, Inc [Wed, 14 Mar 2012 18:00:05 +0000 (11:00 -0700)] 
USB Arbitrator: split version into vm_usbarb_version.h

I swear that half of changes in open-vm-tools repositoty
are due to arbitrator version updates recorded in vm_version.h.
Let's split it out into vm_usbarb_version.h that we do not need
to ship to make my job easier.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Wed, 14 Mar 2012 17:59:57 +0000 (10:59 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoMake VMCI Socket protocol header definition public
VMware, Inc [Tue, 13 Mar 2012 20:15:35 +0000 (13:15 -0700)] 
Make VMCI Socket protocol header definition public

The upcoming VMCI firewall feature needs to understand the
protocol format used by control packets for VMCI sockets. This
change moves the definition to a new file in the bora/public
for easier consumption by the VMCI module.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoIternal branch sync. Included in this change:
VMware, Inc [Tue, 13 Mar 2012 20:15:29 +0000 (13:15 -0700)] 
Iternal branch sync. Included in this change:

. updates to German and Japanese translations

. make File_GetVMFSAttributes public.

. small cleanup in lib/file.

. VMCI: fix "scheduling while atomic" in VPageChannelAcquireSendLock.

. changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix vmxnet driver compilation for kernel 3.3
VMware, Inc [Tue, 13 Mar 2012 20:15:15 +0000 (13:15 -0700)] 
Fix vmxnet driver compilation for kernel 3.3

Some ethtool callbacks were deprecated, remove them.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agolib/log: fix typo in comment
VMware, Inc [Tue, 13 Mar 2012 20:15:04 +0000 (13:15 -0700)] 
lib/log: fix typo in comment

lib not log

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Tue, 13 Mar 2012 20:14:20 +0000 (13:14 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoInternal branch sync. Included in this change:
VMware, Inc [Tue, 13 Mar 2012 20:14:15 +0000 (13:14 -0700)] 
Internal branch sync. Included in this change:

. VMCI: fix for locking scheme.

. updates to Chinese/German/Japanese/Korean translations.

. changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoVMXNET(3): allow building on Solaris 11
VMware, Inc [Tue, 13 Mar 2012 20:13:53 +0000 (13:13 -0700)] 
VMXNET(3): allow building on Solaris 11

This CS does NOT fix all of the problems with a Solaris 11 Tools install, though
the drivers do load and the install and uninstall complete.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Tue, 13 Mar 2012 20:13:47 +0000 (13:13 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoIntroducing new XML tag <cmd>...</cmd> for command name in ListProcessesInGuest.
VMware, Inc [Tue, 13 Mar 2012 20:13:23 +0000 (13:13 -0700)] 
Introducing new XML tag <cmd>...</cmd> for command name in ListProcessesInGuest.

This is to relieve VIX Client code from having to parse OS specific
command names from the full command line, except for Windows, which
has been left as it is. Without this fix, current implementation on
Mac, Linux, Solaris and FreeBSD are broken whenever we have folders
or executable file names with blanks spaces in them.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix compile issues in hostinfoPosix on iOS
VMware, Inc [Tue, 13 Mar 2012 20:13:14 +0000 (13:13 -0700)] 
Fix compile issues in hostinfoPosix on iOS

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoAdd an option to disable the Windows8 DPC watchdog
VMware, Inc [Tue, 13 Mar 2012 20:12:31 +0000 (13:12 -0700)] 
Add an option to disable the Windows8 DPC watchdog

This change adds an option to set the hypervisor CPUID bits that tells
Windows to disable Watchdog timers.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoIntroduce FileIO_AtomicTempPath()
VMware, Inc [Tue, 13 Mar 2012 20:12:14 +0000 (13:12 -0700)] 
Introduce FileIO_AtomicTempPath()

This new function returns a temp path name in the same directory
as the argument path.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoIntroduce VMW_CLAMP macro
VMware, Inc [Tue, 13 Mar 2012 20:12:01 +0000 (13:12 -0700)] 
Introduce VMW_CLAMP macro

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoImproper ASSERTs in vmx cpuid handling
VMware, Inc [Tue, 13 Mar 2012 20:11:53 +0000 (13:11 -0700)] 
Improper ASSERTs in vmx cpuid handling

2 ASSERTs can trigger due to input values from the guest cpuid call. The
first one happens if the input level falls within the valid low range
level, but hits a hole where no level exists. The second ASSERT triggers
if the ecx value is out of range for the TOPOLOGY level on Intel.  The
fix is to handle the values at runtime and not assert.  Also fix a
couple of line wraps.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoGOS table: add darwin12
VMware, Inc [Tue, 13 Mar 2012 20:11:46 +0000 (13:11 -0700)] 
GOS table: add darwin12

We don't know of any reason why darwin12 will require support
different than darwin11 so for now, implement it as an alias

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoClean up one of the GOS tables.
VMware, Inc [Tue, 13 Mar 2012 20:11:41 +0000 (13:11 -0700)] 
Clean up one of the GOS tables.

Make things easier to read and maintain. Basically, line things up.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Tue, 13 Mar 2012 20:11:35 +0000 (13:11 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix HGFS, pvscsi, vmxnet3, vmci, and vmnet build problems on 3.3 kernel
VMware, Inc [Tue, 13 Mar 2012 20:11:30 +0000 (13:11 -0700)] 
Fix HGFS, pvscsi, vmxnet3, vmci, and vmnet build problems on 3.3 kernel

hgfs: Mode argument is now umode_t, rather than int.

vmxnet3: Features are netdev_features_t, rather than uint32 (and
they are uint64 now).

vmci, pvscsi: Bool module option is bool, not int.

vmnet: Missing compat_module.h include.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoMac OS: stop depending on zprint
VMware, Inc [Tue, 13 Mar 2012 20:11:24 +0000 (13:11 -0700)] 
Mac OS: stop depending on zprint

Since Mac OS version 10.7, the proper way to retrieve kernel zone
information is to call mach_zone_info().

The modified code is used by Fusion and the Mac OS Tools, so we have
to be extra careful and check:

o At run-time for the availability of mach_zone_info(), and in case
  it is not available, fallback on the existing zprint mechanism.

o At compile time for the availability of various mach_zone_*_t types,
  and in case they are not defined, define them.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agolib/file: trivial cleanup
VMware, Inc [Tue, 13 Mar 2012 20:11:12 +0000 (13:11 -0700)] 
lib/file: trivial cleanup

Simplify formatting strings for paths.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix callback in vmcilib
VMware, Inc [Tue, 13 Mar 2012 20:11:07 +0000 (13:11 -0700)] 
Fix callback in vmcilib

There's a nasty bug where, if the detach callback gets invoked at the
same time that the client is releasing, we can end up executing after
the client has unloaded.  The problem is that the callback will wait on
the lock, and once Release() lets it go, the client is allowed to unload.
The lock, and the rest of the code for the callback, is then gone.

The fix is two-fold:

1. Use the system callback mechanism.  This utilizes callback objects
stored in the system object table.  The callback object is shared between
the publisher and the subscriber using a symbolic name.  This provides
a level of indirection between VMCI and vmcilib, i.e., they don't have
to rely on each other being around.

2. Introduce a new function, VMCI_Exit().  The client calls this function
when it unloads, at PASSIVE level, with no locks held, and this
unregisters from the callback.  So the new workflow for a client is as
follows:

VMCI_DeviceGet()
VMCI_DeviceRelease()
VMCI_DeviceGet()
VMCI_DeviceRelease()
...
VMCI_Exit()

The above changes require no modification to the VMCI/vmcilib IOCTLs and
so are backwards-compatible with shipping clients that do not use
callbacks (we haven't yet shipped any that do).

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoAllow compiling hgfs and dnd library code on Android
VMware, Inc [Tue, 13 Mar 2012 20:10:54 +0000 (13:10 -0700)] 
Allow compiling hgfs and dnd library code on Android

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agogosTable: Add RHEL7
VMware, Inc [Tue, 13 Mar 2012 20:10:48 +0000 (13:10 -0700)] 
gosTable: Add RHEL7

We'll need this soon so we need to have the framework in place now. The
UI presence can be tweeked later.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoChange File_CreateDirectoryHierarchy to enable "undo"
VMware, Inc [Tue, 13 Mar 2012 20:10:34 +0000 (13:10 -0700)] 
Change File_CreateDirectoryHierarchy to enable "undo"

When calling File_CreateDirectoryHierarchy, there was no way to know
what was actually created by the call and what wasn't. This meant that
trying to be a good neighbor and clean up after ourselves if whatever we
wanted the directory for failed (or was cancelled) wasn't possible.

This change adds an optional OUT parameter to that gets set to the
top-most directory which was actually created by the call. If the caller
then wants to clean up, they can pass that into
File_DeleteDirectoryTree.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix some inline assembly constraints
VMware, Inc [Tue, 13 Mar 2012 20:10:24 +0000 (13:10 -0700)] 
Fix some inline assembly constraints

The constant arguments to the "bt" family of instructions are limited
to [0,31] for 32-bit operations and [0,63] for 64-bit operations.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoBIOS handoff to the operating system with X2APIC enabled
VMware, Inc [Tue, 13 Mar 2012 20:10:20 +0000 (13:10 -0700)] 
BIOS handoff to the operating system with X2APIC enabled

The following change defines new backdoro command to be used by BIOS
to check if it needs to enable X2APIC before handing off to the OS.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoInternal branch sync. Included in this change:
VMware, Inc [Tue, 13 Mar 2012 20:10:16 +0000 (13:10 -0700)] 
Internal branch sync. Included in this change:

. FileIO_AtomicUpdate() should preserve errno value.

. More VGAuth changes

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix compilation of vmxnet(3) for FreeBSD9.0
VMware, Inc [Tue, 13 Mar 2012 20:09:56 +0000 (13:09 -0700)] 
Fix compilation of vmxnet(3) for FreeBSD9.0

if_timer and if_watchdog were depricated in FreeBSD9.0

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Tue, 13 Mar 2012 20:09:45 +0000 (13:09 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoNo need to lock twice before accessing VMCI context queue pair array.
VMware, Inc [Tue, 13 Mar 2012 20:09:39 +0000 (13:09 -0700)] 
No need to lock twice before accessing VMCI context queue pair array.

The VMCI context keeps track of queue pairs allocated by that
context in a handle array. This handle array is always
accessed while holding the general queue pair lock, so we do
not need to grab the context lock as well. In fact, the header
file already describes this. So drop grabbing the context lock
for queuePairArray.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoFix tools uninstall crash when stopping vmuser
VMware, Inc [Tue, 13 Mar 2012 20:09:34 +0000 (13:09 -0700)] 
Fix tools uninstall crash when stopping vmuser

During uninstall/upgrade, tools launches
vmtoolsd.exe -n vmusr --kill
to stop the existing user process. The new instance however
crashes before it could send the message, and therefore the
existing vmuser process remains.

The problem is uninstall doesn't wait for the process to
finish, and proceeds with the uninstall. This removes the
Tools registry entry which vmtoolsd.exe tries to read on
startup. It hits the assert and crashes the process.

The fix is in two places. We fixed vmtoolsd.exe so it doesn't
assert if the registry entry doesn't exist, and updated the
installer to launch and wait for the process to finish before
continue.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoAdjust some log messages.
VMware, Inc [Tue, 13 Mar 2012 20:09:28 +0000 (13:09 -0700)] 
Adjust some log messages.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoSnapshot's file absolute path must be respected
VMware, Inc [Tue, 13 Mar 2012 20:09:18 +0000 (13:09 -0700)] 
Snapshot's file absolute path must be respected

It is just wrong to take an absolute pathname, truncate it to a basename,
then do a path search on the basename to find the file. It seems incredible
that such a blunder has existed in a common routine since 2004.

Made path search semantics more sensible: only unadorned basename
is searched via path.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoBump the major version again...
VMware, Inc [Tue, 13 Mar 2012 20:09:08 +0000 (13:09 -0700)] 
Bump the major version again...

...cos we missed one release.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoChanges in shared code that don't affect open-vm-tools functionality.
VMware, Inc [Tue, 13 Mar 2012 20:09:01 +0000 (13:09 -0700)] 
Changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoWiden MainMem pagenums.
VMware, Inc [Tue, 13 Mar 2012 20:08:57 +0000 (13:08 -0700)] 
Widen MainMem pagenums.

This change widens the MainMem pagenums to 30 bits, in order to
support up to 4TB of vRAM. BPN_MAINMEM_TAG is bit 30 now. For
non-mainMem BPNs, the slot bits move into bits 23-29.

No monitor size change.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
14 years agoCheck for NULL before calling strcmp().
VMware, Inc [Tue, 13 Mar 2012 20:08:42 +0000 (13:08 -0700)] 
Check for NULL before calling strcmp().

In few code paths, we pass NULL value to the strcmp() functions which
may result in a crash. Modified the code to implement NULL checks
before calling strcmp() function.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>