summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/gvt
diff options
context:
space:
mode:
authorMin He2016-12-21 07:54:48 +0100
committerZhenyu Wang2016-12-26 02:45:29 +0100
commit34700631bd465de3e555e5964f36a0919c466aa8 (patch)
tree7e47c651cd483948b98da13755a6a2fb600892c4 /drivers/gpu/drm/i915/gvt
parentdrm/i915/gvt/kvmgt: trival: code cleanup (diff)
downloadkernel-qcow2-linux-34700631bd465de3e555e5964f36a0919c466aa8.tar.gz
kernel-qcow2-linux-34700631bd465de3e555e5964f36a0919c466aa8.tar.xz
kernel-qcow2-linux-34700631bd465de3e555e5964f36a0919c466aa8.zip
drm/i915/gvt: fix an issue in emulating cfg space PCI_COMMAND
There's an issue in current cfg space emulation for PCI_COMMAND (offset 0x4): when guest changes some bits other than PCI_COMMAND_MEMORY, this write operation will not be written to virutal cfg space successfully. This patch is to fix the wrong behavior above. Signed-off-by: Min He <min.he@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/cfg_space.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/gvt/cfg_space.c b/drivers/gpu/drm/i915/gvt/cfg_space.c
index db516382a4d4..959c7f0144b4 100644
--- a/drivers/gpu/drm/i915/gvt/cfg_space.c
+++ b/drivers/gpu/drm/i915/gvt/cfg_space.c
@@ -123,6 +123,7 @@ static int emulate_pci_command_write(struct intel_vgpu *vgpu,
u8 changed = old ^ new;
int ret;
+ memcpy(vgpu_cfg_space(vgpu) + offset, p_data, bytes);
if (!(changed & PCI_COMMAND_MEMORY))
return 0;
@@ -142,7 +143,6 @@ static int emulate_pci_command_write(struct intel_vgpu *vgpu,
return ret;
}
- memcpy(vgpu_cfg_space(vgpu) + offset, p_data, bytes);
return 0;
}