From: "Michael S. Tsirkin" <mst@redhat.com>
To: Knut Omang <knut.omang@oracle.com>
Cc: qemu-ppc@nongnu.org, "Marcel Apfelbaum" <marcel.a@redhat.com>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Michael Tokarev" <mjt@tls.msk.ru>,
qemu-devel@nongnu.org, "Alexander Graf" <agraf@suse.de>,
"Andreas Färber" <andreas.faerber@web.de>,
pbonzini@redhat.com, "Jan Kiszka" <jan.kiszka@web.de>,
"Anthony Liguori" <aliguori@amazon.com>,
"Stefan Weil" <sw@weilnetz.de>,
"Hervé Poussineau" <hpoussin@reactos.org>,
"Markus Armbruster" <armbru@redhat.com>,
"Richard Henderson" <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 2/2] intel_iommu: Add support for translation for devices behind bridges.
Date: Sun, 26 Oct 2014 17:20:13 +0200 [thread overview]
Message-ID: <20141026152013.GA7563@redhat.com> (raw)
In-Reply-To: <1414329324.24636.48.camel@ori.omang.mine.nu>
On Sun, Oct 26, 2014 at 02:15:24PM +0100, Knut Omang wrote:
> On Sun, 2014-10-26 at 13:06 +0100, Jan Kiszka wrote:
> > On 2014-10-21 00:34, Knut Omang wrote:
> > > @@ -65,11 +66,12 @@ struct VTDContextCacheEntry {
> > > };
> > >
> > > struct VTDAddressSpace {
> > > - uint8_t bus_num;
> > > + PCIDevice *dev;
> >
> > This change is not helpful for clean handling of non-PCI devices (i.e.
> > platform device interrupt remapping => you had to pull
> > Q35_PSEUDO_BUS_PLATFORM into intel_iommu, which is violating the
> > layering). Please leave bus_num in place - or convert to a 16-bit SID.
>
> Hmm - I see..
> - the problem I tried to solve is that the bus number of devices below a
> root port or downstream switch has not been initialized when
> q35_host_dma_iommu is called, so what happens is that the device in the
> root port gets indexed as if it were on bus 0.
> I am not that familiar with what type of non-pci devices that exists but
> I suppose moving this up to the most generic device type that has a bus
> associated with it is one way to go.
>
> An alternative implementation that would work in the intel case would be
> to keep the list in intel_iommu but provide a callback that iommus can
> subscribe to to get notifications when bus numbers change?
>
> Knut
I dislike callbacks.
IMO the right thing as usual is to do what real hardware does.
After all it's devices put the requester id in transactions.
How about we add "source id" in AddressSpace structure,
or add a wrapper structure including AddressSpace and
source id.
Update in pci core on config writes into bus number.
Paolo, would that be ok with you?
> > > uint8_t devfn;
> > > AddressSpace as;
> > > MemoryRegion iommu;
> > > IntelIOMMUState *iommu_state;
> > > + QLIST_ENTRY(VTDAddressSpace) iommu_next; /* For traversal by the iommu */
> > > VTDContextCacheEntry context_cache_entry;
> > > };
> > >
> >
> > Jan
> >
> >
>
next prev parent reply other threads:[~2014-10-26 15:20 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-20 22:34 [Qemu-devel] [PATCH 0/2] intel_iommu: Add support for translation for devices behind bridges Knut Omang
2014-10-20 22:34 ` [Qemu-devel] [PATCH 1/2] iommu: Replace bus+devfn arguments with PCIDevice* in PCIIOMMUFunc Knut Omang
2014-10-20 22:34 ` [Qemu-devel] [PATCH 2/2] intel_iommu: Add support for translation for devices behind bridges Knut Omang
2014-10-25 11:36 ` Jan Kiszka
2014-10-25 12:24 ` Jan Kiszka
2014-10-26 4:46 ` Knut Omang
2014-10-25 12:28 ` Jan Kiszka
2014-10-26 12:06 ` Jan Kiszka
2014-10-26 13:15 ` Knut Omang
2014-10-26 15:20 ` Michael S. Tsirkin [this message]
2014-10-20 23:29 ` [Qemu-devel] [PATCH 0/2] " Alexander Graf
2014-10-21 5:26 ` Knut Omang
2014-10-21 9:07 ` Alexander Graf
2014-10-21 9:35 ` Knut Omang
2014-10-21 11:15 ` Alexander Graf
2014-10-21 11:26 ` Michael S. Tsirkin
2014-10-21 11:37 ` Knut Omang
2014-10-21 12:20 ` Michael S. Tsirkin
2014-10-21 15:07 ` Alex Williamson
2014-10-21 22:26 ` Michael S. Tsirkin
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=20141026152013.GA7563@redhat.com \
--to=mst@redhat.com \
--cc=agraf@suse.de \
--cc=aliguori@amazon.com \
--cc=andreas.faerber@web.de \
--cc=armbru@redhat.com \
--cc=hpoussin@reactos.org \
--cc=jan.kiszka@web.de \
--cc=knut.omang@oracle.com \
--cc=marcel.a@redhat.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=mjt@tls.msk.ru \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=rth@twiddle.net \
--cc=sw@weilnetz.de \
/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).