]> xenbits.xensource.com Git - pvdrivers/win/xeniface.git/log
pvdrivers/win/xeniface.git
7 years agoAck "control/shutdown" as soon as possible.
Owen Smith [Thu, 22 Mar 2018 11:20:05 +0000 (11:20 +0000)]
Ack "control/shutdown" as soon as possible.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
7 years agoDo more optimization in release builds and add /Qspectre flag
Paul Durrant [Tue, 30 Jan 2018 10:15:00 +0000 (10:15 +0000)]
Do more optimization in release builds and add /Qspectre flag

Spectre mitigations apparently only work on optimized code.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
7 years agoAdd support for building with Visual Studio 2017
Paul Durrant [Tue, 30 Jan 2018 10:10:53 +0000 (10:10 +0000)]
Add support for building with Visual Studio 2017

Also remove mappings for obsolete versions of VS in build.py.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
7 years agoUpdate util.h
Paul Durrant [Thu, 25 Jan 2018 13:54:10 +0000 (13:54 +0000)]
Update util.h

XENIFACE does not use much of the functionality in util.h, including the
__AllocatePages() function modified by this change, however
it is good to keep the header in-sync with the other drivers.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
7 years agoSuppress warning (28159)
Owen Smith [Fri, 3 Nov 2017 17:40:53 +0000 (17:40 +0000)]
Suppress warning (28159)

Setting "control/shutdown" to "poweroff" or "reboot" is intended
to trigger a shutdown/reboot!

Signed-off-by: Owen Smith <owen.smith@citrix.com>
7 years agoAdd log message if Windows Update requires a reboot
Owen Smith [Fri, 3 Nov 2017 17:39:21 +0000 (17:39 +0000)]
Add log message if Windows Update requires a reboot

When Windows requires a reboot to install updates, the reboot and shutdown
operations can take a long time. The agent will have acknowledged the
request, but the operation may not complete in a suitable timeout period.
Add a log entry to help indicate an additional unknown amount of time
will be required for shutdown/reboot.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
7 years agoDon't allow user-supplied values to be used as a format specifier
Ben Chalmers [Tue, 19 Sep 2017 10:43:48 +0000 (11:43 +0100)]
Don't allow user-supplied values to be used as a format specifier

Signed-off-by: Ben Chalmers <ben.chalmers@citrix.com>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
7 years agoUpdate registry code
Paul Durrant [Thu, 3 Aug 2017 10:30:21 +0000 (11:30 +0100)]
Update registry code

Bring the code into like with the latest XENBUS code, which has a few
fixes that are missing here.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
7 years agoPrevent events getting lost, and remove xenstore polling
Ben Chalmers [Wed, 5 Jul 2017 08:48:24 +0000 (09:48 +0100)]
Prevent events getting lost, and remove xenstore polling

Auto-resetting events, on occasion, are getting lost.  This
can be avoided by ensuring events are manually reset.

As events are no longer lost, there is no longer a need to
poll shudown or suspend every minute

Also fix invocation of CreateEvent methods.

Signed-Off-By: Ben.Chalmers@citrix.com
7 years agoRemove VS2012 and VS2013 build scripts
Paul Durrant [Thu, 18 May 2017 14:18:59 +0000 (15:18 +0100)]
Remove VS2012 and VS2013 build scripts

This patch removes the scripts for building under VS2013 and VS2013 and
also fixes the package destination when building using VS2015.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoAdd a new CConvCreator object to handle laptop/slate mode switch
Paul Durrant [Wed, 29 Mar 2017 12:47:49 +0000 (13:47 +0100)]
Add a new CConvCreator object to handle laptop/slate mode switch

This patch adds a new object derived from IDeviceCreator to interact
with the laptop/slate mode switch interface provided by a Windows
driver that binds to the ACPI CONV device.

It also adds code to support the documented PV interface for triggering
laptop/slate mode switch [1].

http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=3bdb1400

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoOnly add device if the guid matches
Paul Durrant [Wed, 29 Mar 2017 14:48:35 +0000 (15:48 +0100)]
Only add device if the guid matches

