]> xenbits.xensource.com Git - pvdrivers/win/xenvbd.git/log
pvdrivers/win/xenvbd.git
2 months agoReport VPD 0xB1 Block Device Characteristics master
Tu Dinh [Mon, 17 Feb 2025 15:15:55 +0000 (15:15 +0000)]
Report VPD 0xB1 Block Device Characteristics

Report Medium Rotation Rate to be 1 (i.e. solid state disk) to prevent
Windows from defragmenting virtual disks by default.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
Reviewed-by: Owen Smith <owen.smith@cloud.com>
Reviewed-by: Paul Durrant <paul@xen.org>
5 months agoAllow BLKIF_OP_WRITE_BARRIER or BLKIF_OP_FLUSH_DISKCACHE...
Owen Smith [Mon, 21 Oct 2024 11:47:08 +0000 (12:47 +0100)]
Allow BLKIF_OP_WRITE_BARRIER or BLKIF_OP_FLUSH_DISKCACHE...

... when a SCSIOP_SYNCHRONIZE_CACHE is issued, which should be the last
operation issued by the crash kernel.
Certain backends do not advertise WriteBarrier support, and use SyncDiskCache
instead. Add support for creating crashdumps on these backends.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
9 months agoUse UNPLUG v3
Owen Smith [Tue, 9 Jul 2024 10:43:19 +0000 (11:43 +0100)]
Use UNPLUG v3

Use UnplugBootEmulated to detect whether the boot disk should remain emulated
to avoid openning an absolute registry path.
Use UnplugReboot to request a reboot from xenbus_monitor. Also removes the
RequestKey property from the INF file, as its no longer needed.
Bumps binding in INF file to match revision exposed by xenbus that implements
UNPLUG v3 (0x0900000B)

Signed-off-by: Owen Smith <owen.smith@cloud.com>
9 months agoAdd RegistryOpenParametersKey
Owen Smith [Tue, 9 Jul 2024 10:43:18 +0000 (11:43 +0100)]
Add RegistryOpenParametersKey

Server 2025 WHQL tests enables "verifier.exe /onecheck /rc 33 36" on some drivers
under test, which will detect a violation if drivers attempt to access absolute
registry paths.
IoOpenDriverRegistryKey will open the parameters key for a driver, but its not
defined for Server 2016. Use MmGetSystemRoutineAddress to dynamically find the
function so that a single binary can be used on Server 2016 and Server 2025.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
9 months agoUpdate MAINTAINERS
Paul Durrant [Tue, 2 Jul 2024 08:57:19 +0000 (09:57 +0100)]
Update MAINTAINERS

Remove Ben as he is no longer involved in the project, and update Owen's
email address.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
13 months agoAsynchronous power handling.
Martin Harvey [Tue, 12 Mar 2024 07:23:52 +0000 (07:23 +0000)]
Asynchronous power handling.

XenDisk requires minimal IRP_MN_SET_POWER/IRP_MN_QUERY_POWER interactions.
No IoWorkItems are required as operations perform no significant work.
Power handlers are is limited to tracking state changes and calling PoSetPowerState.

Signed-off-by: Martin Harvey <martin.harvey@citrix.com>
Refactored
Signed-off-by: Owen Smith <owen.smith@cloud.com>
Fix gratuitous and unrelated removal of brackets.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
14 months agoGenerate map files and enable integrity check
Owen Smith [Fri, 2 Feb 2024 10:10:37 +0000 (10:10 +0000)]
Generate map files and enable integrity check

Enable linker options to generates map files, to help debugging crashdumps
Adds map files to output package
Add /INTEGRITYCHECK to linker options

https://learn.microsoft.com/en-us/cpp/build/reference/map-generate-mapfile?view=msvc-170
https://learn.microsoft.com/en-us/cpp/build/reference/mapinfo-include-information-in-mapfile?view=msvc-170
https://learn.microsoft.com/en-us/cpp/build/reference/integritycheck-require-signature-check?view=msvc-170

Signed-off-by: Owen Smith <owen.smith@cloud.com>
16 months agoRemove "Win32" as a build target from VS2022 projects
Owen Smith [Mon, 20 Nov 2023 14:49:30 +0000 (14:49 +0000)]
Remove "Win32" as a build target from VS2022 projects

VS2022 is used with EWDK 22621 and later. Win32 is no longer a valid build
target for this set of tools.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
16 months agoRemove "Windows 8" as a build target
Owen Smith [Mon, 20 Nov 2023 14:49:29 +0000 (14:49 +0000)]
Remove "Windows 8" as a build target

Windows 8 is no longer a supported build target with Microsoft, remove
this as a build target

Signed-off-by: Owen Smith <owen.smith@cloud.com>
16 months agoRemove VS2015 and VS2017 projects and configurations
Owen Smith [Mon, 20 Nov 2023 14:49:28 +0000 (14:49 +0000)]
Remove VS2015 and VS2017 projects and configurations

Signed-off-by: Owen Smith <owen.smith@cloud.com>
19 months agoCopy the correct version of unplug_interface.h from XENBUS
Paul Durrant [Mon, 2 Oct 2023 08:49:45 +0000 (09:49 +0100)]
Copy the correct version of unplug_interface.h from XENBUS

The current header contains an incoorrect method name. The method is currently
unused, so no actual harm came of this error.

Fixes: 8d8f73311fe5 ("Remove CoInstaller from INF")
Signed-off-by: Paul Durrant <pdurrant@amazon.com>
19 months agoDelete CoInstaller code
Owen Smith [Fri, 29 Sep 2023 08:03:15 +0000 (09:03 +0100)]
Delete CoInstaller code

With the CoInstaller removed from the INF file, delete the CoInstaller
source code and projects.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
19 months agoRemove CoInstaller from INF
Owen Smith [Fri, 29 Sep 2023 08:03:14 +0000 (09:03 +0100)]
Remove CoInstaller from INF

Windows 11 22H2 WHQL requires INF files pass "InfVerif /k", which highlights
several issues
- PnpLockdown=1 needs to be specified
- CoInstallers are no longer allowed

