Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
Status of PCI emulation in Xen
Roger Pau Monn´e
roger.pau@citrix.com
Chicago – July 9th, 2019
PCI bus PCI-passthroughon Xen Moving forward
PCI bus
Allows attaching hardware devices in a computer.
First specification developed by Intel in 1992.
Superseded VESA, MCA, EISA, NuBus...
Two standards:
PCI local bus.
PCI Express.
Chicago – July 9th, 2019 Status of PCI emulation in Xen 2 / 20
PCI bus PCI-passthroughon Xen Moving forward
PCI slots on a motherboard
Obtained from wikipedia author snickerdo.
Chicago – July 9th, 2019 Status of PCI emulation in Xen 3 / 20
PCI bus PCI-passthroughon Xen Moving forward
PCI card
Chicago – July 9th, 2019 Status of PCI emulation in Xen 4 / 20
PCI bus PCI-passthroughon Xen Moving forward
PCI configuration space
The PCI configuration space provides 256bytes or 4096bytes
of configuration space to each device.
Devices are identified by a 8bit bus, 5bit device and 3bit
function integers.
First 64bytes is standardized, the rest is device dependent
(contains capability structures).
Allows for easy discovery of devices. OS can scan the whole
bus in order to detect present devices.
On x86 can be accessed from IO space (legacy) or memory
(enhanced).
Chicago – July 9th, 2019 Status of PCI emulation in Xen 5 / 20
PCI bus PCI-passthroughon Xen Moving forward
Legacy PCI configuration access
Indirect access using the IO address space.
Address port at 0xcf8:
012781011151623243031
E RSV Bus Device Func Register RSV
Data port at 0xcfc.
Chicago – July 9th, 2019 Status of PCI emulation in Xen 6 / 20
PCI bus PCI-passthroughon Xen Moving forward
Enhanced PCI configuration access
Maps the full config space registers into memory space.
0111214151920272831
Base Bus Device Func Register
If on 64bit mode bits from 63-32 also contain the base
address.
Chicago – July 9th, 2019 Status of PCI emulation in Xen 7 / 20
PCI bus PCI-passthroughon Xen Moving forward
PCI header
0781516232431
Status Command 04h
Base Address 0 16h
Base Address 1 20h
Base Address 2 24h
Base Address 3 28h
Base Address 4 32h
Base Address 5 36h
CardBus CIS Pointer 40h
Subsystem ID Subsystem Vendor ID 44h
Expansion ROM Base Address 44h
Chicago – July 9th, 2019 Status of PCI emulation in Xen 8 / 20
PCI bus PCI-passthroughon Xen Moving forward
MSI capability
0781516232431
Message control Next pointer Capability ID 00h
Message Address [31, 0] 04h
Message Address [63, 32] 08h
Reserved Message Data 12h
Mask Bits 16h
Pending bits 20h
Chicago – July 9th, 2019 Status of PCI emulation in Xen 9 / 20
PCI bus PCI-passthroughon Xen Moving forward
MSI-X capability
0781516232431
Message control Next pointer Capability ID 00h
MSI-X Table Offset BIR 04h
PBA Offset BIR 08h
0
31
32
63
64
Vector Control Message Data
Upper Address Lower Address
Entry 0
...
...
Vector Control Message Data
Upper Address Lower Address
Entry N
Chicago – July 9th, 2019 Status of PCI emulation in Xen 10 / 20
PCI bus PCI-passthroughon Xen Moving forward
PCI handling in Xen
PV privileged domain (dom0) gets almost unlimited access to
the PCI config space:
Xen controls the MSI(-X) mask bits in order to keep a
coherent state when doing PCI-passthrough to HVM guests.
Read only access is allowed to the MSI-X table and the MSI
data and address registers.
Passthrough of PCI devices to unprivileged guests:
PV guests can access the PCI config space using a Xen PV
specific protocol (pciif).
HVM guests can access the PCI config space emulated by a
device model (QEMU).
PVH guests have no PCI-passthrough support yet.
Chicago – July 9th, 2019 Status of PCI emulation in Xen 11 / 20
PCI bus PCI-passthroughon Xen Moving forward
PCI-passthrough for domUs
Hardware
Xen
Control Domain (VM0)
PV1 HVM1
user-space
kernel
QEMU
evtchn devpciback
Chicago – July 9th, 2019 Status of PCI emulation in Xen 12 / 20
PCI bus PCI-passthroughon Xen Moving forward
PCI-passthrough for domUs
PV domU communicates directly with pciback using a shared
memory ring and a Xen specific protocol.
Passthrough to HVM domUs is handled by QEMU, much like
emulated devices:
PCI config space accesses are forwarded by Xen to QEMU
using ioreqs.
QEMU emulates or forwards those accesses to the underlying
device.
Xen directly handles guest writes to the MSI-X mask bits for
performance reasons.
Device MMIO regions (BARs) are directly mapped to the
guest physmap, except for the MSI-X region if present.
Chicago – July 9th, 2019 Status of PCI emulation in Xen 13 / 20
PCI bus PCI-passthroughon Xen Moving forward
PV dom0
Has almost unlimited read/write access to the configuration
space except for certain parts of the MSI(-X) capabilities.
Has to use hypercalls to deal with certain capabilities:
MSI/MSI-X.
Is fully trusted to not misbehave.
Chicago – July 9th, 2019 Status of PCI emulation in Xen 14 / 20
PCI bus PCI-passthroughon Xen Moving forward
PVH dom0
PVH is a HVM guest from Xen’s point of view.
HVM-like access to the configuration space:
Transparent access to the MSI/MSI-X capabilities.
Transparent mapping of BARs into the physmap and handling
of writes to the BAR registers.
Chicago – July 9th, 2019 Status of PCI emulation in Xen 15 / 20
PCI bus PCI-passthroughon Xen Moving forward
PVH dom0
Current PCI-passthrough code for HVM is in QEMU.
Impossible to use QEMU for PVH dom0.
No re-use of the QEMU PCI-passthrough code: would need
heavy modifications that would make sharing changes very
difficult.
Added a PCI config space mediator to the hypervisor: vPCI.
Chicago – July 9th, 2019 Status of PCI emulation in Xen 16 / 20
PCI bus PCI-passthroughon Xen Moving forward
PCI-passthrough mediators in Xen
QEMU (user-space) and Xen for MSI-X mask bits for HVM
domUs.
pciback (hardware domain OS) for PV domUs.
Direct access / hypercalls for PV dom0.
vPCI (hypervisor) for PVH dom0.
Chicago – July 9th, 2019 Status of PCI emulation in Xen 17 / 20
PCI bus PCI-passthroughon Xen Moving forward
Shortcomings
No support for VFIO/MDEV on Xen:
Threatening support for vGPU/XenGT in future releases.
3 different code bases to deal with PCI config space accesses:
More maintainership work.
Non uniform behaviour across different guests types.
Chicago – July 9th, 2019 Status of PCI emulation in Xen 18 / 20
PCI bus PCI-passthroughon Xen Moving forward
Future items
Re-work vPCI so it can be used both inside the hypervisor and
in user-space.
Could be used by HVM and PVH guests as a standalone
PCI-passthrough utility.
Unify PCI-passthrough for HVM and PVH both domU and
dom0 into a single code-base.
Add support for the extended config space to HVM domUs:
allow to passthrough PCIe capabilities.
Add support to passthrough SRIOV capability to vPCI, for
PVH dom0.
Chicago – July 9th, 2019 Status of PCI emulation in Xen 19 / 20
PCI bus PCI-passthroughon Xen Moving forward
Q&A
Thanks
Questions?
Chicago – July 9th, 2019 Status of PCI emulation in Xen 20 / 20