The IDeviceCreator::OnDeviceAdded() method should only be called for
devices matching the GUID specified to the CDeviceList object creator.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoSplit xeniface specific parts out of CXenAgent into CXenIfaceCreator
Paul Durrant [Wed, 29 Mar 2017 12:48:31 +0000 (13:48 +0100)]
Split xeniface specific parts out of CXenAgent into CXenIfaceCreator

In preparation for supporting more than one device interface, the
one-to-one correspondence between the IDeviceCreator interface and the
CXenAgent object needs to be broken.

This patch separates all code that interacts with the CXenIfaceDevice
object (as well as the CDevice and CDeviceList instances for the xeniface
interface) into a new CXenIfaceCreator object.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoAvoid repeatedly acting as if returning from suspend
Ben Chalmers [Wed, 29 Mar 2017 14:01:20 +0000 (15:01 +0100)]
Avoid repeatedly acting as if returning from suspend

Setting m_count to equal count means we will fall out of CheckSuspend
early, if initiated by a timeout when a new suspend has not occurred.

Signed-off-by : <Ben Chalmers> ben.chalmers@citrix.com

8 years agoFix SDV build
Paul Durrant [Fri, 6 Jan 2017 16:49:42 +0000 (16:49 +0000)]
Fix SDV build

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoFix memory leak in __FreePage()
Paul Durrant [Fri, 6 Jan 2017 15:52:26 +0000 (15:52 +0000)]
Fix memory leak in __FreePage()

The pool memory for the MDL also needs to be freed.

Also, generalise __AllocatePage() and __FreePage() to __AllocatePages()
and __FreePages() to allow for multi-page allocations in future.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoUpdate BUILD.md with VS2015/WDK10 information
Paul Durrant [Wed, 14 Dec 2016 16:27:50 +0000 (16:27 +0000)]
Update BUILD.md with VS2015/WDK10 information

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoFixes for VS2015/WDK10 build
Paul Durrant [Wed, 14 Dec 2016 16:19:07 +0000 (16:19 +0000)]
Fixes for VS2015/WDK10 build

The package build was not working correctly and caused the overall build
to fail.
At least part of the reason for this is that Microsoft, in their infinite
wisdom, have removed the DIFx redist from WDK10. This patch makes use of
a new environment variable 'DPINST_REDIST' to find the copy of dpinst.exe
to package such that this can be pointed at an older WDK or alternative
location where dpinst.exe can be found.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoAdd support for building under VS2015/WDK10
Paul Durrant [Tue, 13 Dec 2016 16:39:10 +0000 (16:39 +0000)]
Add support for building under VS2015/WDK10

Moving to the new toolchain also threw up a few new warnings, which this
patch either fixes or squashes. Also, SDV appears to be fragile in new
ways (and whinge about some new things) so there are fixes for that too.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoUpdate driver version from 8.2.0 to 9.0.0
Paul Durrant [Tue, 13 Dec 2016 15:16:05 +0000 (15:16 +0000)]
Update driver version from 8.2.0 to 9.0.0

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoLog some more information at build time
Paul Durrant [Tue, 13 Dec 2016 15:07:52 +0000 (15:07 +0000)]
Log some more information at build time

The OBJECT_PREFIX and REG_KEY_NAME were not being logged by build.py.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoReduce severity of some debug messages 8.2.0 8.2.0-rc1
Owen Smith [Tue, 22 Nov 2016 14:58:37 +0000 (14:58 +0000)]
Reduce severity of some debug messages

Error and Warning were used for Info level messages

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoRemove XenIfaceDebugPrint
Owen Smith [Tue, 22 Nov 2016 14:52:03 +0000 (14:52 +0000)]
Remove XenIfaceDebugPrint

Replace "XenIfaceDebugPrint(TRACE," with "Trace("
Replace "XenIfaceDebugPrint(INFO," with "Info("
Replace "XenIfaceDebugPrint(WARNING," with "Warning("
Replace "XenIfaceDebugPrint(ERROR," with "Error("

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoDon't call DbgPrint (or variants) from an event channel callback
Paul Durrant [Fri, 11 Nov 2016 14:58:25 +0000 (14:58 +0000)]
Don't call DbgPrint (or variants) from an event channel callback

