Blob Blame History Raw
From 17369ba08c065967b7b8c48253f20b73acc0b9f5 Mon Sep 17 00:00:00 2001
From: Chuanxiao Dong <chuanxiao.dong@intel.com>
Date: Fri, 7 Jul 2017 17:50:59 +0800
Subject: [PATCH] drm/i915: Fix the kernel panic when using aliasing ppgtt
Git-commit: 17369ba08c065967b7b8c48253f20b73acc0b9f5
Patch-mainline: v4.14-rc1
References: FATE#322643 bsc#1055900

The ppgtt should be get directly from i915_address_space *vm instead of
vma->vm.

V2: 
- add one more fix for bxt. (Chris)

Fixes: 4a234c5fae16 ("drm/i915: pass the vma to insert_entries")
Bugzilla:https://bugs.freedesktop.org/show_bug.cgi?id=101713

Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com> v1
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1499421059-18262-1-git-send-email-chuanxiao.dong@intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Takashi Iwai <tiwai@suse.de>

---
 drivers/gpu/drm/i915/i915_gem_gtt.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -910,7 +910,7 @@ static void gen8_ppgtt_insert_3lvl(struc
 				   enum i915_cache_level cache_level,
 				   u32 unused)
 {
-	struct i915_hw_ppgtt *ppgtt = i915_vm_to_ppgtt(vma->vm);
+	struct i915_hw_ppgtt *ppgtt = i915_vm_to_ppgtt(vm);
 	struct sgt_dma iter = {
 		.sg = vma->pages->sgl,
 		.dma = sg_dma_address(iter.sg),
@@ -2242,7 +2242,7 @@ static void bxt_vtd_ggtt_insert_entries_
 					     enum i915_cache_level level,
 					     u32 unused)
 {
-	struct insert_entries arg = { vma->vm, vma, level };
+	struct insert_entries arg = { vm, vma, level };
 
 	stop_machine(bxt_vtd_ggtt_insert_entries__cb, &arg, NULL);
 }