More Related Content

Similar to XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D

XPDDS17: PVH Dom0: The Road so Far - Roger Pau Monné, Citrix
XPDDS17: PVH Dom0: The Road so Far - Roger Pau Monné, CitrixXPDDS17: PVH Dom0: The Road so Far - Roger Pau Monné, Citrix
XPDDS17: PVH Dom0: The Road so Far - Roger Pau Monné, Citrix
The Linux Foundation
 
Status update-qemu-pcie
Status update-qemu-pcieStatus update-qemu-pcie
Status update-qemu-pcie
The Linux Foundation
 
XS Boston 2008 VT-D PCI
XS Boston 2008 VT-D PCIXS Boston 2008 VT-D PCI
XS Boston 2008 VT-D PCI
The Linux Foundation
 
PCI_Express_Basics_Background.pdf
PCI_Express_Basics_Background.pdfPCI_Express_Basics_Background.pdf
PCI_Express_Basics_Background.pdf
zahixdd
 
Graphics virtualization
Graphics virtualizationGraphics virtualization
Graphics virtualization
The Linux Foundation
 
Graphics virtualization
Graphics virtualizationGraphics virtualization
Graphics virtualization
The Linux Foundation
 
Slideshare - PCIe
Slideshare - PCIeSlideshare - PCIe
Slideshare - PCIe
Jin Wu
 
