linux_dsm_epyc7002/drivers/gpu/drm/i915
Xiong Zhang 4776f3529d drm/i915: Don't deballoon unused ggtt drm_mm_node in linux guest
The following call trace may exist in linux guest dmesg when guest i915
driver is unloaded.
[   90.776610] [drm:vgt_deballoon_space.isra.0 [i915]] deballoon space: range [0x0 - 0x0] 0 KiB.
[   90.776621] BUG: unable to handle kernel NULL pointer dereference at 00000000000000c0
[   90.776691] IP: drm_mm_remove_node+0x4d/0x320 [drm]
[   90.776718] PGD 800000012c7d0067 P4D 800000012c7d0067 PUD 138e4c067 PMD 0
[   90.777091] task: ffff9adab60f2f00 task.stack: ffffaf39c0fe0000
[   90.777142] RIP: 0010:drm_mm_remove_node+0x4d/0x320 [drm]
[   90.777573] Call Trace:
[   90.777653]  intel_vgt_deballoon+0x4c/0x60 [i915]
[   90.777729]  i915_ggtt_cleanup_hw+0x121/0x190 [i915]
[   90.777792]  i915_driver_unload+0x145/0x180 [i915]
[   90.777856]  i915_pci_remove+0x15/0x20 [i915]
[   90.777890]  pci_device_remove+0x3b/0xc0
[   90.777916]  device_release_driver_internal+0x157/0x220
[   90.777945]  driver_detach+0x39/0x70
[   90.777967]  bus_remove_driver+0x51/0xd0
[   90.777990]  pci_unregister_driver+0x23/0x90
[   90.778019]  SyS_delete_module+0x1da/0x240
[   90.778045]  entry_SYSCALL_64_fastpath+0x24/0x87
[   90.778072] RIP: 0033:0x7f34312af067
[   90.778092] RSP: 002b:00007ffdea3da0d8 EFLAGS: 00000206
[   90.778297] RIP: drm_mm_remove_node+0x4d/0x320 [drm] RSP: ffffaf39c0fe3dc0
[   90.778344] ---[ end trace f4b1bc8305fc59dd ]---

Four drm_mm_node are used to reserve guest ggtt space, but some of them
may be skipped and not initialised due to space constraints in
intel_vgt_balloon(). If drm_mm_remove_node() is called with
uninitialized drm_mm_node, the above call trace occurs.

This patch check drm_mm_node's validity before calling
drm_mm_remove_node().

