]> xenbits.xensource.com Git - pvdrivers/win/xenvbd.git/log
pvdrivers/win/xenvbd.git
6 years agoBack-port rsp_event manipulation changes from master staging-8.2
Paul Durrant [Tue, 24 Jul 2018 14:46:22 +0000 (15:46 +0100)]
Back-port rsp_event manipulation changes from master

Rather than updating rsp_event at the end of every poll, the code in
master sets it to req_prod_pvt during submission to attempt to defer events
until the last request has been processed.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
6 years agoRemove bogus FORCEINLINE
Paul Durrant [Tue, 24 Jul 2018 13:09:17 +0000 (14:09 +0100)]
Remove bogus FORCEINLINE

Not sure why the older toolchains tolerated this, but VS2017 quite rightly
hits a link failure with free builds.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
6 years agoAdd support for building with Visual Studio 2017
Paul Durrant [Mon, 29 Jan 2018 17:09:32 +0000 (17:09 +0000)]
Add support for building with Visual Studio 2017

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
6 years agoUpdate version to 8.2.2
Paul Durrant [Wed, 18 Jul 2018 13:49:52 +0000 (14:49 +0100)]
Update version to 8.2.2

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
7 years agoAdded a function called from DriverEntry where... 8.2.1
Eric Mackay [Mon, 17 Jul 2017 10:31:39 +0000 (11:31 +0100)]
Added a function called from DriverEntry where...

we can safely read registry keys and convert strings at PASSIVE_LEVEL

The MSDN documentation for various registry key access and string
conversion functions requires the caller to be at PASSIVE_LEVEL.
One of the reasons for this is that the string conversion tables used by
functions such as RtlAnsiStringToUnicodeString are stored in paged pool
memory. Both the page fault handler and the process scheduler run at
DISPATCH_LEVEL, therefore you must not touch memory at DISPATCH_LEVEL that
could be paged out. A process running at DISPATCH_LEVEL cannot be
preempted for the page fault handler to run.

To aid Static Driver Verifier code analysis and inform developers, I have
added SAL annotations that indicate PASSIVE_LEVEL is required on certain
registry access functions.

Signed-off-by: Eric Mackay <mackayem@amazon.com>
Re-based onto master and adjusted for style. Note this involved fixing
whitespace issues in frontend.c.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Backported to staging-8.2

Signed-off-by: Owen Smth <owen.smith@citrix.com>
7 years agoUpdate version to 8.2.1
Paul Durrant [Wed, 31 May 2017 14:25:38 +0000 (15:25 +0100)]
Update version to 8.2.1

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
7 years agoReboot request keys should be volatile
Paul Durrant [Mon, 8 May 2017 16:09:02 +0000 (17:09 +0100)]
Reboot request keys should be volatile

When a driver makes a reboot request it should use a volatile registry key.
The monitor service will explicitly remove the key prior to reboot but,
if the reboot is initiated in some other way and the key is non-volatile,
the monitor service will then needlessly prompt for a second reboot.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoTake notice of 'discard-enable' in xenstore 8.2.0 8.2.0-rc4
Andreas Kinzler [Mon, 20 Feb 2017 14:09:04 +0000 (14:09 +0000)]
Take notice of 'discard-enable' in xenstore

When enabling discard in the frontend, both the 'feature-discard' and
'discard-enable' flags should be taken into account.

Signed-off-by: Andreas Kinzler <ml-ak@posteo.de>
[Added commit comment]
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoFix race setting SrbStatus
Paul Durrant [Mon, 20 Feb 2017 14:03:50 +0000 (14:03 +0000)]
Fix race setting SrbStatus

SrbStatus needs to be set to PENDING right at the beginning of the
prepare functions, before the SRB has been added to any queue, otherwise
we risk a race with the completion code.

Reported-by: Andreas Kinzler <ml-ak@posteo.de>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoFix race calculating SrbExt->Count
Owen Smith [Fri, 17 Feb 2017 15:29:35 +0000 (15:29 +0000)]
Fix race calculating SrbExt->Count

It is possible under heavy loads for the backend to
start completing sub-requests of a Srb before the
SrbExt Count is set. This would leave the count unable
to reach 0 (as 1 or more requests are skipped by count
being overridden)

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoEnsure event channel is unmasked
Owen Smith [Fri, 17 Feb 2017 15:27:03 +0000 (15:27 +0000)]
Ensure event channel is unmasked

