On Mon, Sep 09, 2013 at 07:27:48PM +0200, Jan Kiszka wrote:
> On 2013-09-09 19:14, Peter Maydell wrote:
> > On 9 September 2013 18:09, Jan Kiszka <jan.kis...@siemens.com> wrote:
> >> On 2013-09-09 18:58, Peter Maydell wrote:
> >>> Why is a DMA request any different from any other communication
> >>> between two devices?
> >>
> >> Other communication between devices requiring to take the target
> >> device's lock while holding the one of the initiator will be a no-go as
> >> well. But usually these scenarios are clearly defined, not
> >> guest-influenceable and can be avoided by the initiator.
> > 
> > How? If I'm a device and I need to raise a GPIO output line
> > I have no idea what the other end is connected to. Similarly
> > for more interesting device-to-device connections than
> > pure on-or-off signal lines.
> 
> Then you will have to write all devices involved in this in a way that
> they preserve a clear locking order or drop locks before triggering such
> signals - or stay with this communication completely under the BQL.
> 
> > 
> >> DMA is too
> >> generic. E.g., the guest can easily program a device to
> >> "accidentally" hit another device's MMIO region
> > 
> > This is just a special case of generic device-device interaction.
> 
> DMA is dispatched by the memory core which we would like to move out of
> the BQL context soon.
> 
> But you are right, we will have "fun" with interrupts and maybe some
> other performance sensitive inter-device channels as well while breaking
> up the BQL. Same rules as above will have to applied there.
> 
> Jan

Do we really care about BQL for emulated devices so much?

Reason I ask, ATM I see no good reason for virtio specifically
to talk to other PCI devices, and since we control
the drivers for virtio we just need to make sure there are no
security issues with malicious guests - no need to
make it really work, trigger master aborts etc.

So maybe the solution is two APIs: a slower one that
supports device to device, and a fast one that doesn't.

> -- 
> Siemens AG, Corporate Technology, CT RTC ITP SES-DE
> Corporate Competence Center Embedded Linux

Reply via email to