qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Benoît Canet" <benoit.canet@irqsave.net>
To: iommu@lists.linux-foundation.org, qemu-devel@nongnu.org,
	alex.williamson@redhat.com
Subject: [Qemu-devel] VFIO and scheduled SR-IOV cards
Date: Mon, 3 Jun 2013 18:33:05 +0200	[thread overview]
Message-ID: <20130603163305.GC4094@irqsave.net> (raw)


Hello,

I plan to write a PF driver for an SR-IOV card and make the VFs work with QEMU's
VFIO passthrough so I am asking the following design question before trying to
write and push code.

After SR-IOV being enabled on this hardware only one VF function can be active
at a given time.

The PF host kernel driver is acting as a scheduler.
It switch every few milliseconds which VF is the current active function while
disabling the others VFs.

One consequence of how the hardware works is that the MMR regions of the
switched off VFs must be unmapped and their io access should block until the VF
is switched on again.

Each IOMMU map/unmap should be done in less than 100ns.

As the kernel iommu module is being called by the VFIO driver the PF driver
cannot interface with it.

Currently the only interface of the VFIO code is for the userland QEMU process
and I fear that notifying QEMU that it should do the unmap/block would take more
than 100ns.

Also blocking the IO access in QEMU under the BQL would freeze QEMU.

Do you have and idea on how to write this required map and block/unmap feature ?

Best regards

Benoît Canet

             reply	other threads:[~2013-06-03 16:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-03 16:33 Benoît Canet [this message]
2013-06-03 18:02 ` [Qemu-devel] VFIO and scheduled SR-IOV cards Alex Williamson
2013-06-03 18:34   ` Don Dutile
2013-06-03 18:57     ` Alex Williamson
2013-06-04 15:50       ` Benoît Canet
2013-06-04 18:31         ` Alex Williamson
2013-07-10 10:23         ` Michael S. Tsirkin
2013-07-28 15:17           ` Benoît Canet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130603163305.GC4094@irqsave.net \
    --to=benoit.canet@irqsave.net \
    --cc=alex.williamson@redhat.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).