public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Weidong Han <weidong.han@intel.com>
Cc: 'Avi Kivity' <avi@redhat.com>,
	"'iommu@lists.linux-foundation.org'"
	<iommu@lists.linux-foundation.org>, 'kvm' <kvm@vger.kernel.org>,
	"Kay, Allen M" <allen.m.kay@intel.com>
Subject: Re: [PATCH] VT-d: fix PCI device detach from virtual machine
Date: Thu, 17 Jun 2010 09:49:56 +0100	[thread overview]
Message-ID: <1276764596.5664.17.camel@macbook.infradead.org> (raw)
In-Reply-To: <4C199812.4080703@intel.com>

On Thu, 2010-06-17 at 11:35 +0800, Weidong Han wrote:
> David Woodhouse wrote:
> > So why do we bother setting up a context in the IOMMU for the device
> > itself, when no DMA will ever appear to come from this device? And
> >   
> if the device is behind PCI Express-to-PCI/PCI-X bridge, the source-id 
> may be the device bdf or the source-id provided by the bridge. so it
> needs to map the device itself.

Ah, that makes some sense, and matches what Jörg said about the AMD
IOMMU spec. Thanks.

> > likewise why do we bother setting up a context for intermediate PCI
> > bridges?
> >   
> I'm not sure if the intermediate PCI bridges are necessary. need to 
> check PCI spec.

FWIW, the AMD IOMMU doesn't do this; it only sets up the mapping for the
original device and for its 'proxy'.

> > Why not just jump straight to the 'DMA proxy' device, and use that
> > _only_?
> >   
> What's the 'DMA proxy' device? is it the upstream pcie-to-pci bridge?

Yes. Or, in the case of a certain buggy Ricoh multi-function device, it
is function zero -- all other functions do their DMA as if it came from
function zero.

This is why I'm looking at whether we need the whole tree-walking thing,
or whether we can just have a single 'proxy' device (or 'alias' as it's
called in the AMD code).

> all the device behind a pcie-to-pci bridge must be co-assigned to a 
> single domain. So it also require users to detach them together.

Do we even _have_ an API for KVM to assign multiple devices at the same
time? Or an API for KVM to _determine_ which devices are behind the same
'proxy'?

We could even have a new device hotplugged after the assignment has been
done.

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation


  reply	other threads:[~2010-06-17  8:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-26  9:31 [PATCH] VT-d: fix PCI device detach from virtual machine Han, Weidong
2010-06-14 23:19 ` David Woodhouse
2010-06-15 14:10   ` Joerg Roedel
2010-06-15 14:52     ` David Woodhouse
2010-06-17  3:35   ` Weidong Han
2010-06-17  8:49     ` David Woodhouse [this message]
2010-06-17  9:15       ` Weidong Han

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=1276764596.5664.17.camel@macbook.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=allen.m.kay@intel.com \
    --cc=avi@redhat.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kvm@vger.kernel.org \
    --cc=weidong.han@intel.com \
    /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