Windows debug primitives will IPI so it's not a good idea to use them
from within an interrupt handler which may get called at HIGH_LEVEL.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoStop using FAST_MUTEX
Paul Durrant [Wed, 9 Nov 2016 12:29:56 +0000 (12:29 +0000)]
Stop using FAST_MUTEX

There are several build warnings because of functions that must be called
at PASSIVE_LEVEL being called at APC_LEVEL. This is because acquiring a
FAST_MUTEX raises IRQL to APC_LEVEL which is an annoying semantic that
basically renders them useless.

This patch replaces occurences of FAST_MUTEX with XENIFACE_MUTEX acquisition
of which does not modify IRQL.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoEnsure session stays locked...
Ben Chalmers [Wed, 9 Nov 2016 11:58:18 +0000 (11:58 +0000)]
Ensure session stays locked...

...until the reference to WatchThread is stored in it.

This prevents us trying to dispose of an uniintialised WatchThread
if a session is removed (by the driver being removed) while the
session is still being created

Signed-off-by: Ben Chalmers <ben.chalmers@citrix.com>
8 years agoTry to make sure the agent always always handles shutdown events
Paul Durrant [Wed, 9 Nov 2016 11:37:13 +0000 (11:37 +0000)]
Try to make sure the agent always always handles shutdown events

It seems that on Server 2008 the agent does not reliably wake up on
shutdown watch events. This does not seem to occur on any other OS so
it is likely that this is a bug in Server 2008.

To work around the problem this patch nodifies the agent wake up once a
minute and check for a shutdown event (or a suspend event, for
completeness) and act accordingly.

Also this patch squashes the uninteresting error messages that occur
when an attempt is made to read a non-existent xenstore key.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoIndirect user space watch events through a thread
Paul Durrant [Tue, 8 Nov 2016 18:08:11 +0000 (18:08 +0000)]
Indirect user space watch events through a thread

It is useful, for diagnostic purposes, to log the path of a user-space
registered watch when we are about to signal it. To do this create a
thread to handle each user-space watch.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoFix build warnings
Paul Durrant [Thu, 3 Nov 2016 10:48:37 +0000 (10:48 +0000)]
Fix build warnings

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoxenagent: use new Start/StopShutdownWatch() functions in resume from suspend
Paul Durrant [Mon, 1 Aug 2016 15:23:11 +0000 (16:23 +0100)]
xenagent: use new Start/StopShutdownWatch() functions in resume from suspend

The patch removes some code duplication by using the StopShutdownwatch()
and StartShutdownWatch() functions on resume from suspend rather than
duplicating their content.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoxenagent: remove icon
Paul Durrant [Mon, 1 Aug 2016 15:10:42 +0000 (16:10 +0100)]
xenagent: remove icon

This icon is used by Citrix XenServer. The Xen Project agent should not
be using it.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoxenagent: enable all warnings
Paul Durrant [Mon, 1 Aug 2016 14:49:41 +0000 (15:49 +0100)]
xenagent: enable all warnings

Instead of using warning level 3 (which misses quite a lot), enable all
build warnings and disable only selected warnings that we don't want.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoxenagent: re-register shutdown watch after resume from S4
Paul Durrant [Mon, 1 Aug 2016 14:24:53 +0000 (15:24 +0100)]
xenagent: re-register shutdown watch after resume from S4

When xenagent resumes in a VM that was put into S4 it needs to re-
register the watch on control/shutdown and re-advertise all
control/feature-XXX flags.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoxenagent: remove the service when the package is removed
Paul Durrant [Mon, 1 Aug 2016 08:37:18 +0000 (09:37 +0100)]
xenagent: remove the service when the package is removed

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Cc: Owen Smith <owen.smith@citrix.com>
8 years agoxenagent: get event logging working properly
Paul Durrant [Mon, 1 Aug 2016 08:29:59 +0000 (09:29 +0100)]
xenagent: get event logging working properly

The xenagent build does not create the necessary DLL for event logging. This
patch re-works the build vcxproj files to create the DLL and adds the
necessary code in package INF file to install it and configure it.

As part of the work the service display name has been changed to match the
module name.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Cc: Owen Smith <owen.smith@citrix.com>
8 years agoxenagent: use spec. compliant control/feature-XXX keys
Paul Durrant [Fri, 29 Jul 2016 14:22:37 +0000 (15:22 +0100)]
xenagent: use spec. compliant control/feature-XXX keys

