Successfully reported this slideshow.
Your SlideShare is downloading. ×

Project ACRN GVT-d introduction and tutorial

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad

Check these out next

1 of 13 Ad

More Related Content

Slideshows for you (20)

Similar to Project ACRN GVT-d introduction and tutorial (20)

Advertisement

Recently uploaded (20)

Project ACRN GVT-d introduction and tutorial

  1. 1. ACRN GVT-d Introduction and Tutorial ZHAO Yakui Zhao Yakui <Yakui.zhao@intel.com> 05/20/2020
  2. 2. Agenda ● Background ● Design of GVT-d ● How to use GVT-d
  3. 3. Background
  4. 4. GPU Virtualization Approaches API Forwarding Mediated Pass-thru Direct Pass-thru Low perf Compatibility issue Currently used in ACRN Named GVT-g Pass-thru GPU Named GVT-d
  5. 5. Why chose GVT-d • Support GVT-d is simpler than GVT-g for industrial scenario as only one VM require graphic support • GVT-d has better performance than GVT-g
  6. 6. Design of GVT-d
  7. 7. GVT-d initialization flow • Register PCI device in ACRN DM • Add one PCI device from the passthru PCI device • Add the pci_config_read/write callback • Initialize the PCI caps for guest system • Construct the PCI bar for Guest OS • Allocate/initialize the PCI bar for guest OS • construct the EPT mapping from the guest PCI bar to host PCI mmio_addr • This will allow the guest OS to read/write the PCI mmio_registers without Vm-exit • Let hypervisor to prepare DMAR addr translation for passthru-device • Use vm_assign_ptdev SOS_ioctl to communicate with the hypervisor • DMAR addr translation logic allows the pass-thru device to read/write the system memory in Guest by using DMA • This is based on VT-d IOMMU • https://projectacrn.github.io/latest/developer-guides/hld/hv-vt-d.html
  8. 8. Extra resources required by GVT-d Pass-thru Graphics stolen memory • Allow Guest VM to reuse the framebuffer memory allocated by native BIOS Pass-thru OpRegion • Describe board GPU specific information • For example: HDMI/DP ports, eDP timing info • Guest graphic driver relies on it to communicate with native BIOS during GPU initialization Create dummy LPC bridge • Windows guest graphics driver need a LPC bridge located on bdf 00:1f.0 to initialize the platform-specific info
  9. 9. How to use GVT-d
  10. 10. BIOS setting on WHL platforms • Set 64MB graphics stolen memory
  11. 11. BIOS setting on WHL platforms(2) • Set 64MB graphics stolen memory • Set enabled for PM support
  12. 12. GVT-d usage example echo "8086 $GPU_DEVICE_ID" > /sys/bus/pci/drivers/pci-stub/new_id echo "0000:00:02.0" > /sys/bus/pci/devices/0000:00:02.0/driver/unbind echo "0000:00:02.0" > /sys/bus/pci/drivers/pci-stub/bind acrn-dm -A -m $mem_size -s 0:0,hostbridge … -s 2,passthru,0/2/0,gpu … 1. Load the pci_stub driver for the Intel GPU device 2. Pass-thru Intel GPU device for ACRN DM
  13. 13. Q&A

×