The CoInstaller has several functions that will need alternative solutions:
- The AllowUpdate mechanism is no longer possible
- The safety checks that ensure interface versionings remain compatible
- The updating of various system config registry values

Interface safety checks need to be handled by changes to child device bindings,
and assuming upgrade via emulated devices is safe. The unplug keys are cleared
in the INF to revert to emulated on the next boot, incase the current child
drivers rely on an interface that is no longer present (note: in this case,
child drivers will need updating).

Also updates unplug_interface.h and device bindings so that this driver is only
loaded on a later XenBus that has removed the XenBus CoInstaller.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
19 months agoAdd script to generate pooltag.txt for debugger use
Owen Smith [Wed, 13 Sep 2023 08:48:35 +0000 (09:48 +0100)]
Add script to generate pooltag.txt for debugger use

Note: script does not correctly handle src/common paths and attributes
  pool tags discovered within to 'common.sys'

Signed-off-by: Owen Smith <owen.smith@cloud.com>
23 months agoRebuild CodeQL builds
Owen Smith [Tue, 18 Apr 2023 08:50:45 +0000 (09:50 +0100)]
Rebuild CodeQL builds

CodeQL can sometimes fail to detect any source code if the codebase is
not rebuilt. Use the Rebuild target to force all intermediate build artifacts
to be cleaned beforehand.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
23 months agoCheck for zero byte allocations
Owen Smith [Mon, 17 Apr 2023 14:43:49 +0000 (15:43 +0100)]
Check for zero byte allocations

Avoid attempting to allocate zero byte buffers, which can lead to
inefficiencies in pool memory usage.

Suggested-by: Matthew Sykes <matthew.sykes@citrix.com>
Signed-off-by: Owen Smith <owen.smith@cloud.com>
2 years agoRemove trailing blank lines
Paul Durrant [Thu, 23 Mar 2023 15:48:29 +0000 (15:48 +0000)]
Remove trailing blank lines

Use the following bit of shell to remove a trailing blank line from each
file where such exists.

echo "$(echo "$(tac $file)" | tac)" > $file

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
2 years agoScripted replacement of Copyright notices in source
Owen Smith [Thu, 23 Feb 2023 09:51:30 +0000 (09:51 +0000)]
Scripted replacement of Copyright notices in source

Due to a transfer of copyright ownership from Citrix to Cloud Software Group,
the copyright notices in all source files should be updated.

Using the powershell script below replace "Copyright (c) Citrix Systems, Inc."
with "Copyright (c) Xen Project." and "Copyright (c) Cloud Software Group, Inc."

Function Multiline-Replace {
    param(
        [string]$Filename,
        [string]$ToReplace,
        [array]$ReplaceWith
    )

    $content = Get-Content $Filename
    $replace = $false
    $output = ""
    $content | ForEach {
        $line = $_
        if ($line.Contains($ToReplace)) {
            $replace = $true
            $ReplaceWith | ForEach {
                $output += $line.Replace($ToReplace, $_) + "`n"
            }
        } else {
            $output += $line + "`n"
        }
    }
    if ($replace) {
        Write-Host "Replacing: " $Filename
        $output | Set-Content $Filename
    } else {
        Write-Host "Ignoring:  " $Filename
    }
}

Function Replace-Filestrings {
    param(
        [array]$FilleTypes,
        [string]$ToReplace,
        [array]$Replacements,
        [array]$ExcludeList
    )

    $FileTypes | ForEach {
        Get-ChildItem $_ -Recurse | ForEach-Object {
            $filename = $_
            if (($ExcludeList | %{ $filename -Like $_ }) -Contains $True) {
                Write-Host "Excluding: " $filename
            } else {
                Multiline-Replace $_ $ToReplace $Replacements
            }
        }
    }
}

$ExcludeList = @("*include\xen\*", "*\obj\*")
$Replace = "Copyright (c) Citrix Systems Inc."

$Replacements = @("/* Copyright (c) Xen Project.", " * Copyright (c) Cloud Software Group, Inc.")
$FileTypes = @("*.c", "*.h", "*.rc")
Replace-Filestrings $FileTypes ('/* ' + $Replace) $Replacements $ExcludeList

$Replacements = @("; // Copyright (c) Xen Project.", "; // Copyright (c) Cloud Software Group, Inc.")
$FileTypes = @("*.mc")
Replace-Filestrings $FileTypes ('; // ' + $Replace) $Replacements $ExcludeList

$Replacements = @("; Copyright (c) Xen Project.", "; Copyright (c) Cloud Software Group, Inc.")
$FileTypes = @("*.inf", "*.def")
Replace-Filestrings $FileTypes ('; ' + $Replace) $Replacements $ExcludeList

$Replacements = @("Copyright (c) Xen Project.", "Copyright (c) Cloud Software Group, Inc.")
$FileTypes = @("LICENSE")
Replace-Filestrings $FileTypes $Replace $Replacements $ExcludeList

Signed-off-by: Owen Smith <owen.smith@citrix.com>
Amended commit comment. Fixed whitespace.

Signed-off-by: Paul Durrant <paul@xen.org>
2 years agoAdd resource file to coinstaller
Owen Smith [Thu, 23 Feb 2023 09:51:29 +0000 (09:51 +0000)]
Add resource file to coinstaller

Signed-off-by: Owen Smith <owen.smith@citrix.com>
2 years agoAllow rebranding file copyright string
Owen Smith [Thu, 23 Feb 2023 09:51:28 +0000 (09:51 +0000)]
Allow rebranding file copyright string

Pass COPYRIGHT string from environment to override the copyright string
that is embedded in the output binaries.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
2 years agoFree memory in correct fail path
Owen Smith [Mon, 30 Jan 2023 14:54:38 +0000 (14:54 +0000)]
Free memory in correct fail path

SDV identifies this as an error. Only attempt to free the buffer after the
allocation succeeds.