control/feature-shutdown is not documented in Xen's xenstore-paths
documentation. The correct keys are feature-poweroff, feature-reboot,
feature-s3 and feature-s4. Also the values that the toolstack should
write control/shutdown are poweroff, reboot, s3 and s4 so the xenagent
should only respond to these values.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Cc: Owen Smith <owen.smith@citrix.com>
8 years agoMake sure trailing whitespace is trimmed from log messages
Paul Durrant [Wed, 27 Jul 2016 11:54:06 +0000 (12:54 +0100)]
Make sure trailing whitespace is trimmed from log messages

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoLog messages to dom0 log (if possible)
Owen Smith [Wed, 20 Jul 2016 12:02:13 +0000 (13:02 +0100)]
Log messages to dom0 log (if possible)

IoctlLog will strip any trailing newline and insert a single
newline to enforce log file consistancy

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoClean up watches, suspend handlers and events on D0->D3
Owen Smith [Wed, 20 Jul 2016 10:56:25 +0000 (11:56 +0100)]
Clean up watches, suspend handlers and events on D0->D3

* Call XenIfaceCleanup on D0->D3 transition
* Change XenIfaceCleanup to accept a NULL file object, which will
  clean up everything, regardless of file object

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoAdd the missing package name to the INF file
Paul Durrant [Thu, 21 Jul 2016 11:09:43 +0000 (12:09 +0100)]
Add the missing package name to the INF file

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoRecreate watch on resume from suspend
Owen Smith [Mon, 18 Jul 2016 11:47:45 +0000 (12:47 +0100)]
Recreate watch on resume from suspend

Watches are flagged as inactive on the resume from suspend,
and will only recieve the initial watch fire after a suspend.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoAn ioctl should fail on any invalid argument
Ben Chalmers [Thu, 7 Jul 2016 13:44:35 +0000 (14:44 +0100)]
An ioctl should fail on any invalid argument

Previously failures happened only if all arguments
were invalid, leading to bugchecks if both InLen
and OutLen were 0

Signed-off-by: Ben.Chalmers@citrix.com
8 years agoSet VM's time based on host's time exposed by Xen
Owen Smith [Wed, 29 Jun 2016 15:24:40 +0000 (16:24 +0100)]
Set VM's time based on host's time exposed by Xen

Sets the VM's time when XenIface starts and on resume from suspend.
Uses the underlying host's time, accessed via Xen. Provide an option
for the guest to treat Xen's time as UTC or the current timezone.
This option adds 2 new brandable variables that specify a partial
registry path and value in the VM that determines how the time offset
is modified. These values are REG_TOOLS_PATH and REG_UTC_NAME which
should be specified in the build environment if the values need to
be different.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
Changed REG_TOOLS_PATH to REG_KEY_NAME, which now defaults to 'Windows
PV Drivers' (that being the official XenProject sub-project name), and
use hard coded 'HostTime' key name instead of brandable REG_UTC_NAME.
If we have a brandable parent registry key, then we don't really need
to brand the value names under it.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoAdd Suspend and Shutdown handlers
Owen Smith [Tue, 28 Jun 2016 15:49:58 +0000 (16:49 +0100)]
Add Suspend and Shutdown handlers

Suspend needs to re-advertise the shutdown feature
Shutdown responds to control\shutdown to issue a shutdown, reboot,
hibernate or S3 transition.
Suitable event log entries are added when these events are triggered.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoTrack active device in service class
Owen Smith [Tue, 28 Jun 2016 12:18:53 +0000 (13:18 +0100)]
Track active device in service class

Hold a CriticalSection protected local pointer to the XenIfaceDevice
that is currently available. This will be used for all accesses to
the interfaces provided.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoAdd XenIfaceDevice
Owen Smith [Mon, 27 Jun 2016 16:35:44 +0000 (17:35 +0100)]
Add XenIfaceDevice

