Open Source Citrix Windows PV Drivers - Paul Durrant, Citrix

The Linux Foundation
The Linux FoundationDirector, Open Source Solutions at Citrix
Open Source Citrix
Windows PV Drivers
Paul Durrant
Principal Software Engineer, Citrix
Agenda
“A history of the Windows PV drivers and a brief tour of the ‘upstream’
drivers and their interfaces”
• Background
• The XenServer 6.0.2 (a.k.a. legacy) drivers
• The XenServer 6.1 (a.k.a. standard) drivers
• Open Source
• ‘Upstream’ Drivers
• XenServer PV Device
• Interfaces
• Building and Installing
Why use PV Drivers?
• Emulated storage and network are slow
• IDE
• Realtek 8139
• Dom0 takes a lot of load
• Can easily take 50% CPU per VM
• Migration can be problematic
• Testing shown up many crashes and hangs
Windows Drivers

This is a Filter Device Object.
They can be used to interpose on
Plug’n’Play, Power or IO
messages flowing between PDOs
and FDOs.

PDO

PACKAGE (INF FILE)

FDO

FiltDO

local/domain/device/vif

This is a Physical Device Object, created
by a bus driver. The ‘name’ of this device is
used by Windows to select a driver.

This is a Function Device Object, created
when a driver binds to a Physical Device
Object. The INF file states the ‘names’ it will
bind to.
This is a xenstore key that is used
by a PV bus driver to create a
PDO.

PACKAGE

FDO

This is an FDO created by a child
PV driver that binds to the PDO
representing the xenstore key.
XenServer 6.0.2 PV Drivers
Created by installer

Emulated by QEMU

PCIVEN_5853&DEV_0001

ROOTXENEVTCHN

XEVTCHN

XENVBD

XENEVTCHN

XENVBD
XENUTIL

local/domain/device/vif

Linkage dependency

XENVIF

XENVIF

local/domain/device/vif/0
XENNET

XENNET

SCSIFILT

local/domain/device/vif/1
XENNET

XENNET

local/domain/device/vbd/768

…

DISK

SCSIFILT

local/domain/device/vbd/832

DISK

…

Standard in-box
driver

•

XENIFACE omitted for simplicity
XenServer 6.0.2 PV Drivers
• Need SCSIFILT because we use old SCSIPORT storage driver
model, which is really slow
• Creates all sorts of problems with compatibility
• Use of ROOT node requires installer
• Cross-package linkage dependency means drivers have to be
installed and upgraded as a unit
• Prevents deployment via Windows Update

“But Windows Update would be very useful for large installations or
upgrades so that’s a pain. What can we do?”
Enter Windows 8
Enter Windows 8
• With the new WDK Microsoft decided:
• You can only use Visual Studio 2012 to build…
…so throw away your existing build scripts
• They only support building for OS back to Vista…

…so you’re going to have to have two binaries if you want to
support XP and Server 2003 like it or not
“So, we’re going to have to do something.”
XenServer 6.1 PV Drivers
• Goals:
• No installer necessary for drivers
• Can be installed via device manager
• No cross-package linkage dependency
• Versioned interfaces discovered at run-time
• Suitable for Windows Update
• Cannot bind to existing platform PCI device
• Implementation choice:
• Use faster STORPORT storage driver model
• Possible now we’re only targeting Vista onwards
• Removes need for SCSIFILT
XenServer 6.1 PV Drivers
Handles unplug

XENBUS

XENFILT

NOTE: New Device ID

PCIVEN_5853&DEV_0002

XEN

XENBUS

local/domain/device/vif

local/domain/device/vbd

XENVIF

XENVBD
Interface
discovery

XENVIF

local/domain/device/vif/0
XENNET

XENNET

local/domain/device/vif/1
XENNET

XENNET

XENVBD

local/domain/device/vbd/768

…

DISK

local/domain/device/vbd/832

DISK

•

…

XENIFACE omitted again for simplicity
Open Source
• XenServer made completely open source
• Windows driver code hosted on GitHub
•
•
•
•
•

https://github.com/xenserver/win-xenbus
https://github.com/xenserver/win-xenvif
https://github.com/xenserver/win-xennet
https://github.com/xenserver/win-xenvbd
https://github.com/xenserver/win-xeniface

• BSD 2-Clause license
“But the drivers will only work on XenServer, and you can only build
them if you work for Citrix. That’s not very open!”

•

upstream branch may have been merged into master
‘Upstream’ PV Drivers
• Basically the same as 6.1 (and 6.2) drivers
• Removed dependency on XenServer QEMU patches
• Emulated device unplug
• Platform device ID
• Added new binding for XenServer PV device
• Available in upstream QEMU 1.6 onwards
• Should work on any reasonable Xen and dom0
• Tested on Xen 3.4, 4.1 and 4.4
• netback fix may be needed if not using udev

• Code initially in ‘upstream’ branches on GitHub
• Will be merged into ‘master’ once basic testing completed
XENBUS binding

PCIVEN_5853&DEV_0001

PCIVEN_5853&DEV_C000

PCIVEN_5853&DEV_0002

You should have one of
these

• XENBUS binds to all three of these
• Use co-installer to select ‘active’ device
• Will only select if there’s no current selection
• Only active device has children
• Children’s name carries device ID
• Use only C000 for Windows Update

You may have one of
these
Interface Discovery

DRIVER3

DRIVER3

• Message is forwarded to parent if interface
not implemented
DRIVER3
• Client doesn’t care where the
interface is implemented
• Allows interfaces to be exported by
XENFILT
• IRP_MN_QUERY_INTERFACE message
• Identifies interface by GUID
• Gets back jump table and context
Interfaces
• See XXX_interface.h in include directory
• GUID and VERSION
• General sequence
• Query for interface
• Code in win-xenvif.git:/src/xenvif/fdo.c good example
• Get back completed INTERFACE structure
• FOO(Acquire, &Interface);
• Status = FOO(Bar, &Interface, …);
• FOO(Release, &Interface);
Interfaces
• XENFILT
• EMULATED
• UNPLUG
• XENBUS
• EVTCHN
• GNNTAB
• STORE
• DEBUG
• XENVIF
• VIF
Building a driver
• README.md should tell you want you need to know
• Pre-requistes
• Visual Studio 2012 (NOT Express)
• Windows 8 WDK
(See http://msdn.microsoft.com/en-us/windows/hardware/hh852365)

• Python 3.x
• Set environment
• VS
• KIT
• SYMBOL_SERVER

Usually C:Program FilesMicrosoft Visual Studio 11.0 (!)

• build.py free|checked

Usually C:Program FilesWindows Kits8.0
I use C:Symbols
Installing a driver
• INSTALL.md should tell you want you need to know
• Driver build results in directory and tarball
• Copy to target (and unpack if necessary)
• Navigate to x86 or x64
• Either run dpinst.exe or use Device Manager
• Builds are test signed
• Install .pfx file (see proj sub-directory) to avoid scary warning
• Make sure testsigning is enabled on 64-bit systems
bcdedit /set testsigning on
Contributing
• See MAINTAINERS files in existing repositories
• Discuss on xs-devel@lists.xenserver.org
• More drivers
• PV HID
• PV USB (?)
Q&A
1 of 20

Recommended

Multiple Device Emulators for HVM Guests, Paul Durrant, Citrix by
Multiple Device Emulators for HVM Guests, Paul Durrant, CitrixMultiple Device Emulators for HVM Guests, Paul Durrant, Citrix
Multiple Device Emulators for HVM Guests, Paul Durrant, CitrixThe Linux Foundation
7.3K views13 slides
Xen Project: Windows PV Drivers by
Xen Project: Windows PV DriversXen Project: Windows PV Drivers
Xen Project: Windows PV DriversThe Linux Foundation
154.8K views23 slides
Citrix certified administrator certification by
Citrix certified administrator certificationCitrix certified administrator certification
Citrix certified administrator certificationCisco-642-902
333 views20 slides
LFNW2014 Advanced Security Features of Xen Project Hypervisor by
LFNW2014 Advanced Security Features of Xen Project HypervisorLFNW2014 Advanced Security Features of Xen Project Hypervisor
LFNW2014 Advanced Security Features of Xen Project HypervisorThe Linux Foundation
2.9K views66 slides
XPDS14 - Xen in EFI World - Daniel Kiper, Oracle by
XPDS14 - Xen in EFI World - Daniel Kiper, OracleXPDS14 - Xen in EFI World - Daniel Kiper, Oracle
XPDS14 - Xen in EFI World - Daniel Kiper, OracleThe Linux Foundation
2.4K views29 slides
Iaas on xcp by
Iaas on xcpIaas on xcp
Iaas on xcpThe Linux Foundation
678 views16 slides

More Related Content

What's hot

XPDS16: Hypervisor-based Security: Vicarious Learning via Introspektioneerin... by
XPDS16:  Hypervisor-based Security: Vicarious Learning via Introspektioneerin...XPDS16:  Hypervisor-based Security: Vicarious Learning via Introspektioneerin...
XPDS16: Hypervisor-based Security: Vicarious Learning via Introspektioneerin...The Linux Foundation
708 views11 slides
Xen Project CI for OpenStack Overview by
Xen Project CI for OpenStack OverviewXen Project CI for OpenStack Overview
Xen Project CI for OpenStack OverviewThe Linux Foundation
1.7K views11 slides
Erlang on Xen: Redefining the cloud software stack by
Erlang on Xen:  Redefining the cloud software stackErlang on Xen:  Redefining the cloud software stack
Erlang on Xen: Redefining the cloud software stackViktor Sovietov
1.9K views17 slides
LinuxCon Japan 13 : 10 years of Xen and Beyond by
LinuxCon Japan 13 : 10 years of Xen and BeyondLinuxCon Japan 13 : 10 years of Xen and Beyond
LinuxCon Japan 13 : 10 years of Xen and BeyondThe Linux Foundation
451.5K views54 slides
XPDS16: Xen Development Update by
XPDS16: Xen Development UpdateXPDS16: Xen Development Update
XPDS16: Xen Development UpdateThe Linux Foundation
788 views23 slides
XPDS16: Xen Project Weather Report 2016 by
XPDS16: Xen Project Weather Report 2016XPDS16: Xen Project Weather Report 2016
XPDS16: Xen Project Weather Report 2016The Linux Foundation
316 views44 slides

What's hot(20)

XPDS16: Hypervisor-based Security: Vicarious Learning via Introspektioneerin... by The Linux Foundation
XPDS16:  Hypervisor-based Security: Vicarious Learning via Introspektioneerin...XPDS16:  Hypervisor-based Security: Vicarious Learning via Introspektioneerin...
XPDS16: Hypervisor-based Security: Vicarious Learning via Introspektioneerin...
Erlang on Xen: Redefining the cloud software stack by Viktor Sovietov
Erlang on Xen:  Redefining the cloud software stackErlang on Xen:  Redefining the cloud software stack
Erlang on Xen: Redefining the cloud software stack
Viktor Sovietov1.9K views
LinuxCon Japan 13 : 10 years of Xen and Beyond by The Linux Foundation
LinuxCon Japan 13 : 10 years of Xen and BeyondLinuxCon Japan 13 : 10 years of Xen and Beyond
LinuxCon Japan 13 : 10 years of Xen and Beyond
The Linux Foundation451.5K views
ELC21: VM-to-VM Communication Mechanisms for Embedded by Stefano Stabellini
ELC21: VM-to-VM Communication Mechanisms for EmbeddedELC21: VM-to-VM Communication Mechanisms for Embedded
ELC21: VM-to-VM Communication Mechanisms for Embedded
Stefano Stabellini283 views
XPDS16: libvirt and Tools: What's New and What's Next - James Fehlig, SUSE by The Linux Foundation
XPDS16: libvirt and Tools: What's New and What's Next - James Fehlig, SUSEXPDS16: libvirt and Tools: What's New and What's Next - James Fehlig, SUSE
XPDS16: libvirt and Tools: What's New and What's Next - James Fehlig, SUSE
OWF: Xen - Open Source Hypervisor Designed for Clouds by The Linux Foundation
OWF: Xen - Open Source Hypervisor Designed for CloudsOWF: Xen - Open Source Hypervisor Designed for Clouds
OWF: Xen - Open Source Hypervisor Designed for Clouds
The Linux Foundation67.8K views
XPDS16: Xen Scalability Analysis - Weidong Han, Zhichao Huang & Wei Yang, Huawei by The Linux Foundation
XPDS16: Xen Scalability Analysis - Weidong Han, Zhichao Huang & Wei Yang, HuaweiXPDS16: Xen Scalability Analysis - Weidong Han, Zhichao Huang & Wei Yang, Huawei
XPDS16: Xen Scalability Analysis - Weidong Han, Zhichao Huang & Wei Yang, Huawei
Linaro Connect Asia 13 : Citrix - Xen on ARM plenary session by The Linux Foundation
Linaro Connect Asia 13 : Citrix - Xen on ARM plenary sessionLinaro Connect Asia 13 : Citrix - Xen on ARM plenary session
Linaro Connect Asia 13 : Citrix - Xen on ARM plenary session
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo... by The Linux Foundation
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...
LCNA14: Why Use Xen for Large Scale Enterprise Deployments? - Konrad Rzeszute... by The Linux Foundation
LCNA14: Why Use Xen for Large Scale Enterprise Deployments? - Konrad Rzeszute...LCNA14: Why Use Xen for Large Scale Enterprise Deployments? - Konrad Rzeszute...
LCNA14: Why Use Xen for Large Scale Enterprise Deployments? - Konrad Rzeszute...
Advanced Docker Developer Workflows on MacOS X and Windows by Anil Madhavapeddy
Advanced Docker Developer Workflows on MacOS X and WindowsAdvanced Docker Developer Workflows on MacOS X and Windows
Advanced Docker Developer Workflows on MacOS X and Windows
Anil Madhavapeddy70.3K views
Citrix XenServer 5.5 Troubleshooting by Thomas Krampe
Citrix XenServer 5.5 TroubleshootingCitrix XenServer 5.5 Troubleshooting
Citrix XenServer 5.5 Troubleshooting
Thomas Krampe8.5K views
XenServer Design Workshop by Tim Mackey
XenServer Design WorkshopXenServer Design Workshop
XenServer Design Workshop
Tim Mackey3.6K views
Virtualization with KVM (Kernel-based Virtual Machine) by Novell
Virtualization with KVM (Kernel-based Virtual Machine)Virtualization with KVM (Kernel-based Virtual Machine)
Virtualization with KVM (Kernel-based Virtual Machine)
Novell15.9K views

Similar to Open Source Citrix Windows PV Drivers - Paul Durrant, Citrix

Automating Software Development Life Cycle - A DevOps Approach by
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAkshaya Mahapatra
3.7K views60 slides
Automating Yourself Out of Trouble by
Automating Yourself Out of TroubleAutomating Yourself Out of Trouble
Automating Yourself Out of TroubleJose De La Rosa
1.2K views50 slides
Stateless Hypervisors at Scale by
Stateless Hypervisors at ScaleStateless Hypervisors at Scale
Stateless Hypervisors at ScaleAntony Messerl
9.7K views34 slides
Practical Implementation of Virtual Machine by
Practical Implementation of Virtual MachinePractical Implementation of Virtual Machine
Practical Implementation of Virtual MachineRubal Sagwal
836 views61 slides
E2E PVS Technical Overview Stephane Thirion by
E2E PVS Technical Overview Stephane ThirionE2E PVS Technical Overview Stephane Thirion
E2E PVS Technical Overview Stephane Thirionsthirion
2.3K views38 slides
Meetup - DevCloud and CloudStack 4.2 by
Meetup - DevCloud and CloudStack 4.2Meetup - DevCloud and CloudStack 4.2
Meetup - DevCloud and CloudStack 4.2amoghvk
276 views9 slides

Similar to Open Source Citrix Windows PV Drivers - Paul Durrant, Citrix(20)

Automating Software Development Life Cycle - A DevOps Approach by Akshaya Mahapatra
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps Approach
Akshaya Mahapatra3.7K views
Automating Yourself Out of Trouble by Jose De La Rosa
Automating Yourself Out of TroubleAutomating Yourself Out of Trouble
Automating Yourself Out of Trouble
Jose De La Rosa1.2K views
Stateless Hypervisors at Scale by Antony Messerl
Stateless Hypervisors at ScaleStateless Hypervisors at Scale
Stateless Hypervisors at Scale
Antony Messerl9.7K views
Practical Implementation of Virtual Machine by Rubal Sagwal
Practical Implementation of Virtual MachinePractical Implementation of Virtual Machine
Practical Implementation of Virtual Machine
Rubal Sagwal836 views
E2E PVS Technical Overview Stephane Thirion by sthirion
E2E PVS Technical Overview Stephane ThirionE2E PVS Technical Overview Stephane Thirion
E2E PVS Technical Overview Stephane Thirion
sthirion2.3K views
Meetup - DevCloud and CloudStack 4.2 by amoghvk
Meetup - DevCloud and CloudStack 4.2Meetup - DevCloud and CloudStack 4.2
Meetup - DevCloud and CloudStack 4.2
amoghvk276 views
Principles of Virtualization - Introduction to Virtualization Software by Rubal Sagwal
Principles of Virtualization - Introduction to Virtualization Software Principles of Virtualization - Introduction to Virtualization Software
Principles of Virtualization - Introduction to Virtualization Software
Rubal Sagwal976 views
Release notes 3_d_v61 by sundar sivam
Release notes 3_d_v61Release notes 3_d_v61
Release notes 3_d_v61
sundar sivam566 views
No BS, Vendor Neutral Comparison of Application Layering Solutions by Unidesk Corporation
No BS, Vendor Neutral Comparison of Application Layering SolutionsNo BS, Vendor Neutral Comparison of Application Layering Solutions
No BS, Vendor Neutral Comparison of Application Layering Solutions
Unidesk Corporation1.5K views
RHEL5 XEN HandOnTraining_v0.4.pdf by Paul Yang
RHEL5 XEN HandOnTraining_v0.4.pdfRHEL5 XEN HandOnTraining_v0.4.pdf
RHEL5 XEN HandOnTraining_v0.4.pdf
Paul Yang5 views
Docker introduction by Jo Ee Liew
Docker introductionDocker introduction
Docker introduction
Jo Ee Liew1.4K views
Planning and Completing an IBM Connections Upgrade by Gabriella Davis
Planning and Completing an IBM Connections UpgradePlanning and Completing an IBM Connections Upgrade
Planning and Completing an IBM Connections Upgrade
Gabriella Davis1.3K views
Benchmark emc vnx7500, emc fast suite, emc snap sure and oracle rac on v-mware by solarisyougood
Benchmark   emc vnx7500, emc fast suite, emc snap sure and oracle rac on v-mwareBenchmark   emc vnx7500, emc fast suite, emc snap sure and oracle rac on v-mware
Benchmark emc vnx7500, emc fast suite, emc snap sure and oracle rac on v-mware
solarisyougood446 views
DevCloud - Setup and Demo on Apache CloudStack by buildacloud
DevCloud - Setup and Demo on Apache CloudStack DevCloud - Setup and Demo on Apache CloudStack
DevCloud - Setup and Demo on Apache CloudStack
buildacloud4.2K views
VMware vSphere 5.1 - Upgrade Tips & Top New Features by stcroixsolutions
VMware vSphere 5.1 - Upgrade Tips & Top New FeaturesVMware vSphere 5.1 - Upgrade Tips & Top New Features
VMware vSphere 5.1 - Upgrade Tips & Top New Features
stcroixsolutions5.6K views
Killer Docker Workflows for Development by Chris Tankersley
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for Development
Chris Tankersley159 views
Virtualization VM VirtualBox + Oracle Enterprise Linux With Oracle 11GR2 by John Heaton
Virtualization VM VirtualBox + Oracle Enterprise Linux With Oracle 11GR2Virtualization VM VirtualBox + Oracle Enterprise Linux With Oracle 11GR2
Virtualization VM VirtualBox + Oracle Enterprise Linux With Oracle 11GR2
John Heaton1.8K views
2015.09.23 - CHIVMUG UserCon Small Business & Virtualization by Paul Woodward Jr
2015.09.23 - CHIVMUG UserCon Small Business & Virtualization2015.09.23 - CHIVMUG UserCon Small Business & Virtualization
2015.09.23 - CHIVMUG UserCon Small Business & Virtualization
Paul Woodward Jr558 views
Introducing Widows 7 by Gene Carboni
Introducing Widows 7Introducing Widows 7
Introducing Widows 7
Gene Carboni1.1K views

More from The Linux Foundation

ELC2019: Static Partitioning Made Simple by
ELC2019: Static Partitioning Made SimpleELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made SimpleThe Linux Foundation
4.1K views33 slides
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ... by
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...The Linux Foundation
1K views17 slides
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu... by
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...The Linux Foundation
1K views19 slides
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op... by
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...The Linux Foundation
819 views24 slides
XPDDS19 Keynote: Unikraft Weather Report by
XPDDS19 Keynote:  Unikraft Weather ReportXPDDS19 Keynote:  Unikraft Weather Report
XPDDS19 Keynote: Unikraft Weather ReportThe Linux Foundation
923 views58 slides
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E... by
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...The Linux Foundation
941 views17 slides

More from The Linux Foundation(20)

XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ... by The Linux Foundation
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu... by The Linux Foundation
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op... by The Linux Foundation
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E... by The Linux Foundation
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx by The Linux Foundation
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, XilinxXPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys... by The Linux Foundation
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender by The Linux Foundation
XPDDS19: Memories of a VM Funk - Mihai Donțu, BitdefenderXPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
OSSJP/ALS19: The Road to Safety Certification: Overcoming Community Challeng... by The Linux Foundation
OSSJP/ALS19:  The Road to Safety Certification: Overcoming Community Challeng...OSSJP/ALS19:  The Road to Safety Certification: Overcoming Community Challeng...
OSSJP/ALS19: The Road to Safety Certification: Overcoming Community Challeng...
OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making... by The Linux Foundation
 OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making... OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix by The Linux Foundation
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, CitrixXPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd by The Linux Foundation
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltdXPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant... by The Linux Foundation
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D by The Linux Foundation
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&DXPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems by The Linux Foundation
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM SystemsXPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven... by The Linux Foundation
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib... by The Linux Foundation
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr... by The Linux Foundation
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE by The Linux Foundation
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSEXPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE

Recently uploaded

How to reduce cold starts for Java Serverless applications in AWS at JCON Wor... by
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...Vadym Kazulkin
70 views64 slides
.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV by
.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV
.conf Go 2023 - How KPN drives Customer Satisfaction on IPTVSplunk
86 views20 slides
"AI Startup Growth from Idea to 1M ARR", Oleksandr Uspenskyi by
"AI Startup Growth from Idea to 1M ARR", Oleksandr Uspenskyi"AI Startup Growth from Idea to 1M ARR", Oleksandr Uspenskyi
"AI Startup Growth from Idea to 1M ARR", Oleksandr UspenskyiFwdays
26 views9 slides
MemVerge: Gismo (Global IO-free Shared Memory Objects) by
MemVerge: Gismo (Global IO-free Shared Memory Objects)MemVerge: Gismo (Global IO-free Shared Memory Objects)
MemVerge: Gismo (Global IO-free Shared Memory Objects)CXL Forum
112 views16 slides
GigaIO: The March of Composability Onward to Memory with CXL by
GigaIO: The March of Composability Onward to Memory with CXLGigaIO: The March of Composability Onward to Memory with CXL
GigaIO: The March of Composability Onward to Memory with CXLCXL Forum
126 views12 slides
Transcript: The Details of Description Techniques tips and tangents on altern... by
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...BookNet Canada
119 views15 slides

Recently uploaded(20)

How to reduce cold starts for Java Serverless applications in AWS at JCON Wor... by Vadym Kazulkin
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
Vadym Kazulkin70 views
.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV by Splunk
.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV
.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV
Splunk86 views
"AI Startup Growth from Idea to 1M ARR", Oleksandr Uspenskyi by Fwdays
"AI Startup Growth from Idea to 1M ARR", Oleksandr Uspenskyi"AI Startup Growth from Idea to 1M ARR", Oleksandr Uspenskyi
"AI Startup Growth from Idea to 1M ARR", Oleksandr Uspenskyi
Fwdays26 views
MemVerge: Gismo (Global IO-free Shared Memory Objects) by CXL Forum
MemVerge: Gismo (Global IO-free Shared Memory Objects)MemVerge: Gismo (Global IO-free Shared Memory Objects)
MemVerge: Gismo (Global IO-free Shared Memory Objects)
CXL Forum112 views
GigaIO: The March of Composability Onward to Memory with CXL by CXL Forum
GigaIO: The March of Composability Onward to Memory with CXLGigaIO: The March of Composability Onward to Memory with CXL
GigaIO: The March of Composability Onward to Memory with CXL
CXL Forum126 views
Transcript: The Details of Description Techniques tips and tangents on altern... by BookNet Canada
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...
BookNet Canada119 views
PharoJS - Zürich Smalltalk Group Meetup November 2023 by Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi113 views
TE Connectivity: Card Edge Interconnects by CXL Forum
TE Connectivity: Card Edge InterconnectsTE Connectivity: Card Edge Interconnects
TE Connectivity: Card Edge Interconnects
CXL Forum96 views
Photowave Presentation Slides - 11.8.23.pptx by CXL Forum
Photowave Presentation Slides - 11.8.23.pptxPhotowave Presentation Slides - 11.8.23.pptx
Photowave Presentation Slides - 11.8.23.pptx
CXL Forum126 views
Future of Learning - Khoong Chan Meng by NUS-ISS
Future of Learning - Khoong Chan MengFuture of Learning - Khoong Chan Meng
Future of Learning - Khoong Chan Meng
NUS-ISS31 views
CXL at OCP by CXL Forum
CXL at OCPCXL at OCP
CXL at OCP
CXL Forum208 views
JCon Live 2023 - Lice coding some integration problems by Bernd Ruecker
JCon Live 2023 - Lice coding some integration problemsJCon Live 2023 - Lice coding some integration problems
JCon Live 2023 - Lice coding some integration problems
Bernd Ruecker67 views
The Importance of Cybersecurity for Digital Transformation by NUS-ISS
The Importance of Cybersecurity for Digital TransformationThe Importance of Cybersecurity for Digital Transformation
The Importance of Cybersecurity for Digital Transformation
NUS-ISS25 views
Astera Labs: Intelligent Connectivity for Cloud and AI Infrastructure by CXL Forum
Astera Labs:  Intelligent Connectivity for Cloud and AI InfrastructureAstera Labs:  Intelligent Connectivity for Cloud and AI Infrastructure
Astera Labs: Intelligent Connectivity for Cloud and AI Infrastructure
CXL Forum125 views
Micron CXL product and architecture update by CXL Forum
Micron CXL product and architecture updateMicron CXL product and architecture update
Micron CXL product and architecture update
CXL Forum27 views
Combining Orchestration and Choreography for a Clean Architecture by ThomasHeinrichs1
Combining Orchestration and Choreography for a Clean ArchitectureCombining Orchestration and Choreography for a Clean Architecture
Combining Orchestration and Choreography for a Clean Architecture
ThomasHeinrichs168 views
MemVerge: Memory Viewer Software by CXL Forum
MemVerge: Memory Viewer SoftwareMemVerge: Memory Viewer Software
MemVerge: Memory Viewer Software
CXL Forum118 views
Microchip: CXL Use Cases and Enabling Ecosystem by CXL Forum
Microchip: CXL Use Cases and Enabling EcosystemMicrochip: CXL Use Cases and Enabling Ecosystem
Microchip: CXL Use Cases and Enabling Ecosystem
CXL Forum129 views

Open Source Citrix Windows PV Drivers - Paul Durrant, Citrix

  • 1. Open Source Citrix Windows PV Drivers Paul Durrant Principal Software Engineer, Citrix
  • 2. Agenda “A history of the Windows PV drivers and a brief tour of the ‘upstream’ drivers and their interfaces” • Background • The XenServer 6.0.2 (a.k.a. legacy) drivers • The XenServer 6.1 (a.k.a. standard) drivers • Open Source • ‘Upstream’ Drivers • XenServer PV Device • Interfaces • Building and Installing
  • 3. Why use PV Drivers? • Emulated storage and network are slow • IDE • Realtek 8139 • Dom0 takes a lot of load • Can easily take 50% CPU per VM • Migration can be problematic • Testing shown up many crashes and hangs
  • 4. Windows Drivers This is a Filter Device Object. They can be used to interpose on Plug’n’Play, Power or IO messages flowing between PDOs and FDOs. PDO PACKAGE (INF FILE) FDO FiltDO local/domain/device/vif This is a Physical Device Object, created by a bus driver. The ‘name’ of this device is used by Windows to select a driver. This is a Function Device Object, created when a driver binds to a Physical Device Object. The INF file states the ‘names’ it will bind to. This is a xenstore key that is used by a PV bus driver to create a PDO. PACKAGE FDO This is an FDO created by a child PV driver that binds to the PDO representing the xenstore key.
  • 5. XenServer 6.0.2 PV Drivers Created by installer Emulated by QEMU PCIVEN_5853&DEV_0001 ROOTXENEVTCHN XEVTCHN XENVBD XENEVTCHN XENVBD XENUTIL local/domain/device/vif Linkage dependency XENVIF XENVIF local/domain/device/vif/0 XENNET XENNET SCSIFILT local/domain/device/vif/1 XENNET XENNET local/domain/device/vbd/768 … DISK SCSIFILT local/domain/device/vbd/832 DISK … Standard in-box driver • XENIFACE omitted for simplicity
  • 6. XenServer 6.0.2 PV Drivers • Need SCSIFILT because we use old SCSIPORT storage driver model, which is really slow • Creates all sorts of problems with compatibility • Use of ROOT node requires installer • Cross-package linkage dependency means drivers have to be installed and upgraded as a unit • Prevents deployment via Windows Update “But Windows Update would be very useful for large installations or upgrades so that’s a pain. What can we do?”
  • 8. Enter Windows 8 • With the new WDK Microsoft decided: • You can only use Visual Studio 2012 to build… …so throw away your existing build scripts • They only support building for OS back to Vista… …so you’re going to have to have two binaries if you want to support XP and Server 2003 like it or not “So, we’re going to have to do something.”
  • 9. XenServer 6.1 PV Drivers • Goals: • No installer necessary for drivers • Can be installed via device manager • No cross-package linkage dependency • Versioned interfaces discovered at run-time • Suitable for Windows Update • Cannot bind to existing platform PCI device • Implementation choice: • Use faster STORPORT storage driver model • Possible now we’re only targeting Vista onwards • Removes need for SCSIFILT
  • 10. XenServer 6.1 PV Drivers Handles unplug XENBUS XENFILT NOTE: New Device ID PCIVEN_5853&DEV_0002 XEN XENBUS local/domain/device/vif local/domain/device/vbd XENVIF XENVBD Interface discovery XENVIF local/domain/device/vif/0 XENNET XENNET local/domain/device/vif/1 XENNET XENNET XENVBD local/domain/device/vbd/768 … DISK local/domain/device/vbd/832 DISK • … XENIFACE omitted again for simplicity
  • 11. Open Source • XenServer made completely open source • Windows driver code hosted on GitHub • • • • • https://github.com/xenserver/win-xenbus https://github.com/xenserver/win-xenvif https://github.com/xenserver/win-xennet https://github.com/xenserver/win-xenvbd https://github.com/xenserver/win-xeniface • BSD 2-Clause license “But the drivers will only work on XenServer, and you can only build them if you work for Citrix. That’s not very open!” • upstream branch may have been merged into master
  • 12. ‘Upstream’ PV Drivers • Basically the same as 6.1 (and 6.2) drivers • Removed dependency on XenServer QEMU patches • Emulated device unplug • Platform device ID • Added new binding for XenServer PV device • Available in upstream QEMU 1.6 onwards • Should work on any reasonable Xen and dom0 • Tested on Xen 3.4, 4.1 and 4.4 • netback fix may be needed if not using udev • Code initially in ‘upstream’ branches on GitHub • Will be merged into ‘master’ once basic testing completed
  • 13. XENBUS binding PCIVEN_5853&DEV_0001 PCIVEN_5853&DEV_C000 PCIVEN_5853&DEV_0002 You should have one of these • XENBUS binds to all three of these • Use co-installer to select ‘active’ device • Will only select if there’s no current selection • Only active device has children • Children’s name carries device ID • Use only C000 for Windows Update You may have one of these
  • 14. Interface Discovery DRIVER3 DRIVER3 • Message is forwarded to parent if interface not implemented DRIVER3 • Client doesn’t care where the interface is implemented • Allows interfaces to be exported by XENFILT • IRP_MN_QUERY_INTERFACE message • Identifies interface by GUID • Gets back jump table and context
  • 15. Interfaces • See XXX_interface.h in include directory • GUID and VERSION • General sequence • Query for interface • Code in win-xenvif.git:/src/xenvif/fdo.c good example • Get back completed INTERFACE structure • FOO(Acquire, &Interface); • Status = FOO(Bar, &Interface, …); • FOO(Release, &Interface);
  • 16. Interfaces • XENFILT • EMULATED • UNPLUG • XENBUS • EVTCHN • GNNTAB • STORE • DEBUG • XENVIF • VIF
  • 17. Building a driver • README.md should tell you want you need to know • Pre-requistes • Visual Studio 2012 (NOT Express) • Windows 8 WDK (See http://msdn.microsoft.com/en-us/windows/hardware/hh852365) • Python 3.x • Set environment • VS • KIT • SYMBOL_SERVER Usually C:Program FilesMicrosoft Visual Studio 11.0 (!) • build.py free|checked Usually C:Program FilesWindows Kits8.0 I use C:Symbols
  • 18. Installing a driver • INSTALL.md should tell you want you need to know • Driver build results in directory and tarball • Copy to target (and unpack if necessary) • Navigate to x86 or x64 • Either run dpinst.exe or use Device Manager • Builds are test signed • Install .pfx file (see proj sub-directory) to avoid scary warning • Make sure testsigning is enabled on 64-bit systems bcdedit /set testsigning on
  • 19. Contributing • See MAINTAINERS files in existing repositories • Discuss on xs-devel@lists.xenserver.org • More drivers • PV HID • PV USB (?)
  • 20. Q&A