If the Pdo is paused, the notifier dpc will not
unmask the event channel. When the Pdo is unpaused, the
event channel remains masked, so no more interrupts
get delivered.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoMake sure we don't leave SRBs in state PENDING
Paul Durrant [Fri, 16 Dec 2016 15:39:45 +0000 (15:39 +0000)]
Make sure we don't leave SRBs in state PENDING

When we fail to prepare an SRB, it should not be left in state PENDING
otherwise Windows will expect a completion at some point.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoAdd registry overrides for features 8.2.0-rc3
Owen Smith [Fri, 3 Feb 2017 14:03:52 +0000 (14:03 +0000)]
Add registry overrides for features

Add a REG_DWORD to XenVbd's Parameters key, with names based
on the features, as per xenstore value, and set to 0 to
override use of that feature.

For example,
 "HKLM\System\CCS\Services\XenVbd\Parameters" "feature-barrier" 0
  will prevent the frontend issuing BLKIF_OP_WRITE_BARRIERs
 "HKLM\System\CCS\Services\XenVbd\Parameters" "feature-discard" 0
  will prevent the frontend issuing BLKIF_OP_DISCARDs

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoFix memory leak in __FreePages() 8.2.0-rc2
Paul Durrant [Fri, 6 Jan 2017 13:02:32 +0000 (13:02 +0000)]
Fix memory leak in __FreePages()

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

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoFix pool leaks exposed by DriverVerifier
Owen Smith [Fri, 6 Jan 2017 12:02:55 +0000 (12:02 +0000)]
Fix pool leaks exposed by DriverVerifier

* RegistryCloseKey was not called in DriverRequestReboot
* RegistryTeardown was not being called in DriverUnload
* __RegistryFree was not being called in RegistryCreateKey
* Reordered DriverEntry slightly for improved code consistancy

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoDon't disconnect/connect ring when target is reset 8.2.0-rc1
Owen Smith [Fri, 9 Dec 2016 10:54:35 +0000 (10:54 +0000)]
Don't disconnect/connect ring when target is reset

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoAdd registry override to prevent interception of Trim requests
Paul Durrant [Tue, 6 Dec 2016 17:16:22 +0000 (17:16 +0000)]
Add registry override to prevent interception of Trim requests

Add a REG_DWORD called 'InterceptTrim' to XENDISK's parameters key
(now created by xenvbd.inf). Set the value to zero to disable Trim
interception.

This patch also adds registry code to XENDISK, brings util.h up to date,
and fixes some cosmetic issues in thread.c.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoSucceed SRBs that the backend doesnt support
Owen Smith [Mon, 5 Dec 2016 15:58:46 +0000 (15:58 +0000)]
Succeed SRBs that the backend doesnt support

If the backend does not support BLKIF_OP_DISCARD, BLKIF_OP_WRITE_BARRIER,
or BLKIF_OP_FLUSH_DISKCACHE, the first request will be failed and
subsiquent requests will be succeeded instead of being passed to the
backend. Bring the SRB status into line in both of these situations.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
Remove rather scary warning and instead log any features being disabled.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoSend BLKIF_OP_FLUSH_DISKCACHE
Owen Smith [Tue, 22 Nov 2016 15:09:55 +0000 (15:09 +0000)]
Send BLKIF_OP_FLUSH_DISKCACHE

If the backend supports flush, send BLKIF_OP_FLUSH_DISKCACHE in
response to SCSIOP_SYNCHRONIZE_CACHE, and advertise the cache
to Windows. Also tracks count of cache operations. If the backend
does not support flush, but supports barrier, send
BLKIF_OP_WRITE_BARRIER instead, but do not advertise the cache to
Windows, as its assumed the backend will guarantee writes are
flushed if the storage requires flushing.

8 years agoRead backend features and disk info before setting Connected
Owen Smith [Tue, 22 Nov 2016 15:08:29 +0000 (15:08 +0000)]
Read backend features and disk info before setting Connected

Setting connected should be the last step of the connection
state transitions.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoFix VS2012 build
Paul Durrant [Thu, 3 Nov 2016 11:14:48 +0000 (11:14 +0000)]
Fix VS2012 build

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

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoMake use of the 'physical-sector-size' reported by the backend
Paul Durrant [Thu, 6 Oct 2016 13:48:09 +0000 (14:48 +0100)]
Make use of the 'physical-sector-size' reported by the backend

