historical-speck.lore.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: speck@linutronix.de
Subject: [MODERATED] EPT/IOMMU shattering on SNB
Date: Mon, 14 Oct 2019 13:50:56 +0100	[thread overview]
Message-ID: <e6e1d8fc-1c4d-1229-6b8f-c825f28dc07c@citrix.com> (raw)

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


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?



             reply	other threads:[~2019-10-14 12:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14 12:50 Andrew Cooper [this message]
2019-10-15 19:38 ` [MODERATED] Re: EPT/IOMMU shattering on SNB Paolo Bonzini
2019-10-16 21:07   ` Andrew Cooper

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e6e1d8fc-1c4d-1229-6b8f-c825f28dc07c@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=speck@linutronix.de \


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