SlideShare a Scribd company logo
Graphics Virtualization Challenges

             April-29-2010
                Allen Kay
          allen.m.kay@intel.com
Agenda

• Background
   – High Level PCI Driver Operation Flow
   – Native Device Initialization
   – QEMU IO Virtualization
   – Device Pass-through
• Graphics Pass-through
   – Base Changes
   – Discrete Graphics
   – Integrated Graphics Device (IGD)
• Current Status
• Future Work


                             Intel Confidential
                                                  2
High Level PCI Driver Operation Flow
• Initialize device base on vendor_id and device_id
• Map device MMIO area containing device control registers
• Using device control registers to initiate DMA
• Device interrupts CPU when DMA completes




                         Intel Confidential
                                                             3
Background: Native Device Initialization
• Device driver finds matching device with vendor/device ID
   – Reads device’s PCI configuration space
   – Using IO ports 0xCF8 and 0xCFC
• HW will respond when IO ports 0xCF8/0xCFC are accessed
   – OS writes PCI bus:dev:func:offset into 0xCF8
   – HW returns content into 0xCFC
• IO PORT and MMIO accesses are handled by HW
• DMA operation
   – Driver programs DMA physical address in DMA HW
   – No virtual-to-physical translation from the IO side
• HW generates interrupt after DMA completion


                              Intel Confidential
                                                              4
Background: QEMU IO Virtualization
• QEMU provides virtual platform for HVM guests
   – Virtual PCI bus 0
   – Virtual PCI devices hangs off on virtual PCI bus 0
• Virtual PCI vendor/device ID’s in PCI configuration space are
  hardcoded to match the real HW
   – i.e. E1000 NIC has vendor_id = 0x8086, device_id = 0x100E
   – Guest pci config info stored in pci_dev->config[4096]
• Guest PCI config accesses are trapped and emulated
   – Reading virtual E1000 NIC’s device_id returns 0x100E
   – This allows E1000 driver in guest OS to initialize successfully
• IO ports and MMIO accesses are trapped and handled by QEMU
• DMA operations and interrupts are also emulated
                              Intel Confidential
                                                                       5
Background: QEMU IO Virtualization




           Intel Confidential
                                     6
Background: PCI Device Pass-through
• QEMU still provides virtual platform as before
   –   Virtual PCI bus 0
   –   Virtual PCI devices and pass-through devices hang off virtual bus 0
• PCI config handling
   –   Pass-through device config space values are read off from real HW
   –   Vendor and device IDs reflects pass-through device values
   –   Native driver in the guest can be successfully initialized
   –   Most registers are emulated by QEMU as before
   –   Read/Write of some registers are pass-through to HW (i.e. COMMAND)




                                Intel Confidential
                                                                             7
Background: PCI Device Pass-through
• IO port handling
   –   Xen hypervisor intercepts guest IO port accesses
   –   Converts guest IO port to host IO port
   –   Check for host IO port access permission
   –   Read/Write host IO port on guest’s behalf

• MMIO handling
   –   Maps GPA to HPA mapping in hypervisor
   –   Guest can access device MMIO without causing VM exits

• DMA operations can be done without VM exits
   –   Guest device driver programs GPA to the device DMA engine
   –   IOMMU HW translates GPA to HPA

• Interrupt handling
   –   Interrupts from pass-through device is intercepted by hypervisor
   –   Re-injected to the guest via vioapic->vlapic->vmcs mechanism


                                  Intel Confidential
                                                                          8
Graphics Pass-through: Base Changes
• All changes are in user mode
   – QEMU and hvmloader
• Need to execute video BIOS in guest
   – Copy content of physical address 0xC0000 to guest memory
   – Execute at guest BIOS startup
• Allow access to legacy video specific IO Ports
   – 0x3B0 - 0x3BC
   – 0x3C0 – 0x3E0
• Setup GPA to HPA mapping of legacy video MMIO range
   – 0xA0000 – 0xBFFFF



                           Intel Confidential
                                                                9
Graphics Pass-through: Discrete Graphics
• Targeting virtualization friendly discrete devices
    –   nVidia Quadro FX3800 and ATI FireproV3750