blkif backends can report a 'physical-sector-size' as will as
'sector-size'. XENVBD currently reads this xenstore key but does
nothing with the value. This patch makes use of the value to set the
LogicalPerPhysicalExponent field in the READ_CAPACITY16_DATA structure
which is populated in response to a SCSIOP_READ_CAPACITY16 CDB.

The patch also modifies XENDISK to discover the logical block size by
sending a SCSIOP_READ_CAPACITY16 rather than relying on an IOCTL to
query StorageAccessAlignmentProperty being sent down the stack and
succeeded by STORPORT (which does not seem to be the case for Windows 10).

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoDon't include null terminator in synthesized VendorId identifier
Owen Smith [Mon, 3 Oct 2016 07:31:44 +0000 (08:31 +0100)]
Don't include null terminator in synthesized VendorId identifier

The VendorId identifier on SCSI page 83 is 16 bytes long (+header).
When synthesizing the inquiry data, either by global flag, or missing
xenstore data (sm-data/scsi/0x12/0x83), the NULL terminator on the
VendorId should not be included in the field. When this happens, any
query will decode 3 identifiers (VendorId, EUI64, VendorSpecific) instead
of the intended 2 (VendorId, VendorSpecific). This breaks the XenServer
VSS provider that uses the VendorSpecific identifier to retrieve the
vdi-uuid. This is only an issue when the inquiry data is synthesized and
additional identifiers are required, which is not a common use case.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoStop checked builds from crashing
Paul Durrant [Fri, 30 Sep 2016 12:50:26 +0000 (13:50 +0100)]
Stop checked builds from crashing

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoThe SOFTWARE registry hive is not accessible at boot time
Paul Durrant [Mon, 22 Aug 2016 07:44:36 +0000 (08:44 +0100)]
The SOFTWARE registry hive is not accessible at boot time

Hence it cannot be used for the monitor request key, otherwise XENVBD
cannot necessarily access it.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoUpdate registry code
Paul Durrant [Fri, 19 Aug 2016 10:58:51 +0000 (11:58 +0100)]
Update registry code

Bring in new registry code from XENBUS to fix RegistryCreateKey()'s
semantics.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoFix SDV build
Paul Durrant [Wed, 17 Aug 2016 14:05:08 +0000 (15:05 +0100)]
Fix SDV build

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoCreate, rather than open, the RequestKey
Paul Durrant [Wed, 17 Aug 2016 13:34:14 +0000 (14:34 +0100)]
Create, rather than open, the RequestKey

It's possible that, on upgrade, XENVBD is installed before XENBUS and so
the RequestKey may not exist.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoFix typo
Paul Durrant [Tue, 9 Aug 2016 15:06:22 +0000 (16:06 +0100)]
Fix typo

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoUse new monitor request key
Paul Durrant [Tue, 9 Aug 2016 14:19:29 +0000 (15:19 +0100)]
Use new monitor request key

The monitor service now uses a request key in registry under HKLM/SOFTWARE.
This patch modifies __DriverRequestReboot() to use the new key, which is
now set as a parameter by the INF file.

This patch also takes this opportunity to update the registry source module
to being it up to date with the XENBUS source base, and make wider use of it.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoClean up the xenstore frontend area when hibernating/crashing
Paul Durrant [Tue, 2 Aug 2016 09:58:28 +0000 (10:58 +0100)]
Clean up the xenstore frontend area when hibernating/crashing

The frontend code in XENCRSH needs to clean up to avoid fooling the backend
into thinking it handles multi-page rings.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoDon't send a NUL terminator to QEMU's debug port
Paul Durrant [Tue, 2 Aug 2016 09:56:23 +0000 (10:56 +0100)]
Don't send a NUL terminator to QEMU's debug port

Logging a NUL terminator via QEMU's debug port seems to upset upstream
QEMU. It's also unnecessary anyway as QEMU will break log lines at a
newline character.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoRemove reboot request from the co-installer...
Paul Durrant [Fri, 22 Jul 2016 09:37:12 +0000 (10:37 +0100)]
Remove reboot request from the co-installer...