PCIe BUS: A State-of-the-Art-Review
PCIe BUS: A State-of-the-Art-ReviewPCIe BUS: A State-of-the-Art-Review
PCIe BUS: A State-of-the-Art-Review
IOSRJVSP
 
PLNOG 13: Artur Pająk: Storage w sieciach Ethernet, czyli coś o iSCSI I FCoE
PLNOG 13: Artur Pająk: Storage w sieciach Ethernet, czyli coś o iSCSI I FCoEPLNOG 13: Artur Pająk: Storage w sieciach Ethernet, czyli coś o iSCSI I FCoE
PLNOG 13: Artur Pająk: Storage w sieciach Ethernet, czyli coś o iSCSI I FCoE
PROIDEA
 
Pci express modi
Pci express modiPci express modi
Pci express modi
proma_goswami
 
XS Boston 2008 Project Status
XS Boston 2008 Project StatusXS Boston 2008 Project Status
XS Boston 2008 Project Status
The Linux Foundation
 
XPDDS17: Keynote: Towards a Configurable and Slimmer x86 Hypervisor - Wei Liu...
XPDDS17: Keynote: Towards a Configurable and Slimmer x86 Hypervisor - Wei Liu...XPDDS17: Keynote: Towards a Configurable and Slimmer x86 Hypervisor - Wei Liu...
XPDDS17: Keynote: Towards a Configurable and Slimmer x86 Hypervisor - Wei Liu...
The Linux Foundation
 
PCI.pdf
PCI.pdfPCI.pdf
PCI.pdf
ssuserea4759
 
Cisco UCS vs HP Virtual Connect
Cisco UCS vs HP Virtual ConnectCisco UCS vs HP Virtual Connect
Cisco UCS vs HP Virtual Connect
Stefano Soliani
 
Io Architecture
Io ArchitectureIo Architecture
Io Architecture
Aero Plane
 
Project ACRN expose and pass through platform hidden PCIe devices to SOS
Project ACRN expose and pass through platform hidden PCIe devices to SOSProject ACRN expose and pass through platform hidden PCIe devices to SOS
Project ACRN expose and pass through platform hidden PCIe devices to SOS
Project ACRN
 
An AI accelerator ASIC architecture
An AI accelerator ASIC architectureAn AI accelerator ASIC architecture
An AI accelerator ASIC architecture
Khanh Le
 
directCell - Cell/B.E. tightly coupled via PCI Express
directCell - Cell/B.E. tightly coupled via PCI ExpressdirectCell - Cell/B.E. tightly coupled via PCI Express
directCell - Cell/B.E. tightly coupled via PCI Express
Heiko Joerg Schick
 
ACRN Kata Container on ACRN
ACRN Kata Container on ACRNACRN Kata Container on ACRN
ACRN Kata Container on ACRN
Project ACRN
 
Pcie basic
Pcie basicPcie basic
Pcie basic
Saifuddin Kaijar
 

Similar to XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D (20)

XPDDS17: PVH Dom0: The Road so Far - Roger Pau Monné, Citrix
XPDDS17: PVH Dom0: The Road so Far - Roger Pau Monné, CitrixXPDDS17: PVH Dom0: The Road so Far - Roger Pau Monné, Citrix
XPDDS17: PVH Dom0: The Road so Far - Roger Pau Monné, Citrix
 
Status update-qemu-pcie
Status update-qemu-pcieStatus update-qemu-pcie
Status update-qemu-pcie
 
XS Boston 2008 VT-D PCI
XS Boston 2008 VT-D PCIXS Boston 2008 VT-D PCI
XS Boston 2008 VT-D PCI
 
PCI_Express_Basics_Background.pdf
PCI_Express_Basics_Background.pdfPCI_Express_Basics_Background.pdf
PCI_Express_Basics_Background.pdf
 
Graphics virtualization
Graphics virtualizationGraphics virtualization
Graphics virtualization
 
Graphics virtualization
Graphics virtualizationGraphics virtualization
Graphics virtualization
 
Slideshare - PCIe
Slideshare - PCIeSlideshare - PCIe
Slideshare - PCIe
 
PCIe BUS: A State-of-the-Art-Review
PCIe BUS: A State-of-the-Art-ReviewPCIe BUS: A State-of-the-Art-Review
PCIe BUS: A State-of-the-Art-Review
 
PLNOG 13: Artur Pająk: Storage w sieciach Ethernet, czyli coś o iSCSI I FCoE
PLNOG 13: Artur Pająk: Storage w sieciach Ethernet, czyli coś o iSCSI I FCoEPLNOG 13: Artur Pająk: Storage w sieciach Ethernet, czyli coś o iSCSI I FCoE
PLNOG 13: Artur Pająk: Storage w sieciach Ethernet, czyli coś o iSCSI I FCoE
 
Pci express modi
Pci express modiPci express modi
Pci express modi
 
XS Boston 2008 Project Status
XS Boston 2008 Project StatusXS Boston 2008 Project Status
XS Boston 2008 Project Status
 
XPDDS17: Keynote: Towards a Configurable and Slimmer x86 Hypervisor - Wei Liu...
XPDDS17: Keynote: Towards a Configurable and Slimmer x86 Hypervisor - Wei Liu...XPDDS17: Keynote: Towards a Configurable and Slimmer x86 Hypervisor - Wei Liu...
XPDDS17: Keynote: Towards a Configurable and Slimmer x86 Hypervisor - Wei Liu...
 
PCI.pdf
PCI.pdfPCI.pdf
PCI.pdf
 
Cisco UCS vs HP Virtual Connect
Cisco UCS vs HP Virtual ConnectCisco UCS vs HP Virtual Connect
Cisco UCS vs HP Virtual Connect
 
Io Architecture
Io ArchitectureIo Architecture
Io Architecture
 
Project ACRN expose and pass through platform hidden PCIe devices to SOS
Project ACRN expose and pass through platform hidden PCIe devices to SOSProject ACRN expose and pass through platform hidden PCIe devices to SOS
Project ACRN expose and pass through platform hidden PCIe devices to SOS
 
An AI accelerator ASIC architecture
An AI accelerator ASIC architectureAn AI accelerator ASIC architecture
An AI accelerator ASIC architecture
 
directCell - Cell/B.E. tightly coupled via PCI Express
directCell - Cell/B.E. tightly coupled via PCI ExpressdirectCell - Cell/B.E. tightly coupled via PCI Express
directCell - Cell/B.E. tightly coupled via PCI Express
 
ACRN Kata Container on ACRN
ACRN Kata Container on ACRNACRN Kata Container on ACRN
ACRN Kata Container on ACRN
 
Pcie basic
Pcie basicPcie basic
Pcie basic
 

More from The Linux Foundation

ELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made SimpleELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made Simple
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: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
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 in Automotive - Artem Mygaiev, Director, Technology Solu...
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: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
The Linux Foundation
 
XPDDS19 Keynote: Unikraft Weather Report
XPDDS19 Keynote:  Unikraft Weather ReportXPDDS19 Keynote:  Unikraft Weather Report
XPDDS19 Keynote: Unikraft Weather Report
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: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
The Linux Foundation
 
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
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
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 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
The Linux Foundation
 
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
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
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: Overcoming Community Challeng...
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...
OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
The Linux Foundation
 
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, CitrixXPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
The Linux Foundation
 
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
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
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: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
The Linux Foundation
 
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
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
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: Bringing Xen to the Masses: The Story of Building a Community-driven...
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: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
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: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
The Linux Foundation
 
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
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
The Linux Foundation
 
XPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information Security
XPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information SecurityXPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information Security
XPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information Security
The Linux Foundation
 

More from The Linux Foundation (20)

ELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made SimpleELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made Simple
 
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: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
 
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 in Automotive - Artem Mygaiev, Director, Technology Solu...
 
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: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
 
XPDDS19 Keynote: Unikraft Weather Report
XPDDS19 Keynote:  Unikraft Weather ReportXPDDS19 Keynote:  Unikraft Weather Report
XPDDS19 Keynote: Unikraft Weather Report
 
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: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
 
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
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...
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
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...
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...
 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
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
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...
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: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
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...
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...
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...
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
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
 
XPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information Security
XPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information SecurityXPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information Security
XPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information Security
 

Recently uploaded

Project management Course in Australia.pptx
Project management Course in Australia.pptxProject management Course in Australia.pptx
Project management Course in Australia.pptx
deathreaper9
 
TribeQonf2024_Dimpy_ShiftingSecurityLeft
TribeQonf2024_Dimpy_ShiftingSecurityLeftTribeQonf2024_Dimpy_ShiftingSecurityLeft
TribeQonf2024_Dimpy_ShiftingSecurityLeft
Dimpy Adhikary
 
Blue Screen Of Death | Windows Down | Biggest IT failure
Blue Screen Of Death | Windows Down | Biggest IT failureBlue Screen Of Death | Windows Down | Biggest IT failure
Blue Screen Of Death | Windows Down | Biggest IT failure
Dexbytes Infotech Pvt Ltd
 
FIDO Munich Seminar: Securing Smart Car.pptx
FIDO Munich Seminar: Securing Smart Car.pptxFIDO Munich Seminar: Securing Smart Car.pptx
FIDO Munich Seminar: Securing Smart Car.pptx
FIDO Alliance
 
Project Delivery Methodology on a page with activities, deliverables
Project Delivery Methodology on a page with activities, deliverablesProject Delivery Methodology on a page with activities, deliverables
Project Delivery Methodology on a page with activities, deliverables
CLIVE MINCHIN
 
Easy Compliance is Continuous Compliance
Easy Compliance is Continuous ComplianceEasy Compliance is Continuous Compliance
Easy Compliance is Continuous Compliance
Anchore
 
Scientific-Based Blockchain TON Project Analysis Report
Scientific-Based Blockchain  TON Project Analysis ReportScientific-Based Blockchain  TON Project Analysis Report
Scientific-Based Blockchain TON Project Analysis Report
SelcukTOPAL2
 
The Challenge of Interpretability in Generative AI Models.pdf
The Challenge of Interpretability in Generative AI Models.pdfThe Challenge of Interpretability in Generative AI Models.pdf
The Challenge of Interpretability in Generative AI Models.pdf
Sara Kroft
 
SCREENING OF RECOMBINANTS - BLUE AND WHITE SCREENING (MCQS)
SCREENING OF RECOMBINANTS - BLUE AND WHITE SCREENING (MCQS)SCREENING OF RECOMBINANTS - BLUE AND WHITE SCREENING (MCQS)
SCREENING OF RECOMBINANTS - BLUE AND WHITE SCREENING (MCQS)
sabaridaran1310
 
The learners analyze the various sectors of ICT and evaluate the potential ca...
The learners analyze the various sectors of ICT and evaluate the potential ca...The learners analyze the various sectors of ICT and evaluate the potential ca...
The learners analyze the various sectors of ICT and evaluate the potential ca...
maricrismontales
 
The Maritime Security. OSINT [EN] .pdf
The Maritime Security. OSINT [EN]   .pdfThe Maritime Security. OSINT [EN]   .pdf
The Maritime Security. OSINT [EN] .pdf
Snarky Security
 
Network Auto Configuration and Correction using Python.pptx
Network Auto Configuration and Correction using Python.pptxNetwork Auto Configuration and Correction using Python.pptx
Network Auto Configuration and Correction using Python.pptx
saikumaresh2
 
FIDO Munich Seminar: FIDO Tech Principles.pptx
FIDO Munich Seminar: FIDO Tech Principles.pptxFIDO Munich Seminar: FIDO Tech Principles.pptx
FIDO Munich Seminar: FIDO Tech Principles.pptx
FIDO Alliance
 
FIDO Munich Seminar FIDO Automotive Apps.pptx
FIDO Munich Seminar FIDO Automotive Apps.pptxFIDO Munich Seminar FIDO Automotive Apps.pptx
FIDO Munich Seminar FIDO Automotive Apps.pptx
FIDO Alliance
 
Mega MUG 2024: Working smarter in Marketo
Mega MUG 2024: Working smarter in MarketoMega MUG 2024: Working smarter in Marketo
Mega MUG 2024: Working smarter in Marketo
Stephanie Tyagita
 
STKI Israeli IT Market Study v2 August 2024.pdf
STKI Israeli IT Market Study v2 August 2024.pdfSTKI Israeli IT Market Study v2 August 2024.pdf
STKI Israeli IT Market Study v2 August 2024.pdf
Dr. Jimmy Schwarzkopf
 
Getting Started with Azure AI Studio.pptx
Getting Started with Azure AI Studio.pptxGetting Started with Azure AI Studio.pptx
Getting Started with Azure AI Studio.pptx
Swaminathan Vetri
 
