Browse Source

drm/i915/gvt/kvmgt: fill info for ROM/VGA region

Both ROM/VGA region are not supported for vGPU in GVT. But if the device
model want to get those region, we should return the correct information
but not leave the structure with random data. Change to same operation
of BAR3-BAR5 which are also not supported by vGPU.

Refer to function @intel_vgpu_rw.

Signed-off-by: Pei Zhang <pei.zhang@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Pei Zhang 7 years ago
parent
commit
072ec93d50
1 changed files with 5 additions and 1 deletions
  1. 5 1
      drivers/gpu/drm/i915/gvt/kvmgt.c

+ 5 - 1
drivers/gpu/drm/i915/gvt/kvmgt.c

@@ -1029,13 +1029,17 @@ static long intel_vgpu_ioctl(struct mdev_device *mdev, unsigned int cmd,
 		case VFIO_PCI_BAR3_REGION_INDEX ... VFIO_PCI_BAR5_REGION_INDEX:
 		case VFIO_PCI_BAR3_REGION_INDEX ... VFIO_PCI_BAR5_REGION_INDEX:
 			info.offset = VFIO_PCI_INDEX_TO_OFFSET(info.index);
 			info.offset = VFIO_PCI_INDEX_TO_OFFSET(info.index);
 			info.size = 0;
 			info.size = 0;
-
 			info.flags = 0;
 			info.flags = 0;
+
 			gvt_dbg_core("get region info bar:%d\n", info.index);
 			gvt_dbg_core("get region info bar:%d\n", info.index);
 			break;
 			break;
 
 
 		case VFIO_PCI_ROM_REGION_INDEX:
 		case VFIO_PCI_ROM_REGION_INDEX:
 		case VFIO_PCI_VGA_REGION_INDEX:
 		case VFIO_PCI_VGA_REGION_INDEX:
+			info.offset = VFIO_PCI_INDEX_TO_OFFSET(info.index);
+			info.size = 0;
+			info.flags = 0;
+
 			gvt_dbg_core("get region info index:%d\n", info.index);
 			gvt_dbg_core("get region info index:%d\n", info.index);
 			break;
 			break;
 		default:
 		default: