Skip to content

RFC AMD IOMMU emulation patchset

Eduard - Gabriel Munteanu kvm qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest7 patches 34 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7Generic IOMMU layerMakefile.target hw/iommu.c hw/iommu.h +1 more+349 -02 replies
2/7AMD IOMMU emulationMakefile.target configure hw/amd_iommu.c +4 more+644 -01 reply
3/7pci: call IOMMU hookshw/pci.c+21 -02 replies
4/7ide: IOMMU supporthw/ide/core.c+31 -1528 replies
5/7rtl8139: IOMMU supporthw/rtl8139.c+62 -360 replies
6/7eepro100: IOMMU supporthw/eepro100.c+101 -400 replies
7/7ac97: IOMMU supporthw/ac97.c+17 -31 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/7] AMD IOMMU emulation patchset

Hi everybody,

This is my work on the AMD IOMMU emulation project. I've put this, along with the SeaBIOS patches (which you need to test), in my Git repos here:

http://repo.or.cz/w/qemu-kvm/amd-iommu.git
http://repo.or.cz/w/seabios/amd-iommu.git

While it works for Linux guests (didn't try anything else), it's not yet complete. But the ported devices work, and so may others that either don't do DMA (VGA for example) or they're not on a PCI bus.

Passing devices from a guest to a nested guest also works. It seems no modifications were needed for that (well, except getting a host kernel on which nested SVM works right ;), and I'd recommend 2.6.34.1), but I only tested with the rtl8139. Will test soon with a doubly nested guest to cover that scenario as well, along with testing other emulated hw.

I'd like your opinions on this. Perhaps you could test it and report if you find any issues. Some things aren't done/complete yet:
- fixing the theoretical AIO issue, but it's not a priority right now
- actually testing that access checking works (should inject faults)
- implementing skipped translation levels
- a translation cache might be a good idea
- implementing features not used by Linux (e.g. interrupt remapping)

That being said, any feedback is welcome.

Thanks,
Eduard

P.S.: I'd also like to thank Paul Brook for his help on figuring out some aspects of the IOMMU layer.

Eduard - Gabriel Munteanu (7):
Generic IOMMU layer
AMD IOMMU emulation
pci: call IOMMU hooks
ide: IOMMU support
rtl8139: IOMMU support
eepro100: IOMMU support
ac97: IOMMU support

 Makefile.target |    3 +
 configure       |   11 +
 hw/ac97.c       |   20 ++-
 hw/amd_iommu.c  |  621 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/eepro100.c   |  141 +++++++++----
 hw/ide/core.c   |   46 +++--
 hw/iommu.c      |   82 ++++++++
 hw/iommu.h      |  260 +++++++++++++++++++++++
 hw/pc.c         |    4 +
 hw/pc.h         |    3 +
 hw/pci.c        |   21 ++
 hw/pci_ids.h    |    2 +
 hw/pci_regs.h   |    1 +
 hw/qdev.h       |    6 +
 hw/rtl8139.c    |   98 ++++++----
 15 files changed, 1225 insertions(+), 94 deletions(-)
 create mode 100644 hw/amd_iommu.c
 create mode 100644 hw/iommu.c
 create mode 100644 hw/iommu.h