qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Re: [Qemu-devel] vfio for platform devices - 9/5/2012 - minutes
@ 2013-09-11 16:42 Yoder Stuart-B08248
  2013-09-11 17:08 ` Scott Wood
  2013-09-11 17:14 ` Alex Williamson
  0 siblings, 2 replies; 14+ messages in thread
From: Yoder Stuart-B08248 @ 2013-09-11 16:42 UTC (permalink / raw)
  To: Wood Scott-B07421, Sethi Varun-B16395, Bhushan Bharat-R65777,
	'Peter Maydell', 'Santosh Shukla',
	'Alex Williamson', 'Alexander Graf',
	'Antonios Motakis', 'Christoffer Dall',
	'kim.phillips@linaro.org'
  Cc: kvmarm@lists.cs.columbia.edu, kvm-ppc@vger.kernel.org,
	qemu-devel@nongnu.org



> -----Original Message-----
> From: Yoder Stuart-B08248
> Sent: Thursday, September 05, 2013 12:51 PM
> To: Wood Scott-B07421; Sethi Varun-B16395; Bhushan Bharat-R65777; 'Peter
> Maydell'; 'Santosh Shukla'; 'Alex Williamson'; 'Alexander Graf';
> 'Antonios Motakis'; 'Christoffer Dall'; 'kim.phillips@linaro.org'
> Cc: kvmarm@lists.cs.columbia.edu; 'kvm-ppc@vger.kernel.org'; 'qemu-
> devel@nongnu.org'
> Subject: vfio for platform devices - 9/5/2012 - minutes
> 
> We had a call with those interested and/or working on vfio
> for platform devices.
> 
> Participants: Scott Wood, Varun Sethi, Bharat Bhushan, Peter Maydell,
>               Santosh Shukla, Alex Williamson, Alexander Graf,
>               Antonios Motakis, Christoffer Dall, Kim Phillips,
>               Stuart Yoder
> 
> Several aspects to vfio for platform devices:
> 
> 1. IOMMU groups
> 
>  -iommu driver needs to register a bus notifier for the platform bus
>   and create groups for relevant platform devices
>  -Antonios is looking at this for several ARM IOMMUs
>  -PAMU (Freescale) driver already does this
> 
> 2. unbinding device from host
> 
>  PCI:
>    echo 0000:06:0d.0 > /sys/bus/pci/devices/0000:06:0d.0/driver/unbind
>  Platform:
>    echo ffe101300.dma >
> /sys/bus/platform/devices/ffe101300.dma/driver/unbind
> 
>  -don't believe there are issues or work to do here
> 
> 3. binding device to vfio-platform driver
> 
>  PCI:
>    echo 1102 0002 > /sys/bus/pci/drivers/vfio-pci/new_id
> 
>  -this is probably the least understood issue-- platform drivers
>   register themselves with the bus for a specific "name"
>   string.  That is matched with device tree "compatible" strings
>   later to bind a device to a driver
>  -we want is to have the vfio-platform driver to dynamically bind
>   to a variety of platform devices previously unknown to
>   vfio-platform
>  -ideally unbinding and binding could be an atomic operation
>  -Alex W pointed out that x86 could leverage this work so
>   keep that in mind in what we design
>  -Kim Phillips (Linaro) will start working on this

One thing we didn't discuss needs to be considered (probably by
Kim who is looking at the 'binding device' issue) is around
returning a passthru device back to the host.

After a platform device has been bound to vfio and is in use by
user space or a virtual machine, we also need to be able
to unwind all that and return the device back to the host
in a sane state.

What happens when user space exits and the vfio file
descriptors are closed?

What if the device is still active and doing bus 
mastering?   (e.g. a VM crashed causing a QEMU
exit)

How can the vfio-platform layer in the host kernel
get a specific device in a sane state?

When a plaform device is 'unbound' from vfio, what
specifically happens to the device?

Platform devices don't have generic mechanisms like on PCI
to disable bus mastering or even disable or reset a
device.

Haven't thought through all this yet, but just raising
some issues I see.

Regards,
Stuart

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [Qemu-devel] vfio for platform devices - 9/5/2012 - minutes
@ 2013-09-05 17:51 Yoder Stuart-B08248
  2013-09-06 16:56 ` Sethi Varun-B16395
  0 siblings, 1 reply; 14+ messages in thread
From: Yoder Stuart-B08248 @ 2013-09-05 17:51 UTC (permalink / raw)
  To: Wood Scott-B07421, Sethi Varun-B16395, Bhushan Bharat-R65777,
	'Peter Maydell', 'Santosh Shukla',
	'Alex Williamson', 'Alexander Graf',
	'Antonios Motakis', 'Christoffer Dall',
	'kim.phillips@linaro.org'
  Cc: kvmarm@lists.cs.columbia.edu, kvm-ppc@vger.kernel.org,
	qemu-devel@nongnu.org

We had a call with those interested and/or working on vfio
for platform devices.

Participants: Scott Wood, Varun Sethi, Bharat Bhushan, Peter Maydell,
              Santosh Shukla, Alex Williamson, Alexander Graf,
              Antonios Motakis, Christoffer Dall, Kim Phillips,
              Stuart Yoder

Several aspects to vfio for platform devices:

1. IOMMU groups

 -iommu driver needs to register a bus notifier for the platform bus
  and create groups for relevant platform devices
 -Antonios is looking at this for several ARM IOMMUs
 -PAMU (Freescale) driver already does this

2. unbinding device from host

 PCI:
   echo 0000:06:0d.0 > /sys/bus/pci/devices/0000:06:0d.0/driver/unbind
 Platform:
   echo ffe101300.dma > /sys/bus/platform/devices/ffe101300.dma/driver/unbind

 -don't believe there are issues or work to do here

3. binding device to vfio-platform driver

 PCI:
   echo 1102 0002 > /sys/bus/pci/drivers/vfio-pci/new_id

 -this is probably the least understood issue-- platform drivers
  register themselves with the bus for a specific "name"
  string.  That is matched with device tree "compatible" strings
  later to bind a device to a driver
 -we want is to have the vfio-platform driver to dynamically bind
  to a variety of platform devices previously unknown to
  vfio-platform
 -ideally unbinding and binding could be an atomic operation
 -Alex W pointed out that x86 could leverage this work so
  keep that in mind in what we design
 -Kim Phillips (Linaro) will start working on this

4. vfio kernel interface

 -exposes regions and interrupts to user space via FDs
 -there are 'info' ioctls that allow getting info about
  regions/interrupts such as size and type of interrupt
 -there is a proposed extension to the 'info' ioctls that
  provides device tree paths, allowing user space to coorelate
  resources with the device tree
  (https://lists.cs.columbia.edu/pipermail/kvmarm/2013-July/006237.html)

5. QEMU
 -some key tasks
   -interacts with vfio kernel interface
   -registers memslots
   -needs to dynamically get device hooked up to VM's
    platform bus, including IRQs
   -needs to generate device tree node
 -a key point: we don't believe that platform device passthru
  in QEMU can be solved in a completely generic way.  There will
  need to be device specific code for each device type being passed
  through...to do things like generate device tree nodes
 -in general we expect a relatively small number of device types
  to be passed through to VMs
 -Alex Graf is working on dynamic creation of platform devices
  for the PPC e500 paravirt machine
 -see: http://lists.nongnu.org/archive/html/qemu-devel/2013-07/msg03614.html
 -first step is dynamically generating a virtual UART
 -that sets the stage to create and create vfio devices backed
  by real hardware

There is a session at Linux Plumbers in a couple of weeks
and further discussions will happen there.

Regards,
Stuart

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

end of thread, other threads:[~2013-09-12 22:01 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-11 16:42 [Qemu-devel] vfio for platform devices - 9/5/2012 - minutes Yoder Stuart-B08248
2013-09-11 17:08 ` Scott Wood
2013-09-11 17:14 ` Alex Williamson
2013-09-12  9:18   ` Bhushan Bharat-R65777
2013-09-12 18:10     ` Scott Wood
2013-09-12 21:23       ` Alexander Graf
2013-09-12 21:45         ` Scott Wood
2013-09-12 21:48           ` Alexander Graf
2013-09-12 21:51             ` Scott Wood
  -- strict thread matches above, loose matches on Subject: below --
2013-09-05 17:51 Yoder Stuart-B08248
2013-09-06 16:56 ` Sethi Varun-B16395
2013-09-06 18:20   ` Yoder Stuart-B08248
2013-09-09  8:52     ` Will Deacon
2013-09-09  9:18       ` Sethi Varun-B16395

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).