From: ebiederm@xmission.com (Eric W. Biederman)
To: Ingo Molnar <mingo@elte.hu>
Cc: Weidong Han <weidong.han@intel.com>,
dwmw2@infradead.org, suresh.b.siddha@intel.com,
linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
kvm@vger.kernel.org
Subject: Re: [PATCH v2 2/2] Intel-IOMMU, intr-remap: source-id checking
Date: Tue, 19 May 2009 12:28:36 -0700 [thread overview]
Message-ID: <m1k54cj3iz.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <20090519115055.GB14305@elte.hu> (Ingo Molnar's message of "Tue\, 19 May 2009 13\:50\:55 +0200")
Ingo Molnar <mingo@elte.hu> writes:
> * Weidong Han <weidong.han@intel.com> wrote:
>
>> To support domain-isolation usages, the platform hardware must be
>> capable of uniquely identifying the requestor (source-id) for each
>> interrupt message. Without source-id checking for interrupt
>> remapping , a rouge guest/VM with assigned devices can launch
>> interrupt attacks to bring down anothe guest/VM or the VMM itself.
>>
>> This patch adds source-id checking for interrupt remapping, and
>> then really isolates interrupts for guests/VMs with assigned
>> devices.
>>
>> Because PCI subsystem is not initialized yet when set up IOAPIC
>> entries, use read_pci_config_byte to access PCI config space
>> directly.
>>
>> Signed-off-by: Weidong Han <weidong.han@intel.com>
>> ---
>> arch/x86/kernel/apic/io_apic.c | 6 +++
>> drivers/pci/intr_remapping.c | 90 ++++++++++++++++++++++++++++++++++++++-
>> drivers/pci/intr_remapping.h | 2 +
>> include/linux/dmar.h | 11 +++++
>> 4 files changed, 106 insertions(+), 3 deletions(-)
>
> Code structure looks nice now. (and i susect you have tested this on
> real and relevant hardware?) I've Cc:-ed Eric too ... does this
> direction look good to you too Eric?
Being a major nitpick, I have to point out that the code is not
structured to support other iommus, and I think AMD has one that can
do this as well.
The early pci reading of the bus is just wrong. What happens if the
pci layer decided to renumber things? It looks like we have a real
dependency on pci there and are avoiding sorting it out with this.
Hmm. But that is what we use in setup_ioapic_sid....
I expect the right solution is to delay enabling ioapic entries
until driver enable them. That could also reduce screaming
irqs during bootup in the kdump case.
set_msi_sid looks wrong. The comment are unhelpful. irte->svt should
get an enum value or a deine (removing the repeated explanations of
the magic value) and then we could have room to explain why we
are doing what we are doing.
Not finding an upstream pcie_bridge and then concluding we are a pcie
device seems bogus.
Why if we do have an upstream pcie bridge do we only want to do a bus
range verification instead of checking just for the bus :devfn?
The legacy PCI case seems even stranger.
....
The table of apic information by apic_id also seems wrong. Don't
we have chip_data or something that should point it that we can
get from the irq?
Eric
next prev parent reply other threads:[~2009-05-19 19:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-19 18:31 [PATCH v2 0/2] Intel-IOMMU: source-id checking for interrupt remapping Weidong Han
2009-05-19 18:31 ` [PATCH v2 1/2] Intel-IOMMU, intr-remap: set the whole 128bits of irte when modify/free it Weidong Han
2009-05-19 12:14 ` Ingo Molnar
2009-05-19 14:15 ` Han, Weidong
2009-05-19 18:31 ` [PATCH v2 2/2] Intel-IOMMU, intr-remap: source-id checking Weidong Han
2009-05-19 11:50 ` Ingo Molnar
2009-05-19 14:12 ` Han, Weidong
2009-05-19 19:28 ` Eric W. Biederman [this message]
2009-05-20 8:21 ` Ingo Molnar
2009-05-20 8:38 ` Han, Weidong
2009-05-20 12:13 ` Eric W. Biederman
2009-05-20 9:43 ` Joerg Roedel
2009-05-20 12:02 ` Eric W. Biederman
2009-05-20 12:24 ` Eric W. Biederman
2009-05-21 9:00 ` Han, Weidong
2009-05-21 10:04 ` Eric W. Biederman
2009-05-21 13:37 ` Han, Weidong
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=m1k54cj3iz.fsf@fess.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux-foundation.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=suresh.b.siddha@intel.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.