• nVidia Quadro FX3800
    –   Cheapest in the product family at $900 each
    –   Video BIOS cannot be re-executed dynamically in the guest
    –   Manual workaround is not reasonable
    –   Cannot see boot messages
    –   Video works after OS video driver is up and running
• ATI Firepro V3750
    –   A more reasonable alternative at $150 each
    –   Work In Progress
• Plan to use dual QEMU VGA and pass-through graphics
    –   OS loader messages will be display in QEMU VGA
    –   Once OS is up and running, display is switched to the pass-through graphics


                                   Intel Confidential
                                                                                      10
Graphics Pass-through: Integrated Graphics
• Integrated Graphics Device (IGD) OpRegion
   – MMIO memory used for runtime driver/BIOS communication
   – Reported at vendor specific offset 0xFC in PCI config space
   – Not reported in PCI BAR
   – Need additional function call to map this region
• Non-IGD device accessing
   – IGD historically was part of the chipset
   – Driver accesses IOH registers for such info as Top Of Memory
         • Registers accesses are HW implementation dependent
         • Future HW will shadow these registers in IGD device (0:2.0)
   –   Driver also accesses PCH on newer platforms with on die graphics
         • Windows driver hard codes device 00:1f.0
   –   QEMU needs to allow such accesses when there is IGD pass-through


                                Intel Confidential
                                                                          11
Current Status
• Run Environment
   – Guest owns the graphics device
   – Access dom0 via VNC
• Xen 4.0 and xen-unstable supports
   – Quadro FX3800 (with no boot messages)
   – Q35/Q45/GM45 integrated graphics
• Working and need to submit upstream
  – Core i3/i5
  – Sandybridge
• Work In Progress
  – Enabling ATI Firepro V3750 discrete graphics


                            Intel Confidential
                                                   12
Future Work
• Dual IGD and discrete graphics support
   – Dom0 and guest can each have a device
• Restarting guests with graphics pass-through
• Dual QEMU VGA and graphics pass-through support
   – Workaround video BIOS init problem in discrete graphics
• Keyboard/mouse support for OS loader boot menu
   – Allow user to select which kernel to boot
• Raise virtualization awareness in graphics community
   – Windows driver validation team will be using Xen for validating drivers in
       virtualization environment
   –   Shadow IOH and PCH register accesses in IGD device
   –   Report IGD OpRegion address in PCI BAR

                              Intel Confidential
                                                                                  13
Questions?




Intel Confidential
                     14
Backup




Intel Confidential
                     15
Background: PCI Pass-through Example
• Pass-through E1000 NIC device at BDF 1:0.0
• QEMU reads PCI configuration space register using libpci
• QEMU constructs a virtual PCI configuration space with same
  content as 1:0.0 on real platform
   – Example: vendor_id = 0x8086, device_ID = 0x10b9
   – Example: 1:0.0 on real platform is mapped to 2:0.0 on virtual platform
• Guest PCI configuration accesses to device 2:0.0 is handled as
  pass-through device
   – Most read only registers are handled same as QEMU device
   – Some registers are passed through to HW: command register
• Access to any non pass-through devices are emulated
   – Example: host bridge device 0:0.0

                             Intel Confidential
                                                                              16
VT-d : Hardware Overview
            DMA Requests
                                                                         Dev 31, Func 7
Device ID IO Virtual Address Length …
                                                                          Dev P, Func 2
                                                             Bus 255
                                                                                                                   4KB
                                                             Bus N
                                                                                                                   Page
                                                                                                                  Frame
                             Fault Generation
                                                              Bus 0
                                                                         Dev P, Func 1
                                                                                                    4KB Page
                                                                                                     Tables
                                                                          Dev 0, Func 0



                                                                                                Address Translation
       VT-d                                                                           Device D1
                                                                                                  Structures for
     Hardware                                                      Device                           Domain A
                                                                   Context
                          Translation Cache                       Structures
                                                                                      Device D2
                                                                                                  Address Translation
                                                                                                    Structures for
                           Context Cache                                                              Domain B


