From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Alex Williamson <alex.williamson@hp.com>
Cc: xen-devel@lists.xensource.com, keir.fraser@eu.citrix.com
Subject: Re: [PATCH 1 of 1] Intel VT-D: Don't turn x2APIC if there is a missing DRHD entry for the IOAPIC
Date: Thu, 11 Mar 2010 15:25:44 -0500 [thread overview]
Message-ID: <20100311202544.GB22182@phenom.dumpdata.com> (raw)
In-Reply-To: <1268287479.3015.96.camel@2710p.home>
On Wed, Mar 10, 2010 at 11:04:39PM -0700, Alex Williamson wrote:
> On Tue, 2010-03-09 at 12:04 -0500, Konrad Rzeszutek Wilk wrote:
> > # HG changeset patch
> > # User Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > # Date 1268154140 18000
> > # Node ID 81272f761f631d3c0929642fc833b66243b7d2bc
> > # Parent b8d2a4134a6823f6d5179928a0618eaf33be4684
> > Intel VT-D: Don't turn x2APIC if there is a missing DRHD entry for the IOAPIC.
> >
> > Follow the Linux kernel lead in which the x2APIC is
> > only turned on only if there is an DRHD entry for all
> > IOAPICs in the system. If we don't do this
> > we might enable x2APIC and see various devices not covered by the
> > IOAPIC mentioned in DRHD, not receive any interrupts.
> >
> > Workaround is to use 'x2apic=0' on command line.
> >
> > diff -r b8d2a4134a68 -r 81272f761f63 xen/drivers/passthrough/vtd/intremap.c
> > --- a/xen/drivers/passthrough/vtd/intremap.c Wed Mar 03 17:41:58 2010 +0000
> > +++ b/xen/drivers/passthrough/vtd/intremap.c Tue Mar 09 12:02:20 2010 -0500
> > @@ -127,10 +127,17 @@
> > int iommu_supports_eim(void)
> > {
> > struct acpi_drhd_unit *drhd;
> > + int apic;
> >
> > if ( !iommu_enabled || !iommu_qinval || !iommu_intremap )
> > return 0;
> >
> > + // We MUST have a DRHD unit for each IOAPIC.
> > + for ( apic = 0; apic < nr_ioapics; apic++ )
> > + {
> > + if ( ioapic_to_iommu(IO_APIC_ID(apic)) == NULL )
>
>
> This has a pretty serious bug. ioapic_to_iommu() gets returned
> drhd->iommu. However, drhd->iommu isn't allocated until part of
Yikes!
> iommu_setup(), which is called after enable_x2apic(). Has this ever
> worked? Here's the fix.
Yes. But I only have faulty hardware (ie, the is one IOAPIC in the DRHD,
and three existing IOAPICS), so I couldn't test it on working hardware.
Thank you for spotting this mistake and coming to resuce with a proper
patch.
Much appreciated.
>
> Signed-off-by: Alex Williamson <alex.williamson@hp.com>
> --
>
> diff -r 132ac04cbdba xen/drivers/passthrough/vtd/intremap.c
> --- a/xen/drivers/passthrough/vtd/intremap.c Tue Mar 09 18:18:19 2010 +0000
> +++ b/xen/drivers/passthrough/vtd/intremap.c Wed Mar 10 22:58:08 2010 -0700
> @@ -134,7 +134,7 @@
>
> /* We MUST have a DRHD unit for each IOAPIC. */
> for ( apic = 0; apic < nr_ioapics; apic++ )
> - if ( !ioapic_to_iommu(IO_APIC_ID(apic)) )
> + if ( !ioapic_to_drhd(IO_APIC_ID(apic)) )
> return 0;
>
> if ( list_empty(&acpi_drhd_units) )
>
prev parent reply other threads:[~2010-03-11 20:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-09 17:04 [PATCH 0 of 1] Intel VT-d fix Konrad Rzeszutek Wilk
2010-03-09 17:04 ` [PATCH 1 of 1] Intel VT-D: Don't turn x2APIC if there is a missing DRHD entry for the IOAPIC Konrad Rzeszutek Wilk
2010-03-11 6:04 ` Alex Williamson
2010-03-11 20:25 ` Konrad Rzeszutek Wilk [this message]
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=20100311202544.GB22182@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=alex.williamson@hp.com \
--cc=keir.fraser@eu.citrix.com \
--cc=xen-devel@lists.xensource.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.