Signed-off-by: Matthew Sykes <matthew.sykes@citrix.com>
Signed-off-by: Owen Smith <owen.smith@citrix.com>
2 years agoCorrect return codes during racy destruction.
Martin Harvey [Mon, 5 Dec 2022 09:01:59 +0000 (09:01 +0000)]
Correct return codes during racy destruction.

Errors in PnP retun codes found when testing under driver
verifier with mixed VM lifecycle operations. Under some
rare cases, it is possible to get more than one PnP
"remove-like" operation. This results in a PnP remove
operation being processed whilst the device is already
in the deleted state.

This patch fixes the immediate cause of the bugfixes,
by fixing the return code. Device destruction is
unchanged. Investigation into the root cause is still
ongoing.

Signed-off-by: Martin Harvey <martin.harvey@citrix.com>
Cosmetic fixes.

Signed-off-by: Paul Durrant <paul@xen.org>
2 years agoPass SignMode to MSBuild
Owen Smith [Fri, 18 Nov 2022 10:06:10 +0000 (10:06 +0000)]
Pass SignMode to MSBuild

Allows overriding of SignMode to "Off" to prevent signing binaries with the PFX
file. This is useful if wrapper builds sign binaries with alternative signatures
or when signing is not required.

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

Signed-off-by: Paul Durrant <paul@xen.org>
2 years agoAdd build options for EWDK 22621
Paul Durrant [Mon, 31 Oct 2022 13:38:04 +0000 (13:38 +0000)]
Add build options for EWDK 22621

VisualStudioVersion = 17.0 maps to Visual Studio 2022
 * Adds project files for vs2022
 * Adds mapping from VisualStudioVersion 17.0 to "vs2022" project folder
 * Adds mapping from VisualStudioVersion 17.0 to "Windows 10" build target
 * Adds guard to build.ps1 - EWDK 22621 does not build x86 binaries
 * Adds include directive where compiler intrinsics are used

Suggested-by: Owen Smith <owen.smith@citrix.com>
Signed-off-by: Paul Durrant <pdurrant@amazon.com>
2 years agoAdd Svr2019, Svr2022 and Win11 to Inf2Cat
Owen Smith [Thu, 30 Jun 2022 14:24:03 +0000 (15:24 +0100)]
Add Svr2019, Svr2022 and Win11 to Inf2Cat

Signed-off-by: Owen Smith <owen.smith@citrix.com>
2 years agoFix compiler options
Owen Smith [Thu, 5 May 2022 07:04:53 +0000 (08:04 +0100)]
Fix compiler options

Adds '/ZH:SHA_256' '/CETCOMPAT' '/sdl' to compiler and '/SafeSEH' to x86 linker
command lines
These changes were prompted by binskim https://github.com/microsoft/binskim

Note: Rule BA2004 (Warning_NativeWithInsecureStaticLibraryCompilands) is still
      reported for xenvbd_coinst.dll and xencrsh.sys
      Rule BA2018 (Error, empty SEH table) is still reported for xencrsh.sys

Signed-off-by: Owen Smith <owen.smith@citrix.com>
3 years agoCreate/Destroy BlkifRing caches on Connect/Disconnect
Owen Smith [Wed, 30 Mar 2022 14:02:11 +0000 (15:02 +0100)]
Create/Destroy BlkifRing caches on Connect/Disconnect

Move cache creation to Connect after XENBUS_CACHE(Acquire) and cache
destruction to Disconnect before XENBUS_CACHE(Release)

Signed-off-by: Owen Smith <owen.smith@citrix.com>
3 years agoMove BlkifRing CacheCreate/Destroy to inline functions
Owen Smith [Wed, 30 Mar 2022 14:02:10 +0000 (15:02 +0100)]
Move BlkifRing CacheCreate/Destroy to inline functions

Signed-off-by: Owen Smith <owen.smith@citrix.com>
3 years agoAdd /CETCOMPAT to linker options
Owen Smith [Mon, 29 Nov 2021 09:57:26 +0000 (09:57 +0000)]
Add /CETCOMPAT to linker options

Signed-off-by: Owen Smith <owen.smith@citrix.com>
3 years agoInterpret "removable" and "info" flags correctly
Owen Smith [Tue, 30 Nov 2021 16:06:22 +0000 (16:06 +0000)]
Interpret "removable" and "info" flags correctly

"removable" relates to the ability to remove the device (not media)

  "removable" = "1" is used to indicate the device can be hot unplugged, as
  PV devices should support hot plug/unplug in the majority of cases.
  "removable" = "0" is used to indicate that the device is being prevented
  from hot unplug by the tool stack. This will allow XenVbd to report the
  correct device capabilities to the OS to indicate that this disk is not
  capable of being removed. This will allow certain policies to be applied
  which restrict access to removable disks (for security and to prevent data
  exfiltration)

"info" contains various flags for the media (not device)

  VDISK_CDROM implies RemovableMedia (a specific case of VDISK_REMOVABLE)
  VDISK_REMOVABLE imples RemovableMedia (underlying disk has GENHD_FL_REMOVABLE)
  VDISK_READONLY implies a READ_ONLY_DIRECT_ACCESS_DEVICE

  'Standard' disks usually set no flags (i.e. media is RW and not removable)
  A CDROM will set VDISK_CDROM | VDISK_READONLY, to indicate the media is RO
  and removable.

STOR_FEATURE_FULL_PNP_DEVICE_CAPABILITIES must be set, otherwise StorPort will
not use the values provided for EjectSupported and SurpriseRemovalOK in the
STOR_DEVICE_CAPABILITIES_EX structure. Without this, CM_DEVCAP_EJECTSUPPORTED
and CM_DEVCAP_SURPRISEREMOVALOK are left unchanged, and prevents a non-removable
device from identifying correctly as non-removable.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
3 years agoPage80/83 data is optional
Owen Smith [Thu, 12 Aug 2021 12:41:38 +0000 (13:41 +0100)]
Page80/83 data is optional

Check for non-NULL before attempting to free SCSI override data.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
3 years agoFix CodeQL warnings
Owen Smith [Thu, 12 Aug 2021 12:41:37 +0000 (13:41 +0100)]
Fix CodeQL warnings

- ExAllocatePoolWithTag is deprecated in Win10 2004, use
    ExAllocatePoolUninitialized instead

Signed-off-by: Owen Smith <owen.smith@citrix.com>
3 years agoFix SDV/CodeQL log generation
Owen Smith [Thu, 12 Aug 2021 12:41:36 +0000 (13:41 +0100)]
Fix SDV/CodeQL log generation

- sarif files need to be stored with SDV logs when generating the DVL file
- Disable PREFast and CodeAnalysis by default
- Run a seperate CodeAnalysis build after SDV, but before generating DVL file
    DVL file should contain multiple summary lines for SDV, at least 1 line
    for CodeAnalysis and at least 1 line for Semmle (CodeQL)

Signed-off-by: Owen Smith <owen.smith@citrix.com>
3 years agoDocument CodeQL build requirements
Owen Smith [Tue, 7 Sep 2021 08:10:46 +0000 (09:10 +0100)]
Document CodeQL build requirements

CodeQL requires an additional tool and rule set which are seperate from the
EWDK ISOs, and require manual installation and configuration

Signed-off-by: Owen Smith <owen.smith@citrix.com>
3 years agoFix build with later WDKs
Owen Smith [Thu, 12 Aug 2021 12:41:35 +0000 (13:41 +0100)]
Fix build with later WDKs

- Adds alias for GetProjectInfoForReference target to version.vcxproj
    Later kits seemed to have renamed the build target, and will fail without
    this alias target.
- Adds "/fd sha256" to signtool command line
    WDK 20344 and later require binaries signed with a SHA256 file digest, or
    the build outputs are deleted
- Disables warning 4061 - switch statement on enum types need to have a case for
    all values of the enumeration

Signed-off-by: Owen Smith <owen.smith@citrix.com>
- Cast enum types used as array indices to avoid bounds check complaint

Signed-off-by: Paul Durrant <paul@xen.org>
3 years agoCall BlkifRing(Acquire/Release)Lock before/after BlkifRingPoll
Owen Smith [Mon, 21 Jun 2021 12:54:45 +0000 (13:54 +0100)]
Call BlkifRing(Acquire/Release)Lock before/after BlkifRingPoll

Releasing the blkif ring lock drains the atomic SRB list into the queue. When
attempting to move things along, this also includes the atomic SRB list.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
3 years agoMatch __FreePage with __AllocatePage calls
Owen Smith [Mon, 21 Jun 2021 12:54:44 +0000 (13:54 +0100)]
Match __FreePage with __AllocatePage calls

Replace __FreePages with __FreePage when the memory was allocated with
__AllocatePage. This is a cosmetic change, as __FreePage is an alias for
__FreePages

Signed-off-by: Owen Smith <owen.smith@citrix.com>
4 years agoAdd CodeQL build stage
Owen Smith [Fri, 5 Mar 2021 10:16:05 +0000 (10:16 +0000)]
Add CodeQL build stage

CodeQL logs will be required for future WHQL submissions. Add a stage
that generates the required SARIF files. CodeQL is a semantic code
analysis engine, which will highlight vunerabilities that will need
fixing.

In order to use CodeQL, the CodeQL binaries must be on the path and the
Windows-Driver-Developer-Supplemental-Tools must be on the path defined
by the CODEQL_QUERY_SUITE environment variable (if defined), or under
the parent folder (if CODEQL_QUERY_SUITE variable is not defined)

Note: Due to the way the codeql command line is built, using quotes in a
MSBuild command line is not possible, so generate a batch file to wrap
the command line.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
4 years agoBring XENBUS interface versions up to date...
Paul Durrant [Mon, 22 Feb 2021 11:01:40 +0000 (11:01 +0000)]
Bring XENBUS interface versions up to date...

... and amend binding accordingly.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
4 years agoAdd XEN:BOOT_EMULATED handler
Owen Smith [Wed, 16 Dec 2020 15:36:10 +0000 (15:36 +0000)]
Add XEN:BOOT_EMULATED handler

If XEN:BOOT_EMULATED=TRUE is in the system start options, xen.sys will
issue an unplug for only the AUX disks (by writing 0x0004 instead of
0x0001 to port 0x10 during the unplug), this leads to a target being
created for the boot disk which will not be used (due to an emulated
device being present). The non-functioning target will request a reboot
to resolve this, which will return to the current state and request
another reboot.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
4 years agoIntroduce a BlkifRing watchdog
Paul Durrant [Thu, 19 Nov 2020 14:43:33 +0000 (14:43 +0000)]
Introduce a BlkifRing watchdog

Analogous to similar watchdog threads for XENVIF transmitter and receiver
rings, this patch introduces code to start a watchdog thread for blkif rings.
The thread wakes every 30s and checks for responses remaining pending on the
ring (without the frontend making progress) across two consecutive iterations.
If the ring appears to be 'stuck' in this manner then the ring DebugCallback()
function is triggered, the ring is polled and an event is send to wake up
the backend.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
4 years agoInherit versioning info from environment if present
Nicholas Tsirakis [Fri, 6 Nov 2020 20:48:44 +0000 (15:48 -0500)]
Inherit versioning info from environment if present

As the drivers stabilize and mature, there is an ever-growing
chance that other opensource virtualization projects will adopt
them. Allow external projects to inject their own versioning
into the drivers instead of hardcoding the latest winpv version.

Signed-off-by: Nicholas Tsirakis <tsirakisn@ainfosec.com>
Acked-by: Owen Smith <owen.smith@citrix.com>
4 years agoAllow user to specify desired build architecture
Nicholas Tsirakis [Fri, 6 Nov 2020 20:48:43 +0000 (15:48 -0500)]
Allow user to specify desired build architecture

Often times we only need to build a driver for a single
targeted architecture. Continue to build both by default,
but allow the user to specify one if desired.

Signed-off-by: Nicholas Tsirakis <tsirakisn@ainfosec.com>
Use [string]::IsNullOrEmpty($Arch)

Signed-off-by: Paul Durrant <paul@xen.org>
4 years agoStop mis-interpreting the 'removable' node in xenstore...
Paul Durrant [Fri, 28 Aug 2020 16:49:47 +0000 (17:49 +0100)]
Stop mis-interpreting the 'removable' node in xenstore...

... and the VDISK_REMOVABLE bit in the value of the 'info' node.

They both apply to the media and not the device itself. PV devices are always
removable.
The comment in libxl_disk.c concerning the 'removable' flag states that:

"Currently there is only one removable device -- CDROM"

This is not conclusive but it is reasonable to infer from that the removabilty
refers to the media and not the drive itself. (CDROM drives in typical servers
are not removable).
The code in Linux xen-blkback/xenbus.c sets VDISK_REMOVABLE if the underlying
block device has the GENHD_FL_REMOVABLE flag, and the comment above the
definition of that flag in genhd.h states:

"``GENHD_FL_REMOVABLE`` (0x0001): indicates that the block device gives access
to removable media.
When set, the device remains present even when media is not inserted.
Must not be set for devices which are removed entirely when the media is
removed."

This patch, therefore, stops using these values to indicate the removability
of the target devices and instead uses them as they were intended, to indicate
the removability of the media.

NOTE: The code in XENCRSH is modified to simply ignore the 'removable' node.
      The value currently sampled is not used.
      The Removable BOOLEAN field currently in XENVBD_CAPS is also moved into
      XENVBD_FEATURES for consistency with other values sampled from xenstore
      nodes.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
4 years agoDon't pass MM_DONT_ZERO_ALLOCATION to MmAllocatePagesForMdlEx()...
Paul Durrant [Wed, 17 Jun 2020 08:22:44 +0000 (09:22 +0100)]
Don't pass MM_DONT_ZERO_ALLOCATION to MmAllocatePagesForMdlEx()...

...in __AllocatePages()

See commit 4f85d004 "Replace uses of MmAllocatePagesForMdlEx in
__AllocatePage" in XENVIF for more background.

In summary, it is to avoid BSOD 139 1e with a stack similar to the following:

nt!KeBugCheckEx
nt!KiBugCheckDispatch+0x69
nt!KiFastFailDispatch+0xd0
nt!KiRaiseSecurityCheckFailure+0x30e
nt!KiAcquireThreadStateLock+0x11fa90
nt!KeSetIdealProcessorThreadEx+0xd0
nt!MiZeroInParallelWorker+0x115016
nt!MiZeroInParallel+0x11c
nt!MiInitializeMdlBatchPages+0x2ae
nt!MiAllocatePagesForMdl+0x192
nt!MmAllocatePartitionNodePagesForMdlEx+0xc9
nt!MmAllocatePagesForMdlEx+0x4d

These bugchecks have been observed in recent updates of Server 2019.

This patch, rather than replacing calls to MmAllocatePagesForMdlEx() with
calls to MmMapLockedPagesSpecifyCache(), just avoids passing
MM_DONT_ZERO_ALLOCATION to work round the bug.

The patch instead passes MM_ALLOCATE_FULLY_REQUIRED, which arguably should
have always been passed for allocations larger than a single page. It also
fixes a formatting issue.

Reported-by: Jan Bakuwel <jan.bakuwel@gmail.com>
Signed-off-by: Paul Durrant <pdurrant@amazon.com>
4 years agoxencrsh: use ASSERT() in ASSERT3U/3S/3P() rather than BUG_ON()
Paul Durrant [Wed, 17 Jun 2020 08:13:42 +0000 (09:13 +0100)]
xencrsh: use ASSERT() in ASSERT3U/3S/3P() rather than BUG_ON()

ASSERT() then resolves to BUG_ON() followed by __analysis_assume(), which
avoids some spurious warnings during code analysis.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Reviewed-by: Owen Smith <owen.smith@citrix.com>
5 years agoHandle return codes from MSBuild
Owen Smith [Tue, 10 Mar 2020 10:47:03 +0000 (10:47 +0000)]
Handle return codes from MSBuild

If MSBuild fails, it returns a non-zero return value. Forward this
failure to the calling scripts to fail earlier.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
5 years agoMAINTAINERS: Update my email address
Paul Durrant [Tue, 10 Mar 2020 10:56:55 +0000 (10:56 +0000)]
MAINTAINERS: Update my email address

My @amazon.com address is no longer convenient to use.

Signed-off-by: Paul Durrant <paul@xen.org>
5 years agoIncrease FrontendPath length for long DeviceIds
Owen Smith [Wed, 15 Jan 2020 11:50:44 +0000 (11:50 +0000)]
Increase FrontendPath length for long DeviceIds

The DeviceIds maximum value is 1 << 28 | 0xfffff << 8 | 0xff, which is a
9 digit decimal numver. Values higher than this are invalid. Ensure the
FrontendPath buffer is large enough to contain valid DeviceId values.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
5 years agobump version to 9.1.0
Paul Durrant [Fri, 6 Dec 2019 12:11:49 +0000 (12:11 +0000)]
bump version to 9.1.0

Now that 9.0 is branched (in staging-9.0) the master version needs to be
advanced.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
5 years agoMAINTAINERS: Update my email address staging-9.0 9.0.0 9.0.0-rc1
Paul Durrant [Thu, 14 Nov 2019 10:11:28 +0000 (10:11 +0000)]
MAINTAINERS: Update my email address

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
5 years agoFix > 2TB disks
Owen Smith [Fri, 11 Oct 2019 13:51:10 +0000 (14:51 +0100)]
Fix > 2TB disks

In order to determine the size of a disk, Windows will issue a
SCSIOP_READ_CAPACITY. Disks larger than 2TB will respond with a max LBA
of 0xFFFFFFFF, which causes Windows to issue a SCSIOP_READ_CAPACITY16.
The read capacity 16 is passed with a 12 byte buffer to be filled in
using the READ_CAPACITY_DATA_EX structure, not the 16 or 32byte
(depending on packing) READ_CAPACITY16_DATA buffer.
Also adds Error labels to the failure conditions.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
5 years agoTrack StartIo and Failed SRB counts
Owen Smith [Wed, 9 Oct 2019 19:07:24 +0000 (20:07 +0100)]
Track StartIo and Failed SRB counts

Signed-off-by: Owen Smith <owen.smith@citrix.com>
5 years agoIncrease buffer size
Owen Smith [Wed, 9 Oct 2019 19:03:29 +0000 (20:03 +0100)]
Increase buffer size

sizeof("device/vbd/XXXXXXXX") is too small for some of the higher device
identifiers. Increase the size to allow for longer device ids.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
5 years agoUpdate to the new version of the XENFILT_EMULATED interface
Paul Durrant [Wed, 2 Oct 2019 12:20:34 +0000 (13:20 +0100)]
Update to the new version of the XENFILT_EMULATED interface

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
5 years agoFix LNK2005
Owen Smith [Mon, 23 Sep 2019 15:33:53 +0000 (16:33 +0100)]
Fix LNK2005

VS2019 project fails to link with LNK2005 for functions defined in
libcntpr.lib. Remove the unneccessary linker input.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
5 years agoAdd support for EWDK_19h1_release_svc_prod3_18362_190416-1111
Paul Durrant [Thu, 19 Sep 2019 09:56:59 +0000 (10:56 +0100)]
Add support for EWDK_19h1_release_svc_prod3_18362_190416-1111

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
5 years agoMAINTAINERS: Update my email address
Paul Durrant [Thu, 19 Sep 2019 09:28:42 +0000 (10:28 +0100)]
MAINTAINERS: Update my email address

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
5 years agoRemove the old python build scripts and document use of the EWDK
Paul Durrant [Thu, 19 Sep 2019 09:27:54 +0000 (10:27 +0100)]
Remove the old python build scripts and document use of the EWDK

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
5 years agoAttempt to process responses on the ring
Owen Smith [Thu, 19 Sep 2019 08:44:15 +0000 (09:44 +0100)]
Attempt to process responses on the ring

When Disabling the ring, outstanding responses need to be completed.
Poll the ring to complete outstanding responses if the backend is still
connected and valid.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
5 years agoRework BlkifRingDisable
Owen Smith [Thu, 19 Sep 2019 08:30:41 +0000 (09:30 +0100)]
Rework BlkifRingDisable

Clean up all prepared and submitted requests when the ring is disabled,
so that outstanding SRBs are returned to storport for queueing. This is
especially important on the return from suspend path, as the ring is no
longer valid, and any submitted requests would be lost and trigger a
storport target reset.
Also ignores missing requests for responses.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
5 years agoAttempt to process responses on the ring
Owen Smith [Thu, 19 Sep 2019 08:24:28 +0000 (09:24 +0100)]
Attempt to process responses on the ring

When Disabling the ring, outstanding responses need to be completed.
Poll the ring to complete outstanding responses if the backend is still
connected and valid.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
5 years agoReplace XENVBD_SRB_STATE with LIST_ENTRY
Owen Smith [Wed, 18 Sep 2019 16:24:40 +0000 (17:24 +0100)]
Replace XENVBD_SRB_STATE with LIST_ENTRY

Dont treat the prepared queue differently to any other list.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
5 years agoPrevent IsZeroMemory() ASSERTions when XENDISK shuts down
Paul Durrant [Wed, 18 Sep 2019 16:19:19 +0000 (17:19 +0100)]
Prevent IsZeroMemory() ASSERTions when XENDISK shuts down

Pdo->PhysSectorSize needs to be zeroed out.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
5 years agoRework request submission
Owen Smith [Thu, 5 Sep 2019 15:29:04 +0000 (16:29 +0100)]
Rework request submission

Make BlkifRingPostRequests return success for submitting 0 or more requests,
or failure when the ring is full. This prevents the loop in
BlkifRingSchedule() from preparing the next SRB when the ring is already
full.
Also attempt to notify the backend of changes every iteration of the loop in
BlkifRingSchedule(), to trigger the backend as soon as possible.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
5 years agoFix debug callback output
Owen Smith [Thu, 5 Sep 2019 08:57:31 +0000 (09:57 +0100)]
Fix debug callback output

Signed-off-by: Owen Smith <owen.smith@citrix.com>
5 years agoUpdate rsp_event during BlkifRingPoll()
Owen Smith [Thu, 5 Sep 2019 08:42:38 +0000 (09:42 +0100)]
Update rsp_event during BlkifRingPoll()

Currently, by updating it in __BlkifRingPushRequests(), the code is
attempting to defer events until all of the posted requests have responses
on the ring. This is likely to lead to a cycle of fill...empty...fill...
empty etc., which is bad for performance.

This patch instead updates rsp_event when BlkifRingPoll() completes, such
that the very next response placed on the ring by the backend should
cause an event to be sent.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
[Expanded commit message]
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
5 years agoRate limit BLKIF_OP failure log messages
Daniel Davis [Fri, 19 Jul 2019 09:10:31 +0000 (10:10 +0100)]
Rate limit BLKIF_OP failure log messages

Signed-off-by: Daniel Davis <Daniel.Davis@citrix.com>
5 years agoUse genfiles to set DriverVer
Owen Smith [Wed, 17 Jul 2019 12:55:30 +0000 (13:55 +0100)]
Use genfiles to set DriverVer

Signed-off-by: Owen Smith <owen.smith@citrix.com>
5 years agoAdd PowerShell build scripts, version.vcxproj
Owen Smith [Fri, 14 Jun 2019 15:42:49 +0000 (16:42 +0100)]
Add PowerShell build scripts, version.vcxproj

Based on the sequence of commits to xenbus, add powershell scripts to
build the solution using the EWDK
version.vcxproj generates versioned files (version.h and xenvbd.inf) using
scripts/genfiles.ps1
Strips duplicated functionality from build.py to produce consistant
builds between python and powershell.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
5 years agoAdd BUILD_NUMBER to reported version
Owen Smith [Fri, 14 Jun 2019 15:21:05 +0000 (16:21 +0100)]
Add BUILD_NUMBER to reported version

Signed-off-by: Owen Smith <owen.smith@citrix.com>
6 years agoTry to avoid dumping non-RAM pages
Paul Durrant [Fri, 26 Apr 2019 08:53:34 +0000 (09:53 +0100)]
Try to avoid dumping non-RAM pages

When XENCRSH sets up blkif requests they may end up referring to PFNs that
are ballooned out. When these requests reach the backend driver, it will
unsurprisingly encounter failures when trying to map or copy the data from
these PFNs, generally resulting in the request as a whole being failed and
a lot of noise being emitted to various logs.

This patch adds a check into PrepareReadWrite() to check the P2M type of
PFNs being dumped. If the type is found to be anything other than writable
RAM then the PFN is substituted with a buffer PFN, which will just contain
zeroes. The storage backend will be able to map or copy these pages, so
stalls in the dump process and useless log messages will be avoided.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
6 years agoReport disk size and logical sector size in XENDISK...
Paul Durrant [Tue, 9 Apr 2019 16:03:08 +0000 (17:03 +0100)]
Report disk size and logical sector size in XENDISK...

...rather than XENVBD.

This allows us to use the PDO name rather than the more obscure target
number. Also, report the size in MB rather rather than in sectors (now
that sector size may be something other than 512B).

Also fix some whitespace bugs while in the neighbourhood.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
6 years agoGive XENDISK PDOs a name
Paul Durrant [Tue, 9 Apr 2019 15:45:19 +0000 (16:45 +0100)]
Give XENDISK PDOs a name

Use DeviceID/InstanceID to give PDOs a meaningful name that can be used
in log messages.

Also fix some whitespace bugs while in the neighbourhood.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
6 years agoAdd 'feature-large-sector-size'
Paul Durrant [Fri, 5 Apr 2019 15:51:08 +0000 (16:51 +0100)]
Add 'feature-large-sector-size'

As explained in Xen commit 67e1c050 "public/io/blkif.h: try to fix the
semantics of sector based quantities" [1], frontends that always
supply and interpret sector based quantities in terms of the 'sector-size'
of the backend should declare 'feature-large-sector-size'.

[1] http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=67e1c050e36b2c9900cca83618e56189effbad98

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
6 years agoMake PdoSendTrimSynchronous less noisy
Paul Durrant [Fri, 5 Apr 2019 15:38:45 +0000 (16:38 +0100)]
Make PdoSendTrimSynchronous less noisy

Remove the 'TRIM' Trace statement. Also fix some hard-tab nonsense in
nearby code.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
6 years agoImplement query for StorageAccessAlignmentProperty
Paul Durrant [Fri, 5 Apr 2019 15:15:47 +0000 (16:15 +0100)]
Implement query for StorageAccessAlignmentProperty

XENDISK already issues a SCSIOP_READ_CAPACITY16 down to XENVBD and so it
may as well handle a query for StorageAccessAlignmentProperty.

NOTE: This patch also adds a name decoder for STORAGE_QUERY_TYPE and adds
      some missing entries to the name decoder for STORAGE_PROPERTY_ID.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
6 years agoForce crashdump driver to use single ring
Owen Smith [Wed, 27 Mar 2019 09:52:33 +0000 (09:52 +0000)]
Force crashdump driver to use single ring

Signed-off-by: Owen Smith <owen.smith@citrix.com>
6 years agoTrack State.Count in BlkifRingDisable
Owen Smith [Wed, 27 Mar 2019 09:51:30 +0000 (09:51 +0000)]
Track State.Count in BlkifRingDisable

Signed-off-by: Owen Smith <owen.smith@citrix.com>
6 years agoRemove duplicate xenstore-write
Owen Smith [Wed, 27 Mar 2019 09:50:33 +0000 (09:50 +0000)]
Remove duplicate xenstore-write

Also shows num/max queues in debug callback

Signed-off-by: Owen Smith <owen.smith@citrix.com>
6 years agoFix ASSERTion failure during disk unplug
Paul Durrant [Tue, 22 Jan 2019 16:21:53 +0000 (16:21 +0000)]
Fix ASSERTion failure during disk unplug

BlkifRing->Path is not being NULL-ed out after freeing.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
6 years agoFix BSOD on RingDestroy
Owen Smith [Wed, 26 Sep 2018 09:47:36 +0000 (10:47 +0100)]
Fix BSOD on RingDestroy

Zero Frontend->MaxQueues after calling RingDestroy, as RingDestroy will
query this value to free each BlkifRing, which will decrement an
unsigned value below 0.
Also adds an ASSERT to detect if FrontendGetMaxQueues returns 0.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
Test that Index != 0 rather than > 0, since it is an unsigned quantity.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
6 years agoConditionally package DPInst
Owen Smith [Fri, 24 Aug 2018 16:46:43 +0000 (17:46 +0100)]
Conditionally package DPInst

Since DPInst.exe is not shipped with the Windows Driver Kit 10, an
environment variable must point to local copies. Make the inclusion of
DPInst conditional on DPINST_REDIST being defined and that path
existing. This simplifies building packages which do not require DPInst
for installation, and removes a required step to create a working build.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
6 years agoRemove bogus ASSERTion
Paul Durrant [Mon, 6 Aug 2018 09:47:58 +0000 (10:47 +0100)]
Remove bogus ASSERTion

In a checked build the code in BlkifRingSchedule() sometimes hits the
ASSERTion:

ASSERT3U(State->Count, ==, 0);

This check is there because this code was ported across from XENVIF. In
the context of that driver the check is valid because it should never be
possible to post a partial sequence of netif requests (since that would
violate the protocol). However, in the context of XENVBD posting blkif
requests, it is perfectly reasonable for a subset of blkif requests for
a single SRB to be posted, and hence __BlkifRingPostRequests() may exit
before State->Count falls to zero. Thus the ASSERTion is invalid in this
context and needs to be removed.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
6 years agoAdd some sensible default overrides
Owen Smith [Fri, 3 Aug 2018 13:48:17 +0000 (14:48 +0100)]
Add some sensible default overrides

Without overrides, "max-ring-page-order" and "multi-queue-max-queues"
use values that will consume large amounts of grant references.
"max-ring-page-order" will default to 4 (16 pages per ring)
"multi-queue-max-queues" will default to the lowest of guest vCPU count
or backend's vCPU count.

Override "max-ring-page-order" to 1 (2 pages per ring) and
"multi-queue-max-queues" to 2 (2 rings per block device)

Signed-off-by: Owen Smith <owen.smith@citrix.com>
6 years agoWork around bug in VS2017 SDV
Paul Durrant [Thu, 19 Jul 2018 09:52:24 +0000 (10:52 +0100)]
Work around bug in VS2017 SDV

XENBUS commit 868cd40f (of the same name) introduced a workaround for a
quoting bug in SDV. This commit applies a similar workaround for XENVBD.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
6 years agoFix SDV release parameter
Paul Durrant [Wed, 18 Jul 2018 14:23:21 +0000 (15:23 +0100)]
Fix SDV release parameter

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
6 years agoDisable spectre mitigation warnings
Paul Durrant [Tue, 10 Jul 2018 15:02:42 +0000 (16:02 +0100)]
Disable spectre mitigation warnings

These are not terribly useful and cause the build to fail.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
6 years agoUpdate EVTCHN, GNTTAB and STORE interface headers
Owen Smith [Tue, 26 Jun 2018 11:52:35 +0000 (12:52 +0100)]
Update EVTCHN, GNTTAB and STORE interface headers

Updates revision to 09000004
Fixes Evtchn Unmask calls
Updates xenbus interface headers to latest versions

This will resolve an issue where, under certain timing conditions,
xenvbd will request a second reboot before functioning correctly.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
6 years agoFix SDV build error
Paul Durrant [Mon, 4 Jun 2018 16:48:02 +0000 (17:48 +0100)]
Fix SDV build error

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
6 years agoFix VS2015 build
Paul Durrant [Mon, 4 Jun 2018 15:34:31 +0000 (16:34 +0100)]
Fix VS2015 build

STOR_PERF_NO_SGL does not appear to exist in the older WDK.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
6 years agoSet StorPortInitializePerfOpts
Owen Smith [Mon, 4 Jun 2018 14:37:36 +0000 (15:37 +0100)]
Set StorPortInitializePerfOpts

Sets DPC_REDIRECTION, OPTIMIZE_FOR_COMPLETION_DURING_STARTIO and
CONCURRENT_CHANNELS (to "multi-queue-max-queues") to improve StorPort's
distribution of SRBs to vCPUs.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
6 years agoMove query of "multi-queue-max-queues" to driver.c
Owen Smith [Mon, 4 Jun 2018 14:34:23 +0000 (15:34 +0100)]
Move query of "multi-queue-max-queues" to driver.c

Signed-off-by: Owen Smith <owen.smith@citrix.com>
6 years agoRemove queue.h/.c
Owen Smith [Mon, 4 Jun 2018 14:30:55 +0000 (15:30 +0100)]
Remove queue.h/.c

XENVBD_QUEUE has been replaced by LIST_ENTRY, and is no longer used.
Remove queue.h/.c and any include directives

Signed-off-by: Owen Smith <owen.smith@citrix.com>
6 years agoImplement multi-queues
Owen Smith [Mon, 4 Jun 2018 14:11:26 +0000 (15:11 +0100)]
Implement multi-queues

Splits XENVBD_RING into multiple XENVBD_BLKIF_RINGs, one for each shared
ring. Up-to "multi-queue-max-queues" rings are used to pass
blkif_requests and blkif_responses between frontend and backend. Reworks
the ring interactions to remove the locks used by XENVBD_QUEUE,
implementing a queue system similar to XenVifs transmitter queues.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
s/Packets/SRBs in ring.c

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
6 years agoForce single queue in crash/hibernate path
Owen Smith [Mon, 4 Jun 2018 13:57:43 +0000 (14:57 +0100)]
Force single queue in crash/hibernate path

Remove "multi-queue-num-queues" from frontend area when the crashump
driver is active. This will force the backend to use a single queue,
which the crashdump frontend is supplying

Signed-off-by: Owen Smith <owen.smith@citrix.com>
Add whitespace after cast for consistency with other code.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
6 years agoDont close ring during FrontendReset
Owen Smith [Mon, 4 Jun 2018 13:47:15 +0000 (14:47 +0100)]
Dont close ring during FrontendReset

Closing the ring (and destroying the shared pages, etc) is not required
when a HwStorResetBus or SRB_FUNCTION_RESET_DEVICE is triggered.
Disabling the ring will cause any outstanding blkif_requests and SRBs to
be failed.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
6 years agoRemove RingTrigger
Owen Smith [Mon, 4 Jun 2018 13:42:23 +0000 (14:42 +0100)]
Remove RingTrigger

RingTrigger calls XENBUS_EVTCHN(Trigger..) on during the suspend
callback. Just before this, the ring is recreated and enabled, which
also calls XENBUS_EVTCHN(Trigger..). The explicit call RingTrigger is
unneccessary

Signed-off-by: Owen Smith <owen.smith@citrix.com>
6 years agoQuery "multi-queue-max-queues"
Owen Smith [Mon, 4 Jun 2018 13:36:21 +0000 (14:36 +0100)]
Query "multi-queue-max-queues"

Query "multi-queue-max-queues", and override if neccessary, and work
out a suitable value for the number of queues used. Also adds the
commented out writing code to set "multi-queue-num-queues"

Signed-off-by: Owen Smith <owen.smith@citrix.com>
6 years agoUpdate Xen header files
Paul Durrant [Mon, 4 Jun 2018 13:19:52 +0000 (14:19 +0100)]
Update Xen header files

The original patch from Owen contained too much whitespace damage. This
patch replaces it with the results of an invocation of get_xen_headers.py
and includes all resulting header updates.

NOTE: This patch adds one extra header (physdev.h) and a fix to remove
      now-duplicate definitions of DOMID_INVALID from frontend.c.

Suggested-by: Owen Smith <owen.smith@citrix.com>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>