Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-06-24 12:01:36 +0200
committerTakashi Iwai <tiwai@suse.de>2019-06-24 12:01:36 +0200
commite0e908b1cd4a26198c4c9fb09b00a3594af0258f (patch)
tree531a29ac0d2dfd3e886fe1f9be34ae3d35d3d1e6
parent47a9e1a61c3a5aebb0c94f517b2fb03d10726736 (diff)
drm/i915/gvt: ignore unexpected pvinfo write (bsc#1051510).
-rw-r--r--patches.drm/drm-i915-gvt-ignore-unexpected-pvinfo-write.patch74
-rw-r--r--series.conf1
2 files changed, 75 insertions, 0 deletions
diff --git a/patches.drm/drm-i915-gvt-ignore-unexpected-pvinfo-write.patch b/patches.drm/drm-i915-gvt-ignore-unexpected-pvinfo-write.patch
new file mode 100644
index 0000000000..03ebbbe2d4
--- /dev/null
+++ b/patches.drm/drm-i915-gvt-ignore-unexpected-pvinfo-write.patch
@@ -0,0 +1,74 @@
+From 971afec3a5373f96684ad899579f6a4d51462410 Mon Sep 17 00:00:00 2001
+From: Weinan Li <weinan.z.li@intel.com>
+Date: Fri, 14 Jun 2019 09:35:19 +0800
+Subject: [PATCH] drm/i915/gvt: ignore unexpected pvinfo write
+Git-commit: 971afec3a5373f96684ad899579f6a4d51462410
+Patch-mainline: v5.2-rc6
+References: bsc#1051510
+
+There is pvinfo writing come from vgpu might be unexpected, like
+writing to one unknown address, GVT-g should do as reserved register
+to discard any invalid write. Now GVT-g lets it write to the vreg
+without prompt error message, should ignore the unexpected pvinfo
+write access and leave the vreg as the default value.
+
+For possible guest query GVT-g host feature, this returned proper
+value instead of wrong guest setting.
+
+V2: ignore unexpected pvinfo write instead of return predefined value
+
+Fixes: e39c5add3221 ("drm/i915/gvt: vGPU MMIO virtualization")
+Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
+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>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/gpu/drm/i915/gvt/handlers.c | 15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+--- a/drivers/gpu/drm/i915/gvt/handlers.c
++++ b/drivers/gpu/drm/i915/gvt/handlers.c
+@@ -1184,18 +1184,15 @@ static int send_display_ready_uevent(str
+ static int pvinfo_mmio_write(struct intel_vgpu *vgpu, unsigned int offset,
+ void *p_data, unsigned int bytes)
+ {
+- u32 data;
+- int ret;
+-
+- write_vreg(vgpu, offset, p_data, bytes);
+- data = vgpu_vreg(vgpu, offset);
++ u32 data = *(u32 *)p_data;
++ bool invalid_write = false;
+
+ switch (offset) {
+ case _vgtif_reg(display_ready):
+ send_display_ready_uevent(vgpu, data ? 1 : 0);
+ break;
+ case _vgtif_reg(g2v_notify):
+- ret = handle_g2v_notification(vgpu, data);
++ handle_g2v_notification(vgpu, data);
+ break;
+ /* add xhot and yhot to handled list to avoid error log */
+ case 0x78830:
+@@ -1212,13 +1209,19 @@ static int pvinfo_mmio_write(struct inte
+ case _vgtif_reg(execlist_context_descriptor_hi):
+ break;
+ case _vgtif_reg(rsv5[0])..._vgtif_reg(rsv5[3]):
++ invalid_write = true;
+ enter_failsafe_mode(vgpu, GVT_FAILSAFE_INSUFFICIENT_RESOURCE);
+ break;
+ default:
++ invalid_write = true;
+ gvt_vgpu_err("invalid pvinfo write offset %x bytes %x data %x\n",
+ offset, bytes, data);
+ break;
+ }
++
++ if (!invalid_write)
++ write_vreg(vgpu, offset, p_data, bytes);
++
+ return 0;
+ }
+
diff --git a/series.conf b/series.conf
index 1a4b9b07fa..e93061f4e0 100644
--- a/series.conf
+++ b/series.conf
@@ -22610,6 +22610,7 @@
patches.fixes/tcp-tcp_fragment-should-apply-sane-memory-limits.patch
patches.fixes/tcp-add-tcp_min_snd_mss-sysctl.patch
patches.fixes/tcp-enforce-tcp_min_snd_mss-in-tcp_mtu_probing.patch
+ patches.drm/drm-i915-gvt-ignore-unexpected-pvinfo-write.patch
patches.drivers/Bluetooth-Fix-regression-with-minimum-encryption-key.patch
# davem/net