XenIfaceDevice is a CDevice subclass that abstracts the IOCTL
interface by managing the conversion to/from IOCTL inputs/outputs.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
Fix VS2013 build.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoAdd device list to track XenIface device(s)
Owen Smith [Mon, 27 Jun 2016 16:19:47 +0000 (17:19 +0100)]
Add device list to track XenIface device(s)

Uses RegisterDeviceNotificationA and SetupApi to track
GUID_INTERFACE_XENIFACE device(s). Calls service base class
after insertion and before remove complete.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
Fix VS2013 build.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoRemove LiteAgent, replace with boilerplate xenagent service
Owen Smith [Mon, 27 Jun 2016 14:55:21 +0000 (15:55 +0100)]
Remove LiteAgent, replace with boilerplate xenagent service

Remove the LiteAgent project and replace it with the xenagent
project. Xenagent is a boilerplate service that has no
functionality in this patch. Subsiquent patches will add
the required functionality.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
Fix VS2013 build.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoAdd Log IOCTL
Owen Smith [Mon, 27 Jun 2016 11:02:06 +0000 (12:02 +0100)]
Add Log IOCTL

Adds an IOCTL that sends a user defined message to Xen to log.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoAdd SharedInfo IOCTL interface
Owen Smith [Mon, 27 Jun 2016 10:24:44 +0000 (11:24 +0100)]
Add SharedInfo IOCTL interface

Adds
* GetTime - returns Xen wallclock time

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoAdd Suspend IOCTL interface
Owen Smith [Mon, 27 Jun 2016 09:52:15 +0000 (10:52 +0100)]
Add Suspend IOCTL interface

Adds
* GetCount - returns a value which changes over suspend
* Register - registers an event that is set on resume from suspend
* Deregister - deregisters a resume from suspend event

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoCall XenIfaceCleanup from IRP_MJ_CLEANUP
Owen Smith [Mon, 27 Jun 2016 09:40:24 +0000 (10:40 +0100)]
Call XenIfaceCleanup from IRP_MJ_CLEANUP

XenIfaceCleanup was not called which meant that some watches, event
channels and grant entries were not cleaned up on closing the device
handle and required explicit cleanup. Add a IRP handler to call
XenIfaceCleanup from the IRP_MJ_CLEANUP for a specific FileObject.
This ensures all watches, event channels and grant entries are
destroyed in the event of the caller crashing or not gracefullly
cleaning up objects.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoGet rid of InitSafeBootMode veto
Paul Durrant [Tue, 1 Mar 2016 17:26:18 +0000 (17:26 +0000)]
Get rid of InitSafeBootMode veto

This driver does nothing that clashes with any emulation so it's fine to
leave it emabled in safe mode.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoAvoid evaluating assertion expressions in free builds
Paul Durrant [Fri, 22 Jan 2016 17:11:13 +0000 (17:11 +0000)]
Avoid evaluating assertion expressions in free builds

The evaluations are pointless and the warnings generated by not evaluating
can be squashed with a couple of #pragmas.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoUse a DPC per XENIFACE_EVTCHN_CONTEXT for signalling to user space
Paul Durrant [Thu, 10 Dec 2015 12:38:28 +0000 (12:38 +0000)]
Use a DPC per XENIFACE_EVTCHN_CONTEXT for signalling to user space

The scheme of using a DPC per CPU will not work when multiple event channels
are in use since events may be lost when channels bound to the same CPU
are simultaneously pending. The problem is avoided by simply having
separate DPCs for each channel.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Cc: Rafal Wojdyla <omeg@invisiblethingslab.com>
9 years agoRe-synchronize registry.c with XENBUS
Paul Durrant [Thu, 10 Dec 2015 11:53:15 +0000 (11:53 +0000)]
Re-synchronize registry.c with XENBUS

The registry code in XENBUS has some fixes that are not present in the
XENIFACE copy, so import the updated code from XENBUS.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoRe-synchronize util.h with XENBUS and use __toupper()
Paul Durrant [Thu, 10 Dec 2015 11:38:54 +0000 (11:38 +0000)]
Re-synchronize util.h with XENBUS and use __toupper()