Fixes: ff8f797557c7("drm/i915: return the correct usable aperture size under gvt environment")
Cc: stable@vger.kernel.org
Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
Acked-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/1566279978-9659-1-git-send-email-xiong.y.zhang@intel.com
2019-08-21 18:03:03 +01:00
..
display drm/i915: Do not create a new max_bpc prop for MST connectors 2019-08-21 19:40:55 +03:00
gem drm/i915: Replace PIN_NONFAULT with calls to PIN_NOEVICT 2019-08-21 14:07:54 +01:00
gt drm/i915/execlists: Set priority hint prior to submission 2019-08-21 17:32:27 +01:00
gvt Merge tag 'gvt-next-2019-08-13' of https://github.com/intel/gvt-linux into drm-intel-next-queued 2019-08-13 13:46:19 -07:00
oa drm/i915/perf: Refactor oa object to better manage resources 2019-08-07 20:34:39 +01:00
selftests drm/i915: Serialize against vma moves 2019-08-19 15:25:56 +01:00
i915_active_types.h drm/i915: Markup expected timeline locks for i915_active 2019-08-16 18:02:07 +01:00
i915_active.c drm/i915: i915_active.retire() is optional 2019-08-19 16:41:19 +01:00
i915_active.h drm/i915: Markup expected timeline locks for i915_active 2019-08-16 18:02:07 +01:00
i915_buddy.c drm/i915/buddy: use kmemleak_update_trace 2019-08-16 16:28:41 +01:00
i915_buddy.h drm/i915: buddy allocator 2019-08-10 19:47:40 +01:00
i915_cmd_parser.c drm/i915: extract i915_memcpy.h from i915_drv.h 2019-08-09 12:03:25 +03:00
i915_debugfs.c drm/i915/guc: Don't open log relay if GuC is not running 2019-08-18 11:58:40 +01:00
i915_debugfs.h
i915_drv.c drm/i915: Dynamically allocate s0ix struct for VLV 2019-08-20 15:23:33 +01:00
i915_drv.h drm/i915: Update DRIVER_DATE to 20190820 2019-08-20 09:55:48 -07:00
i915_fixed.h drm/i915: make i915_fixed.h self-contained 2019-06-27 10:50:24 +03:00
i915_gem_evict.c drm/i915: Replace PIN_NONFAULT with calls to PIN_NOEVICT 2019-08-21 14:07:54 +01:00
i915_gem_fence_reg.c drm/i915: Forgo last_fence active request tracking 2019-08-12 19:29:16 +01:00
i915_gem_fence_reg.h drm/i915: Convert i915_gem_init_swizzling to intel_gt 2019-06-21 13:48:22 +01:00
i915_gem_gtt.c drm/i915/gtt: Add some range asserts 2019-08-21 17:58:54 +01:00
i915_gem_gtt.h drm/i915: Replace PIN_NONFAULT with calls to PIN_NOEVICT 2019-08-21 14:07:54 +01:00
i915_gem.c drm/i915: Replace PIN_NONFAULT with calls to PIN_NOEVICT 2019-08-21 14:07:54 +01:00
i915_gem.h drm/i915: avoid including intel_drv.h via i915_drv.h->i915_trace.h 2019-08-07 12:43:14 +03:00
i915_getparam.c drm/i915: Isolate i915_getparam_ioctl() 2019-08-07 16:48:24 +01:00
i915_globals.c drm/i915: buddy allocator 2019-08-10 19:47:40 +01:00
i915_globals.h drm/i915: buddy allocator 2019-08-10 19:47:40 +01:00
i915_gpu_error.c drm/i915: Only emit the 'send bug report' once for a GPU hang 2019-08-19 12:39:45 +01:00
i915_gpu_error.h drm/i915: Only include active engines in the capture state 2019-08-08 21:54:08 +01:00
i915_ioc32.c
i915_irq.c drm/i915/bdw+: Move misc display IRQ handling to it own function 2019-08-13 15:51:12 -07:00
i915_irq.h drm/i915: Extract general GT interrupt handlers 2019-08-12 15:36:13 +01:00
i915_memcpy.c drm/i915: extract i915_memcpy.h from i915_drv.h 2019-08-09 12:03:25 +03:00
i915_memcpy.h drm/i915: extract i915_memcpy.h from i915_drv.h 2019-08-09 12:03:25 +03:00
i915_mm.c drm/i915: Drop expectations of VM_IO from our GGTT mmappings 2019-08-07 12:06:07 +01:00
i915_params.c Revert "drm/i915: Update description of i915.enable_guc modparam" 2019-07-19 15:36:21 +01:00
i915_params.h Revert "drm/i915/guc: Turn on GuC/HuC auto mode" 2019-07-19 15:35:58 +01:00
i915_pci.c drm/i915/gtt: disable 2M pages for pre-gen11 2019-08-10 13:19:00 +01:00
i915_perf.c drm/i915: extract i915_perf.h from i915_drv.h 2019-08-09 11:52:04 +03:00
i915_perf.h drm/i915: extract i915_perf.h from i915_drv.h 2019-08-09 11:52:04 +03:00
i915_pmu.c drm/i915: Convert a few more bland dmesg info to be device specific 2019-08-15 13:13:23 +01:00
i915_pmu.h
i915_priolist_types.h drm/i915: Push the wakeref->count deferral to the backend 2019-08-13 21:09:49 +01:00
i915_pvinfo.h drm/i915: make i915_pvinfo.h self-contained 2019-06-27 10:50:35 +03:00
i915_query.c drm/i915/gt: Move the [class][inst] lookup for engines onto the GT 2019-08-06 15:00:43 +01:00
i915_query.h
i915_reg.h drm/i915/tgl: Updated Private PAT programming 2019-08-20 15:23:33 +01:00
i915_request.c drm/i915: Serialize insertion into the file->mm.request_list 2019-08-20 14:23:45 +01:00
i915_request.h drm/i915: Protect request retirement with timeline->mutex 2019-08-15 23:21:13 +01:00
i915_scatterlist.c drm/i915: Pull scatterlist utils out of i915_gem.h 2019-05-28 12:45:29 +01:00
i915_scatterlist.h drm/i915: Pull scatterlist utils out of i915_gem.h 2019-05-28 12:45:29 +01:00
i915_scheduler_types.h drm/i915/execlists: Minimalistic timeslicing 2019-06-20 16:52:36 +01:00
i915_scheduler.c drm/i915: Push the wakeref->count deferral to the backend 2019-08-13 21:09:49 +01:00
i915_scheduler.h
i915_selftest.h drm/i915: make i915_selftest.h self-contained 2019-07-30 13:41:35 -07:00
i915_suspend.c drm/i915: extract i915_suspend.h from i915_drv.h 2019-08-09 12:03:05 +03:00
i915_suspend.h drm/i915: extract i915_suspend.h from i915_drv.h 2019-08-09 12:03:05 +03:00
i915_sw_fence.c drm/i915: Propagate fence errors 2019-08-18 12:38:09 +01:00
i915_sw_fence.h drm/i915: Propagate fence errors 2019-08-18 12:38:09 +01:00
i915_syncmap.c
i915_syncmap.h
i915_sysfs.c drm/i915: extract i915_sysfs.h from i915_drv.h 2019-08-09 11:52:09 +03:00
i915_sysfs.h drm/i915: extract i915_sysfs.h from i915_drv.h 2019-08-09 11:52:09 +03:00
i915_trace_points.c
i915_trace.h drm/i915: rename intel_drv.h to display/intel_display_types.h 2019-08-07 12:43:50 +03:00
i915_user_extensions.c
i915_user_extensions.h
i915_utils.c drm/i915: move printing and load error inject to i915_utils.[ch] 2019-08-09 11:51:58 +03:00
i915_utils.h drm/i915/execlists: Lift process_csb() out of the irq-off spinlock 2019-08-16 20:59:02 +01:00
i915_vgpu.c drm/i915: Don't deballoon unused ggtt drm_mm_node in linux guest 2019-08-21 18:03:03 +01:00
i915_vgpu.h drm/i915: make i915_vgpu.h self-contained 2019-06-27 10:50:38 +03:00
i915_vma.c drm/i915: Be defensive when starting vma activity 2019-08-20 14:23:45 +01:00
i915_vma.h drm/i915: Be defensive when starting vma activity 2019-08-20 14:23:45 +01:00
intel_csr.c drm/i915/tgl: update DMC firmware to 2.04 2019-08-20 12:49:29 -07:00
intel_csr.h
intel_device_info.c drm/i915/tgl: add support for reading the timestamp frequency 2019-08-20 12:48:57 -07:00
intel_device_info.h drm/i915/tgl: Tigerlake only has global MOCS registers 2019-07-31 07:40:32 -07:00
intel_gvt.c drm/i915: Add i915 to i915_inject_probe_failure 2019-08-02 21:14:29 +01:00
intel_gvt.h drm/i915: Propagate "_remove" function name suffix down 2019-07-12 13:05:08 +01:00
intel_pch.c drm/i915: split out intel_pch.[ch] from i915_drv.[ch] 2019-08-08 11:38:22 +03:00
intel_pch.h drm/i915: split out intel_pch.[ch] from i915_drv.[ch] 2019-08-08 11:38:22 +03:00
intel_pm.c drm/i915/tgl: Introduce initial Tiger Lake workarounds 2019-08-20 15:23:33 +01:00
intel_pm.h drm/i915: Convert most of atomic commit to take more intel state 2019-07-01 10:32:14 +02:00
intel_runtime_pm.c drm/i915: avoid including intel_drv.h via i915_drv.h->i915_trace.h 2019-08-07 12:43:14 +03:00
intel_runtime_pm.h Merge drm/drm-next into drm-intel-next-queued 2019-07-29 08:51:48 -07:00
intel_sideband.c drm/i915: remove unnecessary includes of intel_display_types.h header 2019-08-07 12:43:55 +03:00
intel_sideband.h
intel_uncore.c drm/i915: split out uncore_mmio_debug 2019-08-09 20:25:24 +01:00
intel_uncore.h drm/i915: split out uncore_mmio_debug 2019-08-09 20:25:24 +01:00
intel_wakeref.c drm/i915: Push the wakeref->count deferral to the backend 2019-08-13 21:09:49 +01:00
intel_wakeref.h drm/i915: Push the wakeref->count deferral to the backend 2019-08-13 21:09:49 +01:00
intel_wopcm.c drm/i915/wopcm: Fix SPDX tag location 2019-08-16 16:50:03 +01:00
intel_wopcm.h drm/i915/wopcm: Don't fail on WOPCM partitioning failure 2019-08-02 21:14:32 +01:00
Kconfig drm/i915: add force_probe module parameter to replace alpha_support 2019-05-31 16:20:30 +03:00
Kconfig.debug drm/i915: use upstream version of header tests 2019-07-30 12:11:57 +03:00
Kconfig.profile drm/i915: Add a label for config DRM_I915_SPIN_REQUEST 2019-06-12 11:18:55 +01:00
Makefile drm/i915: Extract general GT interrupt handlers 2019-08-12 15:36:13 +01:00