qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC 0/4] AMD IOMMU
@ 2015-08-24 23:19 David Kiarie
  2015-08-24 23:19 ` [Qemu-devel] [RFC 1/4] hw/core: Prepare for introducing " David Kiarie
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: David Kiarie @ 2015-08-24 23:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: valentine.sinitsyn, jan.kiszka, David Kiarie, mst

This series implements basic AMD IOMMU emulation to Qemu

AMD IOMMU emulation.
   -This series emulates AMD IOMMU on qemu. It implements the following features
      -Translation - 4K pages
      -Event logging - particulary fault logging.

   -AMD IOMMU, being a convectional PCI device doesn't rely on any other technology from AMD and hence you can test this patch on l2 guest emulated on an Intel PC.
   -These patches have been tested using the 'ac97' sound device with QEMU_AUDIO_DRV=alsa and proven to work.
   
Testing - pretty basic stuff...
On host
    #kvm_amd is loaded with nested support by default by anyways :)
   -$modprobe -r kvm_amd
    $modprobe kvm_amd nested=1

    $command to start guest with 'iommu=1' kernel arguments

On the guest
    $dmesg | AMD-Vi

        AMD-Vi: Enabling IOMMU at 0000:00:00.2 cap 0x40
        AMD-Vi: Lazy IO/TLB flushing enabled

    $modprobe kvm_amd

    $modprobe pci_stub

    $lspci -n 
    01:00.0 0200: 8086:10b9 (rev 06)

    $echo "8086 10b9" > /sys/bus/pci/drivers/pci-stub/new_id
    $echo 0000:01:00.0 > /sys/bus/pci/devices/0000:01:00.0/driver/unbind
    $echo 0000:01:00.0 > /sys/bus/pci/drivers/pci-stub/bind

    Assign the device

    $/usr/local/bin/qemu-system-x86_64 -m 512 -boot c -net none -hda /root/ia32e_rhel5u1.img -device pci-assign,host=01:00.0 

I guess that's all there is to say. Please test!

asla.

David (4):
  hw/core: Prepare for introducing AMD IOMMU
  hw/i386: Introduce AMD IOMMU
  hw/i386: Introduce IVRS for AMD IOMMU
  hw/pci-host: Add AMD IOMMU emulation to q35 and PIIX

 hw/core/machine.c           |  25 ++
 hw/i386/Makefile.objs       |   1 +
 hw/i386/acpi-build.c        |  85 ++++
 hw/i386/amd_iommu.c         | 993 ++++++++++++++++++++++++++++++++++++++++++++
 hw/i386/amd_iommu.h         | 298 +++++++++++++
 hw/pci-host/piix.c          |  11 +
 hw/pci-host/q35.c           |  11 +
 include/hw/acpi/acpi-defs.h |  55 +++
 include/hw/boards.h         |   2 +
 9 files changed, 1481 insertions(+)
 create mode 100644 hw/i386/amd_iommu.c
 create mode 100644 hw/i386/amd_iommu.h

-- 
2.1.4

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2015-09-12 10:56 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-24 23:19 [Qemu-devel] [RFC 0/4] AMD IOMMU David Kiarie
2015-08-24 23:19 ` [Qemu-devel] [RFC 1/4] hw/core: Prepare for introducing " David Kiarie
2015-08-24 23:19 ` [Qemu-devel] [RFC 2/4] hw/i386: Introduce " David Kiarie
2015-08-25  6:39   ` Valentine Sinitsyn
2015-08-25  7:25     ` David kiarie
2015-08-25  7:31       ` Valentine Sinitsyn
2015-08-25  7:41         ` David kiarie
2015-08-25  7:43           ` Valentine Sinitsyn
2015-08-25  7:44           ` David kiarie
2015-09-07 12:46   ` Valentine Sinitsyn
2015-09-09  7:30     ` David kiarie
2015-09-09  7:45       ` Valentine Sinitsyn
2015-09-09  7:59         ` David kiarie
2015-09-09  8:07           ` Valentine Sinitsyn
2015-09-09  8:12             ` David kiarie
2015-09-09  8:14               ` Valentine Sinitsyn
2015-09-09  8:31                 ` David kiarie
2015-09-09  7:59         ` Michael S. Tsirkin
2015-09-09  8:04           ` Valentine Sinitsyn
2015-09-12 10:55     ` Valentine Sinitsyn
2015-08-24 23:19 ` [Qemu-devel] [RFC 3/4] hw/i386: Introduce IVRS for " David Kiarie
2015-08-24 23:19 ` [Qemu-devel] [RFC 4/4] hw/pci-host: Add AMD IOMMU emulation to q35 and PIIX David Kiarie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).