A recent patch introduced __tolower() and __toupper() into util.h as
replacements for tolower() and toupper() respectively as the latter do
a hidden conversion to Unicode which make then unsafe at any IRQL other
than PASSIVE_LEVEL.
This patch imports util.h from XENBUS and fixes other code to be compatible.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoFix ASSERT failure
Paul Durrant [Wed, 25 Nov 2015 14:27:34 +0000 (14:27 +0000)]
Fix ASSERT failure

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoPublish distribution information to xenstore
Paul Durrant [Wed, 25 Nov 2015 14:00:44 +0000 (14:00 +0000)]
Publish distribution information to xenstore

My recent patch series to Xen added a documented path and format for
publishing information about PV driver distributions to xenstore.

This patch adds code to populate the documented path (should it exist)
with information about the XENIFACE driver package.

Suggested-by: Owen Smith <owen.smith@citrix.com>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoSmall whitespace fix
Paul Durrant [Wed, 25 Nov 2015 10:34:14 +0000 (10:34 +0000)]
Small whitespace fix

There was a residual hard tab in driver.c

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoDont force a WMI event when reregistering a watch
Owen Smith [Tue, 17 Nov 2015 17:05:23 +0000 (17:05 +0000)]
Dont force a WMI event when reregistering a watch

When a watch is registered, the watch gets triggered. This will result
in a WMI event being fired. There is no need to manually fire a WMI
event in this case, as it can lead to the WMI event being discarded.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoEnsure defunct watches have NULL handles
Owen Smith [Thu, 29 Oct 2015 14:49:47 +0000 (14:49 +0000)]
Ensure defunct watches have NULL handles

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoFold __FdoD0ToD3/__FdoD3ToD0 into caller Remove redundant functions
Owen Smith [Thu, 29 Oct 2015 14:49:46 +0000 (14:49 +0000)]
Fold __FdoD0ToD3/__FdoD3ToD0 into caller Remove redundant functions

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoRework Wmi setup/cleanup to always Resume/Suspend sessions
Owen Smith [Thu, 29 Oct 2015 14:49:45 +0000 (14:49 +0000)]
Rework Wmi setup/cleanup to always Resume/Suspend sessions

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoRefactor Wmi header, split initialize/teardown and register/deregister
Owen Smith [Thu, 29 Oct 2015 14:49:44 +0000 (14:49 +0000)]
Refactor Wmi header, split initialize/teardown and register/deregister

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoRefactor WmiFireSuspendEvent
Owen Smith [Thu, 29 Oct 2015 14:49:43 +0000 (14:49 +0000)]
Refactor WmiFireSuspendEvent

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoCleanup fdo dispatch entry points
Owen Smith [Thu, 29 Oct 2015 14:49:42 +0000 (14:49 +0000)]
Cleanup fdo dispatch entry points

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoFix VS2013 build
Paul Durrant [Mon, 2 Nov 2015 14:21:26 +0000 (14:21 +0000)]
Fix VS2013 build

Commit 9498b68 only dealt with VS2012 builds and broke VS2013 build. This patch
restores parity.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoRemove calls to KeGetCurrentProcessorNumber()
Paul Durrant [Mon, 2 Nov 2015 14:19:34 +0000 (14:19 +0000)]
Remove calls to KeGetCurrentProcessorNumber()

This function is not valid for group aware drivers.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoDefine NT_PROCESSOR_GROUPS for VS2012 project
Owen Smith [Fri, 30 Oct 2015 17:39:23 +0000 (17:39 +0000)]
Define NT_PROCESSOR_GROUPS for VS2012 project

Previous patch missed the obvious compatability macros provided
and used by xenbus.
Also fixes a few badly formed ASSERTions

Signed-off-by: Owen Smith <owen.smith@citrix.com>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoBind to the latest XENBUS revision
Rafał Wojdyła [Wed, 21 Oct 2015 05:26:44 +0000 (07:26 +0200)]
Bind to the latest XENBUS revision

Revision 0x0800000B or later is needed for STORE interface version 2 and
GNTTAB interface version 2.

Signed-off-by: Rafal Wojdyla <omeg@invisiblethingslab.com>
9 years agoImplement new IOCTL handlers
Rafał Wojdyła [Wed, 21 Oct 2015 05:26:32 +0000 (07:26 +0200)]
Implement new IOCTL handlers

This patch implements new store, evtchn and gnttab IOCTLs.
Handlers are split into separate files for readability.

