historical-speck.lore.kernel.org archive mirror
 help / color / mirror / Atom feed
* [MODERATED] EPT/IOMMU shattering on SNB
@ 2019-10-14 12:50 Andrew Cooper
  2019-10-15 19:38 ` [MODERATED] " Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cooper @ 2019-10-14 12:50 UTC (permalink / raw)
  To: speck

[-- Attachment #1: Type: text/plain, Size: 1493 bytes --]

Hello,

Testing has revealed an issue with the use of NX superpages in
combination with in-flight DMA.

It is possible that this is a bug in Xen, but we can only reproduce it
on SandyBridge E5 parts.

The scenario is running a graphics workload (Haven benchmark) in a VM
(Win7) with GPU Passthrough (Nvidia Quatro card in this case).  The EPT
tables are shared with the IOMMU.

What we observe is that userspace starting up results in a load of
shatters (as the VM is freshly booted at the time), and then we start
taking IOMMU faults (read/write access denied) against IO-virtual
addresses which have just been shattered.

I am now certain that R and W permissions and translations, are valid at
all times, so am at a loss to explain the IOMMU faults.  The fact that
we can't reproduce this with the same scenario on newer parts does
suggest that it might not be software related.

I know the IO-TLB on SNB is a little weird.  The IOMMU claims support
for superpages but doesn't implement them, and DMA through a 2M
superpage has about 40% lower throughput than through equivalent 4k
mappings.  We never adequately got to the bottom of this so Xen, like
Linux, still uses IO-superpages.

Avoiding sharing the EPT and IOMMU tables does avoid the problem, but
that is to be expected as the shattering activity now has no interaction
with the IOMMU.

Has anyone experimented with the above scenario, and if so, how has
testing gone?

Thanks,

~Andrew


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [MODERATED] Re: EPT/IOMMU shattering on SNB
  2019-10-14 12:50 [MODERATED] EPT/IOMMU shattering on SNB Andrew Cooper
@ 2019-10-15 19:38 ` Paolo Bonzini
  2019-10-16 21:07   ` Andrew Cooper
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2019-10-15 19:38 UTC (permalink / raw)
  To: speck

[-- Attachment #1: Type: text/plain, Size: 378 bytes --]

On 14/10/19 14:50, speck for Andrew Cooper wrote:
> Avoiding sharing the EPT and IOMMU tables does avoid the problem, but
> that is to be expected as the shattering activity now has no interaction
> with the IOMMU.
> 
> Has anyone experimented with the above scenario, and if so, how has
> testing gone?

Nope, sorry.  KVM and VFIO do not share page tables.

Paolo


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [MODERATED] Re: EPT/IOMMU shattering on SNB
  2019-10-15 19:38 ` [MODERATED] " Paolo Bonzini
@ 2019-10-16 21:07   ` Andrew Cooper
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2019-10-16 21:07 UTC (permalink / raw)
  To: speck

[-- Attachment #1: Type: text/plain, Size: 532 bytes --]

On 15/10/2019 20:38, speck for Paolo Bonzini wrote:
> On 14/10/19 14:50, speck for Andrew Cooper wrote:
>> Avoiding sharing the EPT and IOMMU tables does avoid the problem, but
>> that is to be expected as the shattering activity now has no interaction
>> with the IOMMU.
>>
>> Has anyone experimented with the above scenario, and if so, how has
>> testing gone?
> Nope, sorry.  KVM and VFIO do not share page tables.

Thanks.  That's helpful to know.  I'll try and follow up directly with
folk at Intel.

~Andrew


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-16 21:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-14 12:50 [MODERATED] EPT/IOMMU shattering on SNB Andrew Cooper
2019-10-15 19:38 ` [MODERATED] " Paolo Bonzini
2019-10-16 21:07   ` Andrew Cooper

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).