Paul Durrant [Wed, 30 Apr 2014 10:47:01 +0000 (11:47 +0100)]
Fix RangeSet cursor problem
When the last or first range in the set is removed then the cursor may end
up pointing back at the anchor point. This confused RangeSetPop() so we
need to make sure that the cursor wraps round when this happens, such that
the only valid reason for the cursor to ever point at the anchor is when
the set goes empty.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Tue, 29 Apr 2014 14:46:17 +0000 (15:46 +0100)]
Add FIST capability for pools
By setting xenstore parameters 'fist/pool/<name>/defer' to X and
'fist/pool/<name>/probability' to Y you can now cause failures of PoolGet()
such that it will fail with probability Y% after X initial invocations.
The name of the grant table pool has been set to 'gnttab' to make typing it
in more convenients, and some debug-keys output has been added to give
the PoolGet() failure count.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Tue, 29 Apr 2014 10:03:48 +0000 (11:03 +0100)]
RangeSet fixes
- add spinlock to protect rangesets.
- add a Count value to check against empty condition in audit.
- use LONGLONG in ranges rather than ULONGLONG so that ranges can be
invalidated by setting Start > End.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Ben Chalmers [Fri, 25 Apr 2014 14:15:27 +0000 (15:15 +0100)]
[SCTX-1104] Add WindowsPEMode to xenfilt
ParentIdPrefixes are not avilable at Windows PE driver filtering time,
but we don't actually need them if we know emulated devices will be
unplugged, so, if ParentIdPrefix can't be read from the registry and
HKLM\System\CurrentControlSet\Services\xenfilt\WindowsPEMode is set to 1
then just set the prefix to be an empty string and continue
We never set WindowsPEMode anywhere except in the sample Windows PE
scripts, so non-WindowsPE environments are unaffected
Signed-off-by: Ben Chalmers <Ben.Chalmers@citrix.com>
Paul Durrant [Wed, 23 Apr 2014 09:04:59 +0000 (10:04 +0100)]
Various fixes in improvements to the XEX.SYS System module
- Improved error handling. Various errors were ignored before.
- Moved several globals inside scope of __SystemGetCpuInformation since
that's the only place they are used.
- Added a call to free memory range information. It was leaked before.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Wed, 23 Apr 2014 09:26:42 +0000 (10:26 +0100)]
Better way to ignore assertions in free builds
Disabling warnings is not a great thing to do so define an inline function
to take the assertion expression as an argument and then declare its
argument to be ignored.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Wed, 23 Apr 2014 09:00:48 +0000 (10:00 +0100)]
Fix bug in RangeSetGet()
If RangeSetGet() was invoked when the cursor just happened to be pointing at
the correct singleton range than that range was not removed and an ASSERT was
hit. This patch fixes that problem.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Fri, 11 Apr 2014 10:09:20 +0000 (11:09 +0100)]
Re-worked GNTTAB.
The new version of the interface no longer exposes raw references to clients.
They are now behind an opaque XENVIF_GNTTAB_DESCRIPTOR, analogous to the
XENVIF_EVTCHN_DESCRIPTOR which hides raw ports from clients.
The allocator is also more sophisticated. It uses a pool with per-cpu
magazines for lockless access backed by rangesets.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Fri, 1 Nov 2013 09:21:42 +0000 (10:21 +0100)]
Enable and disable callback via at source rather than
trying to keep a local disabled flag for the interrupt.
If we don't do this we can get into a interrupt storm on
startup.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Thu, 31 Oct 2013 15:37:42 +0000 (16:37 +0100)]
Enable and disable callback via at source rather than
trying to keep a local disabled flag for the interrupt.
If we don't do this we can get into a interrupt storm on
startup.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Fri, 4 Oct 2013 10:54:11 +0000 (11:54 +0100)]
Keep track of ActiveDevice rather than ActiveDeviceInstance. If we include
the instance then any change in the PCI bus can cause the PV drivers to
become inactive.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Ben Chalmers [Mon, 16 Sep 2013 12:36:19 +0000 (13:36 +0100)]
[CA-115744] [SCTX-1538] Do not treat DbgPrint strings as format strings
Our hook for DbgPrint messages was passing these messages as the
format parameter into a printf statement. If there was a %s or
similar in the string we would then deference the next argument on
the stack, leading to a potential BSOD.
Signed-off-by: Ben Chalmers <Ben.Chalmers@citrix.com>
Paul Durrant [Tue, 27 Aug 2013 10:48:16 +0000 (11:48 +0100)]
Start work on XENFILT
Start to move towards a new EMULATED interface that will allow child
drivers to check presence of 'DEVICE's (by DeviceID and InstanceID) and
'DISK's (by Controller, Target, Lun tuples). This first commit just puts
in the groundwork for setting the right data on the PDOs.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Thu, 22 Aug 2013 14:23:14 +0000 (15:23 +0100)]
Re-factoring for use with upstream Xen.
Strip out XenServer specific parts of the drivers and enable them
to cope with multiple bindings.
Also, refine some of the source, add a common source area to reduce
code duplication, and change the PDO names to reflect the PV driver
vendor and also use a format that should work with Windows Update.
Note that XENFILT is pretty useless at this point. It binds to devices
correctly but all the unplug code is gone, to be replaced with code that
is not reliant upon XenServer-specific patches to QEMU.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Tue, 13 Aug 2013 09:15:11 +0000 (10:15 +0100)]
Ignore attempts to remove device usage types that were not added.
ASSERTing on this condition is not particularly helpful as other buggy
software causes BSODs. We should be able to safely ignore and succeed
such IRPs.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Ben Chalmers [Fri, 21 Jun 2013 13:54:35 +0000 (14:54 +0100)]
Resync with internal repository
changeset: 305:e377a99e8721
tag: tip
user: Paul Durrant <paul.durrant@citrix.com>
date: Fri Jun 21 13:19:15 2013 +0100
summary: [CA-109475] Handle __RangeSetAdd failure.
changeset: 304:7818aaf86215
parent: 303:37f03f68abf5
parent: 302:b576d67847cb
user: Paul Durrant <paul.durrant@citrix.com>
date: Fri Jun 21 09:58:03 2013 +0100
summary: Merge
changeset: 303:37f03f68abf5
parent: 299:f17689532d11
user: Paul Durrant <paul.durrant@citrix.com>
date: Fri Jun 21 09:57:04 2013 +0100
summary: * * *
changeset: 302:b576d67847cb
user: Ben Chalmers <ben.chalmers@citrix.com>
date: Wed Jun 19 10:30:32 2013 +0100
summary: [CP-4195] Add README.md and associated files to xenbus
changeset: 301:407589c56880
user: Owen Smith <owen.smith@citrix.com>
date: Thu Jun 13 16:07:04 2013 +0100
summary: Fix/suppress SDV warnings
changeset: 300:966e06420ce5
user: Owen Smith <owen.smith@citrix.com>
date: Wed Jun 12 16:48:22 2013 +0100
summary: [CA-86240] Update sdv.py and vcxprojs to build targetting Vista, an
d attempt to produce sdv logs
changeset: 299:f17689532d11
user: Owen Smith <owen.smith@citrix.com>
date: Thu Jun 06 12:47:30 2013 +0100
summary: Backed out merge changeset: b35edbab18ee
changeset: 298:b35edbab18ee
parent: 297:0675b68b3e8d
parent: 296:5aefe3d5985a
user: Owen Smith <owen.smith@citrix.com>
date: Tue Jun 04 12:18:12 2013 +0100
summary: Merge
changeset: 297:0675b68b3e8d
parent: 294:28a400f3d92a
user: Owen Smith <owen.smith@citrix.com>
date: Tue Jun 04 12:17:26 2013 +0100
summary: [CA-86240] Generate SDV logs with sdv.py script
changeset: 296:5aefe3d5985a
parent: 295:0fad50b631e3
parent: 294:28a400f3d92a
user: Paul Durrant <paul.durrant@citrix.com>
date: Mon Jun 03 17:49:00 2013 +0100
summary: Merge
changeset: 295:0fad50b631e3
parent: 293:5c23adc1aa58
user: Paul Durrant <paul.durrant@citrix.com>
date: Mon Jun 03 17:48:06 2013 +0100
summary: Fix line endings
changeset: 294:28a400f3d92a
user: Ben Chalmers <ben.chalmers@citrix.com>
date: Wed May 29 14:57:17 2013 +0100
summary: [CP-4685] Add BSD licence header to inf file