Signed-off-by: Rafal Wojdyla <omeg@invisiblethingslab.com>
9 years agoDefine new IOCTLs for user-mode clients
Rafał Wojdyła [Wed, 21 Oct 2015 05:26:19 +0000 (07:26 +0200)]
Define new IOCTLs for user-mode clients

IOCTL input is defined as XENIFACE_*_IN structs.
IOCTL output is defined as XENIFACE_*_OUT structs.

Signed-off-by: Rafal Wojdyla <omeg@invisiblethingslab.com>
9 years agoUntabify the whole XENIFACE project
Rafał Wojdyła [Wed, 21 Oct 2015 05:26:06 +0000 (07:26 +0200)]
Untabify the whole XENIFACE project

Signed-off-by: Rafal Wojdyla <omeg@invisiblethingslab.com>
9 years agoInclude ntifs.h instead of ntddk.h
Rafał Wojdyła [Wed, 21 Oct 2015 05:25:54 +0000 (07:25 +0200)]
Include ntifs.h instead of ntddk.h

Gnttab code uses KeStackAttachProcess which is only declared in ntifs.h
(conflicts with ntddk.h).

Signed-off-by: Rafal Wojdyla <omeg@invisiblethingslab.com>
9 years agoUpdate XENBUS interface headers
Rafał Wojdyła [Wed, 21 Oct 2015 05:25:35 +0000 (07:25 +0200)]
Update XENBUS interface headers

Also add headers needed for next patches in the series.

Signed-off-by: Rafal Wojdyla <omeg@invisiblethingslab.com>
9 years agoAdd a registry override to veto driver installations
Paul Durrant [Thu, 22 Oct 2015 15:22:02 +0000 (16:22 +0100)]
Add a registry override to veto driver installations

There are certain cases where a local installer package may wish to
prevent Windows Update installations of drivers. This can be achieved by
having the co-installer check for a registry value and fail it's pre-install
phase if the value is present.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoChange coinstaller log level to TXTLOG_WARNING
Paul Durrant [Thu, 22 Oct 2015 13:56:00 +0000 (14:56 +0100)]
Change coinstaller log level to TXTLOG_WARNING

Windows 10 does not enable logging of TXTLOG_DETAILS in setupapi.dev.log by
default, so use TXTLOG_WARNING to make sure the messages appear.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoParameterize vendor prefix and PCI device id
Paul Durrant [Tue, 8 Sep 2015 16:59:49 +0000 (17:59 +0100)]
Parameterize vendor prefix and PCI device id

The XenServer PV vendor prefix ('XS') and PCI device (C000) are still
hard-coded into the XENIFACE package. These need to be stripped out and
replaced by values that can be customized at build time. This patch does
that.

The patch also reverts to building version.h and customizing xeniface.inf
directly in build.py.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoUpdate to 8.2.0
Paul Durrant [Fri, 4 Sep 2015 15:25:01 +0000 (16:25 +0100)]
Update to 8.2.0

I also removed CHANGELOG as it's pretty useless and will likely become
misleading.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoUpdate docs and set version to 8.1.0 8.1.0-rc1
Paul Durrant [Fri, 24 Jul 2015 11:49:14 +0000 (12:49 +0100)]
Update docs and set version to 8.1.0

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoRemove use of subscriber keys from co-installer
Paul Durrant [Fri, 17 Jul 2015 15:56:19 +0000 (16:56 +0100)]
Remove use of subscriber keys from co-installer

They are no longer necessary. The co-installer actually does nothing now
and can probably be removed.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoUpdate bindings
Paul Durrant [Fri, 17 Jul 2015 15:52:01 +0000 (16:52 +0100)]
Update bindings

A recent change to XENBUS to introduce a new unplug mechanism was
incompatible with older drivers so the PDO revisions were deliberately
changed. This patch brings XENIFACE up to date with the new revision
number.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoUpdate bindings
Paul Durrant [Wed, 8 Jul 2015 13:28:40 +0000 (14:28 +0100)]
Update bindings

Refresh the interface headers and add the XENBUS major version into
the top byte of the revision, since this is now used to avoid namespace
conflicts.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
10 years agoSet script file execute permissions
Paul Durrant [Thu, 12 Mar 2015 11:37:11 +0000 (11:37 +0000)]
Set script file execute permissions