Memory Access with Host Physical                                       Memory-resident IO Partitioning &
           Address                                                         Translation Structures
                                        Intel Confidential
                                                                                                                          17
Resources

• VT-d specification:
   – http://download.intel.com/technology/computing/vptech/Intel(r)_VT_for
      _Direct_IO.pdf

• Xen VT-d wiki:
   – http://wiki.xensource.com/xenwiki/VTdHowTo
• SR-IOV Specification:
   – http://www.pcisig.com/members/downloads/specifications/iov/sr-
      iov1.0_11Sep07.pdf

• ATS 1.1 Specification:
   – http://www.pcisig.com/members/downloads/specifications/iov/ats_r1.1
      _22Apr08.pdf



                           Intel Confidential
                                                                             18
Legal Information

• INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION
  WITH INTEL® PRODUCTS. EXCEPT AS PROVIDED IN INTEL'S TERMS
  AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO
  LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS OR
  IMPLIED WARRANTY RELATING TO SALE AND/OR USE OF INTEL
  PRODUCTS, INCLUDING LIABILITY OR WARRANTIES RELATING TO
  FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR
  INFRINGEMENT OF ANY PATENT, COPYRIGHT, OR OTHER
  INTELLECTUAL PROPERTY RIGHT.
• Intel may make changes to specifications, product descriptions, and
  plans at any time, without notice.
• All dates provided are subject to change without notice.
• Intel is a trademark of Intel Corporation in the U.S. and other
  countries.
• *Other names and brands may be claimed as the property of others.
• Copyright © 2007, Intel Corporation. All rights are protected.

                          Intel Confidential
                                                                        19
Intel Confidential
                     20

More Related Content

PDF
Williams xen summit 2010
PPT
PPTX
Realtime scheduling for virtual machines in SKT
PDF
Mobile Virtualization using the Xen Technologies
PDF
Multiple Shared Processor Pools In Power Systems
PDF
Nakajima hvm-be final
PDF
Linux PV on HVM
PDF
Windows server 8 hyper v networking (aidan finn)
Williams xen summit 2010
Realtime scheduling for virtual machines in SKT
Mobile Virtualization using the Xen Technologies
Multiple Shared Processor Pools In Power Systems
Nakajima hvm-be final
Linux PV on HVM
Windows server 8 hyper v networking (aidan finn)

What's hot (20)

PDF
Matching Cisco and System p
PPTX
Presentation power vm common 2012
PPTX
Presentation power vm virtualization without limits
PDF
XS Boston 2008 Self IO Emulation
PDF
Windows Server 2012 Hyper-V Networking Evolved
PPTX
Windows 8 Hyper-V: Availability
PPTX
Windows Server 8 Hyper V Networking
PDF
I/O Scalability in Xen
PDF
XS Boston 2008 Project Status
PPTX
Presentation power vm editions and power systems virtualization - basic
PPTX
Keynote Speech: Xen ARM Virtualization
PDF
XS Boston 2008 SR-IOV
PPT
IBM System Networking Easy Connect Mode
PPTX
Dealing with Hardware Heterogeneity Using EmbeddedXEN, a Virtualization Frame...
PDF
Ian Prattlinuxworld Xen Aug2008
PDF
Project ACRN: SR-IOV implementation
PDF
XS 2008 Boston VTPM
PPTX
VMware vSphere 4.1 deep dive - part 1
PDF
Xensummit2009 Io Virtualization Performance
PDF
Building a Distributed Block Storage System on Xen
Matching Cisco and System p
Presentation power vm common 2012
Presentation power vm virtualization without limits
XS Boston 2008 Self IO Emulation
Windows Server 2012 Hyper-V Networking Evolved
Windows 8 Hyper-V: Availability
Windows Server 8 Hyper V Networking
I/O Scalability in Xen
XS Boston 2008 Project Status
Presentation power vm editions and power systems virtualization - basic
Keynote Speech: Xen ARM Virtualization
XS Boston 2008 SR-IOV
IBM System Networking Easy Connect Mode
Dealing with Hardware Heterogeneity Using EmbeddedXEN, a Virtualization Frame...
Ian Prattlinuxworld Xen Aug2008
Project ACRN: SR-IOV implementation
XS 2008 Boston VTPM
VMware vSphere 4.1 deep dive - part 1
Xensummit2009 Io Virtualization Performance
Building a Distributed Block Storage System on Xen
Ad

