From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Wang2 Subject: Re: [PATCH] AMD IOMMU: Use global interrupt remapping table by default Date: Wed, 20 Jul 2011 11:52:41 +0200 Message-ID: <201107201152.41482.wei.wang2@amd.com> References: <200910281732.07420.wei.wang2@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: George Dunlap Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Tuesday 19 July 2011 16:14:31 George Dunlap wrote: > Wei, > > Can you be more specific about which BIOSes behave poorly with > per-device intremap tables, and why? We found that, in some case, SATA device uses different device ids for dma= =20 remapping and interrupt remapping. Some early BIOSes cannot handle this=20 situation correctly, so if SATA uses device id for DMA to lookup device tab= le=20 entry for intremap table and if intremap table is per-device configured, SA= TA=20 device won't get the right table. > The problem with a global intremap table is that, AFAICT, it's not > fundamentally compatible with per-cpu IDTs. With per-cpu IDTs, > different devices may end up with interrupts mapped to different cpus > but the same vector (i.e., device A mapped to cpu 9 vector 67, cpu B > mapped to cpu 12 vector 67). This is by design; the whole point of > the per-cpu IDTs is to avoid restricting the number of IRQs to the > number of vectors. But it seems that the intremap table only maps > vectors, not destination IDs; so in the example above, both devices' > interrupts would end up being remapped to the same place, causing one > device driver to get both sets of interrupts, and the other to get > none. Yes, obviously a problem...Using shared intremap table, devices uses the sa= me=20 vector and delivery mode will end up to the same remapping entry. Is per-cp= u=20 IDTs enable by default in Xen? > Do I understand correctly? If so, it seems like we should switch to > per-device intremap tables by default; and if we're using a global > intremap table, we need to somehow make sure that vectors are not > shared across cpus. I agree to use per-device table by default, since BIOS issue has been fixed= =20 and per-device table also has some security advantages. Thanks, Wei > -George > > On Wed, Oct 28, 2009 at 4:32 PM, Wei Wang2 wrote: > > Using a global interrupt remapping table shared by all devices has bett= er > > compatibility with certain old BIOSes. Per-device interrupt remapping > > table can still be enabled by using a new parameter > > "amd-iommu-perdev-intremap". Thanks, > > Wei > > > > Signed-off-by: Wei Wang > > -- > > AMD GmbH, Germany > > Operating System Research Center > > > > Legal Information: > > Advanced Micro Devices GmbH > > Karl-Hammerschmidt-Str. 34 > > 85609 Dornach b. M=FCnchen > > > > Gesch=E4ftsf=FChrer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni > > Sitz: Dornach, Gemeinde Aschheim, Landkreis M=FCnchen > > Registergericht M=FCnchen, HRB Nr. 43632 > > > > _______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.xensource.com > > http://lists.xensource.com/xen-devel