...and use the XENBUS_MONITOR service instead.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoAdd the missing package name to the INF file
Paul Durrant [Thu, 21 Jul 2016 11:08:18 +0000 (12:08 +0100)]
Add the missing package name to the INF file

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoRevert "Remove PdoPnpSrb, since StorPort doesn't call for targets"
Ben Chalmers [Tue, 12 Jul 2016 08:03:53 +0000 (09:03 +0100)]
Revert "Remove PdoPnpSrb, since StorPort doesn't call for targets"

This reverts commit 0f9f5421099d1dabed11d988b3144fb8f6bfed3b.

It appears that this code is called when determining if Windows
can remove a PV disk.  Without it Windows will not know the
disk is removable and will refuse to allow it to be removed

Signed-off-by: Ben.Chalmers@citrix.com
8 years agoOnly break FrontendBackend thread loop when alerted
Ben Chalmers [Mon, 11 Jul 2016 13:29:04 +0000 (14:29 +0100)]
Only break FrontendBackend thread loop when alerted

Returns a missed '!' character without which the FrontendBackend
thread exits immediately - rather than when we Alert the thread
that we wish it to exit

Signed-off-by : Ben.Chalmers@citrix.com

8 years agoFix compile errors
Paul Durrant [Mon, 9 May 2016 12:41:19 +0000 (13:41 +0100)]
Fix compile errors

Two variables were being initialized but not used, leading to a compiler
warning.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoRemove logging from failed Pdo Pnp IRPs
Owen Smith [Fri, 22 Apr 2016 10:29:31 +0000 (11:29 +0100)]
Remove logging from failed Pdo Pnp IRPs

Logging fail codes for unhandled Pnp IRPs is unneccesary and adds
significant noise with multiple VBDs. Its unlikely the return value
from storport is going to add significant insight to diagnose
problems.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoChange enumeration function to take PANSI_STRING array...
Owen Smith [Wed, 20 Apr 2016 15:43:11 +0000 (16:43 +0100)]
Change enumeration function to take PANSI_STRING array...

...to simplify parsing of the data returned by STORE(Directory)

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoWrap all driver.c globals in a struct
Owen Smith [Wed, 20 Apr 2016 14:30:20 +0000 (15:30 +0100)]
Wrap all driver.c globals in a struct

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoCreate a seperate thread per VBD to handle backend change watches
Owen Smith [Tue, 19 Apr 2016 15:50:08 +0000 (16:50 +0100)]
Create a seperate thread per VBD to handle backend change watches

Using a single thread for all backend watch events pust unneccesary
strain on xenstore when multiple vbds are in use, as each change
causes XenVbd to check several values in all backend areas.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoDont create Pdo for emulated devices
Owen Smith [Tue, 19 Apr 2016 14:25:31 +0000 (15:25 +0100)]
Dont create Pdo for emulated devices

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoRework enumeration code to work at PASSIVE_LEVEL in the scan thread
Owen Smith [Tue, 19 Apr 2016 14:12:38 +0000 (15:12 +0100)]
Rework enumeration code to work at PASSIVE_LEVEL in the scan thread

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoRefactor Pnp/Power handlers
Owen Smith [Tue, 19 Apr 2016 10:28:15 +0000 (11:28 +0100)]
Refactor Pnp/Power handlers

Moves the mapping of DeviceObject to Pdo into the Fdo code

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoSimplify StorPort entry points
Owen Smith [Tue, 19 Apr 2016 09:30:05 +0000 (10:30 +0100)]
Simplify StorPort entry points

Signed-off-by: Owen Smith <owen.smith@citrix.com>
8 years agoMove __FdoNotifyInstaller to DriverNotifyInstaller
Owen Smith [Tue, 19 Apr 2016 09:09:01 +0000 (10:09 +0100)]
Move __FdoNotifyInstaller to DriverNotifyInstaller

Removes extern from DriverStatusKey

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

This should no longer be necessary since XENVBD gracefully deactivates if
emulated devices are present, which they will be in safe mode.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoAdd POOL_NX_OPTIN=1 to all drivers
Owen Smith [Mon, 29 Feb 2016 16:51:55 +0000 (16:51 +0000)]
Add POOL_NX_OPTIN=1 to all drivers

Win10's verifier asserts that all non-paged pool allocations are
made from the non-paged no-execute pool

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoOverride PartMgr SanPolicy
Paul Durrant [Mon, 29 Feb 2016 10:20:50 +0000 (10:20 +0000)]
Override PartMgr SanPolicy

