qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Aaron Fabbri <aafabbri@cisco.com>
Cc: B07421@freescale.com, aik@au1.ibm.com, kvm@vger.kernel.org,
	pmac@au1.ibm.com, joerg.roedel@amd.com, konrad.wilk@oracle.com,
	agraf@suse.de, iommu@lists.linux-foundation.org,
	qemu-devel@nongnu.org, chrisw@sous-sol.org, B08248@freescale.com,
	Alex Williamson <alex.williamson@redhat.com>,
	avi@redhat.com, linux-pci@vger.kernel.org, benve@cisco.com
Subject: Re: [Qemu-devel] [RFC PATCH] vfio: VFIO Driver core framework
Date: Tue, 15 Nov 2011 16:29:59 -0600	[thread overview]
Message-ID: <4EC2E7E7.6010203@freescale.com> (raw)
In-Reply-To: <CAE81C3B.12A00%aafabbri@cisco.com>

On 11/15/2011 03:40 PM, Aaron Fabbri wrote:
> 
> 
> 
> On 11/15/11 12:10 PM, "Scott Wood" <scottwood@freescale.com> wrote:
> 
>> On 11/15/2011 12:34 AM, David Gibson wrote:
> <snip> 
>>>> +static int allow_unsafe_intrs;
>>>> +module_param(allow_unsafe_intrs, int, 0);
>>>> +MODULE_PARM_DESC(allow_unsafe_intrs,
>>>> +        "Allow use of IOMMUs which do not support interrupt remapping");
>>>
>>> This should not be a global option, but part of the AMD/Intel IOMMU
>>> specific code.  In general it's a question of how strict the IOMMU
>>> driver is about isolation when it determines what the groups are, and
>>> only the IOMMU driver can know what the possibilities are for its
>>> class of hardware.
>>
>> It's also a concern that is specific to MSIs.  In any case, I'm not sure
>> that the ability to cause a spurious IRQ is bad enough to warrant
>> disabling the entire subsystem by default on certain hardware.
> 
> I think the issue is more that the ability to create fake MSI interrupts can
> lead to bigger exploits.
> 
> Originally we didn't have this parameter. It was added it to reflect the
> fact that MSI's triggered by guests are dangerous without the isolation that
> interrupt remapping provides.
> 
> That is, it *should* be inconvenient to run without interrupt mapping HW
> support.

A sysfs knob is sufficient inconvenience.  It should only affect whether
you can use MSIs, and the relevant issue shouldn't be "has interrupt
remapping" but "is there a hole".

Some systems might address the issue in ways other than IOMMU-level MSI
translation.  Our interrupt controller provides enough separate 4K pages
for MSI interrupt delivery for each PCIe IOMMU group to get its own (we
currently only have 3, one per root complex) -- no special IOMMU feature
required.

It doesn't help that the semantics of IOMMU_CAP_INTR_REMAP are
undefined.  I shouldn't have to know how x86 IOMMUs work when
implementing a driver for different hardware, just to know what the
generic code is expecting.

As David suggests, if you want to do this it should be the x86 IOMMU
driver that has a knob that controls how it forms groups in the absence
of this support.

-Scott

  reply	other threads:[~2011-11-15 22:30 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-03 20:12 [Qemu-devel] [RFC PATCH] vfio: VFIO Driver core framework Alex Williamson
2011-11-09  4:17 ` Aaron Fabbri
2011-11-09  4:41   ` Alex Williamson
2011-11-09  8:11 ` Christian Benvenuti (benve)
2011-11-09 18:02   ` Alex Williamson
2011-11-09 21:08     ` Christian Benvenuti (benve)
2011-11-09 23:40       ` Alex Williamson
2011-11-10  0:57 ` Christian Benvenuti (benve)
2011-11-11 18:04   ` Alex Williamson
2011-11-11 22:22     ` Christian Benvenuti (benve)
2011-11-14 22:59       ` Alex Williamson
2011-11-15  0:05         ` David Gibson
2011-11-15  0:49           ` Benjamin Herrenschmidt
2011-11-11 17:51 ` Konrad Rzeszutek Wilk
2011-11-11 22:10   ` Alex Williamson
2011-11-15  0:00     ` David Gibson
2011-11-16 16:52     ` Konrad Rzeszutek Wilk
2011-11-17 20:22       ` Alex Williamson
2011-11-17 20:56         ` Scott Wood
2011-11-16 17:47     ` Scott Wood
2011-11-17 20:52       ` Alex Williamson
2011-11-12  0:14 ` Scott Wood
2011-11-14 20:54   ` Alex Williamson
2011-11-14 21:46     ` Alex Williamson
2011-11-14 22:26     ` Scott Wood
2011-11-14 22:48       ` Alexander Graf
2011-11-15  2:29     ` Alex Williamson
2011-11-15  6:34 ` David Gibson
2011-11-15 18:01   ` Alex Williamson
2011-11-17  0:02     ` David Gibson
2011-11-18 20:32       ` Alex Williamson
2011-11-18 21:09         ` Scott Wood
2011-11-22 19:16           ` Alex Williamson
2011-11-22 20:00             ` Scott Wood
2011-11-22 21:28               ` Alex Williamson
2011-11-21  2:47         ` David Gibson
2011-11-22 18:22           ` Alex Williamson
2011-11-15 20:10   ` Scott Wood
2011-11-15 21:40     ` Aaron Fabbri
2011-11-15 22:29       ` Scott Wood [this message]
2011-11-16 23:34         ` Alex Williamson
2011-11-29  1:52 ` Alexey Kardashevskiy
2011-11-29  2:01   ` Alexey Kardashevskiy
2011-11-29  2:11     ` Alexey Kardashevskiy
2011-11-29  3:54     ` Alex Williamson
2011-11-29 19:26       ` Alex Williamson
2011-11-29 23:20         ` Stuart Yoder
2011-11-29 23:44           ` Alex Williamson
2011-11-30 15:41             ` Stuart Yoder
2011-11-30 16:58               ` Alex Williamson
2011-12-01 20:58                 ` Stuart Yoder
2011-12-01 21:25                   ` Alex Williamson
2011-12-02 14:40                     ` Stuart Yoder
2011-12-02 18:11                       ` Bhushan Bharat-R65777
2011-12-02 18:27                         ` Scott Wood
2011-12-02 18:35                           ` Bhushan Bharat-R65777
2011-12-02 18:45                           ` Bhushan Bharat-R65777
2011-12-02 18:52                             ` Scott Wood
2011-12-02 18:21                       ` Scott Wood
2011-11-29  3:46   ` Alex Williamson
2011-11-29  4:34     ` Alexey Kardashevskiy
2011-11-29  5:48       ` Alex Williamson
2011-12-02  5:06         ` Alexey Kardashevskiy

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=4EC2E7E7.6010203@freescale.com \
    --to=scottwood@freescale.com \
    --cc=B07421@freescale.com \
    --cc=B08248@freescale.com \
    --cc=aafabbri@cisco.com \
    --cc=agraf@suse.de \
    --cc=aik@au1.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=avi@redhat.com \
    --cc=benve@cisco.com \
    --cc=chrisw@sous-sol.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joerg.roedel@amd.com \
    --cc=konrad.wilk@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=pmac@au1.ibm.com \
    --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).