Skip to content
Snippets Groups Projects
Commit ac2a9862 authored by Alex Williamson's avatar Alex Williamson
Browse files

vfio-pci: Fix GTT wrap-around for Skylake+ IGD


Previous IGD, up through Broadwell, only seem to write GTT values into
the first 1MB of space allocated for the BDSM, but clearly the GTT
can be multiple MB in size.  Our test in vfio_igd_quirk_data_write()
correctly filters out indexes beyond 1MB, but given the 1MB mask we're
using, we re-apply writes only to the first 1MB of the guest allocated
BDSM.

We can't assume either the host or guest BDSM is naturally aligned, so
we can't simply apply a different mask.  Instead, save the host BDSM
and do the arithmetic to subtract the host value to get the BDSM
offset and add it to the guest allocated BDSM.

Reported-by: default avatarAlexander Indenbaum <alexander.indenbaum@gmail.com>
Tested-by: default avatarAlexander Indenbaum <alexander.indenbaum@gmail.com>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent 98b2faea
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment