qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC v2 0/6] KVM platform device passthrough


From: Eric Auger
Subject: [Qemu-devel] [RFC v2 0/6] KVM platform device passthrough
Date: Wed, 9 Apr 2014 16:33:03 +0100

This is an RFC about QEMU VFIO platform device implementation.
This work aims at enabling KVM platform device passthrough,
where a guest OS is directly assigned a platform device: meaning
it can access the register space without trapping, and receive IRQ
from the device. Also the system MMU downstream to the device is
programmed properly to make sure the device can only see the VM
assigned physical address space.

This work was tested on Calxeda Midway where one xgmac is assigned to
KVM host while the second one is assigned to the guest. The current
status is the guest is able to ping the gateway meaning the basic
functionality is achieved for this device.

Nethertheless some key work remains to be done:
- unbind/migration
- multi-instantiation testing
- multiple IRQ testing
- management of platform devices with more complex device tree node

- The 1st RFC patch works around the limitation of QEMU not being able
to create platform devices from the command line, and should only
be used for testing the second patch.  A discussion of how to address
the limitation is encouraged, however, in the context of the first patch.

- The 2d patch addresses A.Williamson's comment
to have the platform device code separated from the PCI device
code, by firstly moving the existing VFIO PCI code into its
own hw/vfio/.

- the 3d RFC patch achieves MMIO direct access to the device.

- the 4th RFC brings basic IRQ support

- the 5th RFC enables the QEMU end-user to pass the device he wants
  to assign to his guest in the command line.

- the last RFC brings some cleanup and paves the way for cleaner exit

Here are the instructions to test on a Calxeda Midway:

https://wiki.linaro.org/LEG/Engineering/Virtualization/Platform_Device_Passthrough_on_Midway

The code is based on today's: git://git.qemu.org/qemu.git

some patches need to be applied on host linux to correct issues
not yet upstreamed. They can be found on vfio-dev branch of
git://git.linaro.org/people/eric.auger/linux.git

- commit 997691b: enables unmapping stage2 entries on memory region deletion
- commit 731e308: corrects an in read/write function of vfio platform driver
- iommu/arm-smmu commit serie and especially bf5a852 fixing an issue with
  Calxeda Midway sMMU.

QEMU commits can be found on vfio-dev-integ
git://git.linaro.org/people/eric.auger/qemu.git

Best Regards

Eric


Eric Auger (3):
  vfio: Add initial IRQ support in QEMU platform device
  virt: Assign a VFIO platform device to a virt VM in QEMU command line
  vfio: add exit function and IRQ disable functions

Kim Phillips (3):
  hw/arm/virt: add a xgmac device
  vfio: move hw/misc/vfio.c to hw/vfio/pci.c
  vfio: add vfio-platform support

 LICENSE                        |   2 +-
 MAINTAINERS                    |   2 +-
 hw/Makefile.objs               |   1 +
 hw/arm/virt.c                  | 161 ++++++++-
 hw/misc/Makefile.objs          |   1 -
 hw/vfio/Makefile.objs          |   5 +
 hw/vfio/common.c               | 486 ++++++++++++++++++++++++++
 hw/{misc/vfio.c => vfio/pci.c} | 480 +-------------------------
 hw/vfio/platform.c             | 765 +++++++++++++++++++++++++++++++++++++++++
 hw/vfio/vfio-common.h          |  55 +++
 10 files changed, 1480 insertions(+), 478 deletions(-)
 create mode 100644 hw/vfio/Makefile.objs
 create mode 100644 hw/vfio/common.c
 rename hw/{misc/vfio.c => vfio/pci.c} (89%)
 create mode 100644 hw/vfio/platform.c
 create mode 100644 hw/vfio/vfio-common.h

-- 
1.8.3.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]