Viewers also liked (7)

PDF
LinuxCon NA: Xen Project, Lessons Learned
PDF
Xrm xensummit
PDF
Open sourceclouds
PDF
Energy efficient storage in vm
PDF
Xen community update
PDF
Open Source Citrix Windows PV Drivers - Paul Durrant, Citrix
PDF
OWF: Xen Project - Moving a commercial open source project to an open source ...
LinuxCon NA: Xen Project, Lessons Learned
Xrm xensummit
Open sourceclouds
Energy efficient storage in vm
Xen community update
Open Source Citrix Windows PV Drivers - Paul Durrant, Citrix
OWF: Xen Project - Moving a commercial open source project to an open source ...
Ad

Similar to Graphics virtualization (20)

PDF
Project ACRN Device Passthrough Introduction
PDF
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
PDF
Project ACRN GVT-d introduction and tutorial
PDF
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
PPTX
5. IO virtualization
PDF
Status update-qemu-pcie
PDF
XS Boston 2008 VT-D PCI
PDF
PDF
Project ACRN hypervisor introduction
PDF
XS Boston 2008 Networking Direct Assignment
PDF
Rnote17
PDF
Graphics Passthrough With Vt D
PDF
Graphics Passthrough With Vt D V2
PDF
XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...
PDF
Implementing SR-IOv failover for Windows guests during live migration
PDF
Project ACRN expose and pass through platform hidden PCIe devices to SOS
PDF
Presentation cloud computing workshop - virtualization
PDF
XPDDS17: Shared Virtual Memory Virtualization Implementation on Xen - Yi Liu,...
PPTX
NFV Orchestration for Optimal Performance
PDF
PCI Passthrough and ITS Support in Xen / ARM :Xen Dev Summit 2015 Presentation
Project ACRN Device Passthrough Introduction
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
Project ACRN GVT-d introduction and tutorial
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
5. IO virtualization
Status update-qemu-pcie
XS Boston 2008 VT-D PCI
Project ACRN hypervisor introduction
XS Boston 2008 Networking Direct Assignment
Rnote17
Graphics Passthrough With Vt D
Graphics Passthrough With Vt D V2
XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...
Implementing SR-IOv failover for Windows guests during live migration
Project ACRN expose and pass through platform hidden PCIe devices to SOS
Presentation cloud computing workshop - virtualization
XPDDS17: Shared Virtual Memory Virtualization Implementation on Xen - Yi Liu,...
NFV Orchestration for Optimal Performance
PCI Passthrough and ITS Support in Xen / ARM :Xen Dev Summit 2015 Presentation

More from The Linux Foundation (20)

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

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PPT
Teaching material agriculture food technology
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Machine learning based COVID-19 study performance prediction
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Network Security Unit 5.pdf for BCA BBA.
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
KodekX | Application Modernization Development
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Approach and Philosophy of On baking technology
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Spectroscopy.pptx food analysis technology
Unlocking AI with Model Context Protocol (MCP)
Teaching material agriculture food technology
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Machine learning based COVID-19 study performance prediction
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Electronic commerce courselecture one. Pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
MYSQL Presentation for SQL database connectivity
Big Data Technologies - Introduction.pptx
Programs and apps: productivity, graphics, security and other tools
Per capita expenditure prediction using model stacking based on satellite ima...
Network Security Unit 5.pdf for BCA BBA.
The AUB Centre for AI in Media Proposal.docx
KodekX | Application Modernization Development
Encapsulation_ Review paper, used for researhc scholars
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Approach and Philosophy of On baking technology
sap open course for s4hana steps from ECC to s4
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Spectroscopy.pptx food analysis technology

