qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC] AMD IOMMU: emulate multiple devices
@ 2016-06-08 10:00 David Kiarie
  2016-06-08 10:00 ` [Qemu-devel] [RFC] hw/i386: Composite Bus and PCI device David Kiarie
  0 siblings, 1 reply; 6+ messages in thread
From: David Kiarie @ 2016-06-08 10:00 UTC (permalink / raw)
  To: qemu-devel
  Cc: imammedo, ehabkost, marcel, mst, pbonzini, davidkiarie4, peterx,
	wexu, alex.williamson, rkrcmar, jan.kiszka

Hello all,

This patch tries to solve a problem whereby real AMD IOMMUs exhibit both PCI and Platform device properties. AMD IOMMU properties that conflict with conventional PCI devices' features include the fact that its not a BusMaster device and reserves MMIO region without a BAR register among others.

There is some already ongoing work on Intel IOMMU Interrupt remapping with implements an IOMMU base class[1], as a platform device(which means the moment I inherit from this class my device loses it's PCI properties). I am therefore forced to find a way to combine both PCI and platform features(which I had previously avoided) into AMD IOMMU.
                                                X86-IOMMU(common code)
                                                    |
                                                    |
                                                   / \
                                                  /   \
                                        Intel IOMMU   AMD IOMMU

This patch implements a stripped down sample of how I plan to solve this issue. It basically implements PCI device which serves to 'steal' PCI config space while the main device remains a platform device. The platform device maintains a reference to the PCI device and hence the relevant PCI config space. This device will also require [2] to work.

Looking forward to your comments!

[1] http://thread.gmane.org/gmane.comp.emulators.qemu/414510
[2] http://thread.gmane.org/gmane.comp.emulators.qemu/413018

David Kiarie (1):
  hw/i386: Composite Bus and PCI device

 hw/i386/compositedevice.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 113 insertions(+)
 create mode 100644 hw/i386/compositedevice.c

-- 
2.1.4

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [Qemu-devel] [RFC] AMD IOMMU: emulate multiple devices
@ 2016-06-05 16:54 David Kiarie
  0 siblings, 0 replies; 6+ messages in thread
From: David Kiarie @ 2016-06-05 16:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: imammedo, ehabkost, jasowang, marcel, mst, pbonzini, jan.kiszka,
	rkrcmar, alex.williamson, wexu, valentine.sinitsyn, peterx,
	David Kiarie

Hello all,

This patch tries to solve a problem whereby real AMD IOMMUs exhibit both PCI and Platform device properties. AMD IOMMU properties that conflict with conventional PCI devices' features include the fact that its not a BusMaster device, reserves MMIO region without a BAR register.

There is some already ongoing work on Intel IOMMU Interrupt remapping with implements an IOMMU base class, as a platform device(which means the moment I inherit from this class my device loses it's PCI properties). I am therefore forced to find a way to combine both PCI and platform features(which I had previously avoided) into AMD IOMMU. 

This patch implements a dummy PCI device which serves to 'steal' PCI config space while the rest of the device remains a platform device. The platform device maintains a reference to the PCI and hence the relevant PCI config space. Please ignore details in this patch and review the design. Also, some of the changes here are not related to the above issue.

Looking forward to your comments!

David Kiarie (1):
  Allow AMD IOMMU to have both SysBusDevice and PCIDevice properties.

 hw/acpi/aml-build.c         |    2 +-
 hw/i386/amd_iommu.c         | 1471 +++++++++++++++++++++++++++++++++++++++++++
 hw/i386/amd_iommu.h         |  348 ++++++++++
 hw/i386/kvm/pci-assign.c    |    2 +-
 hw/i386/pc_q35.c            |    1 +
 include/hw/acpi/acpi-defs.h |   13 +
 include/hw/acpi/aml-build.h |    1 +
 include/hw/pci/pci.h        |   10 +-
 qemu-options.hx             |    7 +-
 util/qemu-config.c          |    8 +-
 10 files changed, 1853 insertions(+), 10 deletions(-)
 create mode 100644 hw/i386/amd_iommu.c
 create mode 100644 hw/i386/amd_iommu.h

-- 
2.1.4

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

end of thread, other threads:[~2016-06-11 19:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-08 10:00 [Qemu-devel] [RFC] AMD IOMMU: emulate multiple devices David Kiarie
2016-06-08 10:00 ` [Qemu-devel] [RFC] hw/i386: Composite Bus and PCI device David Kiarie
2016-06-08 15:25   ` Eduardo Habkost
2016-06-10  5:30     ` Jan Kiszka
2016-06-11 19:36       ` David Kiarie
  -- strict thread matches above, loose matches on Subject: below --
2016-06-05 16:54 [Qemu-devel] [RFC] AMD IOMMU: emulate multiple devices 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).