xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Peter Kay <syllopsium@syllopsium.co.uk>, xen-devel@lists.xen.org
Subject: Re: Determining iommu groups in Xen?
Date: Thu, 28 Aug 2014 18:13:07 +0100	[thread overview]
Message-ID: <53FF6323.5060100@citrix.com> (raw)
In-Reply-To: <d6b2e33b-094b-49b2-a7b8-808cee6d1f06@email.android.com>

On 28/08/14 17:48, Peter Kay wrote:
>  
>
> On 28 August 2014 14:54:01 BST, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> On 28/08/14 14:26, Peter Kay wrote:
>>> This should be a simple question, but I can't find the answer : how
>> are iommu groups determined/found in Xen?
> ...snip...
> >From memory, ACS is present to fix an interaction issue between PCI
>> Passthrough and peer-to-peer dma translations in the PCIe spec.  ACS
>> instructions a bridge/switch to forward the transaction to the upstream
>> port for translation by the IOMMU instead of resolving it privately as
>> a peer-to-peer transaction.
> Yes, precisely.
>
>> Unfortunately, a lot of 1st era PCIe switches after ACS was specified
>> have errata, caused by an ambiguity in the spec, which means that
>> despite claiming ACS support, they don't function correctly.  
> Yes. KVM has a list of quirks from Intel specifying which chipsets actually work.
>
>> Certainly within XenServer, we state that customers using
>> PCIPassthrough must trust the guest administrators, which
>> 'fixes' the security aspect of things from the point of view
>> of malicious guests.
>>
>> ~Andrew
> Fair enough; possibly not ideal but it's an administrator function with calculated risk. A warning might be nice, though.

I am not aware of a single server platform which doesn't have a single
erraturm which breaks the end-to-end security or functionality of PCI
Passthrough.  I would love to be proved wrong in this regard.

>
> The more important question is : how do I determine the iommu groups? Do I need to write some code? It isn't possible to discover from the motherboard manual (it lies) and furthermore, as expansion cards are added and removed the iommu groups change slightly as do the PCI IDs (which is also annoying as it's then necessary to edit all the domU config files plus the pciback hide parameters. KVM is just as broken here).

I am confused as to what exactly you mean by iommu groups in this
context.  My initial guess of the iommu context identifiers for HAP/EPT
tables was clearly wrong.

>
> I currently have an issue with the system spontaneously rebooting under both 4.4 and -unstable as soon as I pass through the entire USB controller (or the half on one set or other of PCI IDs). I don't know if it's a bug or something daft is happening with iommu groups or similar.

Almost certainly to do with the (lack of correct) RMRR support.  There
is a patch series on-list attempting to remedy this problem.

~Andrew

>
> On the bright side, USB host device passthrough with a virtual USB controller appears to work well under Windows, Linux and FreeBSD. KVM doesn't fare so well under *BSD.
>
> PK

  reply	other threads:[~2014-08-28 17:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-28 13:26 Determining iommu groups in Xen? Peter Kay
2014-08-28 13:54 ` Andrew Cooper
2014-08-28 16:48   ` Peter Kay
2014-08-28 17:13     ` Andrew Cooper [this message]
2014-08-28 17:53       ` Peter Kay
2014-08-28 18:02         ` Andrew Cooper
2014-08-28 18:45           ` Peter Kay
2014-08-29  0:35             ` Peter Kay
2014-08-29  8:27               ` Andrew Cooper
2014-08-29 14:34                 ` Konrad Rzeszutek Wilk

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=53FF6323.5060100@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=syllopsium@syllopsium.co.uk \
    --cc=xen-devel@lists.xen.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).