Skip to content

Commit f42259e

Browse files
Hang Yuanzhenyw
authored andcommitted
drm/i915/gvt: invalidate old ggtt page when update ggtt entry
Previously only cancelled dma map of a ggtt page when the ggtt entry was cleared. This patch will cancel dma map of an old ggtt page as well when the ggtt entry is updated with new page address. Fixes: 7598e87(drm/i915/gvt: Missed to cancel dma map for ggtt entries) Signed-off-by: Hang Yuan <hang.yuan@linux.intel.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
1 parent 7759ca3 commit f42259e

File tree

1 file changed

+5
-3
lines changed
  • drivers/gpu/drm/i915/gvt

1 file changed

+5
-3
lines changed

drivers/gpu/drm/i915/gvt/gtt.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2259,16 +2259,18 @@ static int emulate_ggtt_mmio_write(struct intel_vgpu *vgpu, unsigned int off,
22592259
} else
22602260
ops->set_pfn(&m, dma_addr >> PAGE_SHIFT);
22612261
} else {
2262-
ggtt_get_host_entry(ggtt_mm, &m, g_gtt_index);
2263-
ggtt_invalidate_pte(vgpu, &m);
22642262
ops->set_pfn(&m, gvt->gtt.scratch_mfn);
22652263
ops->clear_present(&m);
22662264
}
22672265

22682266
out:
2267+
ggtt_set_guest_entry(ggtt_mm, &e, g_gtt_index);
2268+
2269+
ggtt_get_host_entry(ggtt_mm, &e, g_gtt_index);
2270+
ggtt_invalidate_pte(vgpu, &e);
2271+
22692272
ggtt_set_host_entry(ggtt_mm, &m, g_gtt_index);
22702273
ggtt_invalidate(gvt->dev_priv);
2271-
ggtt_set_guest_entry(ggtt_mm, &e, g_gtt_index);
22722274
return 0;
22732275
}
22742276

0 commit comments

Comments
 (0)