diff options
author | Changbin Du <changbin.du@intel.com> | 2018-05-15 05:35:44 +0300 |
---|---|---|
committer | Zhenyu Wang <zhenyuw@linux.intel.com> | 2018-07-09 05:35:09 +0300 |
commit | 54c81653bd67ce2a11fa08295d9148385ea29603 (patch) | |
tree | 8b3a0a04f361ca43f690a4b347458ab30b5c8c61 /drivers/gpu/drm/i915/gvt | |
parent | b901b252b6cf5cecc612059ccf05d974a9085c58 (diff) | |
download | linux-54c81653bd67ce2a11fa08295d9148385ea29603.tar.xz |
drm/i915/gvt: Handle special sequence on PDE IPS bit
If the guest update the 64K gtt entry before changing IPS bit of PDE, we
need to re-shadow the whole page table. Because we have ignored all
updates to unused entries.
Signed-off-by: Changbin Du <changbin.du@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/gvt')
-rw-r--r-- | drivers/gpu/drm/i915/gvt/gtt.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c index 5a66d0f3365c..b40c6154e571 100644 --- a/drivers/gpu/drm/i915/gvt/gtt.c +++ b/drivers/gpu/drm/i915/gvt/gtt.c @@ -1045,14 +1045,24 @@ static struct intel_vgpu_ppgtt_spt *ppgtt_populate_spt_by_guest_entry( GEM_BUG_ON(!gtt_type_is_pt(get_next_pt_type(we->type))); + if (we->type == GTT_TYPE_PPGTT_PDE_ENTRY) + ips = vgpu_ips_enabled(vgpu) && ops->test_ips(we); + spt = intel_vgpu_find_spt_by_gfn(vgpu, ops->get_pfn(we)); - if (spt) + if (spt) { ppgtt_get_spt(spt); - else { - int type = get_next_pt_type(we->type); - if (we->type == GTT_TYPE_PPGTT_PDE_ENTRY) - ips = vgpu_ips_enabled(vgpu) && ops->test_ips(we); + if (ips != spt->guest_page.pde_ips) { + spt->guest_page.pde_ips = ips; + + gvt_dbg_mm("reshadow PDE since ips changed\n"); + clear_page(spt->shadow_page.vaddr); + ret = ppgtt_populate_spt(spt); + if (ret) + goto fail; + } + } else { + int type = get_next_pt_type(we->type); spt = ppgtt_alloc_spt_gfn(vgpu, type, ops->get_pfn(we), ips); if (IS_ERR(spt)) { |