Weinan Li
a1ac5f0943
drm/i915/gvt: request srcu_read_lock before checking if one gfn is valid
...
Fix the suspicious RCU usage issue in intel_vgpu_emulate_mmio_write.
Here need to request the srcu read lock of kvm->srcu before doing
gfn_to_memslot(). The detailed log is as below:
[ 218.710688] =============================
[ 218.710690] WARNING: suspicious RCU usage
[ 218.710693] 4.14.15-dd+ #314 Tainted: G U
[ 218.710695] -----------------------------
[ 218.710697] ./include/linux/kvm_host.h:575 suspicious rcu_dereference_check() usage!
[ 218.710699]
other info that might help us debug this:
[ 218.710702]
rcu_scheduler_active = 2, debug_locks = 1
[ 218.710704] 1 lock held by qemu-system-x86/2144:
[ 218.710706] #0 : (&gvt->lock){+.+.}, at: [<ffffffff816a1eea>] intel_vgpu_emulate_mmio_write+0x5a/0x2d0
[ 218.710721]
stack backtrace:
[ 218.710724] CPU: 0 PID: 2144 Comm: qemu-system-x86 Tainted: G U 4.14.15-dd+ #314
[ 218.710727] Hardware name: Dell Inc. OptiPlex 7040/0Y7WYT, BIOS 1.1.1 10/07/2015
[ 218.710729] Call Trace:
[ 218.710734] dump_stack+0x7c/0xb3
[ 218.710739] gfn_to_memslot+0x15f/0x170
[ 218.710743] kvm_is_visible_gfn+0xa/0x30
[ 218.710746] intel_vgpu_emulate_gtt_mmio_write+0x267/0x3c0
[ 218.710751] ? __mutex_unlock_slowpath+0x3b/0x260
[ 218.710754] intel_vgpu_emulate_mmio_write+0x182/0x2d0
[ 218.710759] intel_vgpu_rw+0xba/0x170 [kvmgt]
[ 218.710763] intel_vgpu_write+0x14d/0x1a0 [kvmgt]
[ 218.710767] __vfs_write+0x23/0x130
[ 218.710770] vfs_write+0xb0/0x1b0
[ 218.710774] SyS_pwrite64+0x73/0x90
[ 218.710777] entry_SYSCALL_64_fastpath+0x25/0x9c
[ 218.710780] RIP: 0033:0x7f33e8a91da3
[ 218.710783] RSP: 002b:00007f33dddc8700 EFLAGS: 00000293
v2: add 'Fixes' tag, refine log format.(Zhenyu)
Fixes: cc753fbe1ac4 ("drm/i915/gvt: validate gfn before set shadow page")
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Weinan Li <weinan.z.li@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2018-09-18 10:37:55 +08:00
..
2018-08-14 15:26:59 +08:00
2018-02-06 11:41:27 -08:00
2018-08-14 15:26:39 +08:00
2017-08-10 10:26:06 +08:00
2017-11-16 11:48:34 +08:00
2018-04-23 13:09:34 +08:00
2018-07-30 10:39:22 +10:00
2018-04-12 11:29:01 +08:00
2018-08-30 12:56:33 +08:00
2017-12-04 11:24:33 +08:00
2018-06-13 10:57:29 +08:00
2018-02-06 11:40:59 -08:00
2018-06-11 15:04:45 +08:00
2018-08-30 12:56:33 +08:00
2018-08-30 12:56:33 +08:00
2018-05-17 22:05:10 +08:00
2018-07-30 10:39:22 +10:00
2018-07-30 10:39:22 +10:00
2018-08-14 15:25:32 +08:00
2018-08-13 12:32:57 +08:00
2018-09-18 10:37:44 +08:00
2018-07-09 10:34:28 +08:00
2018-06-13 10:57:29 +08:00
2018-09-18 10:37:55 +08:00
2018-03-06 13:19:20 +08:00
2018-08-30 12:54:32 +08:00
2018-05-18 09:35:22 +01:00
2018-09-18 10:37:29 +08:00
2018-07-30 10:39:22 +10:00
2018-07-09 10:34:28 +08:00
2018-09-06 11:17:38 +08:00
2018-05-18 12:39:02 +08:00
2018-03-06 13:19:20 +08:00
2017-11-16 11:48:22 +08:00
2018-09-03 14:28:23 +08:00
2017-12-04 11:24:35 +08:00
2018-08-13 12:32:57 +08:00
2018-08-13 12:32:57 +08:00
2018-04-23 13:09:34 +08:00
2018-08-14 15:26:09 +08:00