Graphics virtualization

  • 1. Graphics Virtualization Challenges April-29-2010 Allen Kay allen.m.kay@intel.com
  • 2. Agenda • Background – High Level PCI Driver Operation Flow – Native Device Initialization – QEMU IO Virtualization – Device Pass-through • Graphics Pass-through – Base Changes – Discrete Graphics – Integrated Graphics Device (IGD) • Current Status • Future Work Intel Confidential 2
  • 3. High Level PCI Driver Operation Flow • Initialize device base on vendor_id and device_id • Map device MMIO area containing device control registers • Using device control registers to initiate DMA • Device interrupts CPU when DMA completes Intel Confidential 3
  • 4. Background: Native Device Initialization • Device driver finds matching device with vendor/device ID – Reads device’s PCI configuration space – Using IO ports 0xCF8 and 0xCFC • HW will respond when IO ports 0xCF8/0xCFC are accessed – OS writes PCI bus:dev:func:offset into 0xCF8 – HW returns content into 0xCFC • IO PORT and MMIO accesses are handled by HW • DMA operation – Driver programs DMA physical address in DMA HW – No virtual-to-physical translation from the IO side • HW generates interrupt after DMA completion Intel Confidential 4
  • 5. Background: QEMU IO Virtualization • QEMU provides virtual platform for HVM guests – Virtual PCI bus 0 – Virtual PCI devices hangs off on virtual PCI bus 0 • Virtual PCI vendor/device ID’s in PCI configuration space are hardcoded to match the real HW – i.e. E1000 NIC has vendor_id = 0x8086, device_id = 0x100E – Guest pci config info stored in pci_dev->config[4096] • Guest PCI config accesses are trapped and emulated – Reading virtual E1000 NIC’s device_id returns 0x100E – This allows E1000 driver in guest OS to initialize successfully • IO ports and MMIO accesses are trapped and handled by QEMU • DMA operations and interrupts are also emulated Intel Confidential 5
  • 6. Background: QEMU IO Virtualization Intel Confidential 6
  • 7. Background: PCI Device Pass-through • QEMU still provides virtual platform as before – Virtual PCI bus 0 – Virtual PCI devices and pass-through devices hang off virtual bus 0 • PCI config handling – Pass-through device config space values are read off from real HW – Vendor and device IDs reflects pass-through device values – Native driver in the guest can be successfully initialized – Most registers are emulated by QEMU as before – Read/Write of some registers are pass-through to HW (i.e. COMMAND) Intel Confidential 7
  • 8. Background: PCI Device Pass-through • IO port handling – Xen hypervisor intercepts guest IO port accesses – Converts guest IO port to host IO port – Check for host IO port access permission – Read/Write host IO port on guest’s behalf • MMIO handling – Maps GPA to HPA mapping in hypervisor – Guest can access device MMIO without causing VM exits • DMA operations can be done without VM exits – Guest device driver programs GPA to the device DMA engine – IOMMU HW translates GPA to HPA • Interrupt handling – Interrupts from pass-through device is intercepted by hypervisor – Re-injected to the guest via vioapic->vlapic->vmcs mechanism Intel Confidential 8
  • 9. Graphics Pass-through: Base Changes • All changes are in user mode – QEMU and hvmloader • Need to execute video BIOS in guest – Copy content of physical address 0xC0000 to guest memory – Execute at guest BIOS startup • Allow access to legacy video specific IO Ports – 0x3B0 - 0x3BC – 0x3C0 – 0x3E0 • Setup GPA to HPA mapping of legacy video MMIO range – 0xA0000 – 0xBFFFF Intel Confidential 9
  • 10. Graphics Pass-through: Discrete Graphics • Targeting virtualization friendly discrete devices – nVidia Quadro FX3800 and ATI FireproV3750 • nVidia Quadro FX3800 – Cheapest in the product family at $900 each – Video BIOS cannot be re-executed dynamically in the guest – Manual workaround is not reasonable – Cannot see boot messages – Video works after OS video driver is up and running • ATI Firepro V3750 – A more reasonable alternative at $150 each – Work In Progress • Plan to use dual QEMU VGA and pass-through graphics – OS loader messages will be display in QEMU VGA – Once OS is up and running, display is switched to the pass-through graphics Intel Confidential 10
  • 11. Graphics Pass-through: Integrated Graphics • Integrated Graphics Device (IGD) OpRegion – MMIO memory used for runtime driver/BIOS communication – Reported at vendor specific offset 0xFC in PCI config space – Not reported in PCI BAR – Need additional function call to map this region • Non-IGD device accessing – IGD historically was part of the chipset – Driver accesses IOH registers for such info as Top Of Memory • Registers accesses are HW implementation dependent • Future HW will shadow these registers in IGD device (0:2.0) – Driver also accesses PCH on newer platforms with on die graphics • Windows driver hard codes device 00:1f.0 – QEMU needs to allow such accesses when there is IGD pass-through Intel Confidential 11
  • 12. Current Status • Run Environment – Guest owns the graphics device – Access dom0 via VNC • Xen 4.0 and xen-unstable supports – Quadro FX3800 (with no boot messages) – Q35/Q45/GM45 integrated graphics • Working and need to submit upstream – Core i3/i5 – Sandybridge • Work In Progress – Enabling ATI Firepro V3750 discrete graphics Intel Confidential 12
  • 13. Future Work • Dual IGD and discrete graphics support – Dom0 and guest can each have a device • Restarting guests with graphics pass-through • Dual QEMU VGA and graphics pass-through support – Workaround video BIOS init problem in discrete graphics • Keyboard/mouse support for OS loader boot menu – Allow user to select which kernel to boot • Raise virtualization awareness in graphics community – Windows driver validation team will be using Xen for validating drivers in virtualization environment – Shadow IOH and PCH register accesses in IGD device – Report IGD OpRegion address in PCI BAR Intel Confidential 13
  • 16. Background: PCI Pass-through Example • Pass-through E1000 NIC device at BDF 1:0.0 • QEMU reads PCI configuration space register using libpci • QEMU constructs a virtual PCI configuration space with same content as 1:0.0 on real platform – Example: vendor_id = 0x8086, device_ID = 0x10b9 – Example: 1:0.0 on real platform is mapped to 2:0.0 on virtual platform • Guest PCI configuration accesses to device 2:0.0 is handled as pass-through device – Most read only registers are handled same as QEMU device – Some registers are passed through to HW: command register • Access to any non pass-through devices are emulated – Example: host bridge device 0:0.0 Intel Confidential 16
  • 17. VT-d : Hardware Overview DMA Requests Dev 31, Func 7 Device ID IO Virtual Address Length … Dev P, Func 2 Bus 255 4KB Bus N Page Frame Fault Generation Bus 0 Dev P, Func 1 4KB Page Tables Dev 0, Func 0 Address Translation VT-d Device D1 Structures for Hardware Device Domain A Context Translation Cache Structures Device D2 Address Translation Structures for Context Cache Domain B Memory Access with Host Physical Memory-resident IO Partitioning & Address Translation Structures Intel Confidential 17
  • 18. Resources • VT-d specification: – http://download.intel.com/technology/computing/vptech/Intel(r)_VT_for _Direct_IO.pdf • Xen VT-d wiki: – http://wiki.xensource.com/xenwiki/VTdHowTo • SR-IOV Specification: – http://www.pcisig.com/members/downloads/specifications/iov/sr- iov1.0_11Sep07.pdf • ATS 1.1 Specification: – http://www.pcisig.com/members/downloads/specifications/iov/ats_r1.1 _22Apr08.pdf Intel Confidential 18
  • 19. Legal Information • INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL® PRODUCTS. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY RELATING TO SALE AND/OR USE OF INTEL PRODUCTS, INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT, OR OTHER INTELLECTUAL PROPERTY RIGHT. • Intel may make changes to specifications, product descriptions, and plans at any time, without notice. • All dates provided are subject to change without notice. • Intel is a trademark of Intel Corporation in the U.S. and other countries. • *Other names and brands may be claimed as the property of others. • Copyright © 2007, Intel Corporation. All rights are protected. Intel Confidential 19