Flame Atomic Emission Spectroscopy.-pptx
Flame Atomic Emission Spectroscopy.-pptxFlame Atomic Emission Spectroscopy.-pptx
Flame Atomic Emission Spectroscopy.-pptx
VaishnaviChavan206944
 
Increase Quality with User Access Policies - July 2024
Increase Quality with User Access Policies - July 2024Increase Quality with User Access Policies - July 2024
Increase Quality with User Access Policies - July 2024
Peter Caitens
 
Informatika smk kelas 10 kurikulum merdeka.pptx
Informatika smk kelas 10 kurikulum merdeka.pptxInformatika smk kelas 10 kurikulum merdeka.pptx
Informatika smk kelas 10 kurikulum merdeka.pptx
OkyPrayudi
 

Recently uploaded (20)

Project management Course in Australia.pptx
Project management Course in Australia.pptxProject management Course in Australia.pptx
Project management Course in Australia.pptx
 
TribeQonf2024_Dimpy_ShiftingSecurityLeft
TribeQonf2024_Dimpy_ShiftingSecurityLeftTribeQonf2024_Dimpy_ShiftingSecurityLeft
TribeQonf2024_Dimpy_ShiftingSecurityLeft
 
Blue Screen Of Death | Windows Down | Biggest IT failure
Blue Screen Of Death | Windows Down | Biggest IT failureBlue Screen Of Death | Windows Down | Biggest IT failure
Blue Screen Of Death | Windows Down | Biggest IT failure
 
FIDO Munich Seminar: Securing Smart Car.pptx
FIDO Munich Seminar: Securing Smart Car.pptxFIDO Munich Seminar: Securing Smart Car.pptx
FIDO Munich Seminar: Securing Smart Car.pptx
 
Project Delivery Methodology on a page with activities, deliverables
Project Delivery Methodology on a page with activities, deliverablesProject Delivery Methodology on a page with activities, deliverables
Project Delivery Methodology on a page with activities, deliverables
 
Easy Compliance is Continuous Compliance
Easy Compliance is Continuous ComplianceEasy Compliance is Continuous Compliance
Easy Compliance is Continuous Compliance
 
Scientific-Based Blockchain TON Project Analysis Report
Scientific-Based Blockchain  TON Project Analysis ReportScientific-Based Blockchain  TON Project Analysis Report
Scientific-Based Blockchain TON Project Analysis Report
 
The Challenge of Interpretability in Generative AI Models.pdf
The Challenge of Interpretability in Generative AI Models.pdfThe Challenge of Interpretability in Generative AI Models.pdf
The Challenge of Interpretability in Generative AI Models.pdf
 
SCREENING OF RECOMBINANTS - BLUE AND WHITE SCREENING (MCQS)
SCREENING OF RECOMBINANTS - BLUE AND WHITE SCREENING (MCQS)SCREENING OF RECOMBINANTS - BLUE AND WHITE SCREENING (MCQS)
SCREENING OF RECOMBINANTS - BLUE AND WHITE SCREENING (MCQS)
 
The learners analyze the various sectors of ICT and evaluate the potential ca...
The learners analyze the various sectors of ICT and evaluate the potential ca...The learners analyze the various sectors of ICT and evaluate the potential ca...
The learners analyze the various sectors of ICT and evaluate the potential ca...
 
The Maritime Security. OSINT [EN] .pdf
The Maritime Security. OSINT [EN]   .pdfThe Maritime Security. OSINT [EN]   .pdf
The Maritime Security. OSINT [EN] .pdf
 
Network Auto Configuration and Correction using Python.pptx
Network Auto Configuration and Correction using Python.pptxNetwork Auto Configuration and Correction using Python.pptx
Network Auto Configuration and Correction using Python.pptx
 
FIDO Munich Seminar: FIDO Tech Principles.pptx
FIDO Munich Seminar: FIDO Tech Principles.pptxFIDO Munich Seminar: FIDO Tech Principles.pptx
FIDO Munich Seminar: FIDO Tech Principles.pptx
 
FIDO Munich Seminar FIDO Automotive Apps.pptx
FIDO Munich Seminar FIDO Automotive Apps.pptxFIDO Munich Seminar FIDO Automotive Apps.pptx
FIDO Munich Seminar FIDO Automotive Apps.pptx
 
Mega MUG 2024: Working smarter in Marketo
Mega MUG 2024: Working smarter in MarketoMega MUG 2024: Working smarter in Marketo
Mega MUG 2024: Working smarter in Marketo
 