This patch makes sure that PartMgr's SanPolicy is 1 after XENVBD
installation, which means that newly plugged VBDs will come online as most
admins will expect.

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:08:59 +0000 (17:08 +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 agoFixed improper SCSI UNMAP request implementation
Dave Buches [Fri, 22 Jan 2016 04:30:03 +0000 (20:30 -0800)]
Fixed improper SCSI UNMAP request implementation

The XenDisk disk class filter driver was generating requests
that did not adhere to the t10 SBC-3 SCSI specification for UNMAP
operations.  Specifically, the data length and block descriptor data
length fields were not populated properly per the spec.

Although the XenVBD miniport driver handled these malformed
requests correctly, it failed to handle *properly* formed requests,
which would result in unpredictable behavior.

Additionally, the XenDisk filter wasn't properly responding to
StorageDeviceTrimProperty queries per the MSDN spec. Specifically,
the DEVICE_TRIM_DESCRIPTOR::Version structure member needs to be set
to sizeof(DEVICE_TRIM_DESCRIPTOR).

Signed-off-by: David Buches <davebuch@amazon.com>
9 years agoUse correct FdoD0ToD3 function.
Mark Syms [Fri, 8 Jan 2016 11:50:22 +0000 (11:50 +0000)]
Use correct FdoD0ToD3 function.

Signed-off-by: Mark Syms <mark.syms@citrix.com>
9 years agoTurn off ASSERTions in free builds
Paul Durrant [Mon, 4 Jan 2016 15:33:42 +0000 (15:33 +0000)]
Turn off ASSERTions in free builds

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoDon't use C runtime version of toupper()
Paul Durrant [Thu, 10 Dec 2015 11:39:37 +0000 (11:39 +0000)]
Don't use C runtime version of toupper()

It seems that, despite its trivial functionality, the runtime implementation
insists on converting to Unicode! This means the function is actually only
safe at PASSIVE_LEVEL.
This patch implements __toupper() as a replacement with no such hidden
nastiness and modifies callers to use that.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoRemove BlockRing.Outstanding / BlockRingAbort
Owen Smith [Wed, 2 Dec 2015 15:16:49 +0000 (15:16 +0000)]
Remove BlockRing.Outstanding / BlockRingAbort

The BlockRing Outstanding stat is duplicated by SubmittedReqs.Count.
Remove BlockRing.Outstanding and the BlockRingAbort function as the
stat is not useful, and can trigger ASSERTion failures when requests
are stuck outstanding on a broken ring that is being destroyed.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoNULL the SuspendCallback context when going to D3...
Paul Durrant [Wed, 2 Dec 2015 15:31:27 +0000 (15:31 +0000)]
NULL the SuspendCallback context when going to D3...

...otherwise going back to D0 will hit an ASSERTion failure.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoFix SDV build
Paul Durrant [Wed, 25 Nov 2015 13:59:00 +0000 (13:59 +0000)]
Fix SDV build

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoPublish distribution information and hotplug capability to xenstore
Paul Durrant [Tue, 24 Nov 2015 17:47:59 +0000 (17:47 +0000)]
Publish distribution information and hotplug capability to xenstore

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

This patch adds code to populate the documented paths (should they exist)
with information about the XENVBD driver package and the driver's ability
to handle hotplug events.

Suggested-by: Owen Smith <owen.smith@citrix.com>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoRework indirect context structure
Owen Smith [Tue, 27 Oct 2015 11:15:46 +0000 (11:15 +0000)]
Rework indirect context structure

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoAdd Get/Put for request, segment and indirect(pages)
Owen Smith [Tue, 27 Oct 2015 11:15:45 +0000 (11:15 +0000)]
Add Get/Put for request, segment and indirect(pages)

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoPrepare calls only need to return success/failure, not an error code
Owen Smith [Tue, 27 Oct 2015 11:15:44 +0000 (11:15 +0000)]
Prepare calls only need to return success/failure, not an error code

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoRefactor - move more functions
Owen Smith [Tue, 27 Oct 2015 11:15:43 +0000 (11:15 +0000)]
Refactor - move more functions

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoRemove PdoPnpSrb, since StorPort doesn't call for targets
Owen Smith [Tue, 27 Oct 2015 11:15:42 +0000 (11:15 +0000)]
Remove PdoPnpSrb, since StorPort doesn't call for targets

Signed-off-by: Owen Smith <owen.smith@citrix.com>
SRB_FUNCTION_PNP case removed.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoRefactor - hide default Pnp/Power function pointers
Owen Smith [Tue, 27 Oct 2015 11:15:41 +0000 (11:15 +0000)]
Refactor - hide default Pnp/Power function pointers

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoRefactor - reorder functions in pdo.c
Owen Smith [Tue, 27 Oct 2015 11:15:40 +0000 (11:15 +0000)]
Refactor - reorder functions in pdo.c

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoSRB_FUNCTION_RESET_DEVICE should succeed... otherwise the entire controller is reset.
Owen Smith [Tue, 27 Oct 2015 11:15:39 +0000 (11:15 +0000)]
SRB_FUNCTION_RESET_DEVICE should succeed... otherwise the entire controller is reset.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoKick notifier DPC directly.
Owen Smith [Thu, 22 Oct 2015 13:13:48 +0000 (14:13 +0100)]
Kick notifier DPC directly.

EVTCHN(Trigger, ...) was changed with the FiFo event channel
implementation, which led to a performance regression. Kicking
the notifier does not require triggering the local end of the
event channel, so shortcut this process by queueing the notifier
DPC directly.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoAdd a registry override to veto driver installations
Paul Durrant [Thu, 22 Oct 2015 14:55:20 +0000 (15:55 +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:54:55 +0000 (14:54 +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:36:00 +0000 (17:36 +0100)]
Parameterize vendor prefix and PCI device id

The XenServer PV vendor prefix ('XS') and PCI device (C000) are still
hard-coded into the XENVBD 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 xenvbd.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:18:49 +0000 (16:18 +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 agoClear unplug requests from co-installer 8.1.0-rc1
Paul Durrant [Thu, 3 Sep 2015 16:36:43 +0000 (17:36 +0100)]
Clear unplug requests from co-installer

When XENVBD is uninstalled there is no suitable notification in kernel
which can be used to clear any remaining unplug requests. This leads to
a certain 0x7B bugcheck on reboot. This patch therefore does the job
from the co-installer since this seems to be the only way.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoSimplify unplug request
Paul Durrant [Thu, 3 Sep 2015 16:22:35 +0000 (17:22 +0100)]
Simplify unplug request

Since the PDO driver in XENVBD's case is in-box, we don't need to defer
requesting emulated device unplug to when PDOs are started, we can do it
when the FDO is started.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoReduce the number of registered watches per target
Paul Durrant [Tue, 11 Aug 2015 08:09:01 +0000 (09:09 +0100)]
Reduce the number of registered watches per target

XENVBD registers watches for changes in various per-VBD backend quantities,
e.g. state. All these watches, however, trigger one common event and so it
is wasteful of the guest's watch quota. Instead register a single watch on
the backend key, which will fire if any key below it is modified. This may
cause the event to be set slightly more often, but saves 3 watches per
target.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoAdd missing parameter to log statement
Paul Durrant [Fri, 7 Aug 2015 16:57:40 +0000 (17:57 +0100)]
Add missing parameter to log statement

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoSet per-disk queue depth
Paul Durrant [Fri, 7 Aug 2015 16:03:16 +0000 (17:03 +0100)]
Set per-disk queue depth

Windows apparently defaults to a queue depth of 20, which is a bit on the
small side. This patch sets the value to the maximum possible, which is
apparently 254 instead of the documented 255.

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

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoFix build warning
Paul Durrant [Thu, 23 Jul 2015 14:18:35 +0000 (15:18 +0100)]
Fix build warning

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoRemove Relations->Count assertion
Paul Durrant [Thu, 23 Jul 2015 14:04:36 +0000 (15:04 +0100)]
Remove Relations->Count assertion

It's bogus in the case of block-detach

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoDon't drop FDO mutex between PDO enumeration and Relations Count check
Paul Durrant [Thu, 23 Jul 2015 11:11:19 +0000 (12:11 +0100)]
Don't drop FDO mutex between PDO enumeration and Relations Count check

A PDO can disappear between these two, leading to an assertion failure so
keep the lock held to stop the list from being changed.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoAdd missing unplug request
Paul Durrant [Wed, 22 Jul 2015 15:44:49 +0000 (16:44 +0100)]
Add missing unplug request

If a new target is enumerated during a device relations query then no
request is made for unplug, or reboot. This patch adds the necessary code
to rectify this issue.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoForce a re-enumeration of PDOs after filter destruction
Paul Durrant [Wed, 22 Jul 2015 12:25:11 +0000 (13:25 +0100)]
Force a re-enumeration of PDOs after filter destruction

If the underlying PDO has not gone away then we need to create a fresh
filter object.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoRemove interface subscription and unplug code from the co-installed...
Paul Durrant [Mon, 20 Jul 2015 09:02:58 +0000 (10:02 +0100)]
Remove interface subscription and unplug code from the co-installed...

...and use the new XENBUS_UNPLUG interface to request unplug.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoIgnore failures when closing the frontend
Paul Durrant [Fri, 10 Jul 2015 16:29:23 +0000 (17:29 +0100)]
Ignore failures when closing the frontend

The backend may disappear when this happens but we must always carry on
and disconnect the frontend regardless.

From: Owen Smith <owen.smith@citrix.com>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoRemove PDO set/is-missing logic from XENDISK
Paul Durrant [Fri, 10 Jul 2015 16:09:13 +0000 (17:09 +0100)]
Remove PDO set/is-missing logic from XENDISK

It's all completely unnecessary for a filter driver

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoUse inline functions to acquire/release FDO mutex...
Paul Durrant [Wed, 8 Jul 2015 17:04:59 +0000 (18:04 +0100)]
Use inline functions to acquire/release FDO mutex...

...rather then open-coded acquires and releases.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoREMOVE_DEVICE must set device to Deleted
Owen Smith [Mon, 29 Jun 2015 13:45:53 +0000 (14:45 +0100)]
REMOVE_DEVICE must set device to Deleted

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoFix target enumeration
Owen Smith [Mon, 29 Jun 2015 10:13:50 +0000 (11:13 +0100)]
Fix target enumeration

Issues were found when enumeration races with plug/unplug. This patch
should fix these problems.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoUpdate bindings
Paul Durrant [Wed, 8 Jul 2015 13:36:06 +0000 (14:36 +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>
9 years agoAccount for rewinding requests
Owen Smith [Mon, 15 Jun 2015 11:05:19 +0000 (12:05 +0100)]
Account for rewinding requests

When requests are rewound to the fresh queue during resume from suspend,
decrement the Outstanding stat so that an ASSERT is not triggered.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoFix device relations in xendisk filter
Paul Durrant [Mon, 15 Jun 2015 11:10:45 +0000 (12:10 +0100)]
Fix device relations in xendisk filter

Incorrect handling breaks device removal. The crucial point is that a
PDO in the case of a filter should always disappear when an
IRP_MN_REMOVE_DEVICE comes down the stack. It does not need to stick around
in some cases, like a true PDO.

Signed-off-by: Ghiya, Murtaza <murtazg@amazon.com>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agoFix ASSERT
Owen Smith [Thu, 11 Jun 2015 11:30:31 +0000 (12:30 +0100)]
Fix ASSERT

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoFix ASSERT, s/Recieved/Received
Owen Smith [Thu, 11 Jun 2015 11:30:30 +0000 (12:30 +0100)]
Fix ASSERT, s/Recieved/Received

Signed-off-by: Owen Smith <owen.smith@citrix.com>
9 years agoCalculate size of DEVICE_RELATIONS
Owen Smith [Thu, 11 Jun 2015 11:30:29 +0000 (12:30 +0100)]
Calculate size of DEVICE_RELATIONS

Signed-off-by: Owen Smith <owen.smith@citrix.com>
10 years agoSet script file execute permissions
Paul Durrant [Thu, 12 Mar 2015 11:33:00 +0000 (11:33 +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 agoA further VS2013 SDV fix
Paul Durrant [Tue, 3 Mar 2015 10:28:33 +0000 (10:28 +0000)]
A further VS2013 SDV fix

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

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
10 years agoFix austere allocator when small heap list head is NULL
Owen Smith [Wed, 25 Feb 2015 15:05:12 +0000 (15:05 +0000)]
Fix austere allocator when small heap list head is NULL

Signed-off-by: Owen Smith <owen.smith@citrix.com>
10 years agoAttempt to reset event channel ABI to 2-Layer
Owen Smith [Wed, 25 Feb 2015 15:05:11 +0000 (15:05 +0000)]
Attempt to reset event channel ABI to 2-Layer

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