SlideShare a Scribd company logo
PCI Express support in qemu




Isaku Yamahata, VA Linux Systems Japan K.K.
               <yamahata@private.email.ne.jp>
Akio Takebe, Fujitsu Limited
             <takebe_akio@jp.fujitsu.com>

Xen Summit Asia Shanghai, China
November 20, 2009
Agenda
Introduction
New chipset emulator in qemu
Summary
Future work
Introduction
Background
Current Qemu emulates
For Pentium Pro/II/III
North bridge: I440FX
South bridge: PIIX3 (and PIIX4 for acpi power
management and pci hot plug)
Hardware release date: May 1996
Too old compared to new real hardware
features
Motivation
More PCI features are wanted
Currently Qemu only supports part of PCI specs.
e.g.64bit BAR isn't supported.
More buses/slots
Qemu only supports single host bus (for PC emulation). Sub
PCI bus isn't supported.
3+ pci bus(96+ slots)/96+ pcie slots are wanted.
Brige emulation: filtering aren't implemented.
Motivation(cont.)
PCI express features
   Hot plug, power management, ARI, AER
Native pass through of PCI express device to
guest OS
PCI express devices can be passed through as PCI
device, though.
Need to fill those gap between newer real
hardware features and qemu emulation mainly
in PCI related area.
New chipset emulator for new
      hardware features
Why new chipset?
Keep the currently supported chipset(I440FX,
PIIX) for legacy compatibility.
Old OSes must run on it.
add new features for modern OSes without
legacy compatibility.
New chipset emulator
Q35 chipset based
For Core2 Duo
North bridge: mch
South bridge: ich9
Release date: Sep 2007
In fact I have chosen Q35 because I have it
available at hand.
Newer chipsets(gmch/ioh, ich10) have mostly same feature
from the point of view of emulation except graphics.
New chipset emulator(cont.)
Now the followings are working
64bit BAR
PCI express MMCONFIG
BIOS updates(MCFG, e820)
Linux boots happily using MMCONFIG
Windows XP installs and boots.
Currently those are under heavy
review/rewrite process for qemu 0.12.0.
Q35 chipset emulator doesn't
               have
IOMMU(VT-d) emulation in qemu
It would make sense to support IOMMU for guest OS.
This requires full redesign of qemu DMA layer.
Graphic emulation
So it should be called P45 emulator, not Q35?
BIOS
ACPI MCFG to specify MMCONFIG area
E820 update
Make e820 code 64bit aware.
So far it filled higher bits with zero.
Linux requires MCFG area is covered by e820
reserved area
Otherwise Linux thinks that it's bios bug and
avoids to use MMCONFIG.
BIOS(cont.)
PCI initialization
Teach the bios new chipset
PCI IO/memory area assignment for multi pci bus.
ACPI
ACPI tables update
FADT
MCFG
DSDT
PCI express(PNP0A08)
PCI routing table
Summary: current status
   PCI express
   PCIe MMCONFIG               Merged.
   Q35 chipset base            working. Pushing this now.
   PCIe portemulator           WIP
   pcie native hotplug         WIP
   pcie passthrough            WIP
   3+ pci bus                  working(not merged yet)

   pcbios
   mcfg                        working(not merged yet)
   e820                        working(not merged yet)
   host bridge
   initiazatlin                working(not merged yet)
   pci io/memory
   space initialization        working(not merged yet)
   switching acpi table
   or passing acpi table
   outside qemu                WIP

   sea bios: Not started yet
Future work
Future work:PCI express
PCI express hot plug will be provided as
pcie switch emulator (not integrated into
chipset)
Many (96+) port wanted
ARI(alternative routing ID)
Future work:PCI express(cont.)
PCI express native passthrough.
PCI express specific configuration registers
should be virtualized
Device serial number cap, VSEC...
AER(Advanced Error Report): passing errors to
guest OS
Power management
Multi PCI domain?
More slots
Future work:BIOS
pcbios(bochs bios) vs seabios
Pcbios is from bochs.
Seabios is more clean and featured.
Qemu switches from pcbios to seabios
Now qemu uses pcbios so that patches for pcbios
have been created.
Qemu 0.12.0 release will use seabios instead of
pcbios.
So patches for seabios are necessary for merging.
Future work:ACPI
BIOS code change is small, however ACPI
table change would be large.
Have two tables (more in future?), and switch it
dynamically?
pass tables outside qemu, say, by command line
option.
Requires interface between qemu and bios
fw_cfg
Dynamically generating ACPI code?
COREBOOT does.
Future work: IOMMU?
IOMMU: Intel VT-d, AMD IOMMU
IOMMU emulator in qemu
The implementation will be interesting.
Requires full revise of qemu DMA layer
Shadowing IOMMU page tables for guest OS
For HVM guest
Future work:
   passthrough support in qemu?
Support passthrough in qemu.
Hopefully consolidate xen passthrough code into
qemu.
By consolidating the passthrough code into qemu,
the code base would get more tests and become more
stable.
Thank you




Questions?
This work was partly funded by Ministry of Economy,
Trade and Industry (METI) of Japan as the Secure
Platform project of Association of Super-Advanced
Electronics Technologies (ASET).

More Related Content

PDF
Arm device tree and linux device drivers
PDF
U-Boot - An universal bootloader
PDF
Uboot startup sequence
PPTX
Linux Network Stack
PPTX
Memory model
PDF
LCU14 500 ARM Trusted Firmware
PDF
Vmlinux: anatomy of bzimage and how x86 64 processor is booted
Arm device tree and linux device drivers
U-Boot - An universal bootloader
Uboot startup sequence
Linux Network Stack
Memory model
LCU14 500 ARM Trusted Firmware
Vmlinux: anatomy of bzimage and how x86 64 processor is booted

What's hot (20)

PDF
I2c drivers
PPTX
U-Boot presentation 2013
PPTX
Linux Device Tree
PDF
HKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
PDF
The linux networking architecture
PDF
Understanding a kernel oops and a kernel panic
ODP
eBPF maps 101
PDF
Trusted firmware deep_dive_v1.0_
PPTX
The TCP/IP Stack in the Linux Kernel
PDF
USB Drivers
PPTX
QEMU - Binary Translation
PPT
U boot porting guide for SoC
PDF
Decompressed vmlinux: linux kernel initialization from page table configurati...
PPTX
qemu + gdb + sample_code: Run sample code in QEMU OS and observe Linux Kernel...
PDF
Embedded_Linux_Booting
PDF
Qemu Introduction
PPTX
用Raspberry Pi 學Linux I2C Driver
PDF
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
PPTX
Linux Kernel Booting Process (1) - For NLKB
I2c drivers
U-Boot presentation 2013
Linux Device Tree
HKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
The linux networking architecture
Understanding a kernel oops and a kernel panic
eBPF maps 101
Trusted firmware deep_dive_v1.0_
The TCP/IP Stack in the Linux Kernel
USB Drivers
QEMU - Binary Translation
U boot porting guide for SoC
Decompressed vmlinux: linux kernel initialization from page table configurati...
qemu + gdb + sample_code: Run sample code in QEMU OS and observe Linux Kernel...
Embedded_Linux_Booting
Qemu Introduction
用Raspberry Pi 學Linux I2C Driver
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Linux Kernel Booting Process (1) - For NLKB
Ad

Similar to Qemu Pcie (20)

PDF
Status update-qemu-pcie
PDF
XS Boston 2008 VT-D PCI
PDF
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
PDF
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
PDF
Buiding a better Userspace - The current and future state of QEMU and KVM int...
PDF
haifux-pcie.pdf
PDF
Project ACRN Device Passthrough Introduction
PDF
Graphics virtualization
PDF
Graphics virtualization
PPTX
Slideshare - PCIe
PDF
PCI Passthrough and ITS Support in Xen / ARM :Xen Dev Summit 2015 Presentation
PDF
ACPI and FreeBSD (Part 1)
DOCX
Bsdtw17: ruslan bukin: free bsd/risc-v and device drivers
PDF
Vortex86 Sx Linux How To
PDF
Qemu device prototyping
PDF
Development platform virtualization using qemu
PDF
XS Boston 2008 Self IO Emulation
PDF
mtcawsc2019_marjanovic_pcie_xilinx_and_fpga_tool
PDF
Xen summit spring2010_tom_woller_amd
PPTX
QEMU and Raspberry Pi. Instant Embedded Development
Status update-qemu-pcie
XS Boston 2008 VT-D PCI
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
Buiding a better Userspace - The current and future state of QEMU and KVM int...
haifux-pcie.pdf
Project ACRN Device Passthrough Introduction
Graphics virtualization
Graphics virtualization
Slideshare - PCIe
PCI Passthrough and ITS Support in Xen / ARM :Xen Dev Summit 2015 Presentation
ACPI and FreeBSD (Part 1)
Bsdtw17: ruslan bukin: free bsd/risc-v and device drivers
Vortex86 Sx Linux How To
Qemu device prototyping
Development platform virtualization using qemu
XS Boston 2008 Self IO Emulation
mtcawsc2019_marjanovic_pcie_xilinx_and_fpga_tool
Xen summit spring2010_tom_woller_amd
QEMU and Raspberry Pi. Instant Embedded Development
Ad

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: [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
PDF
XPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information Security
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: [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
XPDDS19: Implementing AMD MxGPU - Jonathan Farrell, Assured Information Security

Recently uploaded (20)

PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Electronic commerce courselecture one. Pdf
PDF
Approach and Philosophy of On baking technology
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Big Data Technologies - Introduction.pptx
PDF
KodekX | Application Modernization Development
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Cloud computing and distributed systems.
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Understanding_Digital_Forensics_Presentation.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Electronic commerce courselecture one. Pdf
Approach and Philosophy of On baking technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Programs and apps: productivity, graphics, security and other tools
Building Integrated photovoltaic BIPV_UPV.pdf
Unlocking AI with Model Context Protocol (MCP)
Big Data Technologies - Introduction.pptx
KodekX | Application Modernization Development
Dropbox Q2 2025 Financial Results & Investor Presentation
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Cloud computing and distributed systems.
Spectral efficient network and resource selection model in 5G networks
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11

Qemu Pcie

  • 1. PCI Express support in qemu Isaku Yamahata, VA Linux Systems Japan K.K. <yamahata@private.email.ne.jp> Akio Takebe, Fujitsu Limited <takebe_akio@jp.fujitsu.com> Xen Summit Asia Shanghai, China November 20, 2009
  • 2. Agenda Introduction New chipset emulator in qemu Summary Future work
  • 4. Background Current Qemu emulates For Pentium Pro/II/III North bridge: I440FX South bridge: PIIX3 (and PIIX4 for acpi power management and pci hot plug) Hardware release date: May 1996 Too old compared to new real hardware features
  • 5. Motivation More PCI features are wanted Currently Qemu only supports part of PCI specs. e.g.64bit BAR isn't supported. More buses/slots Qemu only supports single host bus (for PC emulation). Sub PCI bus isn't supported. 3+ pci bus(96+ slots)/96+ pcie slots are wanted. Brige emulation: filtering aren't implemented.
  • 6. Motivation(cont.) PCI express features Hot plug, power management, ARI, AER Native pass through of PCI express device to guest OS PCI express devices can be passed through as PCI device, though. Need to fill those gap between newer real hardware features and qemu emulation mainly in PCI related area.
  • 7. New chipset emulator for new hardware features
  • 8. Why new chipset? Keep the currently supported chipset(I440FX, PIIX) for legacy compatibility. Old OSes must run on it. add new features for modern OSes without legacy compatibility.
  • 9. New chipset emulator Q35 chipset based For Core2 Duo North bridge: mch South bridge: ich9 Release date: Sep 2007 In fact I have chosen Q35 because I have it available at hand. Newer chipsets(gmch/ioh, ich10) have mostly same feature from the point of view of emulation except graphics.
  • 10. New chipset emulator(cont.) Now the followings are working 64bit BAR PCI express MMCONFIG BIOS updates(MCFG, e820) Linux boots happily using MMCONFIG Windows XP installs and boots. Currently those are under heavy review/rewrite process for qemu 0.12.0.
  • 11. Q35 chipset emulator doesn't have IOMMU(VT-d) emulation in qemu It would make sense to support IOMMU for guest OS. This requires full redesign of qemu DMA layer. Graphic emulation So it should be called P45 emulator, not Q35?
  • 12. BIOS ACPI MCFG to specify MMCONFIG area E820 update Make e820 code 64bit aware. So far it filled higher bits with zero. Linux requires MCFG area is covered by e820 reserved area Otherwise Linux thinks that it's bios bug and avoids to use MMCONFIG.
  • 13. BIOS(cont.) PCI initialization Teach the bios new chipset PCI IO/memory area assignment for multi pci bus.
  • 14. ACPI ACPI tables update FADT MCFG DSDT PCI express(PNP0A08) PCI routing table
  • 15. Summary: current status PCI express PCIe MMCONFIG Merged. Q35 chipset base working. Pushing this now. PCIe portemulator WIP pcie native hotplug WIP pcie passthrough WIP 3+ pci bus working(not merged yet) pcbios mcfg working(not merged yet) e820 working(not merged yet) host bridge initiazatlin working(not merged yet) pci io/memory space initialization working(not merged yet) switching acpi table or passing acpi table outside qemu WIP sea bios: Not started yet
  • 17. Future work:PCI express PCI express hot plug will be provided as pcie switch emulator (not integrated into chipset) Many (96+) port wanted ARI(alternative routing ID)
  • 18. Future work:PCI express(cont.) PCI express native passthrough. PCI express specific configuration registers should be virtualized Device serial number cap, VSEC... AER(Advanced Error Report): passing errors to guest OS Power management Multi PCI domain? More slots
  • 19. Future work:BIOS pcbios(bochs bios) vs seabios Pcbios is from bochs. Seabios is more clean and featured. Qemu switches from pcbios to seabios Now qemu uses pcbios so that patches for pcbios have been created. Qemu 0.12.0 release will use seabios instead of pcbios. So patches for seabios are necessary for merging.
  • 20. Future work:ACPI BIOS code change is small, however ACPI table change would be large. Have two tables (more in future?), and switch it dynamically? pass tables outside qemu, say, by command line option. Requires interface between qemu and bios fw_cfg Dynamically generating ACPI code? COREBOOT does.
  • 21. Future work: IOMMU? IOMMU: Intel VT-d, AMD IOMMU IOMMU emulator in qemu The implementation will be interesting. Requires full revise of qemu DMA layer Shadowing IOMMU page tables for guest OS For HVM guest
  • 22. Future work: passthrough support in qemu? Support passthrough in qemu. Hopefully consolidate xen passthrough code into qemu. By consolidating the passthrough code into qemu, the code base would get more tests and become more stable.
  • 24. This work was partly funded by Ministry of Economy, Trade and Industry (METI) of Japan as the Secure Platform project of Association of Super-Advanced Electronics Technologies (ASET).