STKI Israeli IT Market Study v2 August 2024.pdf
STKI Israeli IT Market Study v2 August 2024.pdfSTKI Israeli IT Market Study v2 August 2024.pdf
STKI Israeli IT Market Study v2 August 2024.pdf
 
Getting Started with Azure AI Studio.pptx
Getting Started with Azure AI Studio.pptxGetting Started with Azure AI Studio.pptx
Getting Started with Azure AI Studio.pptx
 
Flame Atomic Emission Spectroscopy.-pptx
Flame Atomic Emission Spectroscopy.-pptxFlame Atomic Emission Spectroscopy.-pptx
Flame Atomic Emission Spectroscopy.-pptx
 
Increase Quality with User Access Policies - July 2024
Increase Quality with User Access Policies - July 2024Increase Quality with User Access Policies - July 2024
Increase Quality with User Access Policies - July 2024
 
Informatika smk kelas 10 kurikulum merdeka.pptx
Informatika smk kelas 10 kurikulum merdeka.pptxInformatika smk kelas 10 kurikulum merdeka.pptx
Informatika smk kelas 10 kurikulum merdeka.pptx
 

XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D

  • 1. Status of PCI emulation in Xen Roger Pau Monn´e roger.pau@citrix.com Chicago – July 9th, 2019
  • 2. PCI bus PCI-passthroughon Xen Moving forward PCI bus Allows attaching hardware devices in a computer. First specification developed by Intel in 1992. Superseded VESA, MCA, EISA, NuBus... Two standards: PCI local bus. PCI Express. Chicago – July 9th, 2019 Status of PCI emulation in Xen 2 / 20
  • 3. PCI bus PCI-passthroughon Xen Moving forward PCI slots on a motherboard Obtained from wikipedia author snickerdo. Chicago – July 9th, 2019 Status of PCI emulation in Xen 3 / 20
  • 4. PCI bus PCI-passthroughon Xen Moving forward PCI card Chicago – July 9th, 2019 Status of PCI emulation in Xen 4 / 20
  • 5. PCI bus PCI-passthroughon Xen Moving forward PCI configuration space The PCI configuration space provides 256bytes or 4096bytes of configuration space to each device. Devices are identified by a 8bit bus, 5bit device and 3bit function integers. First 64bytes is standardized, the rest is device dependent (contains capability structures). Allows for easy discovery of devices. OS can scan the whole bus in order to detect present devices. On x86 can be accessed from IO space (legacy) or memory (enhanced). Chicago – July 9th, 2019 Status of PCI emulation in Xen 5 / 20
  • 6. PCI bus PCI-passthroughon Xen Moving forward Legacy PCI configuration access Indirect access using the IO address space. Address port at 0xcf8: 012781011151623243031 E RSV Bus Device Func Register RSV Data port at 0xcfc. Chicago – July 9th, 2019 Status of PCI emulation in Xen 6 / 20
  • 7. PCI bus PCI-passthroughon Xen Moving forward Enhanced PCI configuration access Maps the full config space registers into memory space. 0111214151920272831 Base Bus Device Func Register If on 64bit mode bits from 63-32 also contain the base address. Chicago – July 9th, 2019 Status of PCI emulation in Xen 7 / 20
  • 8. PCI bus PCI-passthroughon Xen Moving forward PCI header 0781516232431 Status Command 04h Base Address 0 16h Base Address 1 20h Base Address 2 24h Base Address 3 28h Base Address 4 32h Base Address 5 36h CardBus CIS Pointer 40h Subsystem ID Subsystem Vendor ID 44h Expansion ROM Base Address 44h Chicago – July 9th, 2019 Status of PCI emulation in Xen 8 / 20
  • 9. PCI bus PCI-passthroughon Xen Moving forward MSI capability 0781516232431 Message control Next pointer Capability ID 00h Message Address [31, 0] 04h Message Address [63, 32] 08h Reserved Message Data 12h Mask Bits 16h Pending bits 20h Chicago – July 9th, 2019 Status of PCI emulation in Xen 9 / 20
  • 10. PCI bus PCI-passthroughon Xen Moving forward MSI-X capability 0781516232431 Message control Next pointer Capability ID 00h MSI-X Table Offset BIR 04h PBA Offset BIR 08h 0 31 32 63 64 Vector Control Message Data Upper Address Lower Address Entry 0 ... ... Vector Control Message Data Upper Address Lower Address Entry N Chicago – July 9th, 2019 Status of PCI emulation in Xen 10 / 20
  • 11. PCI bus PCI-passthroughon Xen Moving forward PCI handling in Xen PV privileged domain (dom0) gets almost unlimited access to the PCI config space: Xen controls the MSI(-X) mask bits in order to keep a coherent state when doing PCI-passthrough to HVM guests. Read only access is allowed to the MSI-X table and the MSI data and address registers. Passthrough of PCI devices to unprivileged guests: PV guests can access the PCI config space using a Xen PV specific protocol (pciif). HVM guests can access the PCI config space emulated by a device model (QEMU). PVH guests have no PCI-passthrough support yet. Chicago – July 9th, 2019 Status of PCI emulation in Xen 11 / 20
  • 12. PCI bus PCI-passthroughon Xen Moving forward PCI-passthrough for domUs Hardware Xen Control Domain (VM0) PV1 HVM1 user-space kernel QEMU evtchn devpciback Chicago – July 9th, 2019 Status of PCI emulation in Xen 12 / 20
  • 13. PCI bus PCI-passthroughon Xen Moving forward PCI-passthrough for domUs PV domU communicates directly with pciback using a shared memory ring and a Xen specific protocol. Passthrough to HVM domUs is handled by QEMU, much like emulated devices: PCI config space accesses are forwarded by Xen to QEMU using ioreqs. QEMU emulates or forwards those accesses to the underlying device. Xen directly handles guest writes to the MSI-X mask bits for performance reasons. Device MMIO regions (BARs) are directly mapped to the guest physmap, except for the MSI-X region if present. Chicago – July 9th, 2019 Status of PCI emulation in Xen 13 / 20
  • 14. PCI bus PCI-passthroughon Xen Moving forward PV dom0 Has almost unlimited read/write access to the configuration space except for certain parts of the MSI(-X) capabilities. Has to use hypercalls to deal with certain capabilities: MSI/MSI-X. Is fully trusted to not misbehave. Chicago – July 9th, 2019 Status of PCI emulation in Xen 14 / 20
  • 15. PCI bus PCI-passthroughon Xen Moving forward PVH dom0 PVH is a HVM guest from Xen’s point of view. HVM-like access to the configuration space: Transparent access to the MSI/MSI-X capabilities. Transparent mapping of BARs into the physmap and handling of writes to the BAR registers. Chicago – July 9th, 2019 Status of PCI emulation in Xen 15 / 20
  • 16. PCI bus PCI-passthroughon Xen Moving forward PVH dom0 Current PCI-passthrough code for HVM is in QEMU. Impossible to use QEMU for PVH dom0. No re-use of the QEMU PCI-passthrough code: would need heavy modifications that would make sharing changes very difficult. Added a PCI config space mediator to the hypervisor: vPCI. Chicago – July 9th, 2019 Status of PCI emulation in Xen 16 / 20
  • 17. PCI bus PCI-passthroughon Xen Moving forward PCI-passthrough mediators in Xen QEMU (user-space) and Xen for MSI-X mask bits for HVM domUs. pciback (hardware domain OS) for PV domUs. Direct access / hypercalls for PV dom0. vPCI (hypervisor) for PVH dom0. Chicago – July 9th, 2019 Status of PCI emulation in Xen 17 / 20
  • 18. PCI bus PCI-passthroughon Xen Moving forward Shortcomings No support for VFIO/MDEV on Xen: Threatening support for vGPU/XenGT in future releases. 3 different code bases to deal with PCI config space accesses: More maintainership work. Non uniform behaviour across different guests types. Chicago – July 9th, 2019 Status of PCI emulation in Xen 18 / 20
  • 19. PCI bus PCI-passthroughon Xen Moving forward Future items Re-work vPCI so it can be used both inside the hypervisor and in user-space. Could be used by HVM and PVH guests as a standalone PCI-passthrough utility. Unify PCI-passthrough for HVM and PVH both domU and dom0 into a single code-base. Add support for the extended config space to HVM domUs: allow to passthrough PCIe capabilities. Add support to passthrough SRIOV capability to vPCI, for PVH dom0. Chicago – July 9th, 2019 Status of PCI emulation in Xen 19 / 20
  • 20. PCI bus PCI-passthroughon Xen Moving forward Q&A Thanks Questions? Chicago – July 9th, 2019 Status of PCI emulation in Xen 20 / 20