The lack of execute persmission causes clones done using cygwin git to
leave scripts in a non-executable state.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
10 years agoFix VS2013 SDV failures
Paul Durrant [Mon, 2 Mar 2015 17:47:40 +0000 (17:47 +0000)]
Fix VS2013 SDV failures

Also update the assert.h header.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
10 years agoMove interface subscription code into co-installer
Paul Durrant [Tue, 13 Jan 2015 16:42:33 +0000 (16:42 +0000)]
Move interface subscription code into co-installer

Interface subscription is better handled at package installation time and
therefore the co-installer is the right place for it to live.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
10 years agoAdd a co-installer
Paul Durrant [Tue, 13 Jan 2015 16:07:25 +0000 (16:07 +0000)]
Add a co-installer

The co-installer does not do anything as yet. Functionality will be added in
a subsequent patch.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
10 years agoFix line endings
Paul Durrant [Tue, 13 Jan 2015 16:50:48 +0000 (16:50 +0000)]
Fix line endings

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
10 years agoMake sure INF gets re-built each time
Paul Durrant [Fri, 19 Dec 2014 15:45:32 +0000 (15:45 +0000)]
Make sure INF gets re-built each time

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
10 years agoMake sure version header gets re-built each time
Paul Durrant [Fri, 19 Dec 2014 13:21:09 +0000 (13:21 +0000)]
Make sure version header gets re-built each time

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
10 years agoFix line endings
Paul Durrant [Tue, 7 Oct 2014 14:12:57 +0000 (15:12 +0100)]
Fix line endings

Files checked into the repository should use unix line endings

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
10 years agoFix OBJECT_PREFIX and PRODUCT_NAME substitution
Paul Durrant [Tue, 7 Oct 2014 14:10:54 +0000 (15:10 +0100)]
Fix OBJECT_PREFIX and PRODUCT_NAME substitution

There were missing trailing '@' characters causing substitution to fail.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
10 years agoReduce spam from build.py
Paul Durrant [Thu, 25 Sep 2014 15:17:01 +0000 (16:17 +0100)]
Reduce spam from build.py

We don't the verbose prints when deciding whether we're using vs2012 or 2013.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
10 years agoDon't use universal_newlines=True in subprocess.Popen()
Paul Durrant [Thu, 25 Sep 2014 14:06:31 +0000 (15:06 +0100)]
Don't use universal_newlines=True in subprocess.Popen()

For some versions of python this appears to cause corruption of the
output byte string by forcibly decoding with the wrong encoding.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
10 years agoSupport Visual Studio 2013 & WDK 8.1
Ben Chalmers [Tue, 19 Aug 2014 09:55:38 +0000 (10:55 +0100)]
Support Visual Studio 2013 & WDK 8.1

Signed-off-by: Ben Chalmers <ben.chalmers@citrix.com>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
10 years agoUpdate branding
Paul Durrant [Fri, 15 Aug 2014 13:22:17 +0000 (14:22 +0100)]
Update branding

Remove the use of the 'XenServer' product name except where it is
still appropriate.
Remove use of 'Citrix' from all places except source file
copyrights.
Allow company and product name to be set at build time.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
10 years agoFix/suppress prefast warnings
Paul Durrant [Fri, 15 Aug 2014 10:14:37 +0000 (11:14 +0100)]
Fix/suppress prefast warnings

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
10 years agoImplement new API version scheme
Paul Durrant [Tue, 22 Jul 2014 14:28:56 +0000 (15:28 +0100)]
Implement new API version scheme

This patch changes the way APIs work in an incompatible way. (See README.md
for details).
The patch also includes a *lot* of code tidying and movement and as such
is not really suitable for review as a patch; the resulting code should
itself be reviewed.
Given the scale of the change, the major version number has been revised to
8 and other version numbers reset to zero.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
11 years agoMerge pull request #12 from benchalmers/sdv
Paul Durrant [Tue, 25 Mar 2014 11:09:31 +0000 (11:09 +0000)]
Merge pull request #12 from benchalmers